diff options
author | Masami Hiramatsu <mhiramat@kernel.org> | 2021-02-01 20:48:11 +0100 |
---|---|---|
committer | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2021-02-09 18:52:15 +0100 |
commit | d262271d04830e4b5009f4a5cc64934d86b49832 (patch) | |
tree | 5f22cea362fec30f4e879f4192bd6aa1c31441d8 /kernel/trace/trace.c | |
parent | kprobes: Warn if the kprobe is reregistered (diff) | |
download | linux-d262271d04830e4b5009f4a5cc64934d86b49832.tar.xz linux-d262271d04830e4b5009f4a5cc64934d86b49832.zip |
tracing/dynevent: Delegate parsing to create function
Delegate command parsing to each create function so that the
command syntax can be customized.
This requires changes to the kprobe/uprobe/synthetic event handling,
which are also included here.
Link: https://lkml.kernel.org/r/e488726f49cbdbc01568618f8680584306c4c79f.1612208610.git.zanussi@kernel.org
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
[ zanussi@kernel.org: added synthetic event modifications ]
Signed-off-by: Tom Zanussi <zanussi@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r-- | kernel/trace/trace.c | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 7fd432334ff5..b79bcacdd6f9 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -9412,30 +9412,11 @@ void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) } EXPORT_SYMBOL_GPL(ftrace_dump); -int trace_run_command(const char *buf, int (*createfn)(int, char **)) -{ - char **argv; - int argc, ret; - - argc = 0; - ret = 0; - argv = argv_split(GFP_KERNEL, buf, &argc); - if (!argv) - return -ENOMEM; - - if (argc) - ret = createfn(argc, argv); - - argv_free(argv); - - return ret; -} - #define WRITE_BUFSIZE 4096 ssize_t trace_parse_run_command(struct file *file, const char __user *buffer, size_t count, loff_t *ppos, - int (*createfn)(int, char **)) + int (*createfn)(const char *)) { char *kbuf, *buf, *tmp; int ret = 0; @@ -9483,7 +9464,7 @@ ssize_t trace_parse_run_command(struct file *file, const char __user *buffer, if (tmp) *tmp = '\0'; - ret = trace_run_command(buf, createfn); + ret = createfn(buf); if (ret) goto out; buf += size; |