You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
tracing/kprobes: Use dyn_event framework for kprobe events
Use dyn_event framework for kprobe events. This shows kprobe events on "tracing/dynamic_events" file. User can also define new events via tracing/dynamic_events. Link: http://lkml.kernel.org/r/154140855646.17322.6619219995865980392.stgit@devbox Reviewed-by: Tom Zanussi <tom.zanussi@linux.intel.com> Tested-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
This commit is contained in:
committed by
Steven Rostedt (VMware)
parent
5448d44c38
commit
6212dd2968
@@ -20,6 +20,9 @@ current_tracer. Instead of that, add probe points via
|
||||
/sys/kernel/debug/tracing/kprobe_events, and enable it via
|
||||
/sys/kernel/debug/tracing/events/kprobes/<EVENT>/enable.
|
||||
|
||||
You can also use /sys/kernel/debug/tracing/dynamic_events instead of
|
||||
kprobe_events. That interface will provide unified access to other
|
||||
dynamic events too.
|
||||
|
||||
Synopsis of kprobe_events
|
||||
-------------------------
|
||||
|
||||
@@ -461,6 +461,7 @@ config KPROBE_EVENTS
|
||||
bool "Enable kprobes-based dynamic events"
|
||||
select TRACING
|
||||
select PROBE_EVENTS
|
||||
select DYNAMIC_EVENTS
|
||||
default y
|
||||
help
|
||||
This allows the user to add tracing events (similar to tracepoints)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -154,6 +154,33 @@ int traceprobe_split_symbol_offset(char *symbol, long *offset)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* @buf must has MAX_EVENT_NAME_LEN size */
|
||||
int traceprobe_parse_event_name(const char **pevent, const char **pgroup,
|
||||
char *buf)
|
||||
{
|
||||
const char *slash, *event = *pevent;
|
||||
|
||||
slash = strchr(event, '/');
|
||||
if (slash) {
|
||||
if (slash == event) {
|
||||
pr_info("Group name is not specified\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
if (slash - event + 1 > MAX_EVENT_NAME_LEN) {
|
||||
pr_info("Group name is too long\n");
|
||||
return -E2BIG;
|
||||
}
|
||||
strlcpy(buf, event, slash - event + 1);
|
||||
*pgroup = buf;
|
||||
*pevent = slash + 1;
|
||||
}
|
||||
if (strlen(event) == 0) {
|
||||
pr_info("Event name is not specified\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define PARAM_MAX_STACK (THREAD_SIZE / sizeof(unsigned long))
|
||||
|
||||
static int parse_probe_vars(char *arg, const struct fetch_type *t,
|
||||
|
||||
@@ -279,6 +279,8 @@ extern int traceprobe_update_arg(struct probe_arg *arg);
|
||||
extern void traceprobe_free_probe_arg(struct probe_arg *arg);
|
||||
|
||||
extern int traceprobe_split_symbol_offset(char *symbol, long *offset);
|
||||
extern int traceprobe_parse_event_name(const char **pevent,
|
||||
const char **pgroup, char *buf);
|
||||
|
||||
extern int traceprobe_set_print_fmt(struct trace_probe *tp, bool is_return);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user