summaryrefslogtreecommitdiffstats
path: root/qemu/trace/ftrace.c
diff options
context:
space:
mode:
authorRajithaY <rajithax.yerrumsetty@intel.com>2017-04-25 03:31:15 -0700
committerRajitha Yerrumchetty <rajithax.yerrumsetty@intel.com>2017-05-22 06:48:08 +0000
commitbb756eebdac6fd24e8919e2c43f7d2c8c4091f59 (patch)
treeca11e03542edf2d8f631efeca5e1626d211107e3 /qemu/trace/ftrace.c
parenta14b48d18a9ed03ec191cf16b162206998a895ce (diff)
Adding qemu as a submodule of KVMFORNFV
This Patch includes the changes to add qemu as a submodule to kvmfornfv repo and make use of the updated latest qemu for the execution of all testcase Change-Id: I1280af507a857675c7f81d30c95255635667bdd7 Signed-off-by:RajithaY<rajithax.yerrumsetty@intel.com>
Diffstat (limited to 'qemu/trace/ftrace.c')
-rw-r--r--qemu/trace/ftrace.c76
1 files changed, 0 insertions, 76 deletions
diff --git a/qemu/trace/ftrace.c b/qemu/trace/ftrace.c
deleted file mode 100644
index e953922f5..000000000
--- a/qemu/trace/ftrace.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Ftrace trace backend
- *
- * Copyright (C) 2013 Hitachi, Ltd.
- * Created by Eiichi Tsukata <eiichi.tsukata.xh@hitachi.com>
- *
- * This work is licensed under the terms of the GNU GPL, version 2. See
- * the COPYING file in the top-level directory.
- *
- */
-
-#include "qemu/osdep.h"
-#include "trace.h"
-#include "trace/control.h"
-
-int trace_marker_fd;
-
-static int find_debugfs(char *debugfs)
-{
- char type[100];
- FILE *fp;
-
- fp = fopen("/proc/mounts", "r");
- if (fp == NULL) {
- return 0;
- }
-
- while (fscanf(fp, "%*s %" STR(PATH_MAX) "s %99s %*s %*d %*d\n",
- debugfs, type) == 2) {
- if (strcmp(type, "debugfs") == 0) {
- break;
- }
- }
- fclose(fp);
-
- if (strcmp(type, "debugfs") != 0) {
- return 0;
- }
- return 1;
-}
-
-bool ftrace_init(void)
-{
- char debugfs[PATH_MAX];
- char path[PATH_MAX];
- int debugfs_found;
- int trace_fd = -1;
-
- debugfs_found = find_debugfs(debugfs);
- if (debugfs_found) {
- snprintf(path, PATH_MAX, "%s/tracing/tracing_on", debugfs);
- trace_fd = open(path, O_WRONLY);
- if (trace_fd < 0) {
- perror("Could not open ftrace 'tracing_on' file");
- return false;
- } else {
- if (write(trace_fd, "1", 1) < 0) {
- perror("Could not write to 'tracing_on' file");
- close(trace_fd);
- return false;
- }
- close(trace_fd);
- }
- snprintf(path, PATH_MAX, "%s/tracing/trace_marker", debugfs);
- trace_marker_fd = open(path, O_WRONLY);
- if (trace_marker_fd < 0) {
- perror("Could not open ftrace 'trace_marker' file");
- return false;
- }
- } else {
- fprintf(stderr, "debugfs is not mounted\n");
- return false;
- }
-
- return true;
-}