diff options
Diffstat (limited to 'tools/lib/traceevent/plugin_function.c')
-rw-r--r-- | tools/lib/traceevent/plugin_function.c | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/tools/lib/traceevent/plugin_function.c b/tools/lib/traceevent/plugin_function.c index 42dbf73758f3..528acc75d81a 100644 --- a/tools/lib/traceevent/plugin_function.c +++ b/tools/lib/traceevent/plugin_function.c @@ -23,6 +23,7 @@ #include "event-parse.h" #include "event-utils.h" +#include "trace-seq.h" static struct func_stack { int size; @@ -33,7 +34,7 @@ static int cpus = -1; #define STK_BLK 10 -struct pevent_plugin_option plugin_options[] = +struct tep_plugin_option plugin_options[] = { { .name = "parent", @@ -53,8 +54,8 @@ struct pevent_plugin_option plugin_options[] = } }; -static struct pevent_plugin_option *ftrace_parent = &plugin_options[0]; -static struct pevent_plugin_option *ftrace_indent = &plugin_options[1]; +static struct tep_plugin_option *ftrace_parent = &plugin_options[0]; +static struct tep_plugin_option *ftrace_indent = &plugin_options[1]; static void add_child(struct func_stack *stack, const char *child, int pos) { @@ -122,25 +123,25 @@ static int add_and_get_index(const char *parent, const char *child, int cpu) return 0; } -static int function_handler(struct trace_seq *s, struct pevent_record *record, - struct event_format *event, void *context) +static int function_handler(struct trace_seq *s, struct tep_record *record, + struct tep_event_format *event, void *context) { - struct pevent *pevent = event->pevent; + struct tep_handle *pevent = event->pevent; unsigned long long function; unsigned long long pfunction; const char *func; const char *parent; int index = 0; - if (pevent_get_field_val(s, event, "ip", record, &function, 1)) + if (tep_get_field_val(s, event, "ip", record, &function, 1)) return trace_seq_putc(s, '!'); - func = pevent_find_function(pevent, function); + func = tep_find_function(pevent, function); - if (pevent_get_field_val(s, event, "parent_ip", record, &pfunction, 1)) + if (tep_get_field_val(s, event, "parent_ip", record, &pfunction, 1)) return trace_seq_putc(s, '!'); - parent = pevent_find_function(pevent, pfunction); + parent = tep_find_function(pevent, pfunction); if (parent && ftrace_indent->set) index = add_and_get_index(parent, func, record->cpu); @@ -163,22 +164,22 @@ static int function_handler(struct trace_seq *s, struct pevent_record *record, return 0; } -int PEVENT_PLUGIN_LOADER(struct pevent *pevent) +int TEP_PLUGIN_LOADER(struct tep_handle *pevent) { - pevent_register_event_handler(pevent, -1, "ftrace", "function", - function_handler, NULL); + tep_register_event_handler(pevent, -1, "ftrace", "function", + function_handler, NULL); - traceevent_plugin_add_options("ftrace", plugin_options); + tep_plugin_add_options("ftrace", plugin_options); return 0; } -void PEVENT_PLUGIN_UNLOADER(struct pevent *pevent) +void TEP_PLUGIN_UNLOADER(struct tep_handle *pevent) { int i, x; - pevent_unregister_event_handler(pevent, -1, "ftrace", "function", - function_handler, NULL); + tep_unregister_event_handler(pevent, -1, "ftrace", "function", + function_handler, NULL); for (i = 0; i <= cpus; i++) { for (x = 0; x < fstack[i].size && fstack[i].stack[x]; x++) @@ -186,7 +187,7 @@ void PEVENT_PLUGIN_UNLOADER(struct pevent *pevent) free(fstack[i].stack); } - traceevent_plugin_remove_options(plugin_options); + tep_plugin_remove_options(plugin_options); free(fstack); fstack = NULL; |