Commit d7cc4ba3 authored by Joanne Hugé's avatar Joanne Hugé

WIP

parent 5a6dae90
......@@ -93,47 +93,14 @@ static int settracer(char *tracer) {
return -1;
}
static void debugfs_prepare(void) {
if (mount_debugfs(NULL)) printf("could not mount debugfs");
fileprefix = get_debugfileprefix();
if (!trace_file_exists("tracing_enabled") && !trace_file_exists("tracing_on"))
printf(
"tracing_enabled or tracing_on not found\n, debug fs not mounted, "
"TRACERs not configured?\n");
}
void setup_tracer(void) {
debugfs_prepare();
int ret;
if (trace_file_exists("tracing_enabled") && !trace_file_exists("tracing_on"))
setkernvar("tracing_enabled", "1");
/* ftrace_enabled is a sysctl variable */
/* turn it on if you're doing anything but nop or event tracing */
fileprefix = procfileprefix;
setkernvar("ftrace_enabled", "0");
fileprefix = get_debugfileprefix();
// Clear old traces by setting tracer to nop first
ret = settracer("nop");
ret = settracer("function");
if (ret) fprintf(stderr, "Requested tracer not available\n");
setkernvar(traceroptions, "print-parent");
setkernvar(traceroptions, "latency-format");
setkernvar(traceroptions, "nosym-offset");
setkernvar(traceroptions, "nosym-addr");
setkernvar(traceroptions, "noverbose");
setkernvar("tracing_max_latency", "0");
if (trace_file_exists("latency_hist"))
setkernvar("latency_hist/wakeup/reset", "1");
/* open the tracing on file descriptor */
if (trace_fd == -1) {
char path[MAX_PATH];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment