tools/lib/traceevent, tools/perf: Rename pevent plugin related APIs
RFC PATCH 3/24 tools/lib/traceevent, tools/perf: Rename pevent plugin related APIs
From: "Tzvetomir Stoyanov (VMware)" <[email protected]>
In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_" and not "pevent_". This changes the pevent plugin related API.
Signed-off-by Tzvetomir Stoyanov (VMware) <[email protected]>
Signed-off-by Steven Rostedt (VMware) <[email protected]>
--- tools/lib/traceevent/event-parse.c | 8 ++-- tools/lib/traceevent/event-parse.h | 56 +++++++++++----------- tools/lib/traceevent/event-plugin.c | 24 +++++----- tools/lib/traceevent/plugin_cfg80211.c | 4 +- tools/lib/traceevent/plugin_function.c | 10 ++-- tools/lib/traceevent/plugin_hrtimer.c | 4 +- tools/lib/traceevent/plugin_jbd2.c | 4 +- tools/lib/traceevent/plugin_kmem.c | 4 +- tools/lib/traceevent/plugin_kvm.c | 4 +- tools/lib/traceevent/plugin_mac80211.c | 4 +- tools/lib/traceevent/plugin_sched_switch.c | 4 +- tools/lib/traceevent/plugin_scsi.c | 4 +- tools/lib/traceevent/plugin_xen.c | 4 +- 13 files changed, 67 insertions(+), 67 deletions(-)
tools/lib/traceevent/event-parse.c +4 -4
@@ -88,7 +88,7 @@ struct event_handler {int id;const char *sys_name;const char *event_name; -pevent_event_handler_func func; +tep_event_handler_func func;void *context; };
@@ -6633,7 +6633,7 @@ static struct event_format *pevent_search_event(struct tep_handle *pevent, int i*/ int pevent_register_event_handler (struct tep_handle *pevent,int id,const char *sys_name,const char *event_name, -pevent_event_handler_func func,void *context) +tep_event_handler_func func,void *context) {struct event_format *event;struct event_handler *handle;
@@ -6682,7 +6682,7 @@ int pevent_register_event_handler(struct tep_handle *pevent, int id,static int handle_matches (struct event_handler *handler,int id,const char *sys_name,const char *event_name, -pevent_event_handler_func func,void *context) +tep_event_handler_func func,void *context) {if (id >=0 && id != handler->id)return 0 ;
@@ -6717,7 +6717,7 @@ static int handle_matches(struct event_handler *handler, int id,*/ int pevent_unregister_event_handler (struct tep_handle *pevent,int id,const char *sys_name,const char *event_name, -pevent_event_handler_func func,void *context) +tep_event_handler_func func,void *context) {struct event_format *event;struct event_handler *handle;
tools/lib/traceevent/event-parse.h +28 -28
108 lines not on this page · raw message
tools/lib/traceevent/event-plugin.c +12 -12
@@ -34,7 +34,7 @@static struct registered_plugin_options {struct registered_plugin_options *next; -struct pevent_plugin_option *options; +struct tep_plugin_option *options; } *registered_options; static struct trace_plugin_options {
@@ -58,7 +58,7 @@ static void lower_case(char *str) *str =tolower (*str); } -static int update_option_value (struct pevent_plugin_option *op,const char *val) +static int update_option_value (struct tep_plugin_option *op,const char *val) {char *op_val;
@@ -111,7 +111,7 @@ static int update_option_value(struct pevent_plugin_option *op, const char *val)char **traceevent_plugin_list_options (void ) {struct registered_plugin_options *reg; -struct pevent_plugin_option *op; +struct tep_plugin_option *op;char **list =NULL ;char *name;int count =0 ;
@@ -163,7 +163,7 @@ void traceevent_plugin_free_options_list(char **list) }static int -update_option (const char *file,struct pevent_plugin_option *option) +update_option (const char *file,struct tep_plugin_option *option) {struct trace_plugin_options *op;char *plugin;
@@ -222,7 +222,7 @@ update_option(const char *file, struct pevent_plugin_option *option)* Sets the options with the values that have been added by user. */ int traceevent_plugin_add_options (const char *name, -struct pevent_plugin_option *options) +struct tep_plugin_option *options) {struct registered_plugin_options *reg;
@@ -244,7 +244,7 @@ int traceevent_plugin_add_options(const char *name,* traceevent_plugin_remove_options - remove plugin options that were registered * @options: Options to removed that were registered with traceevent_plugin_add_options */ -void traceevent_plugin_remove_options (struct pevent_plugin_option *options) +void traceevent_plugin_remove_options (struct tep_plugin_option *options) {struct registered_plugin_options **last;struct registered_plugin_options *reg;
@@ -285,7 +285,7 @@ load_plugin(struct tep_handle *pevent, const char *path, const char *file, void *data) { struct plugin_list **plugin_list = data; -pevent_plugin_load_func func; +tep_plugin_load_func func;struct plugin_list *list;const char *alias;char *plugin;
@@ -305,14 +305,14 @@ load_plugin(struct tep_handle *pevent, const char *path, goto out_free; } - alias =dlsym (handle,PEVENT_PLUGIN_ALIAS_NAME ); + alias =dlsym (handle,TEP_PLUGIN_ALIAS_NAME );if (!alias) alias = file; - func =dlsym (handle,PEVENT_PLUGIN_LOADER_NAME ); + func =dlsym (handle,TEP_PLUGIN_LOADER_NAME );if (!func) {warning ("could not find func '%s' in plugin '%s'\n%s\n" , -PEVENT_PLUGIN_LOADER_NAME , plugin,dlerror ()); +TEP_PLUGIN_LOADER_NAME , plugin,dlerror ()); goto out_free; }
@@ -442,13 +442,13 @@ traceevent_load_plugins(struct tep_handle *pevent)void traceevent_unload_plugins (struct plugin_list *plugin_list,struct tep_handle *pevent) { -pevent_plugin_unload_func func; +tep_plugin_unload_func func;struct plugin_list *list;while (plugin_list) { list = plugin_list; plugin_list = list->next; - func =dlsym (list->handle,PEVENT_PLUGIN_UNLOADER_NAME ); + func =dlsym (list->handle,TEP_PLUGIN_UNLOADER_NAME );if (func)func (pevent);dlclose (list->handle);
tools/lib/traceevent/plugin_cfg80211.c +2 -2
@@ -25,7 +25,7 @@ process___le16_to_cpup(struct trace_seq *s, unsigned long long *args)return val ? (long long )le16toh (*val) :0 ; } -int PEVENT_PLUGIN_LOADER (struct tep_handle *pevent) +int TEP_PLUGIN_LOADER (struct tep_handle *pevent) { pevent_register_print_function(pevent, process___le16_to_cpup,
@@ -36,7 +36,7 @@ int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent)return 0 ; } -void PEVENT_PLUGIN_UNLOADER (struct tep_handle *pevent) +void TEP_PLUGIN_UNLOADER (struct tep_handle *pevent) {pevent_unregister_print_function (pevent, process___le16_to_cpup,"__le16_to_cpup" );
tools/lib/traceevent/plugin_function.c +5 -5
@@ -33,7 +33,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 +53,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) {
@@ -163,7 +163,7 @@ static int function_handler(struct trace_seq *s, struct tep_record *record,return 0 ; } -int PEVENT_PLUGIN_LOADER (struct tep_handle *pevent) +int TEP_PLUGIN_LOADER (struct tep_handle *pevent) {pevent_register_event_handler (pevent,-1 ,"ftrace" ,"function" , function_handler,NULL );
@@ -173,7 +173,7 @@ int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent)return 0 ; } -void PEVENT_PLUGIN_UNLOADER (struct tep_handle *pevent) +void TEP_PLUGIN_UNLOADER (struct tep_handle *pevent) {int i, x;
tools/lib/traceevent/plugin_hrtimer.c +2 -2
@@ -66,7 +66,7 @@ static int timer_start_handler(struct trace_seq *s,return 0 ; } -int PEVENT_PLUGIN_LOADER (struct tep_handle *pevent) +int TEP_PLUGIN_LOADER (struct tep_handle *pevent) { pevent_register_event_handler(pevent, -1, "timer", "hrtimer_expire_entry",
@@ -77,7 +77,7 @@ int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent)return 0 ; } -void PEVENT_PLUGIN_UNLOADER (struct tep_handle *pevent) +void TEP_PLUGIN_UNLOADER (struct tep_handle *pevent) { pevent_unregister_event_handler(pevent, -1, "timer", "hrtimer_expire_entry",
tools/lib/traceevent/plugin_jbd2.c +2 -2
@@ -47,7 +47,7 @@ process_jiffies_to_msecs(struct trace_seq *s, unsigned long long *args)return jiffies; } -int PEVENT_PLUGIN_LOADER (struct tep_handle *pevent) +int TEP_PLUGIN_LOADER (struct tep_handle *pevent) { pevent_register_print_function(pevent, process_jbd2_dev_to_name,
@@ -65,7 +65,7 @@ int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent)return 0 ; } -void PEVENT_PLUGIN_UNLOADER (struct tep_handle *pevent) +void TEP_PLUGIN_UNLOADER (struct tep_handle *pevent) {pevent_unregister_print_function (pevent, process_jbd2_dev_to_name,"jbd2_dev_to_name" );
tools/lib/traceevent/plugin_kmem.c +2 -2
@@ -48,7 +48,7 @@ static int call_site_handler(struct trace_seq *s, struct tep_record *record,return 1 ; } -int PEVENT_PLUGIN_LOADER (struct tep_handle *pevent) +int TEP_PLUGIN_LOADER (struct tep_handle *pevent) {pevent_register_event_handler (pevent,-1 ,"kmem" ,"kfree" , call_site_handler,NULL );
@@ -71,7 +71,7 @@ int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent)return 0 ; } -void PEVENT_PLUGIN_UNLOADER (struct tep_handle *pevent) +void TEP_PLUGIN_UNLOADER (struct tep_handle *pevent) {pevent_unregister_event_handler (pevent,-1 ,"kmem" ,"kfree" , call_site_handler,NULL );
tools/lib/traceevent/plugin_kvm.c +2 -2
@@ -444,7 +444,7 @@ process_is_writable_pte(struct trace_seq *s, unsigned long long *args)return pte &PT_WRITABLE_MASK ; } -int PEVENT_PLUGIN_LOADER (struct tep_handle *pevent) +int TEP_PLUGIN_LOADER (struct tep_handle *pevent) {init_disassembler ();
@@ -486,7 +486,7 @@ int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent)return 0 ; } -void PEVENT_PLUGIN_UNLOADER (struct tep_handle *pevent) +void TEP_PLUGIN_UNLOADER (struct tep_handle *pevent) {pevent_unregister_event_handler (pevent,-1 ,"kvm" ,"kvm_exit" , kvm_exit_handler,NULL );
tools/lib/traceevent/plugin_mac80211.c +2 -2
@@ -86,7 +86,7 @@ static int drv_bss_info_changed(struct trace_seq *s,return 0 ; } -int PEVENT_PLUGIN_LOADER (struct tep_handle *pevent) +int TEP_PLUGIN_LOADER (struct tep_handle *pevent) { pevent_register_event_handler(pevent, -1, "mac80211", "drv_bss_info_changed",
@@ -94,7 +94,7 @@ int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent)return 0 ; } -void PEVENT_PLUGIN_UNLOADER (struct tep_handle *pevent) +void TEP_PLUGIN_UNLOADER (struct tep_handle *pevent) { pevent_unregister_event_handler(pevent, -1, "mac80211", "drv_bss_info_changed",
tools/lib/traceevent/plugin_sched_switch.c +2 -2
@@ -134,7 +134,7 @@ static int sched_switch_handler(struct trace_seq *s,return 0 ; } -int PEVENT_PLUGIN_LOADER (struct tep_handle *pevent) +int TEP_PLUGIN_LOADER (struct tep_handle *pevent) {pevent_register_event_handler (pevent,-1 ,"sched" ,"sched_switch" , sched_switch_handler,NULL );
@@ -147,7 +147,7 @@ int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent)return 0 ; } -void PEVENT_PLUGIN_UNLOADER (struct tep_handle *pevent) +void TEP_PLUGIN_UNLOADER (struct tep_handle *pevent) {pevent_unregister_event_handler (pevent,-1 ,"sched" ,"sched_switch" , sched_switch_handler,NULL );
tools/lib/traceevent/plugin_scsi.c +2 -2
@@ -413,7 +413,7 @@ unsigned long long process_scsi_trace_parse_cdb(struct trace_seq *s,return 0 ; } -int PEVENT_PLUGIN_LOADER (struct tep_handle *pevent) +int TEP_PLUGIN_LOADER (struct tep_handle *pevent) { pevent_register_print_function(pevent, process_scsi_trace_parse_cdb,
@@ -426,7 +426,7 @@ int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent)return 0 ; } -void PEVENT_PLUGIN_UNLOADER (struct tep_handle *pevent) +void TEP_PLUGIN_UNLOADER (struct tep_handle *pevent) {pevent_unregister_print_function (pevent, process_scsi_trace_parse_cdb,"scsi_trace_parse_cdb" );
tools/lib/traceevent/plugin_xen.c +2 -2
@@ -119,7 +119,7 @@ unsigned long long process_xen_hypercall_name(struct trace_seq *s,return 0 ; } -int PEVENT_PLUGIN_LOADER (struct tep_handle *pevent) +int TEP_PLUGIN_LOADER (struct tep_handle *pevent) { pevent_register_print_function(pevent, process_xen_hypercall_name,
@@ -130,7 +130,7 @@ int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent)return 0 ; } -void PEVENT_PLUGIN_UNLOADER (struct tep_handle *pevent) +void TEP_PLUGIN_UNLOADER (struct tep_handle *pevent) {pevent_unregister_print_function (pevent, process_xen_hypercall_name,"xen_hypercall_name" );
Signature · 1 line
2.18.0