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

WIP

parent 06e5f82b
......@@ -38,6 +38,7 @@
static char *fileprefix;
static char *procfileprefix = "/proc/sys/kernel/";
static char *debugfileprefix = "/sys/kernel/debug/tracing/";
static int trace_fd = -1;
static int kernvar(int mode, const char *name, char *value,
......@@ -47,11 +48,6 @@ static int kernvar(int mode, const char *name, char *value,
int path;
size_t len_prefix = strlen(fileprefix), len_name = strlen(name);
if (len_prefix + len_name + 1 > sizeof(filename)) {
errno = ENOMEM;
return 1;
}
memcpy(filename, fileprefix, len_prefix);
memcpy(filename + len_prefix, name, len_name + 1);
......@@ -97,6 +93,7 @@ void setup_tracer(void) {
fileprefix = procfileprefix;
setkernvar("ftrace_enabled", "1");
fileprefix = debugfileprefix;
// Clear old traces by setting tracer to nop first
settracer("nop");
settracer("function");
......
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