tools lib traceevent: Rename pevent to tep for preparation for library
v2 cover tools lib traceevent: Rename pevent to tep for preparation for library
[
Resending as quilt mail threading was broken, but luckily was fixed by
http://git.savannah.nongnu.org/cgit/quilt.git/commit/?id=360b85e1f6b6d1aff5ada942fcee816e1ad7a13c
And has been reported to Debian:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=900784
]
Having libtraceevent turn into a proper library has long been asked for. I never had time to do it before. Luckily, Tzvetomir was able to spend the time to start the preparation. The first thing that needs to be done is to handle namespace collisions. "pevent" was the prefix I chose, but many people were displeased by it, as it didn't express what the functions were used for. After discussing with many people at many conferences I've come up with "tep", which means "Trace Event Parser". Please don't question this. The bikeshed has been painted and I'm not changing the color.
This series changes all the function names and data structures from the "pevent_" prefix to the "tep_" prefix. Note, it does not change the names of local variables or even parameters. "pevent" variables and parameters still exist. We can change those later, but for now, I want all global references to "pevent" to be "tep_" instead.
This is not complete. It is only one of many preparations to make libtraceevent into a legitimate library. There's other naming conventions that will be made. But for now, I would like to hear thoughts about this change before we proceed further.
Instead of doing one big update, Tzvetomir grouped changes together. I compiled each patch to make sure perf still builds without errors at each step. I only used my own configuration, thus there may be cases that perf might fail to build. Here's what I had:
Auto-detecting system features:
... dwarf: [ on ] ... dwarf_getlocations: [ on ] ... glibc: [ on ] ... gtk2: [ on ] ... libaudit: [ OFF ] ... libbfd: [ on ] ... libelf: [ on ]
... libnuma: [ OFF ]
... numa_num_possible_cpus: [ OFF ]
... libperl: [ OFF ]
... libpython: [ on ]
... libslang: [ OFF ]
... libcrypto: [ on ]
... libunwind: [ OFF ]
... libdw-dwarf-unwind: [ on ] ... zlib: [ on ] ... lzma: [ on ] ... get_cpuid: [ on ] ... bpf: [ on ]
The above is the config I used for testing the build.
-- Steve
Tzvetomir Stoyanov (VMware) (24):
tools/lib/traceevent, tools/perf: Rename struct pevent to struct tep_handle tools/lib/traceevent, tools/perf: Rename struct pevent_record to struct tep_record tools/lib/traceevent, tools/perf: Rename pevent plugin related APIs tools/lib/traceevent, tools/perf: Rename pevent alloc / free APIs tools/lib/traceevent, tools/perf: Rename pevent find APIs tools/lib/traceevent, tools/perf: Rename pevent parse APIs tools/lib/traceevent, tools/perf: Rename pevent print APIs tools/lib/traceevent, tools/perf: Rename pevent_read_number_* APIs tools/lib/traceevent, tools/perf: Rename pevent_register_* APIs tools/lib/traceevent, tools/perf: Rename pevent_set_* APIs tools/lib/traceevent, tools/perf: Rename traceevent_* APIs tools/lib/traceevent, tools/perf: Rename enum pevent_flag to enum tep_flag tools/lib/traceevent, tools/lib/lockdep/: Rename enunm pevent_errno to enum tep_errno tools/lib/traceevent: Rename pevent_function* APIs tools/lib/traceevent, tools/perf: Rename traceevent_plugin_* APIs tools/lib/traceevent: Rename pevent_filter* APIs
tools/lib/traceevent: Rename pevent_register / unregister APIs tools/lib/traceevent: Rename pevent_data_ APIs
tools/lib/traceevent: Rename pevent field APIs
tools/lib/traceevent: Rename pevent_find_* APIs
tools/lib/traceevent: Rename various pevent get/set/is APIs tools/lib/traceevent: Rename internal parser related APIs tools/lib/traceevent: Rename various pevent APIs
tools/lib/traceevent: Rename static variables and functions in event-parse.c
----
tools/lib/lockdep/Makefile | 4 +- tools/lib/traceevent/Makefile | 4 +- tools/lib/traceevent/event-parse.c | 696 ++++++++++----------- tools/lib/traceevent/event-parse.h | 458 +++++++------- tools/lib/traceevent/event-plugin.c | 70 +-- tools/lib/traceevent/parse-filter.c | 288 ++++----- tools/lib/traceevent/plugin_cfg80211.c | 20 +- tools/lib/traceevent/plugin_function.c | 34 +- tools/lib/traceevent/plugin_hrtimer.c | 56 +- tools/lib/traceevent/plugin_jbd2.c | 36 +- tools/lib/traceevent/plugin_kmem.c | 66 +- tools/lib/traceevent/plugin_kvm.c | 154 ++--- tools/lib/traceevent/plugin_mac80211.c | 28 +- tools/lib/traceevent/plugin_sched_switch.c | 60 +- tools/lib/traceevent/plugin_scsi.c | 24 +- tools/lib/traceevent/plugin_xen.c | 20 +- tools/perf/builtin-kmem.c | 6 +- tools/perf/builtin-report.c | 6 +- tools/perf/builtin-script.c | 6 +- tools/perf/util/data-convert-bt.c | 6 +- tools/perf/util/evsel.c | 2 +- tools/perf/util/header.c | 6 +- tools/perf/util/machine.h | 2 +- tools/perf/util/python.c | 10 +- .../perf/util/scripting-engines/trace-event-perl.c | 2 +- .../util/scripting-engines/trace-event-python.c | 6 +- tools/perf/util/sort.c | 16 +- tools/perf/util/sort.h | 2 +- tools/perf/util/trace-event-parse.c | 34 +- tools/perf/util/trace-event-read.c | 44 +- tools/perf/util/trace-event-scripting.c | 4 +- tools/perf/util/trace-event.c | 28 +- tools/perf/util/trace-event.h | 20 +- 33 files changed, 1109 insertions(+), 1109 deletions(-)
RFC PATCH v2 1/24 tools/lib/traceevent, tools/perf: Rename struct pevent to struct tep_handle
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 struct pevent to struct tep_handle.
--- tools/lib/traceevent/event-parse.c | 148 +++++++++--------- tools/lib/traceevent/event-parse.h | 136 ++++++++-------- tools/lib/traceevent/event-plugin.c | 14 +- tools/lib/traceevent/parse-filter.c | 14 +- tools/lib/traceevent/plugin_cfg80211.c | 4 +- tools/lib/traceevent/plugin_function.c | 6 +- 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 +- tools/perf/util/header.c | 4 +- tools/perf/util/python.c | 2 +- .../util/scripting-engines/trace-event-perl.c | 2 +- .../scripting-engines/trace-event-python.c | 2 +- tools/perf/util/sort.h | 2 +- tools/perf/util/trace-event-parse.c | 12 +- tools/perf/util/trace-event-read.c | 24 +-- tools/perf/util/trace-event-scripting.c | 4 +- tools/perf/util/trace-event.c | 6 +- tools/perf/util/trace-event.h | 18 +-- 24 files changed, 215 insertions(+), 215 deletions(-)
tools/lib/traceevent/event-parse.c +74 -74
@@ -160,7 +160,7 @@ struct cmdline_list {int pid; }; -static int cmdline_init (struct pevent *pevent) +static int cmdline_init (struct tep_handle *pevent) {struct cmdline_list *cmdlist = pevent->cmdlist;struct cmdline_list *item;
@@ -189,7 +189,7 @@ static int cmdline_init(struct pevent *pevent)return 0 ; } -static const char *find_cmdline (struct pevent *pevent,int pid) +static const char *find_cmdline (struct tep_handle *pevent,int pid) {const struct cmdline *comm;struct cmdline key;
@@ -218,7 +218,7 @@ static const char *find_cmdline(struct pevent *pevent, int pid)* Returns 1 if the pid has a cmdline mapped to it * 0 otherwise. */ -int pevent_pid_is_registered (struct pevent *pevent,int pid) +int pevent_pid_is_registered (struct tep_handle *pevent,int pid) {const struct cmdline *comm;struct cmdline key;
@@ -244,7 +244,7 @@ int pevent_pid_is_registered(struct pevent *pevent, int pid)* we must add this pid. This is much slower than when cmdlines * are added before the array is initialized. */ -static int add_new_comm (struct pevent *pevent,const char *comm,int pid) +static int add_new_comm (struct tep_handle *pevent,const char *comm,int pid) {struct cmdline *cmdlines = pevent->cmdlines;const struct cmdline *cmdline;
@@ -296,7 +296,7 @@ static int add_new_comm(struct pevent *pevent, const char *comm, int pid)* This adds a mapping to search for command line names with * a given pid. The comm is duplicated. */ -int pevent_register_comm (struct pevent *pevent,const char *comm,int pid) +int pevent_register_comm (struct tep_handle *pevent,const char *comm,int pid) {struct cmdline_list *item;
@@ -324,7 +324,7 @@ int pevent_register_comm(struct pevent *pevent, const char *comm, int pid)return 0 ; } -int pevent_register_trace_clock (struct pevent *pevent,const char *trace_clock) +int pevent_register_trace_clock (struct tep_handle *pevent,const char *trace_clock) { pevent->trace_clock =strdup (trace_clock);if (!pevent->trace_clock) {
@@ -381,7 +381,7 @@ static int func_bcmp(const void *a, const void *b)return 1 ; } -static int func_map_init (struct pevent *pevent) +static int func_map_init (struct tep_handle *pevent) {struct func_list *funclist;struct func_list *item;
@@ -421,7 +421,7 @@ static int func_map_init(struct pevent *pevent) }static struct func_map * -__find_func (struct pevent *pevent,unsigned long long addr) +__find_func (struct tep_handle *pevent,unsigned long long addr) {struct func_map *func;struct func_map key;
@@ -453,7 +453,7 @@ struct func_resolver {* keep using it instead of duplicating all the entries inside * pevent->funclist. */ -int pevent_set_function_resolver (struct pevent *pevent, +int pevent_set_function_resolver (struct tep_handle *pevent,pevent_func_resolver_t *func,void *priv) {struct func_resolver *resolver =malloc (sizeof (*resolver));
@@ -477,14 +477,14 @@ int pevent_set_function_resolver(struct pevent *pevent,* Stop using whatever alternative resolver was set, use the default * one instead. */ -void pevent_reset_function_resolver (struct pevent *pevent) +void pevent_reset_function_resolver (struct tep_handle *pevent) {free (pevent->func_resolver); pevent->func_resolver =NULL ; }static struct func_map * -find_func (struct pevent *pevent,unsigned long long addr) +find_func (struct tep_handle *pevent,unsigned long long addr) {struct func_map *map;
@@ -511,7 +511,7 @@ find_func(struct pevent *pevent, unsigned long long addr)* address. Note, the address does not have to be exact, it * will select the function that would contain the address. */ -const char *pevent_find_function (struct pevent *pevent,unsigned long long addr) +const char *pevent_find_function (struct tep_handle *pevent,unsigned long long addr) {struct func_map *map;
@@ -532,7 +532,7 @@ const char *pevent_find_function(struct pevent *pevent, unsigned long long addr)* name and the function offset. */ unsigned long long -pevent_find_function_address (struct pevent *pevent,unsigned long long addr) +pevent_find_function_address (struct tep_handle *pevent,unsigned long long addr) {struct func_map *map;
@@ -553,7 +553,7 @@ pevent_find_function_address(struct pevent *pevent, unsigned long long addr)* This registers a function name with an address and module. * The @func passed in is duplicated. */ -int pevent_register_function (struct pevent *pevent,char *func, +int pevent_register_function (struct tep_handle *pevent,char *func,unsigned long long addr,char *mod) {struct func_list *item =malloc (sizeof (*item));
@@ -594,7 +594,7 @@ int pevent_register_function(struct pevent *pevent, char *func,* * This prints out the stored functions. */ -void pevent_print_funcs (struct pevent *pevent) +void pevent_print_funcs (struct tep_handle *pevent) {int i;
@@ -636,7 +636,7 @@ static int printk_cmp(const void *a, const void *b)return 0 ; } -static int printk_map_init (struct pevent *pevent) +static int printk_map_init (struct tep_handle *pevent) {struct printk_list *printklist;struct printk_list *item;
@@ -668,7 +668,7 @@ static int printk_map_init(struct pevent *pevent) }static struct printk_map * -find_printk (struct pevent *pevent,unsigned long long addr) +find_printk (struct tep_handle *pevent,unsigned long long addr) {struct printk_map *printk;struct printk_map key;
@@ -693,7 +693,7 @@ find_printk(struct pevent *pevent, unsigned long long addr)* This registers a string by the address it was stored in the kernel. * The @fmt passed in is duplicated. */ -int pevent_register_print_string (struct pevent *pevent,const char *fmt, +int pevent_register_print_string (struct tep_handle *pevent,const char *fmt,unsigned long long addr) {struct printk_list *item =malloc (sizeof (*item));
@@ -737,7 +737,7 @@ int pevent_register_print_string(struct pevent *pevent, const char *fmt,* * This prints the string formats that were stored. */ -void pevent_print_printk (struct pevent *pevent) +void pevent_print_printk (struct tep_handle *pevent) {int i;
@@ -756,7 +756,7 @@ static struct event_format *alloc_event(void)return calloc (1 ,sizeof (struct event_format )); } -static int add_event (struct pevent *pevent,struct event_format *event) +static int add_event (struct tep_handle *pevent,struct event_format *event) {int i; struct event_format **events = realloc(pevent->events, sizeof(event) *
@@ -2915,7 +2915,7 @@ process_bitmask(struct event_format *event __maybe_unused, struct print_arg *arg }static struct pevent_function_handler * -find_func_handler (struct pevent *pevent,char *func_name) +find_func_handler (struct tep_handle *pevent,char *func_name) {struct pevent_function_handler *func;
@@ -2930,7 +2930,7 @@ find_func_handler(struct pevent *pevent, char *func_name)return func; } -static void remove_func_handler (struct pevent *pevent,char *func_name) +static void remove_func_handler (struct tep_handle *pevent,char *func_name) {struct pevent_function_handler *func;struct pevent_function_handler **next;
@@ -3337,7 +3337,7 @@ pevent_find_any_field(struct event_format *event, const char *name)* Returns the number (converted to host) from the * raw data. */ -unsigned long long pevent_read_number (struct pevent *pevent, +unsigned long long pevent_read_number (struct tep_handle *pevent,const void *ptr,int size) {switch (size) {
@@ -3384,7 +3384,7 @@ int pevent_read_number_field(struct format_field *field, const void *data, } } -static int get_common_info (struct pevent *pevent, +static int get_common_info (struct tep_handle *pevent,const char *type,int *offset,int *size) {struct event_format *event;
@@ -3410,7 +3410,7 @@ static int get_common_info(struct pevent *pevent,return 0 ; } -static int __parse_common (struct pevent *pevent,void *data, +static int __parse_common (struct tep_handle *pevent,void *data,int *size,int *offset,const char *name) {int ret;
@@ -3423,42 +3423,42 @@ static int __parse_common(struct pevent *pevent, void *data,return pevent_read_number (pevent, data + *offset, *size); } -static int trace_parse_common_type (struct pevent *pevent,void *data) +static int trace_parse_common_type (struct tep_handle *pevent,void *data) {return __parse_common (pevent, data, &pevent->type_size, &pevent->type_offset,"common_type" ); } -static int parse_common_pid (struct pevent *pevent,void *data) +static int parse_common_pid (struct tep_handle *pevent,void *data) {return __parse_common (pevent, data, &pevent->pid_size, &pevent->pid_offset,"common_pid" ); } -static int parse_common_pc (struct pevent *pevent,void *data) +static int parse_common_pc (struct tep_handle *pevent,void *data) {return __parse_common (pevent, data, &pevent->pc_size, &pevent->pc_offset,"common_preempt_count" ); } -static int parse_common_flags (struct pevent *pevent,void *data) +static int parse_common_flags (struct tep_handle *pevent,void *data) {return __parse_common (pevent, data, &pevent->flags_size, &pevent->flags_offset,"common_flags" ); } -static int parse_common_lock_depth (struct pevent *pevent,void *data) +static int parse_common_lock_depth (struct tep_handle *pevent,void *data) {return __parse_common (pevent, data, &pevent->ld_size, &pevent->ld_offset,"common_lock_depth" ); } -static int parse_common_migrate_disable (struct pevent *pevent,void *data) +static int parse_common_migrate_disable (struct tep_handle *pevent,void *data) { return __parse_common(pevent, data, &pevent->ld_size, &pevent->ld_offset,
@@ -3474,7 +3474,7 @@ static int events_id_cmp(const void *a, const void *b);* * Returns an event that has a given @id. */ -struct event_format *pevent_find_event (struct pevent *pevent,int id) +struct event_format *pevent_find_event (struct tep_handle *pevent,int id) {struct event_format **eventptr;struct event_format key;
@@ -3507,7 +3507,7 @@ struct event_format *pevent_find_event(struct pevent *pevent, int id)* @sys. If @sys is NULL the first event with @name is returned. */ struct event_format * -pevent_find_event_by_name (struct pevent *pevent, +pevent_find_event_by_name (struct tep_handle *pevent,const char *sys,const char *name) {struct event_format *event;
@@ -3537,7 +3537,7 @@ pevent_find_event_by_name(struct pevent *pevent,static unsigned long long eval_num_arg (void *data,int size,struct event_format *event,struct print_arg *arg) { -struct pevent *pevent = event->pevent; +struct tep_handle *pevent = event->pevent;unsigned long long val =0 ;unsigned long long left, right;struct print_arg *typearg =NULL ;
@@ -3820,7 +3820,7 @@ static void print_str_to_seq(struct trace_seq *s, const char *format,trace_seq_printf (s, format, str); } -static void print_bitmask_to_seq (struct pevent *pevent, +static void print_bitmask_to_seq (struct tep_handle *pevent,struct trace_seq *s,const char *format,int len_arg,const void *data,int size) {
@@ -3878,7 +3878,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size, struct event_format *event, const char *format, int len_arg, struct print_arg *arg) { - struct pevent *pevent = event->pevent; + struct tep_handle *pevent = event->pevent;struct print_flag_sym *flag;struct format_field *field;struct printk_map *printk;
@@ -4227,7 +4227,7 @@ static void free_args(struct print_arg *args)static struct print_arg *make_bprint_args (char *fmt,void *data,int size,struct event_format *event) { -struct pevent *pevent = event->pevent; +struct tep_handle *pevent = event->pevent;struct format_field *field, *ip_field;struct print_arg *args, *arg, **next;unsigned long long ip, val;
@@ -4404,7 +4404,7 @@ static char * get_bprint_format(void *data, int size __maybe_unused, struct event_format *event) { -struct pevent *pevent = event->pevent; +struct tep_handle *pevent = event->pevent;unsigned long long addr;struct format_field *field;struct printk_map *printk;
@@ -4805,7 +4805,7 @@ void pevent_print_field(struct trace_seq *s, void *data, {unsigned long long val;unsigned int offset, len, i; -struct pevent *pevent = field->event->pevent; +struct tep_handle *pevent = field->event->pevent;if (field->flags &FIELD_IS_ARRAY ) { offset = field->offset;
@@ -4880,7 +4880,7 @@ void pevent_print_fields(struct trace_seq *s, void *data,static void pretty_print (struct trace_seq *s,void *data,int size,struct event_format *event) { -struct pevent *pevent = event->pevent; +struct tep_handle *pevent = event->pevent;struct print_fmt *print_fmt = &event->print_fmt;struct print_arg *arg = print_fmt->args;struct print_arg *args =NULL ;
@@ -5149,7 +5149,7 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct event* need rescheduling, in hard/soft interrupt, preempt count * and lock depth) and places it into the trace_seq. */ -void pevent_data_lat_fmt (struct pevent *pevent, +void pevent_data_lat_fmt (struct tep_handle *pevent,struct trace_seq *s,struct pevent_record *record) {static int check_lock_depth =1 ;
@@ -5229,7 +5229,7 @@ void pevent_data_lat_fmt(struct pevent *pevent,* * This returns the event id from the @rec. */ -int pevent_data_type (struct pevent *pevent,struct pevent_record *rec) +int pevent_data_type (struct tep_handle *pevent,struct pevent_record *rec) {return trace_parse_common_type (pevent, rec->data); }
@@ -5241,7 +5241,7 @@ int pevent_data_type(struct pevent *pevent, struct pevent_record *rec)* * This returns the event form a given @type; */ -struct event_format *pevent_data_event_from_type (struct pevent *pevent,int type) +struct event_format *pevent_data_event_from_type (struct tep_handle *pevent,int type) {return pevent_find_event (pevent, type); }
@@ -5253,7 +5253,7 @@ struct event_format *pevent_data_event_from_type(struct pevent *pevent, int type* * This returns the PID from a record. */ -int pevent_data_pid (struct pevent *pevent,struct pevent_record *rec) +int pevent_data_pid (struct tep_handle *pevent,struct pevent_record *rec) {return parse_common_pid (pevent, rec->data); }
@@ -5265,7 +5265,7 @@ int pevent_data_pid(struct pevent *pevent, struct pevent_record *rec)* * This returns the preempt count from a record. */ -int pevent_data_preempt_count (struct pevent *pevent,struct pevent_record *rec) +int pevent_data_preempt_count (struct tep_handle *pevent,struct pevent_record *rec) {return parse_common_pc (pevent, rec->data); }
@@ -5279,7 +5279,7 @@ int pevent_data_preempt_count(struct pevent *pevent, struct pevent_record *rec)* * Use trace_flag_type enum for the flags (see event-parse.h). */ -int pevent_data_flags (struct pevent *pevent,struct pevent_record *rec) +int pevent_data_flags (struct tep_handle *pevent,struct pevent_record *rec) {return parse_common_flags (pevent, rec->data); }
@@ -5292,7 +5292,7 @@ int pevent_data_flags(struct pevent *pevent, struct pevent_record *rec)* This returns a pointer to the command line that has the given * @pid. */ -const char *pevent_data_comm_from_pid (struct pevent *pevent,int pid) +const char *pevent_data_comm_from_pid (struct tep_handle *pevent,int pid) {const char *comm;
@@ -5301,7 +5301,7 @@ const char *pevent_data_comm_from_pid(struct pevent *pevent, int pid) }static struct cmdline * -pid_from_cmdlist (struct pevent *pevent,const char *comm,struct cmdline *next) +pid_from_cmdlist (struct tep_handle *pevent,const char *comm,struct cmdline *next) {struct cmdline_list *cmdlist = (struct cmdline_list *)next;
@@ -5329,7 +5329,7 @@ pid_from_cmdlist(struct pevent *pevent, const char *comm, struct cmdline *next)* next pid. * Also, it does a linear seach, so it may be slow. */ -struct cmdline *pevent_data_pid_from_comm (struct pevent *pevent,const char *comm, +struct cmdline *pevent_data_pid_from_comm (struct tep_handle *pevent,const char *comm,struct cmdline *next) {struct cmdline *cmdline;
@@ -5371,7 +5371,7 @@ struct cmdline *pevent_data_pid_from_comm(struct pevent *pevent, const char *com* Returns the pid for a give cmdline. If @cmdline is NULL, then * -1 is returned. */ -int pevent_cmdline_pid (struct pevent *pevent,struct cmdline *cmdline) +int pevent_cmdline_pid (struct tep_handle *pevent,struct cmdline *cmdline) {struct cmdline_list *cmdlist = (struct cmdline_list *)cmdline;
@@ -5441,7 +5441,7 @@ static bool is_timestamp_in_us(char *trace_clock, bool use_trace_clock)* is found. */ struct event_format * -pevent_find_event_by_record (struct pevent *pevent,struct pevent_record *record) +pevent_find_event_by_record (struct tep_handle *pevent,struct pevent_record *record) {int type;
@@ -5464,7 +5464,7 @@ pevent_find_event_by_record(struct pevent *pevent, struct pevent_record *record)* * Writes the tasks comm, pid and CPU to @s. */ -void pevent_print_event_task (struct pevent *pevent,struct trace_seq *s, +void pevent_print_event_task (struct tep_handle *pevent,struct trace_seq *s,struct event_format *event,struct pevent_record *record) {
@@ -5492,7 +5492,7 @@ void pevent_print_event_task(struct pevent *pevent, struct trace_seq *s,* * Writes the timestamp of the record into @s. */ -void pevent_print_event_time (struct pevent *pevent,struct trace_seq *s, +void pevent_print_event_time (struct tep_handle *pevent,struct trace_seq *s,struct event_format *event,struct pevent_record *record,bool use_trace_clock)
@@ -5542,7 +5542,7 @@ void pevent_print_event_time(struct pevent *pevent, struct trace_seq *s,* * Writes the parsing of the record's data to @s. */ -void pevent_print_event_data (struct pevent *pevent,struct trace_seq *s, +void pevent_print_event_data (struct tep_handle *pevent,struct trace_seq *s,struct event_format *event,struct pevent_record *record) {
@@ -5559,7 +5559,7 @@ void pevent_print_event_data(struct pevent *pevent, struct trace_seq *s,pevent_event_info (s, event, record); } -void pevent_print_event (struct pevent *pevent,struct trace_seq *s, +void pevent_print_event (struct tep_handle *pevent,struct trace_seq *s,struct pevent_record *record,bool use_trace_clock) {struct event_format *event;
@@ -5630,7 +5630,7 @@ static int events_system_cmp(const void *a, const void *b)return events_id_cmp (a, b); } -struct event_format **pevent_list_events (struct pevent *pevent,enum event_sort_type sort_type) +struct event_format **pevent_list_events (struct tep_handle *pevent,enum event_sort_type sort_type) {struct event_format **events;int (*sort)(const void *a,const void *b);
@@ -5941,7 +5941,7 @@ static void parse_header_field(const char *field,* * /sys/kernel/debug/tracing/events/header_page */ -int pevent_parse_header_page (struct pevent *pevent,char *buf,unsigned long size, +int pevent_parse_header_page (struct tep_handle *pevent,char *buf,unsigned long size,int long_size) {int ignore;
@@ -5994,7 +5994,7 @@ static void free_handler(struct event_handler *handle)free (handle); } -static int find_event_handle (struct pevent *pevent,struct event_format *event) +static int find_event_handle (struct tep_handle *pevent,struct event_format *event) {struct event_handler *handle, **next;
@@ -6036,7 +6036,7 @@ static int find_event_handle(struct pevent *pevent, struct event_format *event)* /sys/kernel/debug/tracing/events/.../.../format */ enum pevent_errno __pevent_parse_format (struct event_format **eventp, -struct pevent *pevent,const char *buf, +struct tep_handle *pevent,const char *buf,unsigned long size,const char *sys) {struct event_format *event;
@@ -6143,7 +6143,7 @@ enum pevent_errno __pevent_parse_format(struct event_format **eventp, }static enum pevent_errno -__pevent_parse_event (struct pevent *pevent, +__pevent_parse_event (struct tep_handle *pevent,struct event_format **eventp,const char *buf,unsigned long size,const char *sys)
@@ -6185,7 +6185,7 @@ __pevent_parse_event(struct pevent *pevent,* * /sys/kernel/debug/tracing/events/.../.../format */ -enum pevent_errno pevent_parse_format (struct pevent *pevent, +enum pevent_errno pevent_parse_format (struct tep_handle *pevent,struct event_format **eventp,const char *buf,unsigned long size,const char *sys)
@@ -6207,7 +6207,7 @@ enum pevent_errno pevent_parse_format(struct pevent *pevent,* * /sys/kernel/debug/tracing/events/.../.../format */ -enum pevent_errno pevent_parse_event (struct pevent *pevent,const char *buf, +enum pevent_errno pevent_parse_event (struct tep_handle *pevent,const char *buf,unsigned long size,const char *sys) {struct event_format *event =NULL ;
@@ -6221,7 +6221,7 @@ static const char * const pevent_error_str[] = { };#undef _PE -int pevent_strerror (struct pevent *pevent__maybe_unused , +int pevent_strerror (struct tep_handle *pevent__maybe_unused ,enum pevent_errno errnum,char *buf,size_t buflen) {int idx;
@@ -6435,7 +6435,7 @@ int pevent_print_func_field(struct trace_seq *s, const char *fmt, struct pevent_record *record, int err) {struct format_field *field =pevent_find_field (event, name); -struct pevent *pevent = event->pevent; +struct tep_handle *pevent = event->pevent;unsigned long long val;struct func_map *func;char tmp[128 ];
@@ -6491,7 +6491,7 @@ static void free_func_handle(struct pevent_function_handler *func)* The @parameters is a variable list of pevent_func_arg_type enums that * must end with PEVENT_FUNC_ARG_VOID. */ -int pevent_register_print_function (struct pevent *pevent, +int pevent_register_print_function (struct tep_handle *pevent,pevent_func_handler func,enum pevent_func_arg_type ret_type,char *name, ...)
@@ -6578,7 +6578,7 @@ int pevent_register_print_function(struct pevent *pevent,* * Returns 0 if the handler was removed successully, -1 otherwise. */ -int pevent_unregister_print_function (struct pevent *pevent, +int pevent_unregister_print_function (struct tep_handle *pevent,pevent_func_handler func,char *name) {struct pevent_function_handler *func_handle;
@@ -6591,7 +6591,7 @@ int pevent_unregister_print_function(struct pevent *pevent,return -1 ; } -static struct event_format *pevent_search_event (struct pevent *pevent,int id, +static struct event_format *pevent_search_event (struct tep_handle *pevent,int id,const char *sys_name,const char *event_name) {
@@ -6631,7 +6631,7 @@ static struct event_format *pevent_search_event(struct pevent *pevent, int id,* If @id is >= 0, then it is used to find the event. * else @sys_name and @event_name are used. */ -int pevent_register_event_handler (struct pevent *pevent,int id, +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) {
@@ -6715,7 +6715,7 @@ static int handle_matches(struct event_handler *handler, int id,* * Returns 0 if handler was removed successfully, -1 if event was not found. */ -int pevent_unregister_event_handler (struct pevent *pevent,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) {
@@ -6756,9 +6756,9 @@ int pevent_unregister_event_handler(struct pevent *pevent, int id,/** * pevent_alloc - create a pevent handle */ -struct pevent *pevent_alloc (void ) +struct tep_handle *pevent_alloc (void ) { -struct pevent *pevent =calloc (1 ,sizeof (*pevent)); +struct tep_handle *pevent =calloc (1 ,sizeof (*pevent));if (pevent) pevent->ref_count =1 ;
@@ -6766,7 +6766,7 @@ struct pevent *pevent_alloc(void)return pevent; } -void pevent_ref (struct pevent *pevent) +void pevent_ref (struct tep_handle *pevent) { pevent->ref_count++; }
@@ -6814,7 +6814,7 @@ void pevent_free_format(struct event_format *event)* pevent_free - free a pevent handle * @pevent: the pevent handle to free */ -void pevent_free (struct pevent *pevent) +void pevent_free (struct tep_handle *pevent) {struct cmdline_list *cmdlist, *cmdnext;struct func_list *funclist, *funcnext;
@@ -6899,7 +6899,7 @@ void pevent_free(struct pevent *pevent)free (pevent); } -void pevent_unref (struct pevent *pevent) +void pevent_unref (struct tep_handle *pevent) {pevent_free (pevent); }
tools/lib/traceevent/event-parse.h +68 -68
329 lines not on this page · raw message
tools/lib/traceevent/event-plugin.c +7 -7
@@ -281,7 +281,7 @@ void traceevent_print_plugins(struct trace_seq *s, }static void -load_plugin (struct pevent *pevent,const char *path, +load_plugin (struct tep_handle *pevent,const char *path,const char *file,void *data) {struct plugin_list **plugin_list = data;
@@ -336,9 +336,9 @@ load_plugin(struct pevent *pevent, const char *path, } static void -load_plugins_dir(struct pevent *pevent, const char *suffix, +load_plugins_dir(struct tep_handle *pevent, const char *suffix, const char *path, - void (*load_plugin)(struct pevent *pevent, + void (*load_plugin)(struct tep_handle *pevent, const char *path, const char *name, void *data),
@@ -378,8 +378,8 @@ load_plugins_dir(struct pevent *pevent, const char *suffix, } static void -load_plugins(struct pevent *pevent, const char *suffix, - void (*load_plugin)(struct pevent *pevent, +load_plugins(struct tep_handle *pevent, const char *suffix, + void (*load_plugin)(struct tep_handle *pevent, const char *path, const char *name, void *data),
@@ -431,7 +431,7 @@ load_plugins(struct pevent *pevent, const char *suffix, }struct plugin_list * -traceevent_load_plugins (struct pevent *pevent) +traceevent_load_plugins (struct tep_handle *pevent) {struct plugin_list *list =NULL ;
@@ -440,7 +440,7 @@ traceevent_load_plugins(struct pevent *pevent) }void -traceevent_unload_plugins (struct plugin_list *plugin_list,struct pevent *pevent) +traceevent_unload_plugins (struct plugin_list *plugin_list,struct tep_handle *pevent) {pevent_plugin_unload_func func;struct plugin_list *list;
tools/lib/traceevent/parse-filter.c +7 -7
@@ -179,7 +179,7 @@ add_filter_type(struct event_filter *filter, int id)* pevent_filter_alloc - create a new event filter * @pevent: The pevent that this filter is associated with */ -struct event_filter *pevent_filter_alloc (struct pevent *pevent) +struct event_filter *pevent_filter_alloc (struct tep_handle *pevent) {struct event_filter *filter;
@@ -269,7 +269,7 @@ static int event_match(struct event_format *event, }static enum pevent_errno -find_event (struct pevent *pevent,struct event_list **events, +find_event (struct tep_handle *pevent,struct event_list **events,char *sys_name,char *event_name) {struct event_format *event;
@@ -1270,7 +1270,7 @@ static void filter_init_error_buf(struct event_filter *filter)enum pevent_errno pevent_filter_add_filter_str (struct event_filter *filter,const char *filter_str) { -struct pevent *pevent = filter->pevent; +struct tep_handle *pevent = filter->pevent;struct event_list *event;struct event_list *events =NULL ;const char *filter_start;
@@ -1550,8 +1550,8 @@ int pevent_filter_copy(struct event_filter *dest, struct event_filter *source)int pevent_update_trivial (struct event_filter *dest,struct event_filter *source,enum filter_trivial_type type) { -struct pevent *src_pevent; -struct pevent *dest_pevent; +struct tep_handle *src_pevent; +struct tep_handle *dest_pevent;struct event_format *event;struct filter_type *filter_type;struct filter_arg *arg;
@@ -1874,7 +1874,7 @@ static int test_num(struct event_format *event, struct filter_arg *arg,static const char *get_field_str (struct filter_arg *arg,struct pevent_record *record) {struct event_format *event; -struct pevent *pevent; +struct tep_handle *pevent;unsigned long long addr;const char *val =NULL ;unsigned int size;
@@ -2049,7 +2049,7 @@ int pevent_event_filtered(struct event_filter *filter, int event_id)enum pevent_errno pevent_filter_match (struct event_filter *filter,struct pevent_record *record) { -struct pevent *pevent = filter->pevent; +struct tep_handle *pevent = filter->pevent;struct filter_type *filter_type;int event_id;int ret;
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 pevent *pevent) +int PEVENT_PLUGIN_LOADER (struct tep_handle *pevent) { pevent_register_print_function(pevent, process___le16_to_cpup,
@@ -36,7 +36,7 @@ int PEVENT_PLUGIN_LOADER(struct pevent *pevent)return 0 ; } -void PEVENT_PLUGIN_UNLOADER (struct pevent *pevent) +void PEVENT_PLUGIN_UNLOADER (struct tep_handle *pevent) {pevent_unregister_print_function (pevent, process___le16_to_cpup,"__le16_to_cpup" );
tools/lib/traceevent/plugin_function.c +3 -3
@@ -125,7 +125,7 @@ static int add_and_get_index(const char *parent, const char *child, int cpu)static int function_handler (struct trace_seq *s,struct pevent_record *record,struct 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;
@@ -163,7 +163,7 @@ static int function_handler(struct trace_seq *s, struct pevent_record *record,return 0 ; } -int PEVENT_PLUGIN_LOADER (struct pevent *pevent) +int PEVENT_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 pevent *pevent)return 0 ; } -void PEVENT_PLUGIN_UNLOADER (struct pevent *pevent) +void PEVENT_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 pevent *pevent) +int PEVENT_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 pevent *pevent)return 0 ; } -void PEVENT_PLUGIN_UNLOADER (struct pevent *pevent) +void PEVENT_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 pevent *pevent) +int PEVENT_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 pevent *pevent)return 0 ; } -void PEVENT_PLUGIN_UNLOADER (struct pevent *pevent) +void PEVENT_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 pevent_record *record,return 1 ; } -int PEVENT_PLUGIN_LOADER (struct pevent *pevent) +int PEVENT_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 pevent *pevent)return 0 ; } -void PEVENT_PLUGIN_UNLOADER (struct pevent *pevent) +void PEVENT_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 pevent *pevent) +int PEVENT_PLUGIN_LOADER (struct tep_handle *pevent) {init_disassembler ();
@@ -486,7 +486,7 @@ int PEVENT_PLUGIN_LOADER(struct pevent *pevent)return 0 ; } -void PEVENT_PLUGIN_UNLOADER (struct pevent *pevent) +void PEVENT_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 pevent *pevent) +int PEVENT_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 pevent *pevent)return 0 ; } -void PEVENT_PLUGIN_UNLOADER (struct pevent *pevent) +void PEVENT_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 pevent *pevent) +int PEVENT_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 pevent *pevent)return 0 ; } -void PEVENT_PLUGIN_UNLOADER (struct pevent *pevent) +void PEVENT_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 pevent *pevent) +int PEVENT_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 pevent *pevent)return 0 ; } -void PEVENT_PLUGIN_UNLOADER (struct pevent *pevent) +void PEVENT_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 pevent *pevent) +int PEVENT_PLUGIN_LOADER (struct tep_handle *pevent) { pevent_register_print_function(pevent, process_xen_hypercall_name,
@@ -130,7 +130,7 @@ int PEVENT_PLUGIN_LOADER(struct pevent *pevent)return 0 ; } -void PEVENT_PLUGIN_UNLOADER (struct pevent *pevent) +void PEVENT_PLUGIN_UNLOADER (struct tep_handle *pevent) {pevent_unregister_print_function (pevent, process_xen_hypercall_name,"xen_hypercall_name" );
tools/perf/util/header.c +2 -2
@@ -3207,7 +3207,7 @@ static int read_attr(int fd, struct perf_header *ph, }static int perf_evsel__prepare_tracepoint_event (struct perf_evsel *evsel, -struct pevent *pevent) +struct tep_handle *pevent) {struct event_format *event;char bf[128 ];
@@ -3239,7 +3239,7 @@ static int perf_evsel__prepare_tracepoint_event(struct perf_evsel *evsel, }static int perf_evlist__prepare_tracepoint_events (struct perf_evlist *evlist, -struct pevent *pevent) +struct tep_handle *pevent) {struct perf_evsel *pos;
tools/perf/util/python.c +1 -1
@@ -341,7 +341,7 @@ static bool is_tracepoint(struct pyrf_event *pevent)static PyObject *tracepoint_field (struct pyrf_event *pe,struct format_field *field) { -struct pevent *pevent = field->event->pevent; +struct tep_handle *pevent = field->event->pevent;void *data = pe->sample.raw_data;PyObject *ret =NULL ;unsigned long long val;
tools/perf/util/scripting-engines/trace-event-perl.c +1 -1
@@ -535,7 +535,7 @@ static int perl_stop_script(void)return 0 ; } -static int perl_generate_script (struct pevent *pevent,const char *outfile) +static int perl_generate_script (struct tep_handle *pevent,const char *outfile) {struct event_format *event =NULL ;struct format_field *f;
tools/perf/util/scripting-engines/trace-event-python.c +1 -1
@@ -1588,7 +1588,7 @@ static int python_stop_script(void)return 0 ; } -static int python_generate_script (struct pevent *pevent,const char *outfile) +static int python_generate_script (struct tep_handle *pevent,const char *outfile) {struct event_format *event =NULL ;struct format_field *f;
tools/perf/util/sort.h +1 -1
@@ -276,7 +276,7 @@ extern struct sort_entry sort_thread;extern struct list_head hist_entry__sort_list;struct perf_evlist ; -struct pevent ; +struct tep_handle ;int setup_sorting (struct perf_evlist *evlist);int setup_output_field (void );void reset_output_field (void );
tools/perf/util/trace-event-parse.c +6 -6
@@ -32,7 +32,7 @@static int get_common_field (struct scripting_context *context,int *offset,int *size,const char *type) { -struct pevent *pevent = context->pevent; +struct tep_handle *pevent = context->pevent;struct event_format *event;struct format_field *field;
@@ -136,7 +136,7 @@ void event_format__print(struct event_format *event,return event_format__fprintf (event, cpu, data, size, stdout); } -void parse_ftrace_printk (struct pevent *pevent, +void parse_ftrace_printk (struct tep_handle *pevent,char *file,unsigned int size__maybe_unused ) {unsigned long long addr;
@@ -161,7 +161,7 @@ void parse_ftrace_printk(struct pevent *pevent, } } -void parse_saved_cmdline (struct pevent *pevent, +void parse_saved_cmdline (struct tep_handle *pevent,char *file,unsigned int size__maybe_unused ) {char *comm;
@@ -178,18 +178,18 @@ void parse_saved_cmdline(struct pevent *pevent, } } -int parse_ftrace_file (struct pevent *pevent,char *buf,unsigned long size) +int parse_ftrace_file (struct tep_handle *pevent,char *buf,unsigned long size) {return pevent_parse_event (pevent, buf, size,"ftrace" ); } -int parse_event_file (struct pevent *pevent, +int parse_event_file (struct tep_handle *pevent,char *buf,unsigned long size,char *sys) {return pevent_parse_event (pevent, buf, size, sys); } -struct event_format *trace_find_next_event (struct pevent *pevent, +struct event_format *trace_find_next_event (struct tep_handle *pevent,struct event_format *event) {static int idx;
tools/perf/util/trace-event-read.c +12 -12
@@ -96,7 +96,7 @@ static void skip(int size) }; } -static unsigned int read4 (struct pevent *pevent) +static unsigned int read4 (struct tep_handle *pevent) {unsigned int data;
@@ -105,7 +105,7 @@ static unsigned int read4(struct pevent *pevent)return __data2host4 (pevent, data); } -static unsigned long long read8 (struct pevent *pevent) +static unsigned long long read8 (struct tep_handle *pevent) {unsigned long long data;
@@ -158,7 +158,7 @@ static char *read_string(void)return str; } -static int read_proc_kallsyms (struct pevent *pevent) +static int read_proc_kallsyms (struct tep_handle *pevent) {unsigned int size;
@@ -181,7 +181,7 @@ static int read_proc_kallsyms(struct pevent *pevent)return 0 ; } -static int read_ftrace_printk (struct pevent *pevent) +static int read_ftrace_printk (struct tep_handle *pevent) {unsigned int size;char *buf;
@@ -208,7 +208,7 @@ static int read_ftrace_printk(struct pevent *pevent)return 0 ; } -static int read_header_files (struct pevent *pevent) +static int read_header_files (struct tep_handle *pevent) {unsigned long long size;char *header_page;
@@ -259,7 +259,7 @@ static int read_header_files(struct pevent *pevent)return ret; } -static int read_ftrace_file (struct pevent *pevent,unsigned long long size) +static int read_ftrace_file (struct tep_handle *pevent,unsigned long long size) {int ret;char *buf;
@@ -284,8 +284,8 @@ static int read_ftrace_file(struct pevent *pevent, unsigned long long size)return ret; } -static int read_event_file (struct pevent *pevent,char *sys, -unsigned long long size) +static int read_event_file (struct tep_handle *pevent,char *sys, +unsigned long long size) {int ret;char *buf;
@@ -310,7 +310,7 @@ static int read_event_file(struct pevent *pevent, char *sys,return ret; } -static int read_ftrace_files (struct pevent *pevent) +static int read_ftrace_files (struct tep_handle *pevent) {unsigned long long size;int count;
@@ -328,7 +328,7 @@ static int read_ftrace_files(struct pevent *pevent)return 0 ; } -static int read_event_files (struct pevent *pevent) +static int read_event_files (struct tep_handle *pevent) {unsigned long long size;char *sys;
@@ -356,7 +356,7 @@ static int read_event_files(struct pevent *pevent)return 0 ; } -static int read_saved_cmdline (struct pevent *pevent) +static int read_saved_cmdline (struct tep_handle *pevent) {unsigned long long size;char *buf;
@@ -399,7 +399,7 @@ ssize_t trace_report(int fd, struct trace_event *tevent, bool __repipe)int host_bigendian;int file_long_size;int file_page_size; -struct pevent *pevent =NULL ; +struct tep_handle *pevent =NULL ;int err; repipe = __repipe;
tools/perf/util/trace-event-scripting.c +2 -2
@@ -66,7 +66,7 @@ static int python_start_script_unsupported(const char *script __maybe_unused,return -1 ; } -static int python_generate_script_unsupported (struct pevent *pevent +static int python_generate_script_unsupported (struct tep_handle *pevent__maybe_unused ,const char *outfile__maybe_unused )
@@ -130,7 +130,7 @@ static int perl_start_script_unsupported(const char *script __maybe_unused,return -1 ; } -static int perl_generate_script_unsupported (struct pevent *pevent +static int perl_generate_script_unsupported (struct tep_handle *pevent__maybe_unused ,const char *outfile__maybe_unused ) {
tools/perf/util/trace-event.c +3 -3
@@ -28,7 +28,7 @@ static bool tevent_initialized;int trace_event__init (struct trace_event *t) { -struct pevent *pevent =pevent_alloc (); +struct tep_handle *pevent =pevent_alloc ();if (pevent) { t->plugin_list =traceevent_load_plugins (pevent);
@@ -41,7 +41,7 @@ int trace_event__init(struct trace_event *t)static int trace_event__init2 (void ) {int be =traceevent_host_bigendian (); -struct pevent *pevent; +struct tep_handle *pevent;if (trace_event__init (&tevent))return -1 ;
@@ -76,7 +76,7 @@ static struct event_format* tp_format(const char *sys, const char *name) { char *tp_dir = get_events_file(sys); -struct pevent *pevent = tevent.pevent; +struct tep_handle *pevent = tevent.pevent;struct event_format *event =NULL ;char path[PATH_MAX ];size_t size;
tools/perf/util/trace-event.h +9 -9
@@ -13,7 +13,7 @@ struct thread;struct plugin_list ;struct trace_event { -struct pevent *pevent; +struct tep_handle *pevent;struct plugin_list *plugin_list; };
@@ -34,20 +34,20 @@ void event_format__fprintf(struct event_format *event,void event_format__print (struct event_format *event,int cpu,void *data,int size); -int parse_ftrace_file (struct pevent *pevent,char *buf,unsigned long size); -int parse_event_file (struct pevent *pevent, +int parse_ftrace_file (struct tep_handle *pevent,char *buf,unsigned long size); +int parse_event_file (struct tep_handle *pevent,char *buf,unsigned long size,char *sys);unsigned long long raw_field_value (struct event_format *event,const char *name,void *data); -void parse_proc_kallsyms (struct pevent *pevent,char *file,unsigned int size); -void parse_ftrace_printk (struct pevent *pevent,char *file,unsigned int size); -void parse_saved_cmdline (struct pevent *pevent,char *file,unsigned int size); +void parse_proc_kallsyms (struct tep_handle *pevent,char *file,unsigned int size); +void parse_ftrace_printk (struct tep_handle *pevent,char *file,unsigned int size); +void parse_saved_cmdline (struct tep_handle *pevent,char *file,unsigned int size);ssize_t trace_report (int fd,struct trace_event *tevent,bool repipe); -struct event_format *trace_find_next_event (struct pevent *pevent, +struct event_format *trace_find_next_event (struct tep_handle *pevent,struct event_format *event);unsigned long long read_size (struct event_format *event,void *ptr,int size);unsigned long long eval_flag (const char *flag);
@@ -83,7 +83,7 @@ struct scripting_ops {void (*process_stat)(struct perf_stat_config *config,struct perf_evsel *evsel,u64 tstamp);void (*process_stat_interval)(u64 tstamp); -int (*generate_script) (struct pevent *pevent,const char *outfile); +int (*generate_script) (struct tep_handle *pevent,const char *outfile); };extern unsigned int scripting_max_stack;
@@ -94,7 +94,7 @@ void setup_perl_scripting(void);void setup_python_scripting (void );struct scripting_context { -struct pevent *pevent; +struct tep_handle *pevent;void *event_data; };
Signature · 1 line
2.18.0
tip-bot for Tzvetomir Stoyanov (VMware)
merge bot[tip:perf/urgent] tools lib traceevent, perf tools: Rename struct pevent to struct tep_handle
tools lib traceevent, perf tools: Rename struct pevent to struct tep_handle
Commit-ID: 096177a8b51937ba3004164f0366ef20656bb17a Gitweb: https://git.kernel.org/tip/096177a8b51937ba3004164f0366ef20656bb17a Author: Tzvetomir Stoyanov (VMware) <[email protected]> AuthorDate: Wed, 8 Aug 2018 14:02:46 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Fri, 10 Aug 2018 15:29:35 -0300
tools lib traceevent, perf tools: Rename struct pevent to struct tep_handle
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 struct pevent to struct tep_handle.
--- tools/lib/traceevent/event-parse.c | 148 ++++++++++----------- tools/lib/traceevent/event-parse.h | 136 +++++++++---------- tools/lib/traceevent/event-plugin.c | 14 +- tools/lib/traceevent/parse-filter.c | 14 +- tools/lib/traceevent/plugin_cfg80211.c | 4 +- tools/lib/traceevent/plugin_function.c | 6 +- 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 +- tools/perf/util/header.c | 4 +- tools/perf/util/python.c | 2 +- .../perf/util/scripting-engines/trace-event-perl.c | 2 +- .../util/scripting-engines/trace-event-python.c | 2 +- tools/perf/util/sort.h | 2 +- tools/perf/util/trace-event-parse.c | 12 +- tools/perf/util/trace-event-read.c | 24 ++-- tools/perf/util/trace-event-scripting.c | 4 +- tools/perf/util/trace-event.c | 6 +- tools/perf/util/trace-event.h | 18 +-- 24 files changed, 215 insertions(+), 215 deletions(-)
tools/lib/traceevent/event-parse.c +74 -74
@@ -160,7 +160,7 @@ struct cmdline_list {int pid; }; -static int cmdline_init (struct pevent *pevent) +static int cmdline_init (struct tep_handle *pevent) {struct cmdline_list *cmdlist = pevent->cmdlist;struct cmdline_list *item;
@@ -189,7 +189,7 @@ static int cmdline_init(struct pevent *pevent)return 0 ; } -static const char *find_cmdline (struct pevent *pevent,int pid) +static const char *find_cmdline (struct tep_handle *pevent,int pid) {const struct cmdline *comm;struct cmdline key;
@@ -218,7 +218,7 @@ static const char *find_cmdline(struct pevent *pevent, int pid)* Returns 1 if the pid has a cmdline mapped to it * 0 otherwise. */ -int pevent_pid_is_registered (struct pevent *pevent,int pid) +int pevent_pid_is_registered (struct tep_handle *pevent,int pid) {const struct cmdline *comm;struct cmdline key;
@@ -244,7 +244,7 @@ int pevent_pid_is_registered(struct pevent *pevent, int pid)* we must add this pid. This is much slower than when cmdlines * are added before the array is initialized. */ -static int add_new_comm (struct pevent *pevent,const char *comm,int pid) +static int add_new_comm (struct tep_handle *pevent,const char *comm,int pid) {struct cmdline *cmdlines = pevent->cmdlines;const struct cmdline *cmdline;
@@ -296,7 +296,7 @@ static int add_new_comm(struct pevent *pevent, const char *comm, int pid)* This adds a mapping to search for command line names with * a given pid. The comm is duplicated. */ -int pevent_register_comm (struct pevent *pevent,const char *comm,int pid) +int pevent_register_comm (struct tep_handle *pevent,const char *comm,int pid) {struct cmdline_list *item;
@@ -324,7 +324,7 @@ int pevent_register_comm(struct pevent *pevent, const char *comm, int pid)return 0 ; } -int pevent_register_trace_clock (struct pevent *pevent,const char *trace_clock) +int pevent_register_trace_clock (struct tep_handle *pevent,const char *trace_clock) { pevent->trace_clock =strdup (trace_clock);if (!pevent->trace_clock) {
@@ -381,7 +381,7 @@ static int func_bcmp(const void *a, const void *b)return 1 ; } -static int func_map_init (struct pevent *pevent) +static int func_map_init (struct tep_handle *pevent) {struct func_list *funclist;struct func_list *item;
@@ -421,7 +421,7 @@ static int func_map_init(struct pevent *pevent) }static struct func_map * -__find_func (struct pevent *pevent,unsigned long long addr) +__find_func (struct tep_handle *pevent,unsigned long long addr) {struct func_map *func;struct func_map key;
@@ -453,7 +453,7 @@ struct func_resolver {* keep using it instead of duplicating all the entries inside * pevent->funclist. */ -int pevent_set_function_resolver (struct pevent *pevent, +int pevent_set_function_resolver (struct tep_handle *pevent,pevent_func_resolver_t *func,void *priv) {struct func_resolver *resolver =malloc (sizeof (*resolver));
@@ -477,14 +477,14 @@ int pevent_set_function_resolver(struct pevent *pevent,* Stop using whatever alternative resolver was set, use the default * one instead. */ -void pevent_reset_function_resolver (struct pevent *pevent) +void pevent_reset_function_resolver (struct tep_handle *pevent) {free (pevent->func_resolver); pevent->func_resolver =NULL ; }static struct func_map * -find_func (struct pevent *pevent,unsigned long long addr) +find_func (struct tep_handle *pevent,unsigned long long addr) {struct func_map *map;
@@ -511,7 +511,7 @@ find_func(struct pevent *pevent, unsigned long long addr)* address. Note, the address does not have to be exact, it * will select the function that would contain the address. */ -const char *pevent_find_function (struct pevent *pevent,unsigned long long addr) +const char *pevent_find_function (struct tep_handle *pevent,unsigned long long addr) {struct func_map *map;
@@ -532,7 +532,7 @@ const char *pevent_find_function(struct pevent *pevent, unsigned long long addr)* name and the function offset. */ unsigned long long -pevent_find_function_address (struct pevent *pevent,unsigned long long addr) +pevent_find_function_address (struct tep_handle *pevent,unsigned long long addr) {struct func_map *map;
@@ -553,7 +553,7 @@ pevent_find_function_address(struct pevent *pevent, unsigned long long addr)* This registers a function name with an address and module. * The @func passed in is duplicated. */ -int pevent_register_function (struct pevent *pevent,char *func, +int pevent_register_function (struct tep_handle *pevent,char *func,unsigned long long addr,char *mod) {struct func_list *item =malloc (sizeof (*item));
@@ -594,7 +594,7 @@ out_free:* * This prints out the stored functions. */ -void pevent_print_funcs (struct pevent *pevent) +void pevent_print_funcs (struct tep_handle *pevent) {int i;
@@ -636,7 +636,7 @@ static int printk_cmp(const void *a, const void *b)return 0 ; } -static int printk_map_init (struct pevent *pevent) +static int printk_map_init (struct tep_handle *pevent) {struct printk_list *printklist;struct printk_list *item;
@@ -668,7 +668,7 @@ static int printk_map_init(struct pevent *pevent) }static struct printk_map * -find_printk (struct pevent *pevent,unsigned long long addr) +find_printk (struct tep_handle *pevent,unsigned long long addr) {struct printk_map *printk;struct printk_map key;
@@ -693,7 +693,7 @@ find_printk(struct pevent *pevent, unsigned long long addr)* This registers a string by the address it was stored in the kernel. * The @fmt passed in is duplicated. */ -int pevent_register_print_string (struct pevent *pevent,const char *fmt, +int pevent_register_print_string (struct tep_handle *pevent,const char *fmt,unsigned long long addr) {struct printk_list *item =malloc (sizeof (*item));
@@ -737,7 +737,7 @@ out_free:* * This prints the string formats that were stored. */ -void pevent_print_printk (struct pevent *pevent) +void pevent_print_printk (struct tep_handle *pevent) {int i;
@@ -756,7 +756,7 @@ static struct event_format *alloc_event(void)return calloc (1 ,sizeof (struct event_format )); } -static int add_event (struct pevent *pevent,struct event_format *event) +static int add_event (struct tep_handle *pevent,struct event_format *event) {int i; struct event_format **events = realloc(pevent->events, sizeof(event) *
@@ -2915,7 +2915,7 @@ process_bitmask(struct event_format *event __maybe_unused, struct print_arg *arg }static struct pevent_function_handler * -find_func_handler (struct pevent *pevent,char *func_name) +find_func_handler (struct tep_handle *pevent,char *func_name) {struct pevent_function_handler *func;
@@ -2930,7 +2930,7 @@ find_func_handler(struct pevent *pevent, char *func_name)return func; } -static void remove_func_handler (struct pevent *pevent,char *func_name) +static void remove_func_handler (struct tep_handle *pevent,char *func_name) {struct pevent_function_handler *func;struct pevent_function_handler **next;
@@ -3337,7 +3337,7 @@ pevent_find_any_field(struct event_format *event, const char *name)* Returns the number (converted to host) from the * raw data. */ -unsigned long long pevent_read_number (struct pevent *pevent, +unsigned long long pevent_read_number (struct tep_handle *pevent,const void *ptr,int size) {switch (size) {
@@ -3384,7 +3384,7 @@ int pevent_read_number_field(struct format_field *field, const void *data, } } -static int get_common_info (struct pevent *pevent, +static int get_common_info (struct tep_handle *pevent,const char *type,int *offset,int *size) {struct event_format *event;
@@ -3410,7 +3410,7 @@ static int get_common_info(struct pevent *pevent,return 0 ; } -static int __parse_common (struct pevent *pevent,void *data, +static int __parse_common (struct tep_handle *pevent,void *data,int *size,int *offset,const char *name) {int ret;
@@ -3423,42 +3423,42 @@ static int __parse_common(struct pevent *pevent, void *data,return pevent_read_number (pevent, data + *offset, *size); } -static int trace_parse_common_type (struct pevent *pevent,void *data) +static int trace_parse_common_type (struct tep_handle *pevent,void *data) {return __parse_common (pevent, data, &pevent->type_size, &pevent->type_offset,"common_type" ); } -static int parse_common_pid (struct pevent *pevent,void *data) +static int parse_common_pid (struct tep_handle *pevent,void *data) {return __parse_common (pevent, data, &pevent->pid_size, &pevent->pid_offset,"common_pid" ); } -static int parse_common_pc (struct pevent *pevent,void *data) +static int parse_common_pc (struct tep_handle *pevent,void *data) {return __parse_common (pevent, data, &pevent->pc_size, &pevent->pc_offset,"common_preempt_count" ); } -static int parse_common_flags (struct pevent *pevent,void *data) +static int parse_common_flags (struct tep_handle *pevent,void *data) {return __parse_common (pevent, data, &pevent->flags_size, &pevent->flags_offset,"common_flags" ); } -static int parse_common_lock_depth (struct pevent *pevent,void *data) +static int parse_common_lock_depth (struct tep_handle *pevent,void *data) {return __parse_common (pevent, data, &pevent->ld_size, &pevent->ld_offset,"common_lock_depth" ); } -static int parse_common_migrate_disable (struct pevent *pevent,void *data) +static int parse_common_migrate_disable (struct tep_handle *pevent,void *data) { return __parse_common(pevent, data, &pevent->ld_size, &pevent->ld_offset,
@@ -3474,7 +3474,7 @@ static int events_id_cmp(const void *a, const void *b);* * Returns an event that has a given @id. */ -struct event_format *pevent_find_event (struct pevent *pevent,int id) +struct event_format *pevent_find_event (struct tep_handle *pevent,int id) {struct event_format **eventptr;struct event_format key;
@@ -3507,7 +3507,7 @@ struct event_format *pevent_find_event(struct pevent *pevent, int id)* @sys. If @sys is NULL the first event with @name is returned. */ struct event_format * -pevent_find_event_by_name (struct pevent *pevent, +pevent_find_event_by_name (struct tep_handle *pevent,const char *sys,const char *name) {struct event_format *event;
@@ -3537,7 +3537,7 @@ pevent_find_event_by_name(struct pevent *pevent,static unsigned long long eval_num_arg (void *data,int size,struct event_format *event,struct print_arg *arg) { -struct pevent *pevent = event->pevent; +struct tep_handle *pevent = event->pevent;unsigned long long val =0 ;unsigned long long left, right;struct print_arg *typearg =NULL ;
@@ -3820,7 +3820,7 @@ static void print_str_to_seq(struct trace_seq *s, const char *format,trace_seq_printf (s, format, str); } -static void print_bitmask_to_seq (struct pevent *pevent, +static void print_bitmask_to_seq (struct tep_handle *pevent,struct trace_seq *s,const char *format,int len_arg,const void *data,int size) {
@@ -3878,7 +3878,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size, struct event_format *event, const char *format, int len_arg, struct print_arg *arg) { - struct pevent *pevent = event->pevent; + struct tep_handle *pevent = event->pevent;struct print_flag_sym *flag;struct format_field *field;struct printk_map *printk;
@@ -4227,7 +4227,7 @@ static void free_args(struct print_arg *args)static struct print_arg *make_bprint_args (char *fmt,void *data,int size,struct event_format *event) { -struct pevent *pevent = event->pevent; +struct tep_handle *pevent = event->pevent;struct format_field *field, *ip_field;struct print_arg *args, *arg, **next;unsigned long long ip, val;
@@ -4404,7 +4404,7 @@ static char * get_bprint_format(void *data, int size __maybe_unused, struct event_format *event) { -struct pevent *pevent = event->pevent; +struct tep_handle *pevent = event->pevent;unsigned long long addr;struct format_field *field;struct printk_map *printk;
@@ -4805,7 +4805,7 @@ void pevent_print_field(struct trace_seq *s, void *data, {unsigned long long val;unsigned int offset, len, i; -struct pevent *pevent = field->event->pevent; +struct tep_handle *pevent = field->event->pevent;if (field->flags &FIELD_IS_ARRAY ) { offset = field->offset;
@@ -4880,7 +4880,7 @@ void pevent_print_fields(struct trace_seq *s, void *data,static void pretty_print (struct trace_seq *s,void *data,int size,struct event_format *event) { -struct pevent *pevent = event->pevent; +struct tep_handle *pevent = event->pevent;struct print_fmt *print_fmt = &event->print_fmt;struct print_arg *arg = print_fmt->args;struct print_arg *args =NULL ;
@@ -5149,7 +5149,7 @@ out_failed:* need rescheduling, in hard/soft interrupt, preempt count * and lock depth) and places it into the trace_seq. */ -void pevent_data_lat_fmt (struct pevent *pevent, +void pevent_data_lat_fmt (struct tep_handle *pevent,struct trace_seq *s,struct pevent_record *record) {static int check_lock_depth =1 ;
@@ -5229,7 +5229,7 @@ void pevent_data_lat_fmt(struct pevent *pevent,* * This returns the event id from the @rec. */ -int pevent_data_type (struct pevent *pevent,struct pevent_record *rec) +int pevent_data_type (struct tep_handle *pevent,struct pevent_record *rec) {return trace_parse_common_type (pevent, rec->data); }
@@ -5241,7 +5241,7 @@ int pevent_data_type(struct pevent *pevent, struct pevent_record *rec)* * This returns the event form a given @type; */ -struct event_format *pevent_data_event_from_type (struct pevent *pevent,int type) +struct event_format *pevent_data_event_from_type (struct tep_handle *pevent,int type) {return pevent_find_event (pevent, type); }
@@ -5253,7 +5253,7 @@ struct event_format *pevent_data_event_from_type(struct pevent *pevent, int type* * This returns the PID from a record. */ -int pevent_data_pid (struct pevent *pevent,struct pevent_record *rec) +int pevent_data_pid (struct tep_handle *pevent,struct pevent_record *rec) {return parse_common_pid (pevent, rec->data); }
@@ -5265,7 +5265,7 @@ int pevent_data_pid(struct pevent *pevent, struct pevent_record *rec)* * This returns the preempt count from a record. */ -int pevent_data_preempt_count (struct pevent *pevent,struct pevent_record *rec) +int pevent_data_preempt_count (struct tep_handle *pevent,struct pevent_record *rec) {return parse_common_pc (pevent, rec->data); }
@@ -5279,7 +5279,7 @@ int pevent_data_preempt_count(struct pevent *pevent, struct pevent_record *rec)* * Use trace_flag_type enum for the flags (see event-parse.h). */ -int pevent_data_flags (struct pevent *pevent,struct pevent_record *rec) +int pevent_data_flags (struct tep_handle *pevent,struct pevent_record *rec) {return parse_common_flags (pevent, rec->data); }
@@ -5292,7 +5292,7 @@ int pevent_data_flags(struct pevent *pevent, struct pevent_record *rec)* This returns a pointer to the command line that has the given * @pid. */ -const char *pevent_data_comm_from_pid (struct pevent *pevent,int pid) +const char *pevent_data_comm_from_pid (struct tep_handle *pevent,int pid) {const char *comm;
@@ -5301,7 +5301,7 @@ const char *pevent_data_comm_from_pid(struct pevent *pevent, int pid) }static struct cmdline * -pid_from_cmdlist (struct pevent *pevent,const char *comm,struct cmdline *next) +pid_from_cmdlist (struct tep_handle *pevent,const char *comm,struct cmdline *next) {struct cmdline_list *cmdlist = (struct cmdline_list *)next;
@@ -5329,7 +5329,7 @@ pid_from_cmdlist(struct pevent *pevent, const char *comm, struct cmdline *next)* next pid. * Also, it does a linear seach, so it may be slow. */ -struct cmdline *pevent_data_pid_from_comm (struct pevent *pevent,const char *comm, +struct cmdline *pevent_data_pid_from_comm (struct tep_handle *pevent,const char *comm,struct cmdline *next) {struct cmdline *cmdline;
@@ -5371,7 +5371,7 @@ struct cmdline *pevent_data_pid_from_comm(struct pevent *pevent, const char *com* Returns the pid for a give cmdline. If @cmdline is NULL, then * -1 is returned. */ -int pevent_cmdline_pid (struct pevent *pevent,struct cmdline *cmdline) +int pevent_cmdline_pid (struct tep_handle *pevent,struct cmdline *cmdline) {struct cmdline_list *cmdlist = (struct cmdline_list *)cmdline;
@@ -5441,7 +5441,7 @@ static bool is_timestamp_in_us(char *trace_clock, bool use_trace_clock)* is found. */ struct event_format * -pevent_find_event_by_record (struct pevent *pevent,struct pevent_record *record) +pevent_find_event_by_record (struct tep_handle *pevent,struct pevent_record *record) {int type;
@@ -5464,7 +5464,7 @@ pevent_find_event_by_record(struct pevent *pevent, struct pevent_record *record)* * Writes the tasks comm, pid and CPU to @s. */ -void pevent_print_event_task (struct pevent *pevent,struct trace_seq *s, +void pevent_print_event_task (struct tep_handle *pevent,struct trace_seq *s,struct event_format *event,struct pevent_record *record) {
@@ -5492,7 +5492,7 @@ void pevent_print_event_task(struct pevent *pevent, struct trace_seq *s,* * Writes the timestamp of the record into @s. */ -void pevent_print_event_time (struct pevent *pevent,struct trace_seq *s, +void pevent_print_event_time (struct tep_handle *pevent,struct trace_seq *s,struct event_format *event,struct pevent_record *record,bool use_trace_clock)
@@ -5542,7 +5542,7 @@ void pevent_print_event_time(struct pevent *pevent, struct trace_seq *s,* * Writes the parsing of the record's data to @s. */ -void pevent_print_event_data (struct pevent *pevent,struct trace_seq *s, +void pevent_print_event_data (struct tep_handle *pevent,struct trace_seq *s,struct event_format *event,struct pevent_record *record) {
@@ -5559,7 +5559,7 @@ void pevent_print_event_data(struct pevent *pevent, struct trace_seq *s,pevent_event_info (s, event, record); } -void pevent_print_event (struct pevent *pevent,struct trace_seq *s, +void pevent_print_event (struct tep_handle *pevent,struct trace_seq *s,struct pevent_record *record,bool use_trace_clock) {struct event_format *event;
@@ -5630,7 +5630,7 @@ static int events_system_cmp(const void *a, const void *b)return events_id_cmp (a, b); } -struct event_format **pevent_list_events (struct pevent *pevent,enum event_sort_type sort_type) +struct event_format **pevent_list_events (struct tep_handle *pevent,enum event_sort_type sort_type) {struct event_format **events;int (*sort)(const void *a,const void *b);
@@ -5941,7 +5941,7 @@ static void parse_header_field(const char *field,* * /sys/kernel/debug/tracing/events/header_page */ -int pevent_parse_header_page (struct pevent *pevent,char *buf,unsigned long size, +int pevent_parse_header_page (struct tep_handle *pevent,char *buf,unsigned long size,int long_size) {int ignore;
@@ -5994,7 +5994,7 @@ static void free_handler(struct event_handler *handle)free (handle); } -static int find_event_handle (struct pevent *pevent,struct event_format *event) +static int find_event_handle (struct tep_handle *pevent,struct event_format *event) {struct event_handler *handle, **next;
@@ -6036,7 +6036,7 @@ static int find_event_handle(struct pevent *pevent, struct event_format *event)* /sys/kernel/debug/tracing/events/.../.../format */ enum pevent_errno __pevent_parse_format (struct event_format **eventp, -struct pevent *pevent,const char *buf, +struct tep_handle *pevent,const char *buf,unsigned long size,const char *sys) {struct event_format *event;
@@ -6143,7 +6143,7 @@ enum pevent_errno __pevent_parse_format(struct event_format **eventp, }static enum pevent_errno -__pevent_parse_event (struct pevent *pevent, +__pevent_parse_event (struct tep_handle *pevent,struct event_format **eventp,const char *buf,unsigned long size,const char *sys)
@@ -6185,7 +6185,7 @@ event_add_failed:* * /sys/kernel/debug/tracing/events/.../.../format */ -enum pevent_errno pevent_parse_format (struct pevent *pevent, +enum pevent_errno pevent_parse_format (struct tep_handle *pevent,struct event_format **eventp,const char *buf,unsigned long size,const char *sys)
@@ -6207,7 +6207,7 @@ enum pevent_errno pevent_parse_format(struct pevent *pevent,* * /sys/kernel/debug/tracing/events/.../.../format */ -enum pevent_errno pevent_parse_event (struct pevent *pevent,const char *buf, +enum pevent_errno pevent_parse_event (struct tep_handle *pevent,const char *buf,unsigned long size,const char *sys) {struct event_format *event =NULL ;
@@ -6221,7 +6221,7 @@ static const char * const pevent_error_str[] = { };#undef _PE -int pevent_strerror (struct pevent *pevent__maybe_unused , +int pevent_strerror (struct tep_handle *pevent__maybe_unused ,enum pevent_errno errnum,char *buf,size_t buflen) {int idx;
@@ -6435,7 +6435,7 @@ int pevent_print_func_field(struct trace_seq *s, const char *fmt, struct pevent_record *record, int err) {struct format_field *field =pevent_find_field (event, name); -struct pevent *pevent = event->pevent; +struct tep_handle *pevent = event->pevent;unsigned long long val;struct func_map *func;char tmp[128 ];
@@ -6491,7 +6491,7 @@ static void free_func_handle(struct pevent_function_handler *func)* The @parameters is a variable list of pevent_func_arg_type enums that * must end with PEVENT_FUNC_ARG_VOID. */ -int pevent_register_print_function (struct pevent *pevent, +int pevent_register_print_function (struct tep_handle *pevent,pevent_func_handler func,enum pevent_func_arg_type ret_type,char *name, ...)
@@ -6578,7 +6578,7 @@ int pevent_register_print_function(struct pevent *pevent,* * Returns 0 if the handler was removed successully, -1 otherwise. */ -int pevent_unregister_print_function (struct pevent *pevent, +int pevent_unregister_print_function (struct tep_handle *pevent,pevent_func_handler func,char *name) {struct pevent_function_handler *func_handle;
@@ -6591,7 +6591,7 @@ int pevent_unregister_print_function(struct pevent *pevent,return -1 ; } -static struct event_format *pevent_search_event (struct pevent *pevent,int id, +static struct event_format *pevent_search_event (struct tep_handle *pevent,int id,const char *sys_name,const char *event_name) {
@@ -6631,7 +6631,7 @@ static struct event_format *pevent_search_event(struct pevent *pevent, int id,* If @id is >= 0, then it is used to find the event. * else @sys_name and @event_name are used. */ -int pevent_register_event_handler (struct pevent *pevent,int id, +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) {
@@ -6715,7 +6715,7 @@ static int handle_matches(struct event_handler *handler, int id,* * Returns 0 if handler was removed successfully, -1 if event was not found. */ -int pevent_unregister_event_handler (struct pevent *pevent,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) {
@@ -6756,9 +6756,9 @@ not_found:/** * pevent_alloc - create a pevent handle */ -struct pevent *pevent_alloc (void ) +struct tep_handle *pevent_alloc (void ) { -struct pevent *pevent =calloc (1 ,sizeof (*pevent)); +struct tep_handle *pevent =calloc (1 ,sizeof (*pevent));if (pevent) pevent->ref_count =1 ;
@@ -6766,7 +6766,7 @@ struct pevent *pevent_alloc(void)return pevent; } -void pevent_ref (struct pevent *pevent) +void pevent_ref (struct tep_handle *pevent) { pevent->ref_count++; }
@@ -6814,7 +6814,7 @@ void pevent_free_format(struct event_format *event)* pevent_free - free a pevent handle * @pevent: the pevent handle to free */ -void pevent_free (struct pevent *pevent) +void pevent_free (struct tep_handle *pevent) {struct cmdline_list *cmdlist, *cmdnext;struct func_list *funclist, *funcnext;
@@ -6899,7 +6899,7 @@ void pevent_free(struct pevent *pevent)free (pevent); } -void pevent_unref (struct pevent *pevent) +void pevent_unref (struct tep_handle *pevent) {pevent_free (pevent); }
tools/lib/traceevent/event-parse.h +68 -68
329 lines not on this page · raw message
tools/lib/traceevent/event-plugin.c +7 -7
@@ -281,7 +281,7 @@ void traceevent_print_plugins(struct trace_seq *s, }static void -load_plugin (struct pevent *pevent,const char *path, +load_plugin (struct tep_handle *pevent,const char *path,const char *file,void *data) {struct plugin_list **plugin_list = data;
@@ -336,9 +336,9 @@ load_plugin(struct pevent *pevent, const char *path, } static void -load_plugins_dir(struct pevent *pevent, const char *suffix, +load_plugins_dir(struct tep_handle *pevent, const char *suffix, const char *path, - void (*load_plugin)(struct pevent *pevent, + void (*load_plugin)(struct tep_handle *pevent, const char *path, const char *name, void *data),
@@ -378,8 +378,8 @@ load_plugins_dir(struct pevent *pevent, const char *suffix, } static void -load_plugins(struct pevent *pevent, const char *suffix, - void (*load_plugin)(struct pevent *pevent, +load_plugins(struct tep_handle *pevent, const char *suffix, + void (*load_plugin)(struct tep_handle *pevent, const char *path, const char *name, void *data),
@@ -431,7 +431,7 @@ load_plugins(struct pevent *pevent, const char *suffix, }struct plugin_list * -traceevent_load_plugins (struct pevent *pevent) +traceevent_load_plugins (struct tep_handle *pevent) {struct plugin_list *list =NULL ;
@@ -440,7 +440,7 @@ traceevent_load_plugins(struct pevent *pevent) }void -traceevent_unload_plugins (struct plugin_list *plugin_list,struct pevent *pevent) +traceevent_unload_plugins (struct plugin_list *plugin_list,struct tep_handle *pevent) {pevent_plugin_unload_func func;struct plugin_list *list;
tools/lib/traceevent/parse-filter.c +7 -7
@@ -179,7 +179,7 @@ add_filter_type(struct event_filter *filter, int id)* pevent_filter_alloc - create a new event filter * @pevent: The pevent that this filter is associated with */ -struct event_filter *pevent_filter_alloc (struct pevent *pevent) +struct event_filter *pevent_filter_alloc (struct tep_handle *pevent) {struct event_filter *filter;
@@ -269,7 +269,7 @@ static int event_match(struct event_format *event, }static enum pevent_errno -find_event (struct pevent *pevent,struct event_list **events, +find_event (struct tep_handle *pevent,struct event_list **events,char *sys_name,char *event_name) {struct event_format *event;
@@ -1270,7 +1270,7 @@ static void filter_init_error_buf(struct event_filter *filter)enum pevent_errno pevent_filter_add_filter_str (struct event_filter *filter,const char *filter_str) { -struct pevent *pevent = filter->pevent; +struct tep_handle *pevent = filter->pevent;struct event_list *event;struct event_list *events =NULL ;const char *filter_start;
@@ -1550,8 +1550,8 @@ int pevent_filter_copy(struct event_filter *dest, struct event_filter *source)int pevent_update_trivial (struct event_filter *dest,struct event_filter *source,enum filter_trivial_type type) { -struct pevent *src_pevent; -struct pevent *dest_pevent; +struct tep_handle *src_pevent; +struct tep_handle *dest_pevent;struct event_format *event;struct filter_type *filter_type;struct filter_arg *arg;
@@ -1874,7 +1874,7 @@ static int test_num(struct event_format *event, struct filter_arg *arg,static const char *get_field_str (struct filter_arg *arg,struct pevent_record *record) {struct event_format *event; -struct pevent *pevent; +struct tep_handle *pevent;unsigned long long addr;const char *val =NULL ;unsigned int size;
@@ -2049,7 +2049,7 @@ int pevent_event_filtered(struct event_filter *filter, int event_id)enum pevent_errno pevent_filter_match (struct event_filter *filter,struct pevent_record *record) { -struct pevent *pevent = filter->pevent; +struct tep_handle *pevent = filter->pevent;struct filter_type *filter_type;int event_id;int ret;
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 pevent *pevent) +int PEVENT_PLUGIN_LOADER (struct tep_handle *pevent) { pevent_register_print_function(pevent, process___le16_to_cpup,
@@ -36,7 +36,7 @@ int PEVENT_PLUGIN_LOADER(struct pevent *pevent)return 0 ; } -void PEVENT_PLUGIN_UNLOADER (struct pevent *pevent) +void PEVENT_PLUGIN_UNLOADER (struct tep_handle *pevent) {pevent_unregister_print_function (pevent, process___le16_to_cpup,"__le16_to_cpup" );
tools/lib/traceevent/plugin_function.c +3 -3
@@ -125,7 +125,7 @@ static int add_and_get_index(const char *parent, const char *child, int cpu)static int function_handler (struct trace_seq *s,struct pevent_record *record,struct 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;
@@ -163,7 +163,7 @@ static int function_handler(struct trace_seq *s, struct pevent_record *record,return 0 ; } -int PEVENT_PLUGIN_LOADER (struct pevent *pevent) +int PEVENT_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 pevent *pevent)return 0 ; } -void PEVENT_PLUGIN_UNLOADER (struct pevent *pevent) +void PEVENT_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 pevent *pevent) +int PEVENT_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 pevent *pevent)return 0 ; } -void PEVENT_PLUGIN_UNLOADER (struct pevent *pevent) +void PEVENT_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 pevent *pevent) +int PEVENT_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 pevent *pevent)return 0 ; } -void PEVENT_PLUGIN_UNLOADER (struct pevent *pevent) +void PEVENT_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 pevent_record *record,return 1 ; } -int PEVENT_PLUGIN_LOADER (struct pevent *pevent) +int PEVENT_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 pevent *pevent)return 0 ; } -void PEVENT_PLUGIN_UNLOADER (struct pevent *pevent) +void PEVENT_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 pevent *pevent) +int PEVENT_PLUGIN_LOADER (struct tep_handle *pevent) {init_disassembler ();
@@ -486,7 +486,7 @@ int PEVENT_PLUGIN_LOADER(struct pevent *pevent)return 0 ; } -void PEVENT_PLUGIN_UNLOADER (struct pevent *pevent) +void PEVENT_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 pevent *pevent) +int PEVENT_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 pevent *pevent)return 0 ; } -void PEVENT_PLUGIN_UNLOADER (struct pevent *pevent) +void PEVENT_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 pevent *pevent) +int PEVENT_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 pevent *pevent)return 0 ; } -void PEVENT_PLUGIN_UNLOADER (struct pevent *pevent) +void PEVENT_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 pevent *pevent) +int PEVENT_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 pevent *pevent)return 0 ; } -void PEVENT_PLUGIN_UNLOADER (struct pevent *pevent) +void PEVENT_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 pevent *pevent) +int PEVENT_PLUGIN_LOADER (struct tep_handle *pevent) { pevent_register_print_function(pevent, process_xen_hypercall_name,
@@ -130,7 +130,7 @@ int PEVENT_PLUGIN_LOADER(struct pevent *pevent)return 0 ; } -void PEVENT_PLUGIN_UNLOADER (struct pevent *pevent) +void PEVENT_PLUGIN_UNLOADER (struct tep_handle *pevent) {pevent_unregister_print_function (pevent, process_xen_hypercall_name,"xen_hypercall_name" );
tools/perf/util/header.c +2 -2
@@ -3204,7 +3204,7 @@ static int read_attr(int fd, struct perf_header *ph, }static int perf_evsel__prepare_tracepoint_event (struct perf_evsel *evsel, -struct pevent *pevent) +struct tep_handle *pevent) {struct event_format *event;char bf[128 ];
@@ -3236,7 +3236,7 @@ static int perf_evsel__prepare_tracepoint_event(struct perf_evsel *evsel, }static int perf_evlist__prepare_tracepoint_events (struct perf_evlist *evlist, -struct pevent *pevent) +struct tep_handle *pevent) {struct perf_evsel *pos;
tools/perf/util/python.c +1 -1
@@ -341,7 +341,7 @@ static bool is_tracepoint(struct pyrf_event *pevent)static PyObject *tracepoint_field (struct pyrf_event *pe,struct format_field *field) { -struct pevent *pevent = field->event->pevent; +struct tep_handle *pevent = field->event->pevent;void *data = pe->sample.raw_data;PyObject *ret =NULL ;unsigned long long val;
tools/perf/util/scripting-engines/trace-event-perl.c +1 -1
@@ -535,7 +535,7 @@ static int perl_stop_script(void)return 0 ; } -static int perl_generate_script (struct pevent *pevent,const char *outfile) +static int perl_generate_script (struct tep_handle *pevent,const char *outfile) {struct event_format *event =NULL ;struct format_field *f;
tools/perf/util/scripting-engines/trace-event-python.c +1 -1
@@ -1588,7 +1588,7 @@ static int python_stop_script(void)return 0 ; } -static int python_generate_script (struct pevent *pevent,const char *outfile) +static int python_generate_script (struct tep_handle *pevent,const char *outfile) {struct event_format *event =NULL ;struct format_field *f;
tools/perf/util/sort.h +1 -1
@@ -276,7 +276,7 @@ extern struct sort_entry sort_thread;extern struct list_head hist_entry__sort_list;struct perf_evlist ; -struct pevent ; +struct tep_handle ;int setup_sorting (struct perf_evlist *evlist);int setup_output_field (void );void reset_output_field (void );
tools/perf/util/trace-event-parse.c +6 -6
@@ -32,7 +32,7 @@static int get_common_field (struct scripting_context *context,int *offset,int *size,const char *type) { -struct pevent *pevent = context->pevent; +struct tep_handle *pevent = context->pevent;struct event_format *event;struct format_field *field;
@@ -136,7 +136,7 @@ void event_format__print(struct event_format *event,return event_format__fprintf (event, cpu, data, size, stdout); } -void parse_ftrace_printk (struct pevent *pevent, +void parse_ftrace_printk (struct tep_handle *pevent,char *file,unsigned int size__maybe_unused ) {unsigned long long addr;
@@ -161,7 +161,7 @@ void parse_ftrace_printk(struct pevent *pevent, } } -void parse_saved_cmdline (struct pevent *pevent, +void parse_saved_cmdline (struct tep_handle *pevent,char *file,unsigned int size__maybe_unused ) {char *comm;
@@ -178,18 +178,18 @@ void parse_saved_cmdline(struct pevent *pevent, } } -int parse_ftrace_file (struct pevent *pevent,char *buf,unsigned long size) +int parse_ftrace_file (struct tep_handle *pevent,char *buf,unsigned long size) {return pevent_parse_event (pevent, buf, size,"ftrace" ); } -int parse_event_file (struct pevent *pevent, +int parse_event_file (struct tep_handle *pevent,char *buf,unsigned long size,char *sys) {return pevent_parse_event (pevent, buf, size, sys); } -struct event_format *trace_find_next_event (struct pevent *pevent, +struct event_format *trace_find_next_event (struct tep_handle *pevent,struct event_format *event) {static int idx;
tools/perf/util/trace-event-read.c +12 -12
@@ -96,7 +96,7 @@ static void skip(int size) }; } -static unsigned int read4 (struct pevent *pevent) +static unsigned int read4 (struct tep_handle *pevent) {unsigned int data;
@@ -105,7 +105,7 @@ static unsigned int read4(struct pevent *pevent)return __data2host4 (pevent, data); } -static unsigned long long read8 (struct pevent *pevent) +static unsigned long long read8 (struct tep_handle *pevent) {unsigned long long data;
@@ -158,7 +158,7 @@ out:return str; } -static int read_proc_kallsyms (struct pevent *pevent) +static int read_proc_kallsyms (struct tep_handle *pevent) {unsigned int size;
@@ -181,7 +181,7 @@ static int read_proc_kallsyms(struct pevent *pevent)return 0 ; } -static int read_ftrace_printk (struct pevent *pevent) +static int read_ftrace_printk (struct tep_handle *pevent) {unsigned int size;char *buf;
@@ -208,7 +208,7 @@ static int read_ftrace_printk(struct pevent *pevent)return 0 ; } -static int read_header_files (struct pevent *pevent) +static int read_header_files (struct tep_handle *pevent) {unsigned long long size;char *header_page;
@@ -259,7 +259,7 @@ static int read_header_files(struct pevent *pevent)return ret; } -static int read_ftrace_file (struct pevent *pevent,unsigned long long size) +static int read_ftrace_file (struct tep_handle *pevent,unsigned long long size) {int ret;char *buf;
@@ -284,8 +284,8 @@ out:return ret; } -static int read_event_file (struct pevent *pevent,char *sys, -unsigned long long size) +static int read_event_file (struct tep_handle *pevent,char *sys, +unsigned long long size) {int ret;char *buf;
@@ -310,7 +310,7 @@ out:return ret; } -static int read_ftrace_files (struct pevent *pevent) +static int read_ftrace_files (struct tep_handle *pevent) {unsigned long long size;int count;
@@ -328,7 +328,7 @@ static int read_ftrace_files(struct pevent *pevent)return 0 ; } -static int read_event_files (struct pevent *pevent) +static int read_event_files (struct tep_handle *pevent) {unsigned long long size;char *sys;
@@ -356,7 +356,7 @@ static int read_event_files(struct pevent *pevent)return 0 ; } -static int read_saved_cmdline (struct pevent *pevent) +static int read_saved_cmdline (struct tep_handle *pevent) {unsigned long long size;char *buf;
@@ -399,7 +399,7 @@ ssize_t trace_report(int fd, struct trace_event *tevent, bool __repipe)int host_bigendian;int file_long_size;int file_page_size; -struct pevent *pevent =NULL ; +struct tep_handle *pevent =NULL ;int err; repipe = __repipe;
tools/perf/util/trace-event-scripting.c +2 -2
@@ -66,7 +66,7 @@ static int python_start_script_unsupported(const char *script __maybe_unused,return -1 ; } -static int python_generate_script_unsupported (struct pevent *pevent +static int python_generate_script_unsupported (struct tep_handle *pevent__maybe_unused ,const char *outfile__maybe_unused )
@@ -130,7 +130,7 @@ static int perl_start_script_unsupported(const char *script __maybe_unused,return -1 ; } -static int perl_generate_script_unsupported (struct pevent *pevent +static int perl_generate_script_unsupported (struct tep_handle *pevent__maybe_unused ,const char *outfile__maybe_unused ) {
tools/perf/util/trace-event.c +3 -3
@@ -28,7 +28,7 @@ static bool tevent_initialized;int trace_event__init (struct trace_event *t) { -struct pevent *pevent =pevent_alloc (); +struct tep_handle *pevent =pevent_alloc ();if (pevent) { t->plugin_list =traceevent_load_plugins (pevent);
@@ -41,7 +41,7 @@ int trace_event__init(struct trace_event *t)static int trace_event__init2 (void ) {int be =traceevent_host_bigendian (); -struct pevent *pevent; +struct tep_handle *pevent;if (trace_event__init (&tevent))return -1 ;
@@ -76,7 +76,7 @@ static struct event_format* tp_format(const char *sys, const char *name) { char *tp_dir = get_events_file(sys); -struct pevent *pevent = tevent.pevent; +struct tep_handle *pevent = tevent.pevent;struct event_format *event =NULL ;char path[PATH_MAX ];size_t size;
tools/perf/util/trace-event.h +9 -9
@@ -13,7 +13,7 @@ struct thread;struct plugin_list ;struct trace_event { -struct pevent *pevent; +struct tep_handle *pevent;struct plugin_list *plugin_list; };
@@ -34,20 +34,20 @@ void event_format__fprintf(struct event_format *event,void event_format__print (struct event_format *event,int cpu,void *data,int size); -int parse_ftrace_file (struct pevent *pevent,char *buf,unsigned long size); -int parse_event_file (struct pevent *pevent, +int parse_ftrace_file (struct tep_handle *pevent,char *buf,unsigned long size); +int parse_event_file (struct tep_handle *pevent,char *buf,unsigned long size,char *sys);unsigned long long raw_field_value (struct event_format *event,const char *name,void *data); -void parse_proc_kallsyms (struct pevent *pevent,char *file,unsigned int size); -void parse_ftrace_printk (struct pevent *pevent,char *file,unsigned int size); -void parse_saved_cmdline (struct pevent *pevent,char *file,unsigned int size); +void parse_proc_kallsyms (struct tep_handle *pevent,char *file,unsigned int size); +void parse_ftrace_printk (struct tep_handle *pevent,char *file,unsigned int size); +void parse_saved_cmdline (struct tep_handle *pevent,char *file,unsigned int size);ssize_t trace_report (int fd,struct trace_event *tevent,bool repipe); -struct event_format *trace_find_next_event (struct pevent *pevent, +struct event_format *trace_find_next_event (struct tep_handle *pevent,struct event_format *event);unsigned long long read_size (struct event_format *event,void *ptr,int size);unsigned long long eval_flag (const char *flag);
@@ -83,7 +83,7 @@ struct scripting_ops {void (*process_stat)(struct perf_stat_config *config,struct perf_evsel *evsel,u64 tstamp);void (*process_stat_interval)(u64 tstamp); -int (*generate_script) (struct pevent *pevent,const char *outfile); +int (*generate_script) (struct tep_handle *pevent,const char *outfile); };extern unsigned int scripting_max_stack;
@@ -94,7 +94,7 @@ void setup_perl_scripting(void);void setup_python_scripting (void );struct scripting_context { -struct pevent *pevent; +struct tep_handle *pevent;void *event_data; };
RFC PATCH v2 2/24 tools/lib/traceevent, tools/perf: Rename struct pevent_record to struct tep_record
In reply to Steven RostedtFrom: "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 struct pevent_record to struct tep_record.
--- tools/lib/traceevent/event-parse.c | 36 +++++++++--------- tools/lib/traceevent/event-parse.h | 44 +++++++++++----------- tools/lib/traceevent/parse-filter.c | 24 ++++++------ tools/lib/traceevent/plugin_function.c | 2 +- tools/lib/traceevent/plugin_hrtimer.c | 4 +- tools/lib/traceevent/plugin_kmem.c | 2 +- tools/lib/traceevent/plugin_kvm.c | 14 +++---- tools/lib/traceevent/plugin_mac80211.c | 2 +- tools/lib/traceevent/plugin_sched_switch.c | 6 +-- tools/perf/builtin-kmem.c | 2 +- tools/perf/util/sort.c | 2 +- tools/perf/util/trace-event-parse.c | 2 +- 12 files changed, 70 insertions(+), 70 deletions(-)
tools/lib/traceevent/event-parse.c +18 -18
@@ -5150,7 +5150,7 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct event* and lock depth) and places it into the trace_seq. */ void pevent_data_lat_fmt (struct tep_handle *pevent, -struct trace_seq *s,struct pevent_record *record) +struct trace_seq *s,struct tep_record *record) {static int check_lock_depth =1 ;static int check_migrate_disable =1 ;
@@ -5229,7 +5229,7 @@ void pevent_data_lat_fmt(struct tep_handle *pevent,* * This returns the event id from the @rec. */ -int pevent_data_type (struct tep_handle *pevent,struct pevent_record *rec) +int pevent_data_type (struct tep_handle *pevent,struct tep_record *rec) {return trace_parse_common_type (pevent, rec->data); }
@@ -5253,7 +5253,7 @@ struct event_format *pevent_data_event_from_type(struct tep_handle *pevent, int* * This returns the PID from a record. */ -int pevent_data_pid (struct tep_handle *pevent,struct pevent_record *rec) +int pevent_data_pid (struct tep_handle *pevent,struct tep_record *rec) {return parse_common_pid (pevent, rec->data); }
@@ -5265,7 +5265,7 @@ int pevent_data_pid(struct tep_handle *pevent, struct pevent_record *rec)* * This returns the preempt count from a record. */ -int pevent_data_preempt_count (struct tep_handle *pevent,struct pevent_record *rec) +int pevent_data_preempt_count (struct tep_handle *pevent,struct tep_record *rec) {return parse_common_pc (pevent, rec->data); }
@@ -5279,7 +5279,7 @@ int pevent_data_preempt_count(struct tep_handle *pevent, struct pevent_record *r* * Use trace_flag_type enum for the flags (see event-parse.h). */ -int pevent_data_flags (struct tep_handle *pevent,struct pevent_record *rec) +int pevent_data_flags (struct tep_handle *pevent,struct tep_record *rec) {return parse_common_flags (pevent, rec->data); }
@@ -5400,7 +5400,7 @@ int pevent_cmdline_pid(struct tep_handle *pevent, struct cmdline *cmdline)* writes the print format into the trace_seq. */ void pevent_event_info (struct trace_seq *s,struct event_format *event, -struct pevent_record *record) +struct tep_record *record) {int print_pretty =1 ;
@@ -5441,7 +5441,7 @@ static bool is_timestamp_in_us(char *trace_clock, bool use_trace_clock)* is found. */ struct event_format * -pevent_find_event_by_record (struct tep_handle *pevent,struct pevent_record *record) +pevent_find_event_by_record (struct tep_handle *pevent,struct tep_record *record) {int type;
@@ -5466,7 +5466,7 @@ pevent_find_event_by_record(struct tep_handle *pevent, struct pevent_record *rec*/ void pevent_print_event_task (struct tep_handle *pevent,struct trace_seq *s,struct event_format *event, -struct pevent_record *record) +struct tep_record *record) {void *data = record->data;const char *comm;
@@ -5494,7 +5494,7 @@ void pevent_print_event_task(struct tep_handle *pevent, struct trace_seq *s,*/ void pevent_print_event_time (struct tep_handle *pevent,struct trace_seq *s,struct event_format *event, -struct pevent_record *record, +struct tep_record *record,bool use_trace_clock) {unsigned long secs;
@@ -5544,7 +5544,7 @@ void pevent_print_event_time(struct tep_handle *pevent, struct trace_seq *s,*/ void pevent_print_event_data (struct tep_handle *pevent,struct trace_seq *s,struct event_format *event, -struct pevent_record *record) +struct tep_record *record) {static const char *spaces =" " ;/* 20 spaces */ int len;
@@ -5560,7 +5560,7 @@ void pevent_print_event_data(struct tep_handle *pevent, struct trace_seq *s, }void pevent_print_event (struct tep_handle *pevent,struct trace_seq *s, -struct pevent_record *record,bool use_trace_clock) +struct tep_record *record,bool use_trace_clock) {struct event_format *event;
@@ -6244,7 +6244,7 @@ int pevent_strerror(struct tep_handle *pevent __maybe_unused, }int get_field_val (struct trace_seq *s,struct format_field *field, -const char *name,struct pevent_record *record, +const char *name,struct tep_record *record,unsigned long long *val,int err) {if (!field) {
@@ -6277,7 +6277,7 @@ int get_field_val(struct trace_seq *s, struct format_field *field,* On failure, it returns NULL. */ void *pevent_get_field_raw (struct trace_seq *s,struct event_format *event, -const char *name,struct pevent_record *record, +const char *name,struct tep_record *record,int *len,int err) {struct format_field *field;
@@ -6324,7 +6324,7 @@ void *pevent_get_field_raw(struct trace_seq *s, struct event_format *event,* Returns 0 on success -1 on field not found. */ int pevent_get_field_val (struct trace_seq *s,struct event_format *event, -const char *name,struct pevent_record *record, +const char *name,struct tep_record *record,unsigned long long *val,int err) {struct format_field *field;
@@ -6349,7 +6349,7 @@ int pevent_get_field_val(struct trace_seq *s, struct event_format *event,* Returns 0 on success -1 on field not found. */ int pevent_get_common_field_val (struct trace_seq *s,struct event_format *event, -const char *name,struct pevent_record *record, +const char *name,struct tep_record *record,unsigned long long *val,int err) {struct format_field *field;
@@ -6374,7 +6374,7 @@ int pevent_get_common_field_val(struct trace_seq *s, struct event_format *event,* Returns 0 on success -1 on field not found. */ int pevent_get_any_field_val (struct trace_seq *s,struct event_format *event, -const char *name,struct pevent_record *record, +const char *name,struct tep_record *record,unsigned long long *val,int err) {struct format_field *field;
@@ -6400,7 +6400,7 @@ int pevent_get_any_field_val(struct trace_seq *s, struct event_format *event,*/ int pevent_print_num_field (struct trace_seq *s,const char *fmt,struct event_format *event,const char *name, -struct pevent_record *record,int err) +struct tep_record *record,int err) {struct format_field *field =pevent_find_field (event, name);unsigned long long val;
@@ -6432,7 +6432,7 @@ int pevent_print_num_field(struct trace_seq *s, const char *fmt,*/ int pevent_print_func_field (struct trace_seq *s,const char *fmt,struct event_format *event,const char *name, -struct pevent_record *record,int err) +struct tep_record *record,int err) {struct format_field *field =pevent_find_field (event, name);struct tep_handle *pevent = event->pevent;
tools/lib/traceevent/event-parse.h +22 -22
115 lines not on this page · raw message
tools/lib/traceevent/parse-filter.c +12 -12
@@ -1697,10 +1697,10 @@ int pevent_filter_event_has_trivial(struct event_filter *filter, }static int test_filter (struct event_format *event,struct filter_arg *arg, -struct pevent_record *record,enum pevent_errno *err); +struct tep_record *record,enum pevent_errno *err);static const char * -get_comm (struct event_format *event,struct pevent_record *record) +get_comm (struct event_format *event,struct tep_record *record) {const char *comm;int pid;
@@ -1712,7 +1712,7 @@ get_comm(struct event_format *event, struct pevent_record *record)static unsigned long long get_value (struct event_format *event, -struct format_field *field,struct pevent_record *record) +struct format_field *field,struct tep_record *record) {unsigned long long val;
@@ -1748,11 +1748,11 @@ get_value(struct event_format *event,static unsigned long long get_arg_value (struct event_format *event,struct filter_arg *arg, -struct pevent_record *record,enum pevent_errno *err); +struct tep_record *record,enum pevent_errno *err);static unsigned long long get_exp_value (struct event_format *event,struct filter_arg *arg, -struct pevent_record *record,enum pevent_errno *err) +struct tep_record *record,enum pevent_errno *err) {unsigned long long lval, rval;
@@ -1807,7 +1807,7 @@ get_exp_value(struct event_format *event, struct filter_arg *arg,static unsigned long long get_arg_value (struct event_format *event,struct filter_arg *arg, -struct pevent_record *record,enum pevent_errno *err) +struct tep_record *record,enum pevent_errno *err) {switch (arg->type) {case FILTER_ARG_FIELD :
@@ -1831,7 +1831,7 @@ get_arg_value(struct event_format *event, struct filter_arg *arg, }static int test_num (struct event_format *event,struct filter_arg *arg, -struct pevent_record *record,enum pevent_errno *err) +struct tep_record *record,enum pevent_errno *err) {unsigned long long lval, rval;
@@ -1871,7 +1871,7 @@ static int test_num(struct event_format *event, struct filter_arg *arg, } } -static const char *get_field_str (struct filter_arg *arg,struct pevent_record *record) +static const char *get_field_str (struct filter_arg *arg,struct tep_record *record) {struct event_format *event;struct tep_handle *pevent;
@@ -1922,7 +1922,7 @@ static const char *get_field_str(struct filter_arg *arg, struct pevent_record *r }static int test_str (struct event_format *event,struct filter_arg *arg, -struct pevent_record *record,enum pevent_errno *err) +struct tep_record *record,enum pevent_errno *err) {const char *val;
@@ -1953,7 +1953,7 @@ static int test_str(struct event_format *event, struct filter_arg *arg, }static int test_op (struct event_format *event,struct filter_arg *arg, -struct pevent_record *record,enum pevent_errno *err) +struct tep_record *record,enum pevent_errno *err) {switch (arg->op.type) {case FILTER_OP_AND :
@@ -1975,7 +1975,7 @@ static int test_op(struct event_format *event, struct filter_arg *arg, }static int test_filter (struct event_format *event,struct filter_arg *arg, -struct pevent_record *record,enum pevent_errno *err) +struct tep_record *record,enum pevent_errno *err) {if (*err) {/*
@@ -2047,7 +2047,7 @@ int pevent_event_filtered(struct event_filter *filter, int event_id)* otherwise - error occurred during test */ enum pevent_errno pevent_filter_match (struct event_filter *filter, -struct pevent_record *record) +struct tep_record *record) {struct tep_handle *pevent = filter->pevent;struct filter_type *filter_type;
tools/lib/traceevent/plugin_function.c +1 -1
@@ -122,7 +122,7 @@ 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, +static int function_handler (struct trace_seq *s,struct tep_record *record,struct event_format *event,void *context) {struct tep_handle *pevent = event->pevent;
tools/lib/traceevent/plugin_hrtimer.c +2 -2
@@ -25,7 +25,7 @@#include "event-parse.h" static int timer_expire_handler (struct trace_seq *s, -struct pevent_record *record, +struct tep_record *record,struct event_format *event,void *context) {trace_seq_printf (s,"hrtimer=" );
@@ -45,7 +45,7 @@ static int timer_expire_handler(struct trace_seq *s, }static int timer_start_handler (struct trace_seq *s, -struct pevent_record *record, +struct tep_record *record,struct event_format *event,void *context) {trace_seq_printf (s,"hrtimer=" );
tools/lib/traceevent/plugin_kmem.c +1 -1
@@ -23,7 +23,7 @@#include "event-parse.h" -static int call_site_handler (struct trace_seq *s,struct pevent_record *record, +static int call_site_handler (struct trace_seq *s,struct tep_record *record,struct event_format *event,void *context) {struct format_field *field;
tools/lib/traceevent/plugin_kvm.c +7 -7
@@ -247,7 +247,7 @@ static const char *find_exit_reason(unsigned isa, int val)return strings[i].str; } -static int print_exit_reason (struct trace_seq *s,struct pevent_record *record, +static int print_exit_reason (struct trace_seq *s,struct tep_record *record,struct event_format *event,const char *field) {unsigned long long isa;
@@ -268,7 +268,7 @@ static int print_exit_reason(struct trace_seq *s, struct pevent_record *record,return 0 ; } -static int kvm_exit_handler (struct trace_seq *s,struct pevent_record *record, +static int kvm_exit_handler (struct trace_seq *s,struct tep_record *record,struct event_format *event,void *context) {unsigned long long info1 =0 , info2 =0 ;
@@ -291,7 +291,7 @@ static int kvm_exit_handler(struct trace_seq *s, struct pevent_record *record,#define KVM_EMUL_INSN_F_CS_L (1 << 3)static int kvm_emulate_insn_handler (struct trace_seq *s, -struct pevent_record *record, +struct tep_record *record,struct event_format *event,void *context) {unsigned long long rip, csbase, len, flags, failed;
@@ -330,7 +330,7 @@ static int kvm_emulate_insn_handler(struct trace_seq *s, } -static int kvm_nested_vmexit_inject_handler (struct trace_seq *s,struct pevent_record *record, +static int kvm_nested_vmexit_inject_handler (struct trace_seq *s,struct tep_record *record,struct event_format *event,void *context) {if (print_exit_reason (s, record, event,"exit_code" ) <0 )
@@ -344,7 +344,7 @@ static int kvm_nested_vmexit_inject_handler(struct trace_seq *s, struct pevent_rreturn 0 ; } -static int kvm_nested_vmexit_handler (struct trace_seq *s,struct pevent_record *record, +static int kvm_nested_vmexit_handler (struct trace_seq *s,struct tep_record *record,struct event_format *event,void *context) {pevent_print_num_field (s,"rip %llx " , event,"rip" , record,1 );
@@ -370,7 +370,7 @@ union kvm_mmu_page_role { }; }; -static int kvm_mmu_print_role (struct trace_seq *s,struct pevent_record *record, +static int kvm_mmu_print_role (struct trace_seq *s,struct tep_record *record,struct event_format *event,void *context) {unsigned long long val;
@@ -417,7 +417,7 @@ static int kvm_mmu_print_role(struct trace_seq *s, struct pevent_record *record, }static int kvm_mmu_get_page_handler (struct trace_seq *s, -struct pevent_record *record, +struct tep_record *record,struct event_format *event,void *context) {unsigned long long val;
tools/lib/traceevent/plugin_mac80211.c +1 -1
@@ -58,7 +58,7 @@ static void print_string(struct trace_seq *s, struct event_format *event,#define SP () trace_seq_putc(s, ' ')static int drv_bss_info_changed (struct trace_seq *s, -struct pevent_record *record, +struct tep_record *record,struct event_format *event,void *context) {void *data = record->data;
tools/lib/traceevent/plugin_sched_switch.c +3 -3
@@ -45,7 +45,7 @@ static void write_state(struct trace_seq *s, int val) }static void write_and_save_comm (struct format_field *field, -struct pevent_record *record, +struct tep_record *record,struct trace_seq *s,int pid) {const char *comm;
@@ -65,7 +65,7 @@ static void write_and_save_comm(struct format_field *field, }static int sched_wakeup_handler (struct trace_seq *s, -struct pevent_record *record, +struct tep_record *record,struct event_format *event,void *context) {struct format_field *field;
@@ -94,7 +94,7 @@ static int sched_wakeup_handler(struct trace_seq *s, }static int sched_switch_handler (struct trace_seq *s, -struct pevent_record *record, +struct tep_record *record,struct event_format *event,void *context) {struct format_field *field;
tools/perf/builtin-kmem.c +1 -1
@@ -729,7 +729,7 @@ static char *compact_gfp_string(unsigned long gfp_flags)static int parse_gfp_flags (struct perf_evsel *evsel,struct perf_sample *sample,unsigned int gfp_flags) { -struct pevent_record record = { +struct tep_record record = { .cpu = sample->cpu, .data = sample->raw_data, .size = sample->raw_size,
tools/perf/util/sort.c +1 -1
@@ -601,7 +601,7 @@ static char *get_trace_output(struct hist_entry *he) {struct trace_seq seq;struct perf_evsel *evsel; -struct pevent_record rec = { +struct tep_record rec = { .data = he->raw_data, .size = he->raw_size, };
tools/perf/util/trace-event-parse.c +1 -1
@@ -116,7 +116,7 @@ unsigned long long read_size(struct event_format *event, void *ptr, int size)void event_format__fprintf (struct event_format *event,int cpu,void *data,int size,FILE *fp) { -struct pevent_record record; +struct tep_record record;struct trace_seq s;memset (&record,0 ,sizeof (record));
Signature · 1 line
2.18.0
tip-bot for Tzvetomir Stoyanov (VMware)
merge bot[tip:perf/urgent] tools lib traceevent, perf tools: Rename 'struct pevent_record' to 'struct tep_record'
tools lib traceevent, perf tools: Rename 'struct pevent_record' to 'struct tep_record'
Commit-ID: cbc49b25b9cf26bf8c91169085be27382d945dd7 Gitweb: https://git.kernel.org/tip/cbc49b25b9cf26bf8c91169085be27382d945dd7 Author: Tzvetomir Stoyanov (VMware) <[email protected]> AuthorDate: Wed, 8 Aug 2018 14:02:47 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Mon, 13 Aug 2018 15:21:13 -0300
tools lib traceevent, perf tools: Rename 'struct pevent_record' to 'struct tep_record'
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 'struct pevent_record' to 'struct tep_record'.
--- tools/lib/traceevent/event-parse.c | 36 ++++++++++++------------ tools/lib/traceevent/event-parse.h | 44 +++++++++++++++--------------- tools/lib/traceevent/parse-filter.c | 24 ++++++++-------- tools/lib/traceevent/plugin_function.c | 2 +- tools/lib/traceevent/plugin_hrtimer.c | 4 +-- tools/lib/traceevent/plugin_kmem.c | 2 +- tools/lib/traceevent/plugin_kvm.c | 14 +++++----- tools/lib/traceevent/plugin_mac80211.c | 2 +- tools/lib/traceevent/plugin_sched_switch.c | 6 ++-- tools/perf/builtin-kmem.c | 2 +- tools/perf/util/sort.c | 2 +- tools/perf/util/trace-event-parse.c | 2 +- 12 files changed, 70 insertions(+), 70 deletions(-)
tools/lib/traceevent/event-parse.c +18 -18
@@ -5150,7 +5150,7 @@ out_failed:* and lock depth) and places it into the trace_seq. */ void pevent_data_lat_fmt (struct tep_handle *pevent, -struct trace_seq *s,struct pevent_record *record) +struct trace_seq *s,struct tep_record *record) {static int check_lock_depth =1 ;static int check_migrate_disable =1 ;
@@ -5229,7 +5229,7 @@ void pevent_data_lat_fmt(struct tep_handle *pevent,* * This returns the event id from the @rec. */ -int pevent_data_type (struct tep_handle *pevent,struct pevent_record *rec) +int pevent_data_type (struct tep_handle *pevent,struct tep_record *rec) {return trace_parse_common_type (pevent, rec->data); }
@@ -5253,7 +5253,7 @@ struct event_format *pevent_data_event_from_type(struct tep_handle *pevent, int* * This returns the PID from a record. */ -int pevent_data_pid (struct tep_handle *pevent,struct pevent_record *rec) +int pevent_data_pid (struct tep_handle *pevent,struct tep_record *rec) {return parse_common_pid (pevent, rec->data); }
@@ -5265,7 +5265,7 @@ int pevent_data_pid(struct tep_handle *pevent, struct pevent_record *rec)* * This returns the preempt count from a record. */ -int pevent_data_preempt_count (struct tep_handle *pevent,struct pevent_record *rec) +int pevent_data_preempt_count (struct tep_handle *pevent,struct tep_record *rec) {return parse_common_pc (pevent, rec->data); }
@@ -5279,7 +5279,7 @@ int pevent_data_preempt_count(struct tep_handle *pevent, struct pevent_record *r* * Use trace_flag_type enum for the flags (see event-parse.h). */ -int pevent_data_flags (struct tep_handle *pevent,struct pevent_record *rec) +int pevent_data_flags (struct tep_handle *pevent,struct tep_record *rec) {return parse_common_flags (pevent, rec->data); }
@@ -5400,7 +5400,7 @@ int pevent_cmdline_pid(struct tep_handle *pevent, struct cmdline *cmdline)* writes the print format into the trace_seq. */ void pevent_event_info (struct trace_seq *s,struct event_format *event, -struct pevent_record *record) +struct tep_record *record) {int print_pretty =1 ;
@@ -5441,7 +5441,7 @@ static bool is_timestamp_in_us(char *trace_clock, bool use_trace_clock)* is found. */ struct event_format * -pevent_find_event_by_record (struct tep_handle *pevent,struct pevent_record *record) +pevent_find_event_by_record (struct tep_handle *pevent,struct tep_record *record) {int type;
@@ -5466,7 +5466,7 @@ pevent_find_event_by_record(struct tep_handle *pevent, struct pevent_record *rec*/ void pevent_print_event_task (struct tep_handle *pevent,struct trace_seq *s,struct event_format *event, -struct pevent_record *record) +struct tep_record *record) {void *data = record->data;const char *comm;
@@ -5494,7 +5494,7 @@ void pevent_print_event_task(struct tep_handle *pevent, struct trace_seq *s,*/ void pevent_print_event_time (struct tep_handle *pevent,struct trace_seq *s,struct event_format *event, -struct pevent_record *record, +struct tep_record *record,bool use_trace_clock) {unsigned long secs;
@@ -5544,7 +5544,7 @@ void pevent_print_event_time(struct tep_handle *pevent, struct trace_seq *s,*/ void pevent_print_event_data (struct tep_handle *pevent,struct trace_seq *s,struct event_format *event, -struct pevent_record *record) +struct tep_record *record) {static const char *spaces =" " ;/* 20 spaces */ int len;
@@ -5560,7 +5560,7 @@ void pevent_print_event_data(struct tep_handle *pevent, struct trace_seq *s, }void pevent_print_event (struct tep_handle *pevent,struct trace_seq *s, -struct pevent_record *record,bool use_trace_clock) +struct tep_record *record,bool use_trace_clock) {struct event_format *event;
@@ -6244,7 +6244,7 @@ int pevent_strerror(struct tep_handle *pevent __maybe_unused, }int get_field_val (struct trace_seq *s,struct format_field *field, -const char *name,struct pevent_record *record, +const char *name,struct tep_record *record,unsigned long long *val,int err) {if (!field) {
@@ -6277,7 +6277,7 @@ int get_field_val(struct trace_seq *s, struct format_field *field,* On failure, it returns NULL. */ void *pevent_get_field_raw (struct trace_seq *s,struct event_format *event, -const char *name,struct pevent_record *record, +const char *name,struct tep_record *record,int *len,int err) {struct format_field *field;
@@ -6324,7 +6324,7 @@ void *pevent_get_field_raw(struct trace_seq *s, struct event_format *event,* Returns 0 on success -1 on field not found. */ int pevent_get_field_val (struct trace_seq *s,struct event_format *event, -const char *name,struct pevent_record *record, +const char *name,struct tep_record *record,unsigned long long *val,int err) {struct format_field *field;
@@ -6349,7 +6349,7 @@ int pevent_get_field_val(struct trace_seq *s, struct event_format *event,* Returns 0 on success -1 on field not found. */ int pevent_get_common_field_val (struct trace_seq *s,struct event_format *event, -const char *name,struct pevent_record *record, +const char *name,struct tep_record *record,unsigned long long *val,int err) {struct format_field *field;
@@ -6374,7 +6374,7 @@ int pevent_get_common_field_val(struct trace_seq *s, struct event_format *event,* Returns 0 on success -1 on field not found. */ int pevent_get_any_field_val (struct trace_seq *s,struct event_format *event, -const char *name,struct pevent_record *record, +const char *name,struct tep_record *record,unsigned long long *val,int err) {struct format_field *field;
@@ -6400,7 +6400,7 @@ int pevent_get_any_field_val(struct trace_seq *s, struct event_format *event,*/ int pevent_print_num_field (struct trace_seq *s,const char *fmt,struct event_format *event,const char *name, -struct pevent_record *record,int err) +struct tep_record *record,int err) {struct format_field *field =pevent_find_field (event, name);unsigned long long val;
@@ -6432,7 +6432,7 @@ int pevent_print_num_field(struct trace_seq *s, const char *fmt,*/ int pevent_print_func_field (struct trace_seq *s,const char *fmt,struct event_format *event,const char *name, -struct pevent_record *record,int err) +struct tep_record *record,int err) {struct format_field *field =pevent_find_field (event, name);struct tep_handle *pevent = event->pevent;
tools/lib/traceevent/event-parse.h +22 -22
115 lines not on this page · raw message
tools/lib/traceevent/parse-filter.c +12 -12
@@ -1697,10 +1697,10 @@ int pevent_filter_event_has_trivial(struct event_filter *filter, }static int test_filter (struct event_format *event,struct filter_arg *arg, -struct pevent_record *record,enum pevent_errno *err); +struct tep_record *record,enum pevent_errno *err);static const char * -get_comm (struct event_format *event,struct pevent_record *record) +get_comm (struct event_format *event,struct tep_record *record) {const char *comm;int pid;
@@ -1712,7 +1712,7 @@ get_comm(struct event_format *event, struct pevent_record *record)static unsigned long long get_value (struct event_format *event, -struct format_field *field,struct pevent_record *record) +struct format_field *field,struct tep_record *record) {unsigned long long val;
@@ -1748,11 +1748,11 @@ get_value(struct event_format *event,static unsigned long long get_arg_value (struct event_format *event,struct filter_arg *arg, -struct pevent_record *record,enum pevent_errno *err); +struct tep_record *record,enum pevent_errno *err);static unsigned long long get_exp_value (struct event_format *event,struct filter_arg *arg, -struct pevent_record *record,enum pevent_errno *err) +struct tep_record *record,enum pevent_errno *err) {unsigned long long lval, rval;
@@ -1807,7 +1807,7 @@ get_exp_value(struct event_format *event, struct filter_arg *arg,static unsigned long long get_arg_value (struct event_format *event,struct filter_arg *arg, -struct pevent_record *record,enum pevent_errno *err) +struct tep_record *record,enum pevent_errno *err) {switch (arg->type) {case FILTER_ARG_FIELD :
@@ -1831,7 +1831,7 @@ get_arg_value(struct event_format *event, struct filter_arg *arg, }static int test_num (struct event_format *event,struct filter_arg *arg, -struct pevent_record *record,enum pevent_errno *err) +struct tep_record *record,enum pevent_errno *err) {unsigned long long lval, rval;
@@ -1871,7 +1871,7 @@ static int test_num(struct event_format *event, struct filter_arg *arg, } } -static const char *get_field_str (struct filter_arg *arg,struct pevent_record *record) +static const char *get_field_str (struct filter_arg *arg,struct tep_record *record) {struct event_format *event;struct tep_handle *pevent;
@@ -1922,7 +1922,7 @@ static const char *get_field_str(struct filter_arg *arg, struct pevent_record *r }static int test_str (struct event_format *event,struct filter_arg *arg, -struct pevent_record *record,enum pevent_errno *err) +struct tep_record *record,enum pevent_errno *err) {const char *val;
@@ -1953,7 +1953,7 @@ static int test_str(struct event_format *event, struct filter_arg *arg, }static int test_op (struct event_format *event,struct filter_arg *arg, -struct pevent_record *record,enum pevent_errno *err) +struct tep_record *record,enum pevent_errno *err) {switch (arg->op.type) {case FILTER_OP_AND :
@@ -1975,7 +1975,7 @@ static int test_op(struct event_format *event, struct filter_arg *arg, }static int test_filter (struct event_format *event,struct filter_arg *arg, -struct pevent_record *record,enum pevent_errno *err) +struct tep_record *record,enum pevent_errno *err) {if (*err) {/*
@@ -2047,7 +2047,7 @@ int pevent_event_filtered(struct event_filter *filter, int event_id)* otherwise - error occurred during test */ enum pevent_errno pevent_filter_match (struct event_filter *filter, -struct pevent_record *record) +struct tep_record *record) {struct tep_handle *pevent = filter->pevent;struct filter_type *filter_type;
tools/lib/traceevent/plugin_function.c +1 -1
@@ -122,7 +122,7 @@ 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, +static int function_handler (struct trace_seq *s,struct tep_record *record,struct event_format *event,void *context) {struct tep_handle *pevent = event->pevent;
tools/lib/traceevent/plugin_hrtimer.c +2 -2
@@ -25,7 +25,7 @@#include "event-parse.h" static int timer_expire_handler (struct trace_seq *s, -struct pevent_record *record, +struct tep_record *record,struct event_format *event,void *context) {trace_seq_printf (s,"hrtimer=" );
@@ -45,7 +45,7 @@ static int timer_expire_handler(struct trace_seq *s, }static int timer_start_handler (struct trace_seq *s, -struct pevent_record *record, +struct tep_record *record,struct event_format *event,void *context) {trace_seq_printf (s,"hrtimer=" );
tools/lib/traceevent/plugin_kmem.c +1 -1
@@ -23,7 +23,7 @@#include "event-parse.h" -static int call_site_handler (struct trace_seq *s,struct pevent_record *record, +static int call_site_handler (struct trace_seq *s,struct tep_record *record,struct event_format *event,void *context) {struct format_field *field;
tools/lib/traceevent/plugin_kvm.c +7 -7
@@ -247,7 +247,7 @@ static const char *find_exit_reason(unsigned isa, int val)return strings[i].str; } -static int print_exit_reason (struct trace_seq *s,struct pevent_record *record, +static int print_exit_reason (struct trace_seq *s,struct tep_record *record,struct event_format *event,const char *field) {unsigned long long isa;
@@ -268,7 +268,7 @@ static int print_exit_reason(struct trace_seq *s, struct pevent_record *record,return 0 ; } -static int kvm_exit_handler (struct trace_seq *s,struct pevent_record *record, +static int kvm_exit_handler (struct trace_seq *s,struct tep_record *record,struct event_format *event,void *context) {unsigned long long info1 =0 , info2 =0 ;
@@ -291,7 +291,7 @@ static int kvm_exit_handler(struct trace_seq *s, struct pevent_record *record,#define KVM_EMUL_INSN_F_CS_L (1 << 3)static int kvm_emulate_insn_handler (struct trace_seq *s, -struct pevent_record *record, +struct tep_record *record,struct event_format *event,void *context) {unsigned long long rip, csbase, len, flags, failed;
@@ -330,7 +330,7 @@ static int kvm_emulate_insn_handler(struct trace_seq *s, } -static int kvm_nested_vmexit_inject_handler (struct trace_seq *s,struct pevent_record *record, +static int kvm_nested_vmexit_inject_handler (struct trace_seq *s,struct tep_record *record,struct event_format *event,void *context) {if (print_exit_reason (s, record, event,"exit_code" ) <0 )
@@ -344,7 +344,7 @@ static int kvm_nested_vmexit_inject_handler(struct trace_seq *s, struct pevent_rreturn 0 ; } -static int kvm_nested_vmexit_handler (struct trace_seq *s,struct pevent_record *record, +static int kvm_nested_vmexit_handler (struct trace_seq *s,struct tep_record *record,struct event_format *event,void *context) {pevent_print_num_field (s,"rip %llx " , event,"rip" , record,1 );
@@ -370,7 +370,7 @@ union kvm_mmu_page_role { }; }; -static int kvm_mmu_print_role (struct trace_seq *s,struct pevent_record *record, +static int kvm_mmu_print_role (struct trace_seq *s,struct tep_record *record,struct event_format *event,void *context) {unsigned long long val;
@@ -417,7 +417,7 @@ static int kvm_mmu_print_role(struct trace_seq *s, struct pevent_record *record, }static int kvm_mmu_get_page_handler (struct trace_seq *s, -struct pevent_record *record, +struct tep_record *record,struct event_format *event,void *context) {unsigned long long val;
tools/lib/traceevent/plugin_mac80211.c +1 -1
@@ -58,7 +58,7 @@ static void print_string(struct trace_seq *s, struct event_format *event,#define SP () trace_seq_putc(s, ' ')static int drv_bss_info_changed (struct trace_seq *s, -struct pevent_record *record, +struct tep_record *record,struct event_format *event,void *context) {void *data = record->data;
tools/lib/traceevent/plugin_sched_switch.c +3 -3
@@ -45,7 +45,7 @@ static void write_state(struct trace_seq *s, int val) }static void write_and_save_comm (struct format_field *field, -struct pevent_record *record, +struct tep_record *record,struct trace_seq *s,int pid) {const char *comm;
@@ -65,7 +65,7 @@ static void write_and_save_comm(struct format_field *field, }static int sched_wakeup_handler (struct trace_seq *s, -struct pevent_record *record, +struct tep_record *record,struct event_format *event,void *context) {struct format_field *field;
@@ -94,7 +94,7 @@ static int sched_wakeup_handler(struct trace_seq *s, }static int sched_switch_handler (struct trace_seq *s, -struct pevent_record *record, +struct tep_record *record,struct event_format *event,void *context) {struct format_field *field;
tools/perf/builtin-kmem.c +1 -1
@@ -729,7 +729,7 @@ static char *compact_gfp_string(unsigned long gfp_flags)static int parse_gfp_flags (struct perf_evsel *evsel,struct perf_sample *sample,unsigned int gfp_flags) { -struct pevent_record record = { +struct tep_record record = { .cpu = sample->cpu, .data = sample->raw_data, .size = sample->raw_size,
tools/perf/util/sort.c +1 -1
@@ -601,7 +601,7 @@ static char *get_trace_output(struct hist_entry *he) {struct trace_seq seq;struct perf_evsel *evsel; -struct pevent_record rec = { +struct tep_record rec = { .data = he->raw_data, .size = he->raw_size, };
tools/perf/util/trace-event-parse.c +1 -1
@@ -116,7 +116,7 @@ unsigned long long read_size(struct event_format *event, void *ptr, int size)void event_format__fprintf (struct event_format *event,int cpu,void *data,int size,FILE *fp) { -struct pevent_record record; +struct tep_record record;struct trace_seq s;memset (&record,0 ,sizeof (record));
RFC PATCH v2 3/24 tools/lib/traceevent, tools/perf: Rename pevent plugin related APIs
In reply to Steven RostedtFrom: "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.
--- 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
tip-bot for Tzvetomir Stoyanov (VMware)
merge bot[tip:perf/urgent] tools lib traceevent, perf tools: Rename pevent plugin related APIs
tools lib traceevent, perf tools: Rename pevent plugin related APIs
Commit-ID: c32d52b4641d3c7b2569b3fe148bf687e5c61888 Gitweb: https://git.kernel.org/tip/c32d52b4641d3c7b2569b3fe148bf687e5c61888 Author: Tzvetomir Stoyanov (VMware) <[email protected]> AuthorDate: Wed, 8 Aug 2018 14:02:48 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Mon, 13 Aug 2018 15:21:39 -0300
tools lib traceevent, perf tools: Rename pevent plugin related APIs
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.
--- 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" );
RFC PATCH v2 4/24 tools/lib/traceevent, tools/perf: Rename pevent alloc / free APIs
In reply to Steven RostedtFrom: "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
APIs: pevent_alloc, pevent_free, pevent_event_info and pevent_func_resolver_t
--- tools/lib/traceevent/event-parse.c | 24 ++++++++++++------------ tools/lib/traceevent/event-parse.h | 12 ++++++------ tools/perf/builtin-kmem.c | 2 +- tools/perf/util/sort.c | 2 +- tools/perf/util/trace-event-parse.c | 2 +- tools/perf/util/trace-event.c | 6 +++--- tools/perf/util/trace-event.h | 2 +- 7 files changed, 25 insertions(+), 25 deletions(-)
tools/lib/traceevent/event-parse.c +12 -12
@@ -438,9 +438,9 @@ __find_func(struct tep_handle *pevent, unsigned long long addr) }struct func_resolver { -pevent_func_resolver_t *func; -void *priv; -struct func_map map; +tep_func_resolver_t *func; +void *priv; +struct func_map map; };/**
@@ -454,7 +454,7 @@ struct func_resolver {* pevent->funclist. */ int pevent_set_function_resolver (struct tep_handle *pevent, -pevent_func_resolver_t *func,void *priv) +tep_func_resolver_t *func,void *priv) {struct func_resolver *resolver =malloc (sizeof (*resolver));
@@ -5399,8 +5399,8 @@ int pevent_cmdline_pid(struct tep_handle *pevent, struct cmdline *cmdline)* This parses the raw @data using the given @event information and * writes the print format into the trace_seq. */ -void pevent_event_info (struct trace_seq *s,struct event_format *event, -struct tep_record *record) +void tep_event_info (struct trace_seq *s,struct event_format *event, +struct tep_record *record) {int print_pretty =1 ;
@@ -5556,7 +5556,7 @@ void pevent_print_event_data(struct tep_handle *pevent, struct trace_seq *s,if (len <20 )trace_seq_printf (s,"%.*s" ,20 - len, spaces); -pevent_event_info (s, event, record); +tep_event_info (s, event, record); } void pevent_print_event(struct tep_handle *pevent, struct trace_seq *s,
@@ -6754,9 +6754,9 @@ int pevent_unregister_event_handler(struct tep_handle *pevent, int id, }/** -* pevent_alloc - create a pevent handle +* tep_alloc - create a pevent handle */ -struct tep_handle *pevent_alloc (void ) +struct tep_handle *tep_alloc (void ) {struct tep_handle *pevent =calloc (1 ,sizeof (*pevent));
@@ -6811,10 +6811,10 @@ void pevent_free_format(struct event_format *event) }/** -* pevent_free - free a pevent handle +* tep_free - free a pevent handle * @pevent: the pevent handle to free */ -void pevent_free (struct tep_handle *pevent) +void tep_free (struct tep_handle *pevent) {struct cmdline_list *cmdlist, *cmdnext;struct func_list *funclist, *funcnext;
@@ -6901,5 +6901,5 @@ void pevent_free(struct tep_handle *pevent)void pevent_unref (struct tep_handle *pevent) { -pevent_free (pevent); +tep_free (pevent); }
tools/lib/traceevent/event-parse.h +6 -6
@@ -454,8 +454,8 @@ struct func_list;struct event_handler ;struct func_resolver ; -typedef char *(pevent_func_resolver_t )(void *priv, -unsigned long long *addrp,char **modp); +typedef char *(tep_func_resolver_t )(void *priv, +unsigned long long *addrp,char **modp);struct tep_handle {int ref_count;
@@ -616,7 +616,7 @@ enum trace_flag_type { };int pevent_set_function_resolver (struct tep_handle *pevent, -pevent_func_resolver_t *func,void *priv); +tep_func_resolver_t *func,void *priv);void pevent_reset_function_resolver (struct tep_handle *pevent);int pevent_register_comm (struct tep_handle *pevent,const char *comm,int pid);int pevent_register_trace_clock (struct tep_handle *pevent,const char *trace_clock);
@@ -722,7 +722,7 @@ void pevent_print_field(struct trace_seq *s, void *data, struct format_field *field);void pevent_print_fields (struct trace_seq *s,void *data,int size__maybe_unused ,struct event_format *event); -void pevent_event_info (struct trace_seq *s,struct event_format *event, +void tep_event_info (struct trace_seq *s,struct event_format *event,struct tep_record *record);int pevent_strerror (struct tep_handle *pevent,enum pevent_errno errnum,char *buf,size_t buflen);
@@ -791,8 +791,8 @@ static inline void pevent_set_latency_format(struct tep_handle *pevent, int lat) pevent->latency_format = lat; } -struct tep_handle *pevent_alloc (void ); -void pevent_free (struct tep_handle *pevent); +struct tep_handle *tep_alloc (void ); +void tep_free (struct tep_handle *pevent);void pevent_ref (struct tep_handle *pevent);void pevent_unref (struct tep_handle *pevent);
tools/perf/builtin-kmem.c +1 -1
@@ -747,7 +747,7 @@ static int parse_gfp_flags(struct perf_evsel *evsel, struct perf_sample *sample, }trace_seq_init (&seq); -pevent_event_info (&seq, evsel->tp_format, &record); +tep_event_info (&seq, evsel->tp_format, &record); str =strtok_r (seq.buffer," " , &pos);while (str) {
tools/perf/util/sort.c +1 -1
@@ -613,7 +613,7 @@ static char *get_trace_output(struct hist_entry *he)pevent_print_fields (&seq, he->raw_data, he->raw_size, evsel->tp_format); }else { -pevent_event_info (&seq, evsel->tp_format, &rec); +tep_event_info (&seq, evsel->tp_format, &rec); }/* * Trim the buffer, it starts at 4KB and we're not going to
tools/perf/util/trace-event-parse.c +1 -1
@@ -125,7 +125,7 @@ void event_format__fprintf(struct event_format *event, record.data = data;trace_seq_init (&s); -pevent_event_info (&s, event, &record); +tep_event_info (&s, event, &record);trace_seq_do_fprintf (&s, fp);trace_seq_destroy (&s); }
tools/perf/util/trace-event.c +3 -3
@@ -28,7 +28,7 @@ static bool tevent_initialized;int trace_event__init (struct trace_event *t) { -struct tep_handle *pevent =pevent_alloc (); +struct tep_handle *pevent =tep_alloc ();if (pevent) { t->plugin_list =traceevent_load_plugins (pevent);
@@ -55,7 +55,7 @@ static int trace_event__init2(void) }int trace_event__register_resolver (struct machine *machine, -pevent_func_resolver_t *func) +tep_func_resolver_t *func) {if (!tevent_initialized &&trace_event__init2 ())return -1 ;
@@ -66,7 +66,7 @@ int trace_event__register_resolver(struct machine *machine,void trace_event__cleanup (struct trace_event *t) {traceevent_unload_plugins (t->plugin_list, t->pevent); -pevent_free (t->pevent); +tep_free (t->pevent); }/*
tools/perf/util/trace-event.h +1 -1
@@ -20,7 +20,7 @@ struct trace_event {int trace_event__init (struct trace_event *t);void trace_event__cleanup (struct trace_event *t);int trace_event__register_resolver (struct machine *machine, -pevent_func_resolver_t *func); +tep_func_resolver_t *func);struct event_format *trace_event__tp_format (const char *sys,const char *name);
Signature · 1 line
2.18.0
tip-bot for Tzvetomir Stoyanov (VMware)
merge bot[tip:perf/urgent] tools lib traceevent, perf tools: Rename pevent alloc / free APIs
tools lib traceevent, perf tools: Rename pevent alloc / free APIs
Commit-ID: 4d5c58b15c4363219e19380848eb74ca60143187 Gitweb: https://git.kernel.org/tip/4d5c58b15c4363219e19380848eb74ca60143187 Author: Tzvetomir Stoyanov (VMware) <[email protected]> AuthorDate: Wed, 8 Aug 2018 14:02:49 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Mon, 13 Aug 2018 15:21:43 -0300
tools lib traceevent, perf tools: Rename pevent alloc / free APIs
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
APIs: pevent_alloc, pevent_free, pevent_event_info and pevent_func_resolver_t
--- tools/lib/traceevent/event-parse.c | 24 ++++++++++++------------ tools/lib/traceevent/event-parse.h | 12 ++++++------ tools/perf/builtin-kmem.c | 2 +- tools/perf/util/sort.c | 2 +- tools/perf/util/trace-event-parse.c | 2 +- tools/perf/util/trace-event.c | 6 +++--- tools/perf/util/trace-event.h | 2 +- 7 files changed, 25 insertions(+), 25 deletions(-)
tools/lib/traceevent/event-parse.c +12 -12
@@ -438,9 +438,9 @@ __find_func(struct tep_handle *pevent, unsigned long long addr) }struct func_resolver { -pevent_func_resolver_t *func; -void *priv; -struct func_map map; +tep_func_resolver_t *func; +void *priv; +struct func_map map; };/**
@@ -454,7 +454,7 @@ struct func_resolver {* pevent->funclist. */ int pevent_set_function_resolver (struct tep_handle *pevent, -pevent_func_resolver_t *func,void *priv) +tep_func_resolver_t *func,void *priv) {struct func_resolver *resolver =malloc (sizeof (*resolver));
@@ -5399,8 +5399,8 @@ int pevent_cmdline_pid(struct tep_handle *pevent, struct cmdline *cmdline)* This parses the raw @data using the given @event information and * writes the print format into the trace_seq. */ -void pevent_event_info (struct trace_seq *s,struct event_format *event, -struct tep_record *record) +void tep_event_info (struct trace_seq *s,struct event_format *event, +struct tep_record *record) {int print_pretty =1 ;
@@ -5556,7 +5556,7 @@ void pevent_print_event_data(struct tep_handle *pevent, struct trace_seq *s,if (len <20 )trace_seq_printf (s,"%.*s" ,20 - len, spaces); -pevent_event_info (s, event, record); +tep_event_info (s, event, record); } void pevent_print_event(struct tep_handle *pevent, struct trace_seq *s,
@@ -6754,9 +6754,9 @@ not_found: }/** -* pevent_alloc - create a pevent handle +* tep_alloc - create a pevent handle */ -struct tep_handle *pevent_alloc (void ) +struct tep_handle *tep_alloc (void ) {struct tep_handle *pevent =calloc (1 ,sizeof (*pevent));
@@ -6811,10 +6811,10 @@ void pevent_free_format(struct event_format *event) }/** -* pevent_free - free a pevent handle +* tep_free - free a pevent handle * @pevent: the pevent handle to free */ -void pevent_free (struct tep_handle *pevent) +void tep_free (struct tep_handle *pevent) {struct cmdline_list *cmdlist, *cmdnext;struct func_list *funclist, *funcnext;
@@ -6901,5 +6901,5 @@ void pevent_free(struct tep_handle *pevent)void pevent_unref (struct tep_handle *pevent) { -pevent_free (pevent); +tep_free (pevent); }
tools/lib/traceevent/event-parse.h +6 -6
@@ -454,8 +454,8 @@ struct func_list;struct event_handler ;struct func_resolver ; -typedef char *(pevent_func_resolver_t )(void *priv, -unsigned long long *addrp,char **modp); +typedef char *(tep_func_resolver_t )(void *priv, +unsigned long long *addrp,char **modp);struct tep_handle {int ref_count;
@@ -616,7 +616,7 @@ enum trace_flag_type { };int pevent_set_function_resolver (struct tep_handle *pevent, -pevent_func_resolver_t *func,void *priv); +tep_func_resolver_t *func,void *priv);void pevent_reset_function_resolver (struct tep_handle *pevent);int pevent_register_comm (struct tep_handle *pevent,const char *comm,int pid);int pevent_register_trace_clock (struct tep_handle *pevent,const char *trace_clock);
@@ -722,7 +722,7 @@ void pevent_print_field(struct trace_seq *s, void *data, struct format_field *field);void pevent_print_fields (struct trace_seq *s,void *data,int size__maybe_unused ,struct event_format *event); -void pevent_event_info (struct trace_seq *s,struct event_format *event, +void tep_event_info (struct trace_seq *s,struct event_format *event,struct tep_record *record);int pevent_strerror (struct tep_handle *pevent,enum pevent_errno errnum,char *buf,size_t buflen);
@@ -791,8 +791,8 @@ static inline void pevent_set_latency_format(struct tep_handle *pevent, int lat) pevent->latency_format = lat; } -struct tep_handle *pevent_alloc (void ); -void pevent_free (struct tep_handle *pevent); +struct tep_handle *tep_alloc (void ); +void tep_free (struct tep_handle *pevent);void pevent_ref (struct tep_handle *pevent);void pevent_unref (struct tep_handle *pevent);
tools/perf/builtin-kmem.c +1 -1
@@ -747,7 +747,7 @@ static int parse_gfp_flags(struct perf_evsel *evsel, struct perf_sample *sample, }trace_seq_init (&seq); -pevent_event_info (&seq, evsel->tp_format, &record); +tep_event_info (&seq, evsel->tp_format, &record); str =strtok_r (seq.buffer," " , &pos);while (str) {
tools/perf/util/sort.c +1 -1
@@ -613,7 +613,7 @@ static char *get_trace_output(struct hist_entry *he)pevent_print_fields (&seq, he->raw_data, he->raw_size, evsel->tp_format); }else { -pevent_event_info (&seq, evsel->tp_format, &rec); +tep_event_info (&seq, evsel->tp_format, &rec); }/* * Trim the buffer, it starts at 4KB and we're not going to
tools/perf/util/trace-event-parse.c +1 -1
@@ -125,7 +125,7 @@ void event_format__fprintf(struct event_format *event, record.data = data;trace_seq_init (&s); -pevent_event_info (&s, event, &record); +tep_event_info (&s, event, &record);trace_seq_do_fprintf (&s, fp);trace_seq_destroy (&s); }
tools/perf/util/trace-event.c +3 -3
@@ -28,7 +28,7 @@ static bool tevent_initialized;int trace_event__init (struct trace_event *t) { -struct tep_handle *pevent =pevent_alloc (); +struct tep_handle *pevent =tep_alloc ();if (pevent) { t->plugin_list =traceevent_load_plugins (pevent);
@@ -55,7 +55,7 @@ static int trace_event__init2(void) }int trace_event__register_resolver (struct machine *machine, -pevent_func_resolver_t *func) +tep_func_resolver_t *func) {if (!tevent_initialized &&trace_event__init2 ())return -1 ;
@@ -66,7 +66,7 @@ int trace_event__register_resolver(struct machine *machine,void trace_event__cleanup (struct trace_event *t) {traceevent_unload_plugins (t->plugin_list, t->pevent); -pevent_free (t->pevent); +tep_free (t->pevent); }/*
tools/perf/util/trace-event.h +1 -1
@@ -20,7 +20,7 @@ struct trace_event {int trace_event__init (struct trace_event *t);void trace_event__cleanup (struct trace_event *t);int trace_event__register_resolver (struct machine *machine, -pevent_func_resolver_t *func); +tep_func_resolver_t *func);struct event_format *trace_event__tp_format (const char *sys,const char *name);
RFC PATCH v2 5/24 tools/lib/traceevent, tools/perf: Rename pevent find APIs
In reply to Steven RostedtFrom: "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
APIs: pevent_find_any_field, pevent_find_common_field, pevent_find_event, pevent_find_field
--- tools/lib/traceevent/event-parse.c | 76 +++++++++++----------- tools/lib/traceevent/event-parse.h | 8 +-- tools/lib/traceevent/parse-filter.c | 4 +- tools/lib/traceevent/plugin_kmem.c | 2 +- tools/lib/traceevent/plugin_mac80211.c | 2 +- tools/lib/traceevent/plugin_sched_switch.c | 6 +- tools/perf/util/evsel.c | 2 +- tools/perf/util/header.c | 2 +- tools/perf/util/python.c | 2 +- tools/perf/util/sort.c | 4 +- tools/perf/util/trace-event-parse.c | 4 +- tools/perf/util/trace-event.c | 2 +- 12 files changed, 57 insertions(+), 57 deletions(-)
tools/lib/traceevent/event-parse.c +38 -38
@@ -2101,11 +2101,11 @@ process_entry(struct event_format *event __maybe_unused, struct print_arg *arg, arg->field.name = field;if (is_flag_field) { - arg->field.field =pevent_find_any_field (event, arg->field.name); + arg->field.field =tep_find_any_field (event, arg->field.name); arg->field.field->flags |=FIELD_IS_FLAG ; is_flag_field =0 ; }else if (is_symbolic_field) { - arg->field.field =pevent_find_any_field (event, arg->field.name); + arg->field.field =tep_find_any_field (event, arg->field.name); arg->field.field->flags |=FIELD_IS_SYMBOLIC ; is_symbolic_field =0 ; }
@@ -2714,7 +2714,7 @@ process_dynamic_array(struct event_format *event, struct print_arg *arg, char **/* Find the field */ - field =pevent_find_field (event, token); + field =tep_find_field (event, token);if (!field) goto out_free;
@@ -2771,7 +2771,7 @@ process_dynamic_array_len(struct event_format *event, struct print_arg *arg, arg->type =PRINT_DYNAMIC_ARRAY_LEN ;/* Find the field */ - field =pevent_find_field (event, token); + field =tep_find_field (event, token);if (!field) goto out_free;
@@ -3265,7 +3265,7 @@ static int event_read_print(struct event_format *event) }/** -* pevent_find_common_field - return a common field by event +* tep_find_common_field - return a common field by event * @event: handle for the event * @name: the name of the common field to return *
@@ -3273,7 +3273,7 @@ static int event_read_print(struct event_format *event)* This only searchs the common fields and not all field. */ struct format_field * -pevent_find_common_field (struct event_format *event,const char *name) +tep_find_common_field (struct event_format *event,const char *name) {struct format_field *format;
@@ -3287,7 +3287,7 @@ pevent_find_common_field(struct event_format *event, const char *name) }/** -* pevent_find_field - find a non-common field +* tep_find_field - find a non-common field * @event: handle for the event * @name: the name of the non-common field *
@@ -3295,7 +3295,7 @@ pevent_find_common_field(struct event_format *event, const char *name)* This does not search common fields. */ struct format_field * -pevent_find_field (struct event_format *event,const char *name) +tep_find_field (struct event_format *event,const char *name) {struct format_field *format;
@@ -3309,7 +3309,7 @@ pevent_find_field(struct event_format *event, const char *name) }/** -* pevent_find_any_field - find any field by name +* tep_find_any_field - find any field by name * @event: handle for the event * @name: the name of the field *
@@ -3318,14 +3318,14 @@ pevent_find_field(struct event_format *event, const char *name)* the non-common ones if a common one was not found. */ struct format_field * -pevent_find_any_field (struct event_format *event,const char *name) +tep_find_any_field (struct event_format *event,const char *name) {struct format_field *format; - format =pevent_find_common_field (event, name); + format =tep_find_common_field (event, name);if (format)return format; -return pevent_find_field (event, name); +return tep_find_field (event, name); }/**
@@ -3400,7 +3400,7 @@ static int get_common_info(struct tep_handle *pevent, } event = pevent->events[0 ]; - field =pevent_find_common_field (event, type); + field =tep_find_common_field (event, type);if (!field)return -1 ;
@@ -3468,13 +3468,13 @@ static int parse_common_migrate_disable(struct tep_handle *pevent, void *data)static int events_id_cmp (const void *a,const void *b);/** -* pevent_find_event - find an event by given id +* tep_find_event - find an event by given id * @pevent: a handle to the pevent * @id: the id of the event * * Returns an event that has a given @id. */ -struct event_format *pevent_find_event (struct tep_handle *pevent,int id) +struct event_format *tep_find_event (struct tep_handle *pevent,int id) {struct event_format **eventptr;struct event_format key;
@@ -3553,7 +3553,7 @@ eval_num_arg(void *data, int size, struct event_format *event, struct print_argreturn strtoull (arg->atom.atom,NULL ,0 );case PRINT_FIELD :if (!arg->field.field) { - arg->field.field =pevent_find_any_field (event, arg->field.name); + arg->field.field =tep_find_any_field (event, arg->field.name);if (!arg->field.field) goto out_warning_field;
@@ -3619,7 +3619,7 @@ eval_num_arg(void *data, int size, struct event_format *event, struct print_argcase PRINT_FIELD :if (!larg->field.field) { larg->field.field = -pevent_find_any_field (event, larg->field.name); +tep_find_any_field (event, larg->field.name);if (!larg->field.field) { arg = larg; goto out_warning_field;
@@ -3899,7 +3899,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,case PRINT_FIELD : field = arg->field.field;if (!field) { - field =pevent_find_any_field (event, arg->field.name); + field =tep_find_any_field (event, arg->field.name);if (!field) { str = arg->field.name; goto out_warning_field;
@@ -4000,7 +4000,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size, field = arg->hex.field->field.field;if (!field) { str = arg->hex.field->field.name; - field =pevent_find_any_field (event, str); + field =tep_find_any_field (event, str);if (!field) goto out_warning_field; arg->hex.field->field.field = field;
@@ -4031,7 +4031,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size, field = arg->int_array.field->field.field;if (!field) { str = arg->int_array.field->field.name; - field =pevent_find_any_field (event, str); + field =tep_find_any_field (event, str);if (!field) goto out_warning_field; arg->int_array.field->field.field = field;
@@ -4071,7 +4071,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,if (arg->string.offset ==-1 ) {struct format_field *f; - f =pevent_find_any_field (event, arg->string.string); + f =tep_find_any_field (event, arg->string.string); arg->string.offset = f->offset; } str_offset =data2host4 (pevent, data + arg->string.offset);
@@ -4089,7 +4089,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,if (arg->bitmask.offset ==-1 ) {struct format_field *f; - f =pevent_find_any_field (event, arg->bitmask.bitmask); + f =tep_find_any_field (event, arg->bitmask.bitmask); arg->bitmask.offset = f->offset; } bitmask_offset =data2host4 (pevent, data + arg->bitmask.offset);
@@ -4239,12 +4239,12 @@ static struct print_arg *make_bprint_args(char *fmt, void *data, int size, struc ip_field = pevent->bprint_ip_field;if (!field) { - field =pevent_find_field (event,"buf" ); + field =tep_find_field (event,"buf" );if (!field) {do_warning_event (event,"can't find buffer field for binary printk" );return NULL ; } - ip_field =pevent_find_field (event,"ip" ); + ip_field =tep_find_field (event,"ip" );if (!ip_field) {do_warning_event (event,"can't find ip field for binary printk" );return NULL ;
@@ -4413,7 +4413,7 @@ get_bprint_format(void *data, int size __maybe_unused, field = pevent->bprint_fmt_field;if (!field) { - field =pevent_find_field (event,"fmt" ); + field =tep_find_field (event,"fmt" );if (!field) {do_warning_event (event,"can't find format field for binary printk" );return NULL ;
@@ -4457,7 +4457,7 @@ static void print_mac_arg(struct trace_seq *s, int mac, void *data, int size, fmt ="%.2x%.2x%.2x%.2x%.2x%.2x" ;if (!arg->field.field) { arg->field.field = -pevent_find_any_field (event, arg->field.name); +tep_find_any_field (event, arg->field.name);if (!arg->field.field) {do_warning_event (event,"%s: field %s not found" , __func__, arg->field.name);
@@ -4607,7 +4607,7 @@ static int print_ipv4_arg(struct trace_seq *s, const char *ptr, char i,if (!arg->field.field) { arg->field.field = -pevent_find_any_field (event, arg->field.name); +tep_find_any_field (event, arg->field.name);if (!arg->field.field) {do_warning ("%s: field %s not found" , __func__, arg->field.name);
@@ -4653,7 +4653,7 @@ static int print_ipv6_arg(struct trace_seq *s, const char *ptr, char i,if (!arg->field.field) { arg->field.field = -pevent_find_any_field (event, arg->field.name); +tep_find_any_field (event, arg->field.name);if (!arg->field.field) {do_warning ("%s: field %s not found" , __func__, arg->field.name);
@@ -4711,7 +4711,7 @@ static int print_ipsa_arg(struct trace_seq *s, const char *ptr, char i,if (!arg->field.field) { arg->field.field = -pevent_find_any_field (event, arg->field.name); +tep_find_any_field (event, arg->field.name);if (!arg->field.field) {do_warning ("%s: field %s not found" , __func__, arg->field.name);
@@ -5243,7 +5243,7 @@ int pevent_data_type(struct tep_handle *pevent, struct tep_record *rec)*/ struct event_format *pevent_data_event_from_type (struct tep_handle *pevent,int type) { -return pevent_find_event (pevent, type); +return tep_find_event (pevent, type); }/**
@@ -5452,7 +5452,7 @@ pevent_find_event_by_record(struct tep_handle *pevent, struct tep_record *record type =trace_parse_common_type (pevent, record->data); -return pevent_find_event (pevent, type); +return tep_find_event (pevent, type); }/**
@@ -6288,7 +6288,7 @@ void *pevent_get_field_raw(struct trace_seq *s, struct event_format *event,if (!event)return NULL ; - field =pevent_find_field (event, name); + field =tep_find_field (event, name);if (!field) {if (err)
@@ -6332,7 +6332,7 @@ int pevent_get_field_val(struct trace_seq *s, struct event_format *event,if (!event)return -1 ; - field =pevent_find_field (event, name); + field =tep_find_field (event, name);return get_field_val (s, field, name, record, val, err); }
@@ -6357,7 +6357,7 @@ int pevent_get_common_field_val(struct trace_seq *s, struct event_format *event,if (!event)return -1 ; - field =pevent_find_common_field (event, name); + field =tep_find_common_field (event, name);return get_field_val (s, field, name, record, val, err); }
@@ -6382,7 +6382,7 @@ int pevent_get_any_field_val(struct trace_seq *s, struct event_format *event,if (!event)return -1 ; - field =pevent_find_any_field (event, name); + field =tep_find_any_field (event, name);return get_field_val (s, field, name, record, val, err); }
@@ -6402,7 +6402,7 @@ int pevent_print_num_field(struct trace_seq *s, const char *fmt, struct event_format *event, const char *name, struct tep_record *record, int err) { - struct format_field *field = pevent_find_field(event, name); + struct format_field *field = tep_find_field(event, name);unsigned long long val;if (!field)
@@ -6434,7 +6434,7 @@ int pevent_print_func_field(struct trace_seq *s, const char *fmt, struct event_format *event, const char *name, struct tep_record *record, int err) { - struct format_field *field = pevent_find_field(event, name); + struct format_field *field = tep_find_field(event, name);struct tep_handle *pevent = event->pevent;unsigned long long val;struct func_map *func;
@@ -6599,7 +6599,7 @@ static struct event_format *pevent_search_event(struct tep_handle *pevent, int iif (id >=0 ) {/* search by id */ - event =pevent_find_event (pevent, id); + event =tep_find_event (pevent, id);if (!event)return NULL ;if (event_name && (strcmp (event_name, event->name) !=0 ))
tools/lib/traceevent/event-parse.h +4 -4
@@ -686,9 +686,9 @@ int pevent_register_print_function(struct tep_handle *pevent,int pevent_unregister_print_function (struct tep_handle *pevent,pevent_func_handler func,char *name); -struct format_field *pevent_find_common_field (struct event_format *event,const char *name); -struct format_field *pevent_find_field (struct event_format *event,const char *name); -struct format_field *pevent_find_any_field (struct event_format *event,const char *name); +struct format_field *tep_find_common_field (struct event_format *event,const char *name); +struct format_field *tep_find_field (struct event_format *event,const char *name); +struct format_field *tep_find_any_field (struct event_format *event,const char *name);const char *pevent_find_function (struct tep_handle *pevent,unsigned long long addr);unsigned long long
@@ -697,7 +697,7 @@ unsigned long long pevent_read_number(struct tep_handle *pevent, const void *ptrint pevent_read_number_field (struct format_field *field,const void *data,unsigned long long *value); -struct event_format *pevent_find_event (struct tep_handle *pevent,int id); +struct event_format *tep_find_event (struct tep_handle *pevent,int id);struct event_format *pevent_find_event_by_name (struct tep_handle *pevent,const char *sys,const char *name);
tools/lib/traceevent/parse-filter.c +2 -2
@@ -167,7 +167,7 @@ add_filter_type(struct event_filter *filter, int id) filter_type = &filter->event_filters[i]; filter_type->event_id = id; - filter_type->event =pevent_find_event (filter->pevent, id); + filter_type->event =tep_find_event (filter->pevent, id); filter_type->filter =NULL ; filter->filters++;
@@ -382,7 +382,7 @@ create_arg_item(struct event_format *event, const char *token,break ; }/* Consider this a field */ - field =pevent_find_any_field (event, token); + field =tep_find_any_field (event, token);if (!field) {/* If token is 'COMM' or 'CPU' then it is special */ if (strcmp (token,COMM ) ==0 ) {
tools/lib/traceevent/plugin_kmem.c +1 -1
@@ -31,7 +31,7 @@ static int call_site_handler(struct trace_seq *s, struct tep_record *record,void *data = record->data;const char *func; - field =pevent_find_field (event,"call_site" ); + field =tep_find_field (event,"call_site" );if (!field)return 1 ;
tools/lib/traceevent/plugin_mac80211.c +1 -1
@@ -28,7 +28,7 @@static void print_string (struct trace_seq *s,struct event_format *event,const char *name,const void *data) { -struct format_field *f =pevent_find_field (event, name); +struct format_field *f =tep_find_field (event, name);int offset;int length;
tools/lib/traceevent/plugin_sched_switch.c +3 -3
@@ -74,7 +74,7 @@ static int sched_wakeup_handler(struct trace_seq *s,if (pevent_get_field_val (s, event,"pid" , record, &val,1 ))return trace_seq_putc (s,'!' ); - field =pevent_find_any_field (event,"comm" ); + field =tep_find_any_field (event,"comm" );if (field) {write_and_save_comm (field, record, s, val);trace_seq_putc (s,':' );
@@ -103,7 +103,7 @@ static int sched_switch_handler(struct trace_seq *s,if (pevent_get_field_val (s, event,"prev_pid" , record, &val,1 ))return trace_seq_putc (s,'!' ); - field =pevent_find_any_field (event,"prev_comm" ); + field =tep_find_any_field (event,"prev_comm" );if (field) {write_and_save_comm (field, record, s, val);trace_seq_putc (s,':' );
@@ -121,7 +121,7 @@ static int sched_switch_handler(struct trace_seq *s,if (pevent_get_field_val (s, event,"next_pid" , record, &val,1 ))return trace_seq_putc (s,'!' ); - field =pevent_find_any_field (event,"next_comm" ); + field =tep_find_any_field (event,"next_comm" );if (field) {write_and_save_comm (field, record, s, val);trace_seq_putc (s,':' );
tools/perf/util/evsel.c +1 -1
@@ -2683,7 +2683,7 @@ int perf_event__synthesize_sample(union perf_event *event, u64 type,struct format_field *perf_evsel__field (struct perf_evsel *evsel,const char *name) { -return pevent_find_field (evsel->tp_format, name); +return tep_find_field (evsel->tp_format, name); } void *perf_evsel__rawptr(struct perf_evsel *evsel, struct perf_sample *sample,
tools/perf/util/header.c +1 -1
@@ -3221,7 +3221,7 @@ static int perf_evsel__prepare_tracepoint_event(struct perf_evsel *evsel,return -1 ; } - event =pevent_find_event (pevent, evsel->attr.config); + event =tep_find_event (pevent, evsel->attr.config);if (event ==NULL ) {pr_debug ("cannot find event format for %d\n" , (int )evsel->attr.config);return -1 ;
tools/perf/util/python.c +1 -1
@@ -394,7 +394,7 @@ get_tracepoint_field(struct pyrf_event *pevent, PyObject *attr_name) evsel->tp_format = tp_format; } - field =pevent_find_any_field (evsel->tp_format, str); + field =tep_find_any_field (evsel->tp_format, str);if (!field)return NULL ;
tools/perf/util/sort.c +2 -2
@@ -2311,7 +2311,7 @@ static int add_all_matching_fields(struct perf_evlist *evlist,if (evsel->attr.type !=PERF_TYPE_TRACEPOINT )continue ; - field =pevent_find_any_field (evsel->tp_format, field_name); + field =tep_find_any_field (evsel->tp_format, field_name);if (field ==NULL )continue ;
@@ -2378,7 +2378,7 @@ static int add_dynamic_entry(struct perf_evlist *evlist, const char *tok,if (!strcmp (field_name,"*" )) { ret =add_evsel_fields (evsel, raw_trace, level); }else { - field =pevent_find_any_field (evsel->tp_format, field_name); + field =tep_find_any_field (evsel->tp_format, field_name);if (field ==NULL ) {pr_debug ("Cannot find event field for %s.%s\n" , event_name, field_name);
tools/perf/util/trace-event-parse.c +2 -2
@@ -41,7 +41,7 @@ static int get_common_field(struct scripting_context *context,return 0 ; event = pevent->events[0 ]; - field =pevent_find_common_field (event, type); + field =tep_find_common_field (event, type);if (!field)return 0 ; *offset = field->offset;
@@ -99,7 +99,7 @@ raw_field_value(struct event_format *event, const char *name, void *data)struct format_field *field;unsigned long long val; - field =pevent_find_any_field (event, name); + field =tep_find_any_field (event, name);if (!field)return 0ULL ;
tools/perf/util/trace-event.c +1 -1
@@ -116,5 +116,5 @@ struct event_format *trace_event__tp_format_id(int id)if (!tevent_initialized &&trace_event__init2 ())return ERR_PTR (-ENOMEM ); -return pevent_find_event (tevent.pevent, id); +return tep_find_event (tevent.pevent, id); }
Signature · 1 line
2.18.0
tip-bot for Tzvetomir Stoyanov (VMware)
merge bot[tip:perf/urgent] tools lib traceevent, perf tools: Rename pevent find APIs
tools lib traceevent, perf tools: Rename pevent find APIs
Commit-ID: af85cd19521fe956eeb2cc8b9e41b9b5bbb8e3ae Gitweb: https://git.kernel.org/tip/af85cd19521fe956eeb2cc8b9e41b9b5bbb8e3ae Author: Tzvetomir Stoyanov (VMware) <[email protected]> AuthorDate: Wed, 8 Aug 2018 14:02:50 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Mon, 13 Aug 2018 15:21:51 -0300
tools lib traceevent, perf tools: Rename pevent find APIs
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
APIs: pevent_find_any_field, pevent_find_common_field, pevent_find_event, pevent_find_field
--- tools/lib/traceevent/event-parse.c | 76 +++++++++++++++--------------- tools/lib/traceevent/event-parse.h | 8 ++-- tools/lib/traceevent/parse-filter.c | 4 +- tools/lib/traceevent/plugin_kmem.c | 2 +- tools/lib/traceevent/plugin_mac80211.c | 2 +- tools/lib/traceevent/plugin_sched_switch.c | 6 +-- tools/perf/util/evsel.c | 2 +- tools/perf/util/header.c | 2 +- tools/perf/util/python.c | 2 +- tools/perf/util/sort.c | 4 +- tools/perf/util/trace-event-parse.c | 4 +- tools/perf/util/trace-event.c | 2 +- 12 files changed, 57 insertions(+), 57 deletions(-)
tools/lib/traceevent/event-parse.c +38 -38
@@ -2101,11 +2101,11 @@ process_entry(struct event_format *event __maybe_unused, struct print_arg *arg, arg->field.name = field;if (is_flag_field) { - arg->field.field =pevent_find_any_field (event, arg->field.name); + arg->field.field =tep_find_any_field (event, arg->field.name); arg->field.field->flags |=FIELD_IS_FLAG ; is_flag_field =0 ; }else if (is_symbolic_field) { - arg->field.field =pevent_find_any_field (event, arg->field.name); + arg->field.field =tep_find_any_field (event, arg->field.name); arg->field.field->flags |=FIELD_IS_SYMBOLIC ; is_symbolic_field =0 ; }
@@ -2714,7 +2714,7 @@ process_dynamic_array(struct event_format *event, struct print_arg *arg, char **/* Find the field */ - field =pevent_find_field (event, token); + field =tep_find_field (event, token);if (!field) goto out_free;
@@ -2771,7 +2771,7 @@ process_dynamic_array_len(struct event_format *event, struct print_arg *arg, arg->type =PRINT_DYNAMIC_ARRAY_LEN ;/* Find the field */ - field =pevent_find_field (event, token); + field =tep_find_field (event, token);if (!field) goto out_free;
@@ -3265,7 +3265,7 @@ static int event_read_print(struct event_format *event) }/** -* pevent_find_common_field - return a common field by event +* tep_find_common_field - return a common field by event * @event: handle for the event * @name: the name of the common field to return *
@@ -3273,7 +3273,7 @@ static int event_read_print(struct event_format *event)* This only searchs the common fields and not all field. */ struct format_field * -pevent_find_common_field (struct event_format *event,const char *name) +tep_find_common_field (struct event_format *event,const char *name) {struct format_field *format;
@@ -3287,7 +3287,7 @@ pevent_find_common_field(struct event_format *event, const char *name) }/** -* pevent_find_field - find a non-common field +* tep_find_field - find a non-common field * @event: handle for the event * @name: the name of the non-common field *
@@ -3295,7 +3295,7 @@ pevent_find_common_field(struct event_format *event, const char *name)* This does not search common fields. */ struct format_field * -pevent_find_field (struct event_format *event,const char *name) +tep_find_field (struct event_format *event,const char *name) {struct format_field *format;
@@ -3309,7 +3309,7 @@ pevent_find_field(struct event_format *event, const char *name) }/** -* pevent_find_any_field - find any field by name +* tep_find_any_field - find any field by name * @event: handle for the event * @name: the name of the field *
@@ -3318,14 +3318,14 @@ pevent_find_field(struct event_format *event, const char *name)* the non-common ones if a common one was not found. */ struct format_field * -pevent_find_any_field (struct event_format *event,const char *name) +tep_find_any_field (struct event_format *event,const char *name) {struct format_field *format; - format =pevent_find_common_field (event, name); + format =tep_find_common_field (event, name);if (format)return format; -return pevent_find_field (event, name); +return tep_find_field (event, name); }/**
@@ -3400,7 +3400,7 @@ static int get_common_info(struct tep_handle *pevent, } event = pevent->events[0 ]; - field =pevent_find_common_field (event, type); + field =tep_find_common_field (event, type);if (!field)return -1 ;
@@ -3468,13 +3468,13 @@ static int parse_common_migrate_disable(struct tep_handle *pevent, void *data)static int events_id_cmp (const void *a,const void *b);/** -* pevent_find_event - find an event by given id +* tep_find_event - find an event by given id * @pevent: a handle to the pevent * @id: the id of the event * * Returns an event that has a given @id. */ -struct event_format *pevent_find_event (struct tep_handle *pevent,int id) +struct event_format *tep_find_event (struct tep_handle *pevent,int id) {struct event_format **eventptr;struct event_format key;
@@ -3553,7 +3553,7 @@ eval_num_arg(void *data, int size, struct event_format *event, struct print_argreturn strtoull (arg->atom.atom,NULL ,0 );case PRINT_FIELD :if (!arg->field.field) { - arg->field.field =pevent_find_any_field (event, arg->field.name); + arg->field.field =tep_find_any_field (event, arg->field.name);if (!arg->field.field) goto out_warning_field;
@@ -3619,7 +3619,7 @@ eval_num_arg(void *data, int size, struct event_format *event, struct print_argcase PRINT_FIELD :if (!larg->field.field) { larg->field.field = -pevent_find_any_field (event, larg->field.name); +tep_find_any_field (event, larg->field.name);if (!larg->field.field) { arg = larg; goto out_warning_field;
@@ -3899,7 +3899,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,case PRINT_FIELD : field = arg->field.field;if (!field) { - field =pevent_find_any_field (event, arg->field.name); + field =tep_find_any_field (event, arg->field.name);if (!field) { str = arg->field.name; goto out_warning_field;
@@ -4000,7 +4000,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size, field = arg->hex.field->field.field;if (!field) { str = arg->hex.field->field.name; - field =pevent_find_any_field (event, str); + field =tep_find_any_field (event, str);if (!field) goto out_warning_field; arg->hex.field->field.field = field;
@@ -4031,7 +4031,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size, field = arg->int_array.field->field.field;if (!field) { str = arg->int_array.field->field.name; - field =pevent_find_any_field (event, str); + field =tep_find_any_field (event, str);if (!field) goto out_warning_field; arg->int_array.field->field.field = field;
@@ -4071,7 +4071,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,if (arg->string.offset ==-1 ) {struct format_field *f; - f =pevent_find_any_field (event, arg->string.string); + f =tep_find_any_field (event, arg->string.string); arg->string.offset = f->offset; } str_offset =data2host4 (pevent, data + arg->string.offset);
@@ -4089,7 +4089,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,if (arg->bitmask.offset ==-1 ) {struct format_field *f; - f =pevent_find_any_field (event, arg->bitmask.bitmask); + f =tep_find_any_field (event, arg->bitmask.bitmask); arg->bitmask.offset = f->offset; } bitmask_offset =data2host4 (pevent, data + arg->bitmask.offset);
@@ -4239,12 +4239,12 @@ static struct print_arg *make_bprint_args(char *fmt, void *data, int size, struc ip_field = pevent->bprint_ip_field;if (!field) { - field =pevent_find_field (event,"buf" ); + field =tep_find_field (event,"buf" );if (!field) {do_warning_event (event,"can't find buffer field for binary printk" );return NULL ; } - ip_field =pevent_find_field (event,"ip" ); + ip_field =tep_find_field (event,"ip" );if (!ip_field) {do_warning_event (event,"can't find ip field for binary printk" );return NULL ;
@@ -4413,7 +4413,7 @@ get_bprint_format(void *data, int size __maybe_unused, field = pevent->bprint_fmt_field;if (!field) { - field =pevent_find_field (event,"fmt" ); + field =tep_find_field (event,"fmt" );if (!field) {do_warning_event (event,"can't find format field for binary printk" );return NULL ;
@@ -4457,7 +4457,7 @@ static void print_mac_arg(struct trace_seq *s, int mac, void *data, int size, fmt ="%.2x%.2x%.2x%.2x%.2x%.2x" ;if (!arg->field.field) { arg->field.field = -pevent_find_any_field (event, arg->field.name); +tep_find_any_field (event, arg->field.name);if (!arg->field.field) {do_warning_event (event,"%s: field %s not found" , __func__, arg->field.name);
@@ -4607,7 +4607,7 @@ static int print_ipv4_arg(struct trace_seq *s, const char *ptr, char i,if (!arg->field.field) { arg->field.field = -pevent_find_any_field (event, arg->field.name); +tep_find_any_field (event, arg->field.name);if (!arg->field.field) {do_warning ("%s: field %s not found" , __func__, arg->field.name);
@@ -4653,7 +4653,7 @@ static int print_ipv6_arg(struct trace_seq *s, const char *ptr, char i,if (!arg->field.field) { arg->field.field = -pevent_find_any_field (event, arg->field.name); +tep_find_any_field (event, arg->field.name);if (!arg->field.field) {do_warning ("%s: field %s not found" , __func__, arg->field.name);
@@ -4711,7 +4711,7 @@ static int print_ipsa_arg(struct trace_seq *s, const char *ptr, char i,if (!arg->field.field) { arg->field.field = -pevent_find_any_field (event, arg->field.name); +tep_find_any_field (event, arg->field.name);if (!arg->field.field) {do_warning ("%s: field %s not found" , __func__, arg->field.name);
@@ -5243,7 +5243,7 @@ int pevent_data_type(struct tep_handle *pevent, struct tep_record *rec)*/ struct event_format *pevent_data_event_from_type (struct tep_handle *pevent,int type) { -return pevent_find_event (pevent, type); +return tep_find_event (pevent, type); }/**
@@ -5452,7 +5452,7 @@ pevent_find_event_by_record(struct tep_handle *pevent, struct tep_record *record type =trace_parse_common_type (pevent, record->data); -return pevent_find_event (pevent, type); +return tep_find_event (pevent, type); }/**
@@ -6288,7 +6288,7 @@ void *pevent_get_field_raw(struct trace_seq *s, struct event_format *event,if (!event)return NULL ; - field =pevent_find_field (event, name); + field =tep_find_field (event, name);if (!field) {if (err)
@@ -6332,7 +6332,7 @@ int pevent_get_field_val(struct trace_seq *s, struct event_format *event,if (!event)return -1 ; - field =pevent_find_field (event, name); + field =tep_find_field (event, name);return get_field_val (s, field, name, record, val, err); }
@@ -6357,7 +6357,7 @@ int pevent_get_common_field_val(struct trace_seq *s, struct event_format *event,if (!event)return -1 ; - field =pevent_find_common_field (event, name); + field =tep_find_common_field (event, name);return get_field_val (s, field, name, record, val, err); }
@@ -6382,7 +6382,7 @@ int pevent_get_any_field_val(struct trace_seq *s, struct event_format *event,if (!event)return -1 ; - field =pevent_find_any_field (event, name); + field =tep_find_any_field (event, name);return get_field_val (s, field, name, record, val, err); }
@@ -6402,7 +6402,7 @@ int pevent_print_num_field(struct trace_seq *s, const char *fmt, struct event_format *event, const char *name, struct tep_record *record, int err) { - struct format_field *field = pevent_find_field(event, name); + struct format_field *field = tep_find_field(event, name);unsigned long long val;if (!field)
@@ -6434,7 +6434,7 @@ int pevent_print_func_field(struct trace_seq *s, const char *fmt, struct event_format *event, const char *name, struct tep_record *record, int err) { - struct format_field *field = pevent_find_field(event, name); + struct format_field *field = tep_find_field(event, name);struct tep_handle *pevent = event->pevent;unsigned long long val;struct func_map *func;
@@ -6599,7 +6599,7 @@ static struct event_format *pevent_search_event(struct tep_handle *pevent, int iif (id >=0 ) {/* search by id */ - event =pevent_find_event (pevent, id); + event =tep_find_event (pevent, id);if (!event)return NULL ;if (event_name && (strcmp (event_name, event->name) !=0 ))
tools/lib/traceevent/event-parse.h +4 -4
@@ -686,9 +686,9 @@ int pevent_register_print_function(struct tep_handle *pevent,int pevent_unregister_print_function (struct tep_handle *pevent,pevent_func_handler func,char *name); -struct format_field *pevent_find_common_field (struct event_format *event,const char *name); -struct format_field *pevent_find_field (struct event_format *event,const char *name); -struct format_field *pevent_find_any_field (struct event_format *event,const char *name); +struct format_field *tep_find_common_field (struct event_format *event,const char *name); +struct format_field *tep_find_field (struct event_format *event,const char *name); +struct format_field *tep_find_any_field (struct event_format *event,const char *name);const char *pevent_find_function (struct tep_handle *pevent,unsigned long long addr);unsigned long long
@@ -697,7 +697,7 @@ unsigned long long pevent_read_number(struct tep_handle *pevent, const void *ptrint pevent_read_number_field (struct format_field *field,const void *data,unsigned long long *value); -struct event_format *pevent_find_event (struct tep_handle *pevent,int id); +struct event_format *tep_find_event (struct tep_handle *pevent,int id);struct event_format *pevent_find_event_by_name (struct tep_handle *pevent,const char *sys,const char *name);
tools/lib/traceevent/parse-filter.c +2 -2
@@ -167,7 +167,7 @@ add_filter_type(struct event_filter *filter, int id) filter_type = &filter->event_filters[i]; filter_type->event_id = id; - filter_type->event =pevent_find_event (filter->pevent, id); + filter_type->event =tep_find_event (filter->pevent, id); filter_type->filter =NULL ; filter->filters++;
@@ -382,7 +382,7 @@ create_arg_item(struct event_format *event, const char *token,break ; }/* Consider this a field */ - field =pevent_find_any_field (event, token); + field =tep_find_any_field (event, token);if (!field) {/* If token is 'COMM' or 'CPU' then it is special */ if (strcmp (token,COMM ) ==0 ) {
tools/lib/traceevent/plugin_kmem.c +1 -1
@@ -31,7 +31,7 @@ static int call_site_handler(struct trace_seq *s, struct tep_record *record,void *data = record->data;const char *func; - field =pevent_find_field (event,"call_site" ); + field =tep_find_field (event,"call_site" );if (!field)return 1 ;
tools/lib/traceevent/plugin_mac80211.c +1 -1
@@ -28,7 +28,7 @@static void print_string (struct trace_seq *s,struct event_format *event,const char *name,const void *data) { -struct format_field *f =pevent_find_field (event, name); +struct format_field *f =tep_find_field (event, name);int offset;int length;
tools/lib/traceevent/plugin_sched_switch.c +3 -3
@@ -74,7 +74,7 @@ static int sched_wakeup_handler(struct trace_seq *s,if (pevent_get_field_val (s, event,"pid" , record, &val,1 ))return trace_seq_putc (s,'!' ); - field =pevent_find_any_field (event,"comm" ); + field =tep_find_any_field (event,"comm" );if (field) {write_and_save_comm (field, record, s, val);trace_seq_putc (s,':' );
@@ -103,7 +103,7 @@ static int sched_switch_handler(struct trace_seq *s,if (pevent_get_field_val (s, event,"prev_pid" , record, &val,1 ))return trace_seq_putc (s,'!' ); - field =pevent_find_any_field (event,"prev_comm" ); + field =tep_find_any_field (event,"prev_comm" );if (field) {write_and_save_comm (field, record, s, val);trace_seq_putc (s,':' );
@@ -121,7 +121,7 @@ static int sched_switch_handler(struct trace_seq *s,if (pevent_get_field_val (s, event,"next_pid" , record, &val,1 ))return trace_seq_putc (s,'!' ); - field =pevent_find_any_field (event,"next_comm" ); + field =tep_find_any_field (event,"next_comm" );if (field) {write_and_save_comm (field, record, s, val);trace_seq_putc (s,':' );
tools/perf/util/evsel.c +1 -1
@@ -2683,7 +2683,7 @@ int perf_event__synthesize_sample(union perf_event *event, u64 type,struct format_field *perf_evsel__field (struct perf_evsel *evsel,const char *name) { -return pevent_find_field (evsel->tp_format, name); +return tep_find_field (evsel->tp_format, name); } void *perf_evsel__rawptr(struct perf_evsel *evsel, struct perf_sample *sample,
tools/perf/util/header.c +1 -1
@@ -3218,7 +3218,7 @@ static int perf_evsel__prepare_tracepoint_event(struct perf_evsel *evsel,return -1 ; } - event =pevent_find_event (pevent, evsel->attr.config); + event =tep_find_event (pevent, evsel->attr.config);if (event ==NULL ) {pr_debug ("cannot find event format for %d\n" , (int )evsel->attr.config);return -1 ;
tools/perf/util/python.c +1 -1
@@ -394,7 +394,7 @@ get_tracepoint_field(struct pyrf_event *pevent, PyObject *attr_name) evsel->tp_format = tp_format; } - field =pevent_find_any_field (evsel->tp_format, str); + field =tep_find_any_field (evsel->tp_format, str);if (!field)return NULL ;
tools/perf/util/sort.c +2 -2
@@ -2311,7 +2311,7 @@ static int add_all_matching_fields(struct perf_evlist *evlist,if (evsel->attr.type !=PERF_TYPE_TRACEPOINT )continue ; - field =pevent_find_any_field (evsel->tp_format, field_name); + field =tep_find_any_field (evsel->tp_format, field_name);if (field ==NULL )continue ;
@@ -2378,7 +2378,7 @@ static int add_dynamic_entry(struct perf_evlist *evlist, const char *tok,if (!strcmp (field_name,"*" )) { ret =add_evsel_fields (evsel, raw_trace, level); }else { - field =pevent_find_any_field (evsel->tp_format, field_name); + field =tep_find_any_field (evsel->tp_format, field_name);if (field ==NULL ) {pr_debug ("Cannot find event field for %s.%s\n" , event_name, field_name);
tools/perf/util/trace-event-parse.c +2 -2
@@ -41,7 +41,7 @@ static int get_common_field(struct scripting_context *context,return 0 ; event = pevent->events[0 ]; - field =pevent_find_common_field (event, type); + field =tep_find_common_field (event, type);if (!field)return 0 ; *offset = field->offset;
@@ -99,7 +99,7 @@ raw_field_value(struct event_format *event, const char *name, void *data)struct format_field *field;unsigned long long val; - field =pevent_find_any_field (event, name); + field =tep_find_any_field (event, name);if (!field)return 0ULL ;
tools/perf/util/trace-event.c +1 -1
@@ -116,5 +116,5 @@ struct event_format *trace_event__tp_format_id(int id)if (!tevent_initialized &&trace_event__init2 ())return ERR_PTR (-ENOMEM ); -return pevent_find_event (tevent.pevent, id); +return tep_find_event (tevent.pevent, id); }
RFC PATCH v2 6/24 tools/lib/traceevent, tools/perf: Rename pevent parse APIs
In reply to Steven RostedtFrom: "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
APIs: pevent_parse_event, pevent_parse_format, pevent_parse_header_page
--- tools/lib/traceevent/event-parse.c | 22 +++++++++++----------- tools/lib/traceevent/event-parse.h | 18 +++++++++--------- tools/perf/util/trace-event-parse.c | 4 ++-- tools/perf/util/trace-event-read.c | 4 ++-- tools/perf/util/trace-event.c | 2 +- 5 files changed, 25 insertions(+), 25 deletions(-)
tools/lib/traceevent/event-parse.c +11 -11
@@ -5930,7 +5930,7 @@ static void parse_header_field(const char *field, }/** -* pevent_parse_header_page - parse the data stored in the header page +* tep_parse_header_page - parse the data stored in the header page * @pevent: the handle to the pevent * @buf: the buffer storing the header page format string * @size: the size of @buf
@@ -5941,8 +5941,8 @@ static void parse_header_field(const char *field,* * /sys/kernel/debug/tracing/events/header_page */ -int pevent_parse_header_page (struct tep_handle *pevent,char *buf,unsigned long size, -int long_size) +int tep_parse_header_page (struct tep_handle *pevent,char *buf,unsigned long size, +int long_size) {int ignore;
@@ -6171,7 +6171,7 @@ __pevent_parse_event(struct tep_handle *pevent, }/** -* pevent_parse_format - parse the event format +* tep_parse_format - parse the event format * @pevent: the handle to the pevent * @eventp: returned format * @buf: the buffer storing the event format string
@@ -6185,16 +6185,16 @@ __pevent_parse_event(struct tep_handle *pevent,* * /sys/kernel/debug/tracing/events/.../.../format */ -enum pevent_errno pevent_parse_format (struct tep_handle *pevent, -struct event_format **eventp, -const char *buf, -unsigned long size,const char *sys) +enum pevent_errno tep_parse_format (struct tep_handle *pevent, +struct event_format **eventp, +const char *buf, +unsigned long size,const char *sys) {return __pevent_parse_event (pevent, eventp, buf, size, sys); }/** -* pevent_parse_event - parse the event format +* tep_parse_event - parse the event format * @pevent: the handle to the pevent * @buf: the buffer storing the event format string * @size: the size of @buf
@@ -6207,8 +6207,8 @@ enum pevent_errno pevent_parse_format(struct tep_handle *pevent,* * /sys/kernel/debug/tracing/events/.../.../format */ -enum pevent_errno pevent_parse_event (struct tep_handle *pevent,const char *buf, -unsigned long size,const char *sys) +enum pevent_errno tep_parse_event (struct tep_handle *pevent,const char *buf, +unsigned long size,const char *sys) {struct event_format *event =NULL ;return __pevent_parse_event (pevent, &event, buf, size, sys);
tools/lib/traceevent/event-parse.h +9 -9
@@ -639,15 +639,15 @@ void pevent_print_event_data(struct tep_handle *pevent, struct trace_seq *s,void pevent_print_event (struct tep_handle *pevent,struct trace_seq *s,struct tep_record *record,bool use_trace_clock); -int pevent_parse_header_page (struct tep_handle *pevent,char *buf,unsigned long size, -int long_size); - -enum pevent_errno pevent_parse_event (struct tep_handle *pevent,const char *buf, -unsigned long size,const char *sys); -enum pevent_errno pevent_parse_format (struct tep_handle *pevent, -struct event_format **eventp, -const char *buf, -unsigned long size,const char *sys); +int tep_parse_header_page (struct tep_handle *pevent,char *buf,unsigned long size, +int long_size); + +enum pevent_errno tep_parse_event (struct tep_handle *pevent,const char *buf, +unsigned long size,const char *sys); +enum pevent_errno tep_parse_format (struct tep_handle *pevent, +struct event_format **eventp, +const char *buf, +unsigned long size,const char *sys);void pevent_free_format (struct event_format *event);void pevent_free_format_field (struct format_field *field);
tools/perf/util/trace-event-parse.c +2 -2
@@ -180,13 +180,13 @@ void parse_saved_cmdline(struct tep_handle *pevent,int parse_ftrace_file (struct tep_handle *pevent,char *buf,unsigned long size) { -return pevent_parse_event (pevent, buf, size,"ftrace" ); +return tep_parse_event (pevent, buf, size,"ftrace" ); }int parse_event_file (struct tep_handle *pevent,char *buf,unsigned long size,char *sys) { -return pevent_parse_event (pevent, buf, size, sys); +return tep_parse_event (pevent, buf, size, sys); } struct event_format *trace_find_next_event(struct tep_handle *pevent,
tools/perf/util/trace-event-read.c +2 -2
@@ -235,8 +235,8 @@ static int read_header_files(struct tep_handle *pevent)return -1 ; } -if (!pevent_parse_header_page (pevent, header_page, size, -pevent_get_long_size (pevent))) { +if (!tep_parse_header_page (pevent, header_page, size, +pevent_get_long_size (pevent))) {/* * The commit field in the page is of type long, * use that instead, since it represents the kernel.
tools/perf/util/trace-event.c +1 -1
@@ -93,7 +93,7 @@ tp_format(const char *sys, const char *name)if (err)return ERR_PTR (err); -pevent_parse_format (pevent, &event, data, size, sys); +tep_parse_format (pevent, &event, data, size, sys);free (data);return event;
Signature · 1 line
2.18.0
tip-bot for Tzvetomir Stoyanov (VMware)
merge bot[tip:perf/urgent] tools lib traceevent, perf tools: Rename pevent parse APIs
tools lib traceevent, perf tools: Rename pevent parse APIs
Commit-ID: c60167c187f9255e698998887bfbbba6418861b5 Gitweb: https://git.kernel.org/tip/c60167c187f9255e698998887bfbbba6418861b5 Author: Tzvetomir Stoyanov (VMware) <[email protected]> AuthorDate: Wed, 8 Aug 2018 14:02:51 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Mon, 13 Aug 2018 15:21:57 -0300
tools lib traceevent, perf tools: Rename pevent parse APIs
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
APIs: pevent_parse_event, pevent_parse_format, pevent_parse_header_page
--- tools/lib/traceevent/event-parse.c | 22 +++++++++++----------- tools/lib/traceevent/event-parse.h | 18 +++++++++--------- tools/perf/util/trace-event-parse.c | 4 ++-- tools/perf/util/trace-event-read.c | 4 ++-- tools/perf/util/trace-event.c | 2 +- 5 files changed, 25 insertions(+), 25 deletions(-)
tools/lib/traceevent/event-parse.c +11 -11
@@ -5930,7 +5930,7 @@ static void parse_header_field(const char *field, }/** -* pevent_parse_header_page - parse the data stored in the header page +* tep_parse_header_page - parse the data stored in the header page * @pevent: the handle to the pevent * @buf: the buffer storing the header page format string * @size: the size of @buf
@@ -5941,8 +5941,8 @@ static void parse_header_field(const char *field,* * /sys/kernel/debug/tracing/events/header_page */ -int pevent_parse_header_page (struct tep_handle *pevent,char *buf,unsigned long size, -int long_size) +int tep_parse_header_page (struct tep_handle *pevent,char *buf,unsigned long size, +int long_size) {int ignore;
@@ -6171,7 +6171,7 @@ event_add_failed: }/** -* pevent_parse_format - parse the event format +* tep_parse_format - parse the event format * @pevent: the handle to the pevent * @eventp: returned format * @buf: the buffer storing the event format string
@@ -6185,16 +6185,16 @@ event_add_failed:* * /sys/kernel/debug/tracing/events/.../.../format */ -enum pevent_errno pevent_parse_format (struct tep_handle *pevent, -struct event_format **eventp, -const char *buf, -unsigned long size,const char *sys) +enum pevent_errno tep_parse_format (struct tep_handle *pevent, +struct event_format **eventp, +const char *buf, +unsigned long size,const char *sys) {return __pevent_parse_event (pevent, eventp, buf, size, sys); }/** -* pevent_parse_event - parse the event format +* tep_parse_event - parse the event format * @pevent: the handle to the pevent * @buf: the buffer storing the event format string * @size: the size of @buf
@@ -6207,8 +6207,8 @@ enum pevent_errno pevent_parse_format(struct tep_handle *pevent,* * /sys/kernel/debug/tracing/events/.../.../format */ -enum pevent_errno pevent_parse_event (struct tep_handle *pevent,const char *buf, -unsigned long size,const char *sys) +enum pevent_errno tep_parse_event (struct tep_handle *pevent,const char *buf, +unsigned long size,const char *sys) {struct event_format *event =NULL ;return __pevent_parse_event (pevent, &event, buf, size, sys);
tools/lib/traceevent/event-parse.h +9 -9
@@ -639,15 +639,15 @@ void pevent_print_event_data(struct tep_handle *pevent, struct trace_seq *s,void pevent_print_event (struct tep_handle *pevent,struct trace_seq *s,struct tep_record *record,bool use_trace_clock); -int pevent_parse_header_page (struct tep_handle *pevent,char *buf,unsigned long size, -int long_size); - -enum pevent_errno pevent_parse_event (struct tep_handle *pevent,const char *buf, -unsigned long size,const char *sys); -enum pevent_errno pevent_parse_format (struct tep_handle *pevent, -struct event_format **eventp, -const char *buf, -unsigned long size,const char *sys); +int tep_parse_header_page (struct tep_handle *pevent,char *buf,unsigned long size, +int long_size); + +enum pevent_errno tep_parse_event (struct tep_handle *pevent,const char *buf, +unsigned long size,const char *sys); +enum pevent_errno tep_parse_format (struct tep_handle *pevent, +struct event_format **eventp, +const char *buf, +unsigned long size,const char *sys);void pevent_free_format (struct event_format *event);void pevent_free_format_field (struct format_field *field);
tools/perf/util/trace-event-parse.c +2 -2
@@ -180,13 +180,13 @@ void parse_saved_cmdline(struct tep_handle *pevent,int parse_ftrace_file (struct tep_handle *pevent,char *buf,unsigned long size) { -return pevent_parse_event (pevent, buf, size,"ftrace" ); +return tep_parse_event (pevent, buf, size,"ftrace" ); }int parse_event_file (struct tep_handle *pevent,char *buf,unsigned long size,char *sys) { -return pevent_parse_event (pevent, buf, size, sys); +return tep_parse_event (pevent, buf, size, sys); } struct event_format *trace_find_next_event(struct tep_handle *pevent,
tools/perf/util/trace-event-read.c +2 -2
@@ -235,8 +235,8 @@ static int read_header_files(struct tep_handle *pevent)return -1 ; } -if (!pevent_parse_header_page (pevent, header_page, size, -pevent_get_long_size (pevent))) { +if (!tep_parse_header_page (pevent, header_page, size, +pevent_get_long_size (pevent))) {/* * The commit field in the page is of type long, * use that instead, since it represents the kernel.
tools/perf/util/trace-event.c +1 -1
@@ -93,7 +93,7 @@ tp_format(const char *sys, const char *name)if (err)return ERR_PTR (err); -pevent_parse_format (pevent, &event, data, size, sys); +tep_parse_format (pevent, &event, data, size, sys);free (data);return event;
RFC PATCH v2 7/24 tools/lib/traceevent, tools/perf: Rename pevent print APIs
In reply to Steven RostedtFrom: "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
APIs: pevent_print_field, pevent_print_fields, pevent_print_funcs, pevent_print_printk
--- tools/lib/traceevent/event-parse.c | 74 +++++++++++++------------- tools/lib/traceevent/event-parse.h | 44 +++++++-------- tools/lib/traceevent/plugin_hrtimer.c | 28 +++++----- tools/lib/traceevent/plugin_kvm.c | 16 +++--- tools/lib/traceevent/plugin_mac80211.c | 6 +-- tools/perf/util/sort.c | 6 +-- tools/perf/util/trace-event-read.c | 4 +- 7 files changed, 89 insertions(+), 89 deletions(-)
tools/lib/traceevent/event-parse.c +37 -37
@@ -589,12 +589,12 @@ int pevent_register_function(struct tep_handle *pevent, char *func, }/** -* pevent_print_funcs - print out the stored functions +* tep_print_funcs - print out the stored functions * @pevent: handle for the pevent * * This prints out the stored functions. */ -void pevent_print_funcs (struct tep_handle *pevent) +void tep_print_funcs (struct tep_handle *pevent) {int i;
@@ -732,12 +732,12 @@ int pevent_register_print_string(struct tep_handle *pevent, const char *fmt, }/** -* pevent_print_printk - print out the stored strings +* tep_print_printk - print out the stored strings * @pevent: handle for the pevent * * This prints the string formats that were stored. */ -void pevent_print_printk (struct tep_handle *pevent) +void tep_print_printk (struct tep_handle *pevent) {int i;
@@ -4800,8 +4800,8 @@ static int is_printable_array(char *p, unsigned int len)return 1 ; } -void pevent_print_field (struct trace_seq *s,void *data, -struct format_field *field) +void tep_print_field (struct trace_seq *s,void *data, +struct format_field *field) {unsigned long long val;unsigned int offset, len, i;
@@ -4865,15 +4865,15 @@ void pevent_print_field(struct trace_seq *s, void *data, } } -void pevent_print_fields (struct trace_seq *s,void *data, -int size__maybe_unused ,struct event_format *event) +void tep_print_fields (struct trace_seq *s,void *data, +int size__maybe_unused ,struct event_format *event) {struct format_field *field; field = event->format.fields;while (field) {trace_seq_printf (s," %s=" , field->name); -pevent_print_field (s, data, field); +tep_print_field (s, data, field); field = field->next; } }
@@ -4899,7 +4899,7 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct eventif (event->flags &EVENT_FL_FAILED ) {trace_seq_printf (s,"[FAILED TO PARSE]" ); -pevent_print_fields (s, data, size, event); +tep_print_fields (s, data, size, event);return ; }
@@ -5405,7 +5405,7 @@ void tep_event_info(struct trace_seq *s, struct event_format *event,int print_pretty =1 ;if (event->pevent->print_raw || (event->flags &EVENT_FL_PRINTRAW )) -pevent_print_fields (s, record->data, record->size, event); +tep_print_fields (s, record->data, record->size, event);else {if (event->handler && !(event->flags &EVENT_FL_NOHANDLE ))
@@ -5456,7 +5456,7 @@ pevent_find_event_by_record(struct tep_handle *pevent, struct tep_record *record }/** -* pevent_print_event_task - Write the event task comm, pid and CPU +* tep_print_event_task - Write the event task comm, pid and CPU * @pevent: a handle to the pevent * @s: the trace_seq to write to * @event: the handle to the record's event
@@ -5464,9 +5464,9 @@ pevent_find_event_by_record(struct tep_handle *pevent, struct tep_record *record* * Writes the tasks comm, pid and CPU to @s. */ -void pevent_print_event_task (struct tep_handle *pevent,struct trace_seq *s, -struct event_format *event, -struct tep_record *record) +void tep_print_event_task (struct tep_handle *pevent,struct trace_seq *s, +struct event_format *event, +struct tep_record *record) {void *data = record->data;const char *comm;
@@ -5483,7 +5483,7 @@ void pevent_print_event_task(struct tep_handle *pevent, struct trace_seq *s, }/** -* pevent_print_event_time - Write the event timestamp +* tep_print_event_time - Write the event timestamp * @pevent: a handle to the pevent * @s: the trace_seq to write to * @event: the handle to the record's event
@@ -5492,10 +5492,10 @@ void pevent_print_event_task(struct tep_handle *pevent, struct trace_seq *s,* * Writes the timestamp of the record into @s. */ -void pevent_print_event_time (struct tep_handle *pevent,struct trace_seq *s, -struct event_format *event, -struct tep_record *record, -bool use_trace_clock) +void tep_print_event_time (struct tep_handle *pevent,struct trace_seq *s, +struct event_format *event, +struct tep_record *record, +bool use_trace_clock) {unsigned long secs;unsigned long usecs;
@@ -5534,7 +5534,7 @@ void pevent_print_event_time(struct tep_handle *pevent, struct trace_seq *s, }/** -* pevent_print_event_data - Write the event data section +* tep_print_event_data - Write the event data section * @pevent: a handle to the pevent * @s: the trace_seq to write to * @event: the handle to the record's event
@@ -5542,9 +5542,9 @@ void pevent_print_event_time(struct tep_handle *pevent, struct trace_seq *s,* * Writes the parsing of the record's data to @s. */ -void pevent_print_event_data (struct tep_handle *pevent,struct trace_seq *s, -struct event_format *event, -struct tep_record *record) +void tep_print_event_data (struct tep_handle *pevent,struct trace_seq *s, +struct event_format *event, +struct tep_record *record) {static const char *spaces =" " ;/* 20 spaces */ int len;
@@ -5559,8 +5559,8 @@ void pevent_print_event_data(struct tep_handle *pevent, struct trace_seq *s,tep_event_info (s, event, record); } -void pevent_print_event (struct tep_handle *pevent,struct trace_seq *s, -struct tep_record *record,bool use_trace_clock) +void tep_print_event (struct tep_handle *pevent,struct trace_seq *s, +struct tep_record *record,bool use_trace_clock) {struct event_format *event;
@@ -5577,9 +5577,9 @@ void pevent_print_event(struct tep_handle *pevent, struct trace_seq *s,return ; } -pevent_print_event_task (pevent, s, event, record); -pevent_print_event_time (pevent, s, event, record, use_trace_clock); -pevent_print_event_data (pevent, s, event, record); +tep_print_event_task (pevent, s, event, record); +tep_print_event_time (pevent, s, event, record, use_trace_clock); +tep_print_event_data (pevent, s, event, record); }static int events_id_cmp (const void *a,const void *b)
@@ -6388,7 +6388,7 @@ int pevent_get_any_field_val(struct trace_seq *s, struct event_format *event, }/** -* pevent_print_num_field - print a field and a format +* tep_print_num_field - print a field and a format * @s: The seq to print to * @fmt: The printf format to print the field with. * @event: the event that the field is for
@@ -6398,9 +6398,9 @@ int pevent_get_any_field_val(struct trace_seq *s, struct event_format *event,* * Returns: 0 on success, -1 field not found, or 1 if buffer is full. */ -int pevent_print_num_field (struct trace_seq *s,const char *fmt, -struct event_format *event,const char *name, -struct tep_record *record,int err) +int tep_print_num_field (struct trace_seq *s,const char *fmt, +struct event_format *event,const char *name, +struct tep_record *record,int err) {struct format_field *field =tep_find_field (event, name);unsigned long long val;
@@ -6420,7 +6420,7 @@ int pevent_print_num_field(struct trace_seq *s, const char *fmt, }/** -* pevent_print_func_field - print a field and a format for function pointers +* tep_print_func_field - print a field and a format for function pointers * @s: The seq to print to * @fmt: The printf format to print the field with. * @event: the event that the field is for
@@ -6430,9 +6430,9 @@ int pevent_print_num_field(struct trace_seq *s, const char *fmt,* * Returns: 0 on success, -1 field not found, or 1 if buffer is full. */ -int pevent_print_func_field (struct trace_seq *s,const char *fmt, -struct event_format *event,const char *name, -struct tep_record *record,int err) +int tep_print_func_field (struct trace_seq *s,const char *fmt, +struct event_format *event,const char *name, +struct tep_record *record,int err) {struct format_field *field =tep_find_field (event, name);struct tep_handle *pevent = event->pevent;
tools/lib/traceevent/event-parse.h +22 -22
71 lines not on this page · raw message
tools/lib/traceevent/plugin_hrtimer.c +14 -14
@@ -30,16 +30,16 @@ static int timer_expire_handler(struct trace_seq *s, {trace_seq_printf (s,"hrtimer=" ); -if (pevent_print_num_field (s,"0x%llx" , event,"timer" , - record,0 ) ==-1 ) -pevent_print_num_field (s,"0x%llx" , event,"hrtimer" , - record,1 ); +if (tep_print_num_field (s,"0x%llx" , event,"timer" , + record,0 ) ==-1 ) +tep_print_num_field (s,"0x%llx" , event,"hrtimer" , + record,1 );trace_seq_printf (s," now=" ); -pevent_print_num_field (s,"%llu" , event,"now" , record,1 ); +tep_print_num_field (s,"%llu" , event,"now" , record,1 ); -pevent_print_func_field (s," function=%s" , event,"function" , +tep_print_func_field (s," function=%s" , event,"function" , record,0 );return 0 ; }
@@ -50,19 +50,19 @@ static int timer_start_handler(struct trace_seq *s, {trace_seq_printf (s,"hrtimer=" ); -if (pevent_print_num_field (s,"0x%llx" , event,"timer" , - record,0 ) ==-1 ) -pevent_print_num_field (s,"0x%llx" , event,"hrtimer" , - record,1 ); +if (tep_print_num_field (s,"0x%llx" , event,"timer" , + record,0 ) ==-1 ) +tep_print_num_field (s,"0x%llx" , event,"hrtimer" , + record,1 ); -pevent_print_func_field (s," function=%s" , event,"function" , - record,0 ); +tep_print_func_field (s," function=%s" , event,"function" , + record,0 );trace_seq_printf (s," expires=" ); -pevent_print_num_field (s,"%llu" , event,"expires" , record,1 ); +tep_print_num_field (s,"%llu" , event,"expires" , record,1 );trace_seq_printf (s," softexpires=" ); -pevent_print_num_field (s,"%llu" , event,"softexpires" , record,1 ); +tep_print_num_field (s,"%llu" , event,"softexpires" , record,1 );return 0 ; }
tools/lib/traceevent/plugin_kvm.c +8 -8
@@ -276,7 +276,7 @@ static int kvm_exit_handler(struct trace_seq *s, struct tep_record *record,if (print_exit_reason (s, record, event,"exit_reason" ) <0 )return -1 ; -pevent_print_num_field (s," rip 0x%lx" , event,"guest_rip" , record,1 ); +tep_print_num_field (s," rip 0x%lx" , event,"guest_rip" , record,1 );if (pevent_get_field_val (s, event,"info1" , record, &info1,0 ) >=0 &&pevent_get_field_val (s, event,"info2" , record, &info2,0 ) >=0 )
@@ -336,10 +336,10 @@ static int kvm_nested_vmexit_inject_handler(struct trace_seq *s, struct tep_recoif (print_exit_reason (s, record, event,"exit_code" ) <0 )return -1 ; -pevent_print_num_field (s," info1 %llx" , event,"exit_info1" , record,1 ); -pevent_print_num_field (s," info2 %llx" , event,"exit_info2" , record,1 ); -pevent_print_num_field (s," int_info %llx" , event,"exit_int_info" , record,1 ); -pevent_print_num_field (s," int_info_err %llx" , event,"exit_int_info_err" , record,1 ); +tep_print_num_field (s," info1 %llx" , event,"exit_info1" , record,1 ); +tep_print_num_field (s," info2 %llx" , event,"exit_info2" , record,1 ); +tep_print_num_field (s," int_info %llx" , event,"exit_int_info" , record,1 ); +tep_print_num_field (s," int_info_err %llx" , event,"exit_int_info_err" , record,1 );return 0 ; }
@@ -347,7 +347,7 @@ static int kvm_nested_vmexit_inject_handler(struct trace_seq *s, struct tep_recostatic int kvm_nested_vmexit_handler (struct trace_seq *s,struct tep_record *record,struct event_format *event,void *context) { -pevent_print_num_field (s,"rip %llx " , event,"rip" , record,1 ); +tep_print_num_field (s,"rip %llx " , event,"rip" , record,1 );return kvm_nested_vmexit_inject_handler (s, record, event, context); }
@@ -406,8 +406,8 @@ static int kvm_mmu_print_role(struct trace_seq *s, struct tep_record *record, }else trace_seq_printf (s,"WORD: %08x" , role.word); -pevent_print_num_field (s," root %u " , event, -"root_count" , record,1 ); +tep_print_num_field (s," root %u " , event, +"root_count" , record,1 );if (pevent_get_field_val (s, event,"unsync" , record, &val,1 ) <0 )return -1 ;
tools/lib/traceevent/plugin_mac80211.c +3 -3
@@ -53,8 +53,8 @@ static void print_string(struct trace_seq *s, struct event_format *event,trace_seq_printf (s,"%.*s" , length, (char *)data + offset); } -#define SF (fn) pevent_print_num_field(s, fn ":%d", event, fn, record, 0) -#define SFX (fn) pevent_print_num_field(s, fn ":%#x", event, fn, record, 0) +#define SF (fn) tep_print_num_field(s, fn ":%d", event, fn, record, 0) +#define SFX (fn) tep_print_num_field(s, fn ":%#x", event, fn, record, 0)#define SP () trace_seq_putc(s, ' ') static int drv_bss_info_changed(struct trace_seq *s,
@@ -66,7 +66,7 @@ static int drv_bss_info_changed(struct trace_seq *s,print_string (s, event,"wiphy_name" , data);trace_seq_printf (s," vif:" );print_string (s, event,"vif_name" , data); -pevent_print_num_field (s,"(%d)" , event,"vif_type" , record,1 ); +tep_print_num_field (s,"(%d)" , event,"vif_type" , record,1 );trace_seq_printf (s,"\n%*s" ,INDENT ,"" );SF ("assoc" );SP ();
tools/perf/util/sort.c +3 -3
@@ -610,8 +610,8 @@ static char *get_trace_output(struct hist_entry *he)trace_seq_init (&seq);if (symbol_conf.raw_trace) { -pevent_print_fields (&seq, he->raw_data, he->raw_size, - evsel->tp_format); +tep_print_fields (&seq, he->raw_data, he->raw_size, + evsel->tp_format); }else {tep_event_info (&seq, evsel->tp_format, &rec); }
@@ -2047,7 +2047,7 @@ static int __sort__hde_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp,struct trace_seq seq; raw_field:trace_seq_init (&seq); -pevent_print_field (&seq, he->raw_data, hde->field); +tep_print_field (&seq, he->raw_data, hde->field); str = seq.buffer; }
tools/perf/util/trace-event-read.c +2 -2
@@ -479,9 +479,9 @@ ssize_t trace_report(int fd, struct trace_event *tevent, bool __repipe) repipe = false;if (show_funcs) { -pevent_print_funcs (pevent); +tep_print_funcs (pevent); }else if (show_printk) { -pevent_print_printk (pevent); +tep_print_printk (pevent); } pevent =NULL ;
Signature · 1 line
2.18.0
tip-bot for Tzvetomir Stoyanov (VMware)
merge bot[tip:perf/urgent] tools lib traceevent, perf tools: Rename pevent print APIs
tools lib traceevent, perf tools: Rename pevent print APIs
Commit-ID: 6a48dc298ee1a4d87403086002b25c6821a1abc5 Gitweb: https://git.kernel.org/tip/6a48dc298ee1a4d87403086002b25c6821a1abc5 Author: Tzvetomir Stoyanov (VMware) <[email protected]> AuthorDate: Wed, 8 Aug 2018 14:02:52 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Mon, 13 Aug 2018 15:22:01 -0300
tools lib traceevent, perf tools: Rename pevent print APIs
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
APIs: pevent_print_field, pevent_print_fields, pevent_print_funcs, pevent_print_printk
--- tools/lib/traceevent/event-parse.c | 74 +++++++++++++++++----------------- tools/lib/traceevent/event-parse.h | 44 ++++++++++---------- tools/lib/traceevent/plugin_hrtimer.c | 28 ++++++------- tools/lib/traceevent/plugin_kvm.c | 16 ++++---- tools/lib/traceevent/plugin_mac80211.c | 6 +-- tools/perf/util/sort.c | 6 +-- tools/perf/util/trace-event-read.c | 4 +- 7 files changed, 89 insertions(+), 89 deletions(-)
tools/lib/traceevent/event-parse.c +37 -37
@@ -589,12 +589,12 @@ out_free: }/** -* pevent_print_funcs - print out the stored functions +* tep_print_funcs - print out the stored functions * @pevent: handle for the pevent * * This prints out the stored functions. */ -void pevent_print_funcs (struct tep_handle *pevent) +void tep_print_funcs (struct tep_handle *pevent) {int i;
@@ -732,12 +732,12 @@ out_free: }/** -* pevent_print_printk - print out the stored strings +* tep_print_printk - print out the stored strings * @pevent: handle for the pevent * * This prints the string formats that were stored. */ -void pevent_print_printk (struct tep_handle *pevent) +void tep_print_printk (struct tep_handle *pevent) {int i;
@@ -4800,8 +4800,8 @@ static int is_printable_array(char *p, unsigned int len)return 1 ; } -void pevent_print_field (struct trace_seq *s,void *data, -struct format_field *field) +void tep_print_field (struct trace_seq *s,void *data, +struct format_field *field) {unsigned long long val;unsigned int offset, len, i;
@@ -4865,15 +4865,15 @@ void pevent_print_field(struct trace_seq *s, void *data, } } -void pevent_print_fields (struct trace_seq *s,void *data, -int size__maybe_unused ,struct event_format *event) +void tep_print_fields (struct trace_seq *s,void *data, +int size__maybe_unused ,struct event_format *event) {struct format_field *field; field = event->format.fields;while (field) {trace_seq_printf (s," %s=" , field->name); -pevent_print_field (s, data, field); +tep_print_field (s, data, field); field = field->next; } }
@@ -4899,7 +4899,7 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct eventif (event->flags &EVENT_FL_FAILED ) {trace_seq_printf (s,"[FAILED TO PARSE]" ); -pevent_print_fields (s, data, size, event); +tep_print_fields (s, data, size, event);return ; }
@@ -5405,7 +5405,7 @@ void tep_event_info(struct trace_seq *s, struct event_format *event,int print_pretty =1 ;if (event->pevent->print_raw || (event->flags &EVENT_FL_PRINTRAW )) -pevent_print_fields (s, record->data, record->size, event); +tep_print_fields (s, record->data, record->size, event);else {if (event->handler && !(event->flags &EVENT_FL_NOHANDLE ))
@@ -5456,7 +5456,7 @@ pevent_find_event_by_record(struct tep_handle *pevent, struct tep_record *record }/** -* pevent_print_event_task - Write the event task comm, pid and CPU +* tep_print_event_task - Write the event task comm, pid and CPU * @pevent: a handle to the pevent * @s: the trace_seq to write to * @event: the handle to the record's event
@@ -5464,9 +5464,9 @@ pevent_find_event_by_record(struct tep_handle *pevent, struct tep_record *record* * Writes the tasks comm, pid and CPU to @s. */ -void pevent_print_event_task (struct tep_handle *pevent,struct trace_seq *s, -struct event_format *event, -struct tep_record *record) +void tep_print_event_task (struct tep_handle *pevent,struct trace_seq *s, +struct event_format *event, +struct tep_record *record) {void *data = record->data;const char *comm;
@@ -5483,7 +5483,7 @@ void pevent_print_event_task(struct tep_handle *pevent, struct trace_seq *s, }/** -* pevent_print_event_time - Write the event timestamp +* tep_print_event_time - Write the event timestamp * @pevent: a handle to the pevent * @s: the trace_seq to write to * @event: the handle to the record's event
@@ -5492,10 +5492,10 @@ void pevent_print_event_task(struct tep_handle *pevent, struct trace_seq *s,* * Writes the timestamp of the record into @s. */ -void pevent_print_event_time (struct tep_handle *pevent,struct trace_seq *s, -struct event_format *event, -struct tep_record *record, -bool use_trace_clock) +void tep_print_event_time (struct tep_handle *pevent,struct trace_seq *s, +struct event_format *event, +struct tep_record *record, +bool use_trace_clock) {unsigned long secs;unsigned long usecs;
@@ -5534,7 +5534,7 @@ void pevent_print_event_time(struct tep_handle *pevent, struct trace_seq *s, }/** -* pevent_print_event_data - Write the event data section +* tep_print_event_data - Write the event data section * @pevent: a handle to the pevent * @s: the trace_seq to write to * @event: the handle to the record's event
@@ -5542,9 +5542,9 @@ void pevent_print_event_time(struct tep_handle *pevent, struct trace_seq *s,* * Writes the parsing of the record's data to @s. */ -void pevent_print_event_data (struct tep_handle *pevent,struct trace_seq *s, -struct event_format *event, -struct tep_record *record) +void tep_print_event_data (struct tep_handle *pevent,struct trace_seq *s, +struct event_format *event, +struct tep_record *record) {static const char *spaces =" " ;/* 20 spaces */ int len;
@@ -5559,8 +5559,8 @@ void pevent_print_event_data(struct tep_handle *pevent, struct trace_seq *s,tep_event_info (s, event, record); } -void pevent_print_event (struct tep_handle *pevent,struct trace_seq *s, -struct tep_record *record,bool use_trace_clock) +void tep_print_event (struct tep_handle *pevent,struct trace_seq *s, +struct tep_record *record,bool use_trace_clock) {struct event_format *event;
@@ -5577,9 +5577,9 @@ void pevent_print_event(struct tep_handle *pevent, struct trace_seq *s,return ; } -pevent_print_event_task (pevent, s, event, record); -pevent_print_event_time (pevent, s, event, record, use_trace_clock); -pevent_print_event_data (pevent, s, event, record); +tep_print_event_task (pevent, s, event, record); +tep_print_event_time (pevent, s, event, record, use_trace_clock); +tep_print_event_data (pevent, s, event, record); }static int events_id_cmp (const void *a,const void *b)
@@ -6388,7 +6388,7 @@ int pevent_get_any_field_val(struct trace_seq *s, struct event_format *event, }/** -* pevent_print_num_field - print a field and a format +* tep_print_num_field - print a field and a format * @s: The seq to print to * @fmt: The printf format to print the field with. * @event: the event that the field is for
@@ -6398,9 +6398,9 @@ int pevent_get_any_field_val(struct trace_seq *s, struct event_format *event,* * Returns: 0 on success, -1 field not found, or 1 if buffer is full. */ -int pevent_print_num_field (struct trace_seq *s,const char *fmt, -struct event_format *event,const char *name, -struct tep_record *record,int err) +int tep_print_num_field (struct trace_seq *s,const char *fmt, +struct event_format *event,const char *name, +struct tep_record *record,int err) {struct format_field *field =tep_find_field (event, name);unsigned long long val;
@@ -6420,7 +6420,7 @@ int pevent_print_num_field(struct trace_seq *s, const char *fmt, }/** -* pevent_print_func_field - print a field and a format for function pointers +* tep_print_func_field - print a field and a format for function pointers * @s: The seq to print to * @fmt: The printf format to print the field with. * @event: the event that the field is for
@@ -6430,9 +6430,9 @@ int pevent_print_num_field(struct trace_seq *s, const char *fmt,* * Returns: 0 on success, -1 field not found, or 1 if buffer is full. */ -int pevent_print_func_field (struct trace_seq *s,const char *fmt, -struct event_format *event,const char *name, -struct tep_record *record,int err) +int tep_print_func_field (struct trace_seq *s,const char *fmt, +struct event_format *event,const char *name, +struct tep_record *record,int err) {struct format_field *field =tep_find_field (event, name);struct tep_handle *pevent = event->pevent;
tools/lib/traceevent/event-parse.h +22 -22
71 lines not on this page · raw message
tools/lib/traceevent/plugin_hrtimer.c +14 -14
@@ -30,16 +30,16 @@ static int timer_expire_handler(struct trace_seq *s, {trace_seq_printf (s,"hrtimer=" ); -if (pevent_print_num_field (s,"0x%llx" , event,"timer" , - record,0 ) ==-1 ) -pevent_print_num_field (s,"0x%llx" , event,"hrtimer" , - record,1 ); +if (tep_print_num_field (s,"0x%llx" , event,"timer" , + record,0 ) ==-1 ) +tep_print_num_field (s,"0x%llx" , event,"hrtimer" , + record,1 );trace_seq_printf (s," now=" ); -pevent_print_num_field (s,"%llu" , event,"now" , record,1 ); +tep_print_num_field (s,"%llu" , event,"now" , record,1 ); -pevent_print_func_field (s," function=%s" , event,"function" , +tep_print_func_field (s," function=%s" , event,"function" , record,0 );return 0 ; }
@@ -50,19 +50,19 @@ static int timer_start_handler(struct trace_seq *s, {trace_seq_printf (s,"hrtimer=" ); -if (pevent_print_num_field (s,"0x%llx" , event,"timer" , - record,0 ) ==-1 ) -pevent_print_num_field (s,"0x%llx" , event,"hrtimer" , - record,1 ); +if (tep_print_num_field (s,"0x%llx" , event,"timer" , + record,0 ) ==-1 ) +tep_print_num_field (s,"0x%llx" , event,"hrtimer" , + record,1 ); -pevent_print_func_field (s," function=%s" , event,"function" , - record,0 ); +tep_print_func_field (s," function=%s" , event,"function" , + record,0 );trace_seq_printf (s," expires=" ); -pevent_print_num_field (s,"%llu" , event,"expires" , record,1 ); +tep_print_num_field (s,"%llu" , event,"expires" , record,1 );trace_seq_printf (s," softexpires=" ); -pevent_print_num_field (s,"%llu" , event,"softexpires" , record,1 ); +tep_print_num_field (s,"%llu" , event,"softexpires" , record,1 );return 0 ; }
tools/lib/traceevent/plugin_kvm.c +8 -8
@@ -276,7 +276,7 @@ static int kvm_exit_handler(struct trace_seq *s, struct tep_record *record,if (print_exit_reason (s, record, event,"exit_reason" ) <0 )return -1 ; -pevent_print_num_field (s," rip 0x%lx" , event,"guest_rip" , record,1 ); +tep_print_num_field (s," rip 0x%lx" , event,"guest_rip" , record,1 );if (pevent_get_field_val (s, event,"info1" , record, &info1,0 ) >=0 &&pevent_get_field_val (s, event,"info2" , record, &info2,0 ) >=0 )
@@ -336,10 +336,10 @@ static int kvm_nested_vmexit_inject_handler(struct trace_seq *s, struct tep_recoif (print_exit_reason (s, record, event,"exit_code" ) <0 )return -1 ; -pevent_print_num_field (s," info1 %llx" , event,"exit_info1" , record,1 ); -pevent_print_num_field (s," info2 %llx" , event,"exit_info2" , record,1 ); -pevent_print_num_field (s," int_info %llx" , event,"exit_int_info" , record,1 ); -pevent_print_num_field (s," int_info_err %llx" , event,"exit_int_info_err" , record,1 ); +tep_print_num_field (s," info1 %llx" , event,"exit_info1" , record,1 ); +tep_print_num_field (s," info2 %llx" , event,"exit_info2" , record,1 ); +tep_print_num_field (s," int_info %llx" , event,"exit_int_info" , record,1 ); +tep_print_num_field (s," int_info_err %llx" , event,"exit_int_info_err" , record,1 );return 0 ; }
@@ -347,7 +347,7 @@ static int kvm_nested_vmexit_inject_handler(struct trace_seq *s, struct tep_recostatic int kvm_nested_vmexit_handler (struct trace_seq *s,struct tep_record *record,struct event_format *event,void *context) { -pevent_print_num_field (s,"rip %llx " , event,"rip" , record,1 ); +tep_print_num_field (s,"rip %llx " , event,"rip" , record,1 );return kvm_nested_vmexit_inject_handler (s, record, event, context); }
@@ -406,8 +406,8 @@ static int kvm_mmu_print_role(struct trace_seq *s, struct tep_record *record, }else trace_seq_printf (s,"WORD: %08x" , role.word); -pevent_print_num_field (s," root %u " , event, -"root_count" , record,1 ); +tep_print_num_field (s," root %u " , event, +"root_count" , record,1 );if (pevent_get_field_val (s, event,"unsync" , record, &val,1 ) <0 )return -1 ;
tools/lib/traceevent/plugin_mac80211.c +3 -3
@@ -53,8 +53,8 @@ static void print_string(struct trace_seq *s, struct event_format *event,trace_seq_printf (s,"%.*s" , length, (char *)data + offset); } -#define SF (fn) pevent_print_num_field(s, fn ":%d", event, fn, record, 0) -#define SFX (fn) pevent_print_num_field(s, fn ":%#x", event, fn, record, 0) +#define SF (fn) tep_print_num_field(s, fn ":%d", event, fn, record, 0) +#define SFX (fn) tep_print_num_field(s, fn ":%#x", event, fn, record, 0)#define SP () trace_seq_putc(s, ' ') static int drv_bss_info_changed(struct trace_seq *s,
@@ -66,7 +66,7 @@ static int drv_bss_info_changed(struct trace_seq *s,print_string (s, event,"wiphy_name" , data);trace_seq_printf (s," vif:" );print_string (s, event,"vif_name" , data); -pevent_print_num_field (s,"(%d)" , event,"vif_type" , record,1 ); +tep_print_num_field (s,"(%d)" , event,"vif_type" , record,1 );trace_seq_printf (s,"\n%*s" ,INDENT ,"" );SF ("assoc" );SP ();
tools/perf/util/sort.c +3 -3
@@ -610,8 +610,8 @@ static char *get_trace_output(struct hist_entry *he)trace_seq_init (&seq);if (symbol_conf.raw_trace) { -pevent_print_fields (&seq, he->raw_data, he->raw_size, - evsel->tp_format); +tep_print_fields (&seq, he->raw_data, he->raw_size, + evsel->tp_format); }else {tep_event_info (&seq, evsel->tp_format, &rec); }
@@ -2047,7 +2047,7 @@ static int __sort__hde_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp,struct trace_seq seq; raw_field:trace_seq_init (&seq); -pevent_print_field (&seq, he->raw_data, hde->field); +tep_print_field (&seq, he->raw_data, hde->field); str = seq.buffer; }
tools/perf/util/trace-event-read.c +2 -2
@@ -479,9 +479,9 @@ ssize_t trace_report(int fd, struct trace_event *tevent, bool __repipe) repipe = false;if (show_funcs) { -pevent_print_funcs (pevent); +tep_print_funcs (pevent); }else if (show_printk) { -pevent_print_printk (pevent); +tep_print_printk (pevent); } pevent =NULL ;
RFC PATCH v2 8/24 tools/lib/traceevent, tools/perf: Rename pevent_read_number_* APIs
In reply to Steven RostedtFrom: "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
APIs: pevent_read_number, pevent_read_number_field
--- tools/lib/traceevent/event-parse.c | 68 +++++++++---------- tools/lib/traceevent/event-parse.h | 6 +- tools/lib/traceevent/parse-filter.c | 2 +- tools/lib/traceevent/plugin_kmem.c | 2 +- tools/lib/traceevent/plugin_mac80211.c | 2 +- tools/perf/util/data-convert-bt.c | 6 +- tools/perf/util/python.c | 6 +- .../scripting-engines/trace-event-python.c | 4 +- tools/perf/util/sort.c | 2 +- tools/perf/util/trace-event-parse.c | 6 +- 10 files changed, 52 insertions(+), 52 deletions(-)
tools/lib/traceevent/event-parse.c +34 -34
@@ -3329,7 +3329,7 @@ tep_find_any_field(struct event_format *event, const char *name) }/** -* pevent_read_number - read a number from data +* tep_read_number - read a number from data * @pevent: handle for the pevent * @ptr: the raw data * @size: the size of the data that holds the number
@@ -3337,8 +3337,8 @@ tep_find_any_field(struct event_format *event, const char *name)* Returns the number (converted to host) from the * raw data. */ -unsigned long long pevent_read_number (struct tep_handle *pevent, -const void *ptr,int size) +unsigned long long tep_read_number (struct tep_handle *pevent, +const void *ptr,int size) {switch (size) {case 1 :
@@ -3356,7 +3356,7 @@ unsigned long long pevent_read_number(struct tep_handle *pevent, }/** -* pevent_read_number_field - read a number from data +* tep_read_number_field - read a number from data * @field: a handle to the field * @data: the raw data to read * @value: the value to place the number in
@@ -3366,8 +3366,8 @@ unsigned long long pevent_read_number(struct tep_handle *pevent,* * Returns 0 on success, -1 otherwise. */ -int pevent_read_number_field (struct format_field *field,const void *data, -unsigned long long *value) +int tep_read_number_field (struct format_field *field,const void *data, +unsigned long long *value) {if (!field)return -1 ;
@@ -3376,8 +3376,8 @@ int pevent_read_number_field(struct format_field *field, const void *data,case 2 :case 4 :case 8 : - *value =pevent_read_number (field->event->pevent, - data + field->offset, field->size); + *value =tep_read_number (field->event->pevent, + data + field->offset, field->size);return 0 ;default :return -1 ;
@@ -3420,7 +3420,7 @@ static int __parse_common(struct tep_handle *pevent, void *data,if (ret <0 )return ret; } -return pevent_read_number (pevent, data + *offset, *size); +return tep_read_number (pevent, data + *offset, *size); }static int trace_parse_common_type (struct tep_handle *pevent,void *data)
@@ -3559,8 +3559,8 @@ eval_num_arg(void *data, int size, struct event_format *event, struct print_arg }/* must be a number */ - val =pevent_read_number (pevent, data + arg->field.field->offset, - arg->field.field->size); + val =tep_read_number (pevent, data + arg->field.field->offset, + arg->field.field->size);break ;case PRINT_FLAGS :case PRINT_SYMBOL :
@@ -3603,7 +3603,7 @@ eval_num_arg(void *data, int size, struct event_format *event, struct print_argswitch (larg->type) {case PRINT_DYNAMIC_ARRAY : - offset =pevent_read_number (pevent, + offset =tep_read_number (pevent, data + larg->dynarray.field->offset, larg->dynarray.field->size);if (larg->dynarray.field->elementsize)
@@ -3632,8 +3632,8 @@ eval_num_arg(void *data, int size, struct event_format *event, struct print_argdefault : goto default_op;/* oops, all bets off */ } - val =pevent_read_number (pevent, - data + offset, field_size); + val =tep_read_number (pevent, + data + offset, field_size);if (typearg) val =eval_type (val, typearg,1 );break ;
@@ -3733,9 +3733,9 @@ eval_num_arg(void *data, int size, struct event_format *event, struct print_arg }break ;case PRINT_DYNAMIC_ARRAY_LEN : - offset =pevent_read_number (pevent, - data + arg->dynarray.field->offset, - arg->dynarray.field->size); + offset =tep_read_number (pevent, + data + arg->dynarray.field->offset, + arg->dynarray.field->size);/* * The total allocated length of the dynamic array is * stored in the top half of the field, and the offset
@@ -3745,9 +3745,9 @@ eval_num_arg(void *data, int size, struct event_format *event, struct print_argbreak ;case PRINT_DYNAMIC_ARRAY :/* Without [], we pass the address to the dynamic data */ - offset =pevent_read_number (pevent, - data + arg->dynarray.field->offset, - arg->dynarray.field->size); + offset =tep_read_number (pevent, + data + arg->dynarray.field->offset, + arg->dynarray.field->size);/* * The total allocated length of the dynamic array is * stored in the top half of the field, and the offset
@@ -3992,7 +3992,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,case PRINT_HEX_STR :if (arg->hex.field->type ==PRINT_DYNAMIC_ARRAY ) {unsigned long offset; - offset =pevent_read_number (pevent, + offset =tep_read_number (pevent, data + arg->hex.field->dynarray.field->offset, arg->hex.field->dynarray.field->size); hex = data + (offset &0xffff );
@@ -4023,9 +4023,9 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,unsigned long offset;struct format_field *field = arg->int_array.field->dynarray.field; - offset =pevent_read_number (pevent, - data + field->offset, - field->size); + offset =tep_read_number (pevent, + data + field->offset, + field->size); num = data + (offset &0xffff ); }else { field = arg->int_array.field->field.field;
@@ -4253,7 +4253,7 @@ static struct print_arg *make_bprint_args(char *fmt, void *data, int size, struc pevent->bprint_ip_field = ip_field; } - ip =pevent_read_number (pevent, data + ip_field->offset, ip_field->size); + ip =tep_read_number (pevent, data + ip_field->offset, ip_field->size);/* * The first arg is the IP pointer.
@@ -4347,7 +4347,7 @@ static struct print_arg *make_bprint_args(char *fmt, void *data, int size, struc/* the pointers are always 4 bytes aligned */ bptr = (void *)(((unsigned long )bptr +3 ) & ~3 ); - val =pevent_read_number (pevent, bptr, vsize); + val =tep_read_number (pevent, bptr, vsize); bptr += vsize; arg =alloc_arg ();if (!arg) {
@@ -4421,7 +4421,7 @@ get_bprint_format(void *data, int size __maybe_unused, pevent->bprint_fmt_field = field; } - addr =pevent_read_number (pevent, data + field->offset, field->size); + addr =tep_read_number (pevent, data + field->offset, field->size); printk =find_printk (pevent, addr);if (!printk) {
@@ -4811,7 +4811,7 @@ void tep_print_field(struct trace_seq *s, void *data, offset = field->offset; len = field->size;if (field->flags &FIELD_IS_DYNAMIC ) { - val =pevent_read_number (pevent, data + offset, len); + val =tep_read_number (pevent, data + offset, len); offset = val; len = offset >>16 ; offset &=0xffff ;
@@ -4831,8 +4831,8 @@ void tep_print_field(struct trace_seq *s, void *data, field->flags &= ~FIELD_IS_STRING ; } }else { - val =pevent_read_number (pevent, data + field->offset, - field->size); + val =tep_read_number (pevent, data + field->offset, + field->size);if (field->flags &FIELD_IS_POINTER ) {trace_seq_printf (s,"0x%llx" , val); }else if (field->flags &FIELD_IS_SIGNED ) {
@@ -6253,7 +6253,7 @@ int get_field_val(struct trace_seq *s, struct format_field *field,return -1 ; } -if (pevent_read_number_field (field, record->data, val)) { +if (tep_read_number_field (field, record->data, val)) {if (err)trace_seq_printf (s," %s=INVALID" , name);return -1 ;
@@ -6302,7 +6302,7 @@ void *pevent_get_field_raw(struct trace_seq *s, struct event_format *event, offset = field->offset;if (field->flags &FIELD_IS_DYNAMIC ) { - offset =pevent_read_number (event->pevent, + offset =tep_read_number (event->pevent, data + offset, field->size); *len = offset >>16 ; offset &=0xffff ;
@@ -6408,7 +6408,7 @@ int tep_print_num_field(struct trace_seq *s, const char *fmt,if (!field) goto failed; -if (pevent_read_number_field (field, record->data, &val)) +if (tep_read_number_field (field, record->data, &val)) goto failed;return trace_seq_printf (s, fmt, val);
@@ -6443,7 +6443,7 @@ int tep_print_func_field(struct trace_seq *s, const char *fmt,if (!field) goto failed; -if (pevent_read_number_field (field, record->data, &val)) +if (tep_read_number_field (field, record->data, &val)) goto failed; func =find_func (pevent, val);
tools/lib/traceevent/event-parse.h +3 -3
@@ -693,9 +693,9 @@ struct format_field *tep_find_any_field(struct event_format *event, const char *const char *pevent_find_function (struct tep_handle *pevent,unsigned long long addr);unsigned long long pevent_find_function_address (struct tep_handle *pevent,unsigned long long addr); -unsigned long long pevent_read_number (struct tep_handle *pevent,const void *ptr,int size); -int pevent_read_number_field (struct format_field *field,const void *data, -unsigned long long *value); +unsigned long long tep_read_number (struct tep_handle *pevent,const void *ptr,int size); +int tep_read_number_field (struct format_field *field,const void *data, +unsigned long long *value);struct event_format *tep_find_event (struct tep_handle *pevent,int id);
tools/lib/traceevent/parse-filter.c +1 -1
@@ -1728,7 +1728,7 @@ get_value(struct event_format *event,if (field == &cpu)return record->cpu; -pevent_read_number_field (field, record->data, &val); +tep_read_number_field (field, record->data, &val);if (!(field->flags &FIELD_IS_SIGNED ))return val;
tools/lib/traceevent/plugin_kmem.c +1 -1
@@ -35,7 +35,7 @@ static int call_site_handler(struct trace_seq *s, struct tep_record *record,if (!field)return 1 ; -if (pevent_read_number_field (field, data, &val)) +if (tep_read_number_field (field, data, &val))return 1 ; func =pevent_find_function (event->pevent, val);
tools/lib/traceevent/plugin_mac80211.c +1 -1
@@ -42,7 +42,7 @@ static void print_string(struct trace_seq *s, struct event_format *event,if (!strncmp (f->type,"__data_loc" ,10 )) {unsigned long long v; -if (pevent_read_number_field (f, data, &v)) { +if (tep_read_number_field (f, data, &v)) {trace_seq_printf (s,"invalid_data_loc" );return ; }
tools/perf/util/data-convert-bt.c +3 -3
@@ -310,8 +310,8 @@ static int add_tracepoint_field_value(struct ctf_writer *cw,if (flags &FIELD_IS_DYNAMIC ) {unsigned long long tmp_val; - tmp_val =pevent_read_number (fmtf->event->pevent, - data + offset, len); + tmp_val =tep_read_number (fmtf->event->pevent, + data + offset, len); offset = tmp_val; len = offset >>16 ; offset &=0xffff ;
@@ -353,7 +353,7 @@ static int add_tracepoint_field_value(struct ctf_writer *cw,else {unsigned long long value_int; - value_int =pevent_read_number ( + value_int =tep_read_number ( fmtf->event->pevent, data + offset + i * len, len);
tools/perf/util/python.c +3 -3
@@ -351,7 +351,7 @@ tracepoint_field(struct pyrf_event *pe, struct format_field *field) offset = field->offset; len = field->size;if (field->flags &FIELD_IS_DYNAMIC ) { - val =pevent_read_number (pevent, data + offset, len); + val =tep_read_number (pevent, data + offset, len); offset = val; len = offset >>16 ; offset &=0xffff ;
@@ -364,8 +364,8 @@ tracepoint_field(struct pyrf_event *pe, struct format_field *field) field->flags &= ~FIELD_IS_STRING ; } }else { - val =pevent_read_number (pevent, data + field->offset, - field->size); + val =tep_read_number (pevent, data + field->offset, + field->size);if (field->flags &FIELD_IS_POINTER ) ret =PyLong_FromUnsignedLong ((unsigned long ) val);else if (field->flags &FIELD_IS_SIGNED )
tools/perf/util/scripting-engines/trace-event-python.c +2 -2
@@ -871,8 +871,8 @@ static void python_process_tracepoint(struct perf_sample *sample, offset = field->offset; len = field->size;if (field->flags &FIELD_IS_DYNAMIC ) { - val =pevent_read_number (scripting_context->pevent, - data + offset, len); + val =tep_read_number (scripting_context->pevent, + data + offset, len); offset = val; len = offset >>16 ; offset &=0xffff ;
tools/perf/util/sort.c +1 -1
@@ -2074,7 +2074,7 @@ static int64_t __sort__hde_cmp(struct perf_hpp_fmt *fmt,if (field->flags &FIELD_IS_DYNAMIC ) {unsigned long long dyn; -pevent_read_number_field (field, a->raw_data, &dyn); +tep_read_number_field (field, a->raw_data, &dyn); offset = dyn &0xffff ; size = (dyn >>16 ) &0xffff ;
tools/perf/util/trace-event-parse.c +3 -3
@@ -48,7 +48,7 @@ static int get_common_field(struct scripting_context *context, *size = field->size; } -return pevent_read_number (pevent, context->event_data + *offset, *size); +return tep_read_number (pevent, context->event_data + *offset, *size); }int common_lock_depth (struct scripting_context *context)
@@ -103,14 +103,14 @@ raw_field_value(struct event_format *event, const char *name, void *data)if (!field)return 0ULL ; -pevent_read_number_field (field, data, &val); +tep_read_number_field (field, data, &val);return val; }unsigned long long read_size (struct event_format *event,void *ptr,int size) { -return pevent_read_number (event->pevent, ptr, size); +return tep_read_number (event->pevent, ptr, size); } void event_format__fprintf(struct event_format *event,
Signature · 1 line
2.18.0
tip-bot for Tzvetomir Stoyanov (VMware)
merge bot[tip:perf/urgent] tools lib traceevent, perf tools: Rename pevent_read_number_* APIs
tools lib traceevent, perf tools: Rename pevent_read_number_* APIs
Commit-ID: 59c1baee25e2b34f8e26a923ea229b3e00cab55a Gitweb: https://git.kernel.org/tip/59c1baee25e2b34f8e26a923ea229b3e00cab55a Author: Tzvetomir Stoyanov (VMware) <[email protected]> AuthorDate: Wed, 8 Aug 2018 14:02:53 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Mon, 13 Aug 2018 15:22:05 -0300
tools lib traceevent, perf tools: Rename pevent_read_number_* APIs
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
APIs: pevent_read_number, pevent_read_number_field
--- tools/lib/traceevent/event-parse.c | 68 +++++++++++----------- tools/lib/traceevent/event-parse.h | 6 +- tools/lib/traceevent/parse-filter.c | 2 +- tools/lib/traceevent/plugin_kmem.c | 2 +- tools/lib/traceevent/plugin_mac80211.c | 2 +- tools/perf/util/data-convert-bt.c | 6 +- tools/perf/util/python.c | 6 +- .../util/scripting-engines/trace-event-python.c | 4 +- tools/perf/util/sort.c | 2 +- tools/perf/util/trace-event-parse.c | 6 +- 10 files changed, 52 insertions(+), 52 deletions(-)
tools/lib/traceevent/event-parse.c +34 -34
@@ -3329,7 +3329,7 @@ tep_find_any_field(struct event_format *event, const char *name) }/** -* pevent_read_number - read a number from data +* tep_read_number - read a number from data * @pevent: handle for the pevent * @ptr: the raw data * @size: the size of the data that holds the number
@@ -3337,8 +3337,8 @@ tep_find_any_field(struct event_format *event, const char *name)* Returns the number (converted to host) from the * raw data. */ -unsigned long long pevent_read_number (struct tep_handle *pevent, -const void *ptr,int size) +unsigned long long tep_read_number (struct tep_handle *pevent, +const void *ptr,int size) {switch (size) {case 1 :
@@ -3356,7 +3356,7 @@ unsigned long long pevent_read_number(struct tep_handle *pevent, }/** -* pevent_read_number_field - read a number from data +* tep_read_number_field - read a number from data * @field: a handle to the field * @data: the raw data to read * @value: the value to place the number in
@@ -3366,8 +3366,8 @@ unsigned long long pevent_read_number(struct tep_handle *pevent,* * Returns 0 on success, -1 otherwise. */ -int pevent_read_number_field (struct format_field *field,const void *data, -unsigned long long *value) +int tep_read_number_field (struct format_field *field,const void *data, +unsigned long long *value) {if (!field)return -1 ;
@@ -3376,8 +3376,8 @@ int pevent_read_number_field(struct format_field *field, const void *data,case 2 :case 4 :case 8 : - *value =pevent_read_number (field->event->pevent, - data + field->offset, field->size); + *value =tep_read_number (field->event->pevent, + data + field->offset, field->size);return 0 ;default :return -1 ;
@@ -3420,7 +3420,7 @@ static int __parse_common(struct tep_handle *pevent, void *data,if (ret <0 )return ret; } -return pevent_read_number (pevent, data + *offset, *size); +return tep_read_number (pevent, data + *offset, *size); }static int trace_parse_common_type (struct tep_handle *pevent,void *data)
@@ -3559,8 +3559,8 @@ eval_num_arg(void *data, int size, struct event_format *event, struct print_arg }/* must be a number */ - val =pevent_read_number (pevent, data + arg->field.field->offset, - arg->field.field->size); + val =tep_read_number (pevent, data + arg->field.field->offset, + arg->field.field->size);break ;case PRINT_FLAGS :case PRINT_SYMBOL :
@@ -3603,7 +3603,7 @@ eval_num_arg(void *data, int size, struct event_format *event, struct print_argswitch (larg->type) {case PRINT_DYNAMIC_ARRAY : - offset =pevent_read_number (pevent, + offset =tep_read_number (pevent, data + larg->dynarray.field->offset, larg->dynarray.field->size);if (larg->dynarray.field->elementsize)
@@ -3632,8 +3632,8 @@ eval_num_arg(void *data, int size, struct event_format *event, struct print_argdefault : goto default_op;/* oops, all bets off */ } - val =pevent_read_number (pevent, - data + offset, field_size); + val =tep_read_number (pevent, + data + offset, field_size);if (typearg) val =eval_type (val, typearg,1 );break ;
@@ -3733,9 +3733,9 @@ eval_num_arg(void *data, int size, struct event_format *event, struct print_arg }break ;case PRINT_DYNAMIC_ARRAY_LEN : - offset =pevent_read_number (pevent, - data + arg->dynarray.field->offset, - arg->dynarray.field->size); + offset =tep_read_number (pevent, + data + arg->dynarray.field->offset, + arg->dynarray.field->size);/* * The total allocated length of the dynamic array is * stored in the top half of the field, and the offset
@@ -3745,9 +3745,9 @@ eval_num_arg(void *data, int size, struct event_format *event, struct print_argbreak ;case PRINT_DYNAMIC_ARRAY :/* Without [], we pass the address to the dynamic data */ - offset =pevent_read_number (pevent, - data + arg->dynarray.field->offset, - arg->dynarray.field->size); + offset =tep_read_number (pevent, + data + arg->dynarray.field->offset, + arg->dynarray.field->size);/* * The total allocated length of the dynamic array is * stored in the top half of the field, and the offset
@@ -3992,7 +3992,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,case PRINT_HEX_STR :if (arg->hex.field->type ==PRINT_DYNAMIC_ARRAY ) {unsigned long offset; - offset =pevent_read_number (pevent, + offset =tep_read_number (pevent, data + arg->hex.field->dynarray.field->offset, arg->hex.field->dynarray.field->size); hex = data + (offset &0xffff );
@@ -4023,9 +4023,9 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,unsigned long offset;struct format_field *field = arg->int_array.field->dynarray.field; - offset =pevent_read_number (pevent, - data + field->offset, - field->size); + offset =tep_read_number (pevent, + data + field->offset, + field->size); num = data + (offset &0xffff ); }else { field = arg->int_array.field->field.field;
@@ -4253,7 +4253,7 @@ static struct print_arg *make_bprint_args(char *fmt, void *data, int size, struc pevent->bprint_ip_field = ip_field; } - ip =pevent_read_number (pevent, data + ip_field->offset, ip_field->size); + ip =tep_read_number (pevent, data + ip_field->offset, ip_field->size);/* * The first arg is the IP pointer.
@@ -4347,7 +4347,7 @@ static struct print_arg *make_bprint_args(char *fmt, void *data, int size, struc/* the pointers are always 4 bytes aligned */ bptr = (void *)(((unsigned long )bptr +3 ) & ~3 ); - val =pevent_read_number (pevent, bptr, vsize); + val =tep_read_number (pevent, bptr, vsize); bptr += vsize; arg =alloc_arg ();if (!arg) {
@@ -4421,7 +4421,7 @@ get_bprint_format(void *data, int size __maybe_unused, pevent->bprint_fmt_field = field; } - addr =pevent_read_number (pevent, data + field->offset, field->size); + addr =tep_read_number (pevent, data + field->offset, field->size); printk =find_printk (pevent, addr);if (!printk) {
@@ -4811,7 +4811,7 @@ void tep_print_field(struct trace_seq *s, void *data, offset = field->offset; len = field->size;if (field->flags &FIELD_IS_DYNAMIC ) { - val =pevent_read_number (pevent, data + offset, len); + val =tep_read_number (pevent, data + offset, len); offset = val; len = offset >>16 ; offset &=0xffff ;
@@ -4831,8 +4831,8 @@ void tep_print_field(struct trace_seq *s, void *data, field->flags &= ~FIELD_IS_STRING ; } }else { - val =pevent_read_number (pevent, data + field->offset, - field->size); + val =tep_read_number (pevent, data + field->offset, + field->size);if (field->flags &FIELD_IS_POINTER ) {trace_seq_printf (s,"0x%llx" , val); }else if (field->flags &FIELD_IS_SIGNED ) {
@@ -6253,7 +6253,7 @@ int get_field_val(struct trace_seq *s, struct format_field *field,return -1 ; } -if (pevent_read_number_field (field, record->data, val)) { +if (tep_read_number_field (field, record->data, val)) {if (err)trace_seq_printf (s," %s=INVALID" , name);return -1 ;
@@ -6302,7 +6302,7 @@ void *pevent_get_field_raw(struct trace_seq *s, struct event_format *event, offset = field->offset;if (field->flags &FIELD_IS_DYNAMIC ) { - offset =pevent_read_number (event->pevent, + offset =tep_read_number (event->pevent, data + offset, field->size); *len = offset >>16 ; offset &=0xffff ;
@@ -6408,7 +6408,7 @@ int tep_print_num_field(struct trace_seq *s, const char *fmt,if (!field) goto failed; -if (pevent_read_number_field (field, record->data, &val)) +if (tep_read_number_field (field, record->data, &val)) goto failed;return trace_seq_printf (s, fmt, val);
@@ -6443,7 +6443,7 @@ int tep_print_func_field(struct trace_seq *s, const char *fmt,if (!field) goto failed; -if (pevent_read_number_field (field, record->data, &val)) +if (tep_read_number_field (field, record->data, &val)) goto failed; func =find_func (pevent, val);
tools/lib/traceevent/event-parse.h +3 -3
@@ -693,9 +693,9 @@ struct format_field *tep_find_any_field(struct event_format *event, const char *const char *pevent_find_function (struct tep_handle *pevent,unsigned long long addr);unsigned long long pevent_find_function_address (struct tep_handle *pevent,unsigned long long addr); -unsigned long long pevent_read_number (struct tep_handle *pevent,const void *ptr,int size); -int pevent_read_number_field (struct format_field *field,const void *data, -unsigned long long *value); +unsigned long long tep_read_number (struct tep_handle *pevent,const void *ptr,int size); +int tep_read_number_field (struct format_field *field,const void *data, +unsigned long long *value);struct event_format *tep_find_event (struct tep_handle *pevent,int id);
tools/lib/traceevent/parse-filter.c +1 -1
@@ -1728,7 +1728,7 @@ get_value(struct event_format *event,if (field == &cpu)return record->cpu; -pevent_read_number_field (field, record->data, &val); +tep_read_number_field (field, record->data, &val);if (!(field->flags &FIELD_IS_SIGNED ))return val;
tools/lib/traceevent/plugin_kmem.c +1 -1
@@ -35,7 +35,7 @@ static int call_site_handler(struct trace_seq *s, struct tep_record *record,if (!field)return 1 ; -if (pevent_read_number_field (field, data, &val)) +if (tep_read_number_field (field, data, &val))return 1 ; func =pevent_find_function (event->pevent, val);
tools/lib/traceevent/plugin_mac80211.c +1 -1
@@ -42,7 +42,7 @@ static void print_string(struct trace_seq *s, struct event_format *event,if (!strncmp (f->type,"__data_loc" ,10 )) {unsigned long long v; -if (pevent_read_number_field (f, data, &v)) { +if (tep_read_number_field (f, data, &v)) {trace_seq_printf (s,"invalid_data_loc" );return ; }
tools/perf/util/data-convert-bt.c +3 -3
@@ -310,8 +310,8 @@ static int add_tracepoint_field_value(struct ctf_writer *cw,if (flags &FIELD_IS_DYNAMIC ) {unsigned long long tmp_val; - tmp_val =pevent_read_number (fmtf->event->pevent, - data + offset, len); + tmp_val =tep_read_number (fmtf->event->pevent, + data + offset, len); offset = tmp_val; len = offset >>16 ; offset &=0xffff ;
@@ -353,7 +353,7 @@ static int add_tracepoint_field_value(struct ctf_writer *cw,else {unsigned long long value_int; - value_int =pevent_read_number ( + value_int =tep_read_number ( fmtf->event->pevent, data + offset + i * len, len);
tools/perf/util/python.c +3 -3
@@ -351,7 +351,7 @@ tracepoint_field(struct pyrf_event *pe, struct format_field *field) offset = field->offset; len = field->size;if (field->flags &FIELD_IS_DYNAMIC ) { - val =pevent_read_number (pevent, data + offset, len); + val =tep_read_number (pevent, data + offset, len); offset = val; len = offset >>16 ; offset &=0xffff ;
@@ -364,8 +364,8 @@ tracepoint_field(struct pyrf_event *pe, struct format_field *field) field->flags &= ~FIELD_IS_STRING ; } }else { - val =pevent_read_number (pevent, data + field->offset, - field->size); + val =tep_read_number (pevent, data + field->offset, + field->size);if (field->flags &FIELD_IS_POINTER ) ret =PyLong_FromUnsignedLong ((unsigned long ) val);else if (field->flags &FIELD_IS_SIGNED )
tools/perf/util/scripting-engines/trace-event-python.c +2 -2
@@ -871,8 +871,8 @@ static void python_process_tracepoint(struct perf_sample *sample, offset = field->offset; len = field->size;if (field->flags &FIELD_IS_DYNAMIC ) { - val =pevent_read_number (scripting_context->pevent, - data + offset, len); + val =tep_read_number (scripting_context->pevent, + data + offset, len); offset = val; len = offset >>16 ; offset &=0xffff ;
tools/perf/util/sort.c +1 -1
@@ -2074,7 +2074,7 @@ static int64_t __sort__hde_cmp(struct perf_hpp_fmt *fmt,if (field->flags &FIELD_IS_DYNAMIC ) {unsigned long long dyn; -pevent_read_number_field (field, a->raw_data, &dyn); +tep_read_number_field (field, a->raw_data, &dyn); offset = dyn &0xffff ; size = (dyn >>16 ) &0xffff ;
tools/perf/util/trace-event-parse.c +3 -3
@@ -48,7 +48,7 @@ static int get_common_field(struct scripting_context *context, *size = field->size; } -return pevent_read_number (pevent, context->event_data + *offset, *size); +return tep_read_number (pevent, context->event_data + *offset, *size); }int common_lock_depth (struct scripting_context *context)
@@ -103,14 +103,14 @@ raw_field_value(struct event_format *event, const char *name, void *data)if (!field)return 0ULL ; -pevent_read_number_field (field, data, &val); +tep_read_number_field (field, data, &val);return val; }unsigned long long read_size (struct event_format *event,void *ptr,int size) { -return pevent_read_number (event->pevent, ptr, size); +return tep_read_number (event->pevent, ptr, size); } void event_format__fprintf(struct event_format *event,
RFC PATCH v2 9/24 tools/lib/traceevent, tools/perf: Rename pevent_register_* APIs
In reply to Steven RostedtFrom: "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
APIs: pevent_register_comm, pevent_register_print_string
--- tools/lib/traceevent/event-parse.c | 10 +++++----- tools/lib/traceevent/event-parse.h | 6 +++--- tools/lib/traceevent/plugin_sched_switch.c | 2 +- tools/perf/util/trace-event-parse.c | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-)
tools/lib/traceevent/event-parse.c +5 -5
@@ -288,7 +288,7 @@ static int add_new_comm(struct tep_handle *pevent, const char *comm, int pid) }/** -* pevent_register_comm - register a pid / comm mapping +* tep_register_comm - register a pid / comm mapping * @pevent: handle for the pevent * @comm: the command line to register * @pid: the pid to map the command line to
@@ -296,7 +296,7 @@ static int add_new_comm(struct tep_handle *pevent, const char *comm, int pid)* This adds a mapping to search for command line names with * a given pid. The comm is duplicated. */ -int pevent_register_comm (struct tep_handle *pevent,const char *comm,int pid) +int tep_register_comm (struct tep_handle *pevent,const char *comm,int pid) {struct cmdline_list *item;
@@ -685,7 +685,7 @@ find_printk(struct tep_handle *pevent, unsigned long long addr) }/** -* pevent_register_print_string - register a string by its address +* tep_register_print_string - register a string by its address * @pevent: handle for the pevent * @fmt: the string format to register * @addr: the address the string was located at
@@ -693,8 +693,8 @@ find_printk(struct tep_handle *pevent, unsigned long long addr)* This registers a string by the address it was stored in the kernel. * The @fmt passed in is duplicated. */ -int pevent_register_print_string (struct tep_handle *pevent,const char *fmt, -unsigned long long addr) +int tep_register_print_string (struct tep_handle *pevent,const char *fmt, +unsigned long long addr) {struct printk_list *item =malloc (sizeof (*item));char *p;
tools/lib/traceevent/event-parse.h +3 -3
@@ -618,12 +618,12 @@ enum trace_flag_type {int pevent_set_function_resolver (struct tep_handle *pevent,tep_func_resolver_t *func,void *priv);void pevent_reset_function_resolver (struct tep_handle *pevent); -int pevent_register_comm (struct tep_handle *pevent,const char *comm,int pid); +int tep_register_comm (struct tep_handle *pevent,const char *comm,int pid);int pevent_register_trace_clock (struct tep_handle *pevent,const char *trace_clock);int pevent_register_function (struct tep_handle *pevent,char *name,unsigned long long addr,char *mod); -int pevent_register_print_string (struct tep_handle *pevent,const char *fmt, -unsigned long long addr); +int tep_register_print_string (struct tep_handle *pevent,const char *fmt, +unsigned long long addr);int pevent_pid_is_registered (struct tep_handle *pevent,int pid); void tep_print_event_task(struct tep_handle *pevent, struct trace_seq *s,
tools/lib/traceevent/plugin_sched_switch.c +1 -1
@@ -61,7 +61,7 @@ static void write_and_save_comm(struct format_field *field, comm = &s->buffer[len];/* Help out the comm to ids. This will handle dups */ -pevent_register_comm (field->event->pevent, comm, pid); +tep_register_comm (field->event->pevent, comm, pid); } static int sched_wakeup_handler(struct trace_seq *s,
tools/perf/util/trace-event-parse.c +2 -2
@@ -157,7 +157,7 @@ void parse_ftrace_printk(struct tep_handle *pevent,/* fmt still has a space, skip it */ printk =strdup (fmt+1 ); line =strtok_r (NULL ,"\n" , &next); -pevent_register_print_string (pevent, printk, addr); +tep_register_print_string (pevent, printk, addr); } }
@@ -172,7 +172,7 @@ void parse_saved_cmdline(struct tep_handle *pevent, line =strtok_r (file,"\n" , &next);while (line) {sscanf (line,"%d %ms" , &pid, &comm); -pevent_register_comm (pevent, comm, pid); +tep_register_comm (pevent, comm, pid);free (comm); line =strtok_r (NULL ,"\n" , &next); }
Signature · 1 line
2.18.0
tip-bot for Tzvetomir Stoyanov (VMware)
merge bot[tip:perf/urgent] tools lib traceevent, perf tools: Rename pevent_register_* APIs
tools lib traceevent, perf tools: Rename pevent_register_* APIs
Commit-ID: 13a418904ee19e7a9892619cc93b025b31d08134 Gitweb: https://git.kernel.org/tip/13a418904ee19e7a9892619cc93b025b31d08134 Author: Tzvetomir Stoyanov (VMware) <[email protected]> AuthorDate: Wed, 8 Aug 2018 14:02:54 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Mon, 13 Aug 2018 15:22:08 -0300
tools lib traceevent, perf tools: Rename pevent_register_* APIs
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
APIs: pevent_register_comm, pevent_register_print_string
--- tools/lib/traceevent/event-parse.c | 10 +++++----- tools/lib/traceevent/event-parse.h | 6 +++--- tools/lib/traceevent/plugin_sched_switch.c | 2 +- tools/perf/util/trace-event-parse.c | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-)
tools/lib/traceevent/event-parse.c +5 -5
@@ -288,7 +288,7 @@ static int add_new_comm(struct tep_handle *pevent, const char *comm, int pid) }/** -* pevent_register_comm - register a pid / comm mapping +* tep_register_comm - register a pid / comm mapping * @pevent: handle for the pevent * @comm: the command line to register * @pid: the pid to map the command line to
@@ -296,7 +296,7 @@ static int add_new_comm(struct tep_handle *pevent, const char *comm, int pid)* This adds a mapping to search for command line names with * a given pid. The comm is duplicated. */ -int pevent_register_comm (struct tep_handle *pevent,const char *comm,int pid) +int tep_register_comm (struct tep_handle *pevent,const char *comm,int pid) {struct cmdline_list *item;
@@ -685,7 +685,7 @@ find_printk(struct tep_handle *pevent, unsigned long long addr) }/** -* pevent_register_print_string - register a string by its address +* tep_register_print_string - register a string by its address * @pevent: handle for the pevent * @fmt: the string format to register * @addr: the address the string was located at
@@ -693,8 +693,8 @@ find_printk(struct tep_handle *pevent, unsigned long long addr)* This registers a string by the address it was stored in the kernel. * The @fmt passed in is duplicated. */ -int pevent_register_print_string (struct tep_handle *pevent,const char *fmt, -unsigned long long addr) +int tep_register_print_string (struct tep_handle *pevent,const char *fmt, +unsigned long long addr) {struct printk_list *item =malloc (sizeof (*item));char *p;
tools/lib/traceevent/event-parse.h +3 -3
@@ -618,12 +618,12 @@ enum trace_flag_type {int pevent_set_function_resolver (struct tep_handle *pevent,tep_func_resolver_t *func,void *priv);void pevent_reset_function_resolver (struct tep_handle *pevent); -int pevent_register_comm (struct tep_handle *pevent,const char *comm,int pid); +int tep_register_comm (struct tep_handle *pevent,const char *comm,int pid);int pevent_register_trace_clock (struct tep_handle *pevent,const char *trace_clock);int pevent_register_function (struct tep_handle *pevent,char *name,unsigned long long addr,char *mod); -int pevent_register_print_string (struct tep_handle *pevent,const char *fmt, -unsigned long long addr); +int tep_register_print_string (struct tep_handle *pevent,const char *fmt, +unsigned long long addr);int pevent_pid_is_registered (struct tep_handle *pevent,int pid); void tep_print_event_task(struct tep_handle *pevent, struct trace_seq *s,
tools/lib/traceevent/plugin_sched_switch.c +1 -1
@@ -61,7 +61,7 @@ static void write_and_save_comm(struct format_field *field, comm = &s->buffer[len];/* Help out the comm to ids. This will handle dups */ -pevent_register_comm (field->event->pevent, comm, pid); +tep_register_comm (field->event->pevent, comm, pid); } static int sched_wakeup_handler(struct trace_seq *s,
tools/perf/util/trace-event-parse.c +2 -2
@@ -157,7 +157,7 @@ void parse_ftrace_printk(struct tep_handle *pevent,/* fmt still has a space, skip it */ printk =strdup (fmt+1 ); line =strtok_r (NULL ,"\n" , &next); -pevent_register_print_string (pevent, printk, addr); +tep_register_print_string (pevent, printk, addr); } }
@@ -172,7 +172,7 @@ void parse_saved_cmdline(struct tep_handle *pevent, line =strtok_r (file,"\n" , &next);while (line) {sscanf (line,"%d %ms" , &pid, &comm); -pevent_register_comm (pevent, comm, pid); +tep_register_comm (pevent, comm, pid);free (comm); line =strtok_r (NULL ,"\n" , &next); }
RFC PATCH v2 10/24 tools/lib/traceevent, tools/perf: Rename pevent_set_* APIs
In reply to Steven RostedtFrom: "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
APIs: pevent_set_file_bigendian, pevent_set_flag, pevent_set_function_resolver, pevent_set_host_bigendian, pevent_set_long_size, pevent_set_page_size and pevent_get_long_size
--- tools/lib/traceevent/event-parse.c | 6 +++--- tools/lib/traceevent/event-parse.h | 16 ++++++++-------- tools/perf/builtin-report.c | 6 +++--- tools/perf/builtin-script.c | 6 +++--- tools/perf/util/machine.h | 2 +- tools/perf/util/trace-event-read.c | 14 +++++++------- tools/perf/util/trace-event.c | 8 ++++---- 7 files changed, 29 insertions(+), 29 deletions(-)
tools/lib/traceevent/event-parse.c +3 -3
@@ -444,7 +444,7 @@ struct func_resolver { };/** -* pevent_set_function_resolver - set an alternative function resolver +* tep_set_function_resolver - set an alternative function resolver * @pevent: handle for the pevent * @resolver: function to be used * @priv: resolver function private state.
@@ -453,8 +453,8 @@ struct func_resolver {* keep using it instead of duplicating all the entries inside * pevent->funclist. */ -int pevent_set_function_resolver (struct tep_handle *pevent, -tep_func_resolver_t *func,void *priv) +int tep_set_function_resolver (struct tep_handle *pevent, +tep_func_resolver_t *func,void *priv) {struct func_resolver *resolver =malloc (sizeof (*resolver));
tools/lib/traceevent/event-parse.h +8 -8
@@ -532,7 +532,7 @@ struct tep_handle {char *trace_clock; }; -static inline void pevent_set_flag (struct tep_handle *pevent,int flag) +static inline void tep_set_flag (struct tep_handle *pevent,int flag) { pevent->flags |= flag; }
@@ -615,8 +615,8 @@ enum trace_flag_type { TRACE_FLAG_SOFTIRQ = 0x10, }; -int pevent_set_function_resolver (struct tep_handle *pevent, -tep_func_resolver_t *func,void *priv); +int tep_set_function_resolver (struct tep_handle *pevent, +tep_func_resolver_t *func,void *priv);void pevent_reset_function_resolver (struct tep_handle *pevent);int tep_register_comm (struct tep_handle *pevent,const char *comm,int pid);int pevent_register_trace_clock (struct tep_handle *pevent,const char *trace_clock);
@@ -741,12 +741,12 @@ static inline void pevent_set_cpus(struct tep_handle *pevent, int cpus) pevent->cpus = cpus; } -static inline int pevent_get_long_size (struct tep_handle *pevent) +static inline int tep_get_long_size (struct tep_handle *pevent) {return pevent->long_size; } -static inline void pevent_set_long_size (struct tep_handle *pevent,int long_size) +static inline void tep_set_long_size (struct tep_handle *pevent,int long_size) { pevent->long_size = long_size; }
@@ -756,7 +756,7 @@ static inline int pevent_get_page_size(struct tep_handle *pevent)return pevent->page_size; } -static inline void pevent_set_page_size (struct tep_handle *pevent,int _page_size) +static inline void tep_set_page_size (struct tep_handle *pevent,int _page_size) { pevent->page_size = _page_size; }
@@ -766,7 +766,7 @@ static inline int pevent_is_file_bigendian(struct tep_handle *pevent)return pevent->file_bigendian; } -static inline void pevent_set_file_bigendian (struct tep_handle *pevent,int endian) +static inline void tep_set_file_bigendian (struct tep_handle *pevent,int endian) { pevent->file_bigendian = endian; }
@@ -776,7 +776,7 @@ static inline int pevent_is_host_bigendian(struct tep_handle *pevent)return pevent->host_bigendian; } -static inline void pevent_set_host_bigendian (struct tep_handle *pevent,int endian) +static inline void tep_set_host_bigendian (struct tep_handle *pevent,int endian) { pevent->host_bigendian = endian; }
tools/perf/builtin-report.c +3 -3
@@ -1366,9 +1366,9 @@ int cmd_report(int argc, const char **argv) }if (session->tevent.pevent && -pevent_set_function_resolver (session->tevent.pevent, - machine__resolve_kernel_addr, - &session->machines.host) <0 ) { +tep_set_function_resolver (session->tevent.pevent, + machine__resolve_kernel_addr, + &session->machines.host) <0 ) {pr_err ("%s: failed to set libtraceevent function resolver\n" , __func__);return -1 ;
tools/perf/builtin-script.c +3 -3
@@ -3429,9 +3429,9 @@ int cmd_script(int argc, const char **argv) symbol_conf.use_callchain = false;if (session->tevent.pevent && -pevent_set_function_resolver (session->tevent.pevent, - machine__resolve_kernel_addr, - &session->machines.host) <0 ) { +tep_set_function_resolver (session->tevent.pevent, + machine__resolve_kernel_addr, + &session->machines.host) <0 ) {pr_err ("%s: failed to set libtraceevent function resolver\n" , __func__); err =-1 ; goto out_delete;
tools/perf/util/machine.h +1 -1
@@ -265,7 +265,7 @@ pid_t machine__get_current_tid(struct machine *machine, int cpu);int machine__set_current_tid (struct machine *machine,int cpu,pid_t pid,pid_t tid);/* -* For use with libtraceevent's pevent_set_function_resolver() +* For use with libtraceevent's tep_set_function_resolver() */ char *machine__resolve_kernel_addr (void *vmachine,unsigned long long *addrp,char **modp);
tools/perf/util/trace-event-read.c +7 -7
@@ -236,12 +236,12 @@ static int read_header_files(struct tep_handle *pevent) }if (!tep_parse_header_page (pevent, header_page, size, -pevent_get_long_size (pevent))) { +tep_get_long_size (pevent))) {/* * The commit field in the page is of type long, * use that instead, since it represents the kernel. */ -pevent_set_long_size (pevent, pevent->header_page_size_size); +tep_set_long_size (pevent, pevent->header_page_size_size); }free (header_page);
@@ -439,9 +439,9 @@ ssize_t trace_report(int fd, struct trace_event *tevent, bool __repipe) pevent = tevent->pevent; -pevent_set_flag (pevent,PEVENT_NSEC_OUTPUT ); -pevent_set_file_bigendian (pevent, file_bigendian); -pevent_set_host_bigendian (pevent, host_bigendian); +tep_set_flag (pevent,PEVENT_NSEC_OUTPUT ); +tep_set_file_bigendian (pevent, file_bigendian); +tep_set_host_bigendian (pevent, host_bigendian);if (do_read (buf,1 ) <0 ) goto out;
@@ -451,8 +451,8 @@ ssize_t trace_report(int fd, struct trace_event *tevent, bool __repipe)if (!file_page_size) goto out; -pevent_set_long_size (pevent, file_long_size); -pevent_set_page_size (pevent, file_page_size); +tep_set_long_size (pevent, file_long_size); +tep_set_page_size (pevent, file_page_size); err =read_header_files (pevent);if (err)
tools/perf/util/trace-event.c +4 -4
@@ -47,9 +47,9 @@ static int trace_event__init2(void)return -1 ; pevent = tevent.pevent; -pevent_set_flag (pevent,PEVENT_NSEC_OUTPUT ); -pevent_set_file_bigendian (pevent, be); -pevent_set_host_bigendian (pevent, be); +tep_set_flag (pevent,PEVENT_NSEC_OUTPUT ); +tep_set_file_bigendian (pevent, be); +tep_set_host_bigendian (pevent, be); tevent_initialized = true;return 0 ; }
@@ -60,7 +60,7 @@ int trace_event__register_resolver(struct machine *machine,if (!tevent_initialized &&trace_event__init2 ())return -1 ; -return pevent_set_function_resolver (tevent.pevent, func, machine); +return tep_set_function_resolver (tevent.pevent, func, machine); }void trace_event__cleanup (struct trace_event *t)
Signature · 1 line
2.18.0
tip-bot for Tzvetomir Stoyanov (VMware)
merge bot[tip:perf/urgent] tools lib traceevent, perf tools: Rename pevent_set_* APIs
tools lib traceevent, perf tools: Rename pevent_set_* APIs
Commit-ID: ece2a4f48386acf7e35a751008976c9dda8d6232 Gitweb: https://git.kernel.org/tip/ece2a4f48386acf7e35a751008976c9dda8d6232 Author: Tzvetomir Stoyanov (VMware) <[email protected]> AuthorDate: Wed, 8 Aug 2018 14:02:55 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Mon, 13 Aug 2018 15:22:10 -0300
tools lib traceevent, perf tools: Rename pevent_set_* APIs
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
APIs: pevent_set_file_bigendian, pevent_set_flag, pevent_set_function_resolver, pevent_set_host_bigendian, pevent_set_long_size, pevent_set_page_size and pevent_get_long_size
--- tools/lib/traceevent/event-parse.c | 6 +++--- tools/lib/traceevent/event-parse.h | 16 ++++++++-------- tools/perf/builtin-report.c | 6 +++--- tools/perf/builtin-script.c | 6 +++--- tools/perf/util/machine.h | 2 +- tools/perf/util/trace-event-read.c | 14 +++++++------- tools/perf/util/trace-event.c | 8 ++++---- 7 files changed, 29 insertions(+), 29 deletions(-)
tools/lib/traceevent/event-parse.c +3 -3
@@ -444,7 +444,7 @@ struct func_resolver { };/** -* pevent_set_function_resolver - set an alternative function resolver +* tep_set_function_resolver - set an alternative function resolver * @pevent: handle for the pevent * @resolver: function to be used * @priv: resolver function private state.
@@ -453,8 +453,8 @@ struct func_resolver {* keep using it instead of duplicating all the entries inside * pevent->funclist. */ -int pevent_set_function_resolver (struct tep_handle *pevent, -tep_func_resolver_t *func,void *priv) +int tep_set_function_resolver (struct tep_handle *pevent, +tep_func_resolver_t *func,void *priv) {struct func_resolver *resolver =malloc (sizeof (*resolver));
tools/lib/traceevent/event-parse.h +8 -8
@@ -532,7 +532,7 @@ struct tep_handle {char *trace_clock; }; -static inline void pevent_set_flag (struct tep_handle *pevent,int flag) +static inline void tep_set_flag (struct tep_handle *pevent,int flag) { pevent->flags |= flag; }
@@ -615,8 +615,8 @@ enum trace_flag_type { TRACE_FLAG_SOFTIRQ = 0x10, }; -int pevent_set_function_resolver (struct tep_handle *pevent, -tep_func_resolver_t *func,void *priv); +int tep_set_function_resolver (struct tep_handle *pevent, +tep_func_resolver_t *func,void *priv);void pevent_reset_function_resolver (struct tep_handle *pevent);int tep_register_comm (struct tep_handle *pevent,const char *comm,int pid);int pevent_register_trace_clock (struct tep_handle *pevent,const char *trace_clock);
@@ -741,12 +741,12 @@ static inline void pevent_set_cpus(struct tep_handle *pevent, int cpus) pevent->cpus = cpus; } -static inline int pevent_get_long_size (struct tep_handle *pevent) +static inline int tep_get_long_size (struct tep_handle *pevent) {return pevent->long_size; } -static inline void pevent_set_long_size (struct tep_handle *pevent,int long_size) +static inline void tep_set_long_size (struct tep_handle *pevent,int long_size) { pevent->long_size = long_size; }
@@ -756,7 +756,7 @@ static inline int pevent_get_page_size(struct tep_handle *pevent)return pevent->page_size; } -static inline void pevent_set_page_size (struct tep_handle *pevent,int _page_size) +static inline void tep_set_page_size (struct tep_handle *pevent,int _page_size) { pevent->page_size = _page_size; }
@@ -766,7 +766,7 @@ static inline int pevent_is_file_bigendian(struct tep_handle *pevent)return pevent->file_bigendian; } -static inline void pevent_set_file_bigendian (struct tep_handle *pevent,int endian) +static inline void tep_set_file_bigendian (struct tep_handle *pevent,int endian) { pevent->file_bigendian = endian; }
@@ -776,7 +776,7 @@ static inline int pevent_is_host_bigendian(struct tep_handle *pevent)return pevent->host_bigendian; } -static inline void pevent_set_host_bigendian (struct tep_handle *pevent,int endian) +static inline void tep_set_host_bigendian (struct tep_handle *pevent,int endian) { pevent->host_bigendian = endian; }
tools/perf/builtin-report.c +3 -3
@@ -1369,9 +1369,9 @@ repeat: }if (session->tevent.pevent && -pevent_set_function_resolver (session->tevent.pevent, - machine__resolve_kernel_addr, - &session->machines.host) <0 ) { +tep_set_function_resolver (session->tevent.pevent, + machine__resolve_kernel_addr, + &session->machines.host) <0 ) {pr_err ("%s: failed to set libtraceevent function resolver\n" , __func__);return -1 ;
tools/perf/builtin-script.c +3 -3
@@ -3429,9 +3429,9 @@ int cmd_script(int argc, const char **argv) symbol_conf.use_callchain = false;if (session->tevent.pevent && -pevent_set_function_resolver (session->tevent.pevent, - machine__resolve_kernel_addr, - &session->machines.host) <0 ) { +tep_set_function_resolver (session->tevent.pevent, + machine__resolve_kernel_addr, + &session->machines.host) <0 ) {pr_err ("%s: failed to set libtraceevent function resolver\n" , __func__); err =-1 ; goto out_delete;
tools/perf/util/machine.h +1 -1
@@ -265,7 +265,7 @@ pid_t machine__get_current_tid(struct machine *machine, int cpu);int machine__set_current_tid (struct machine *machine,int cpu,pid_t pid,pid_t tid);/* -* For use with libtraceevent's pevent_set_function_resolver() +* For use with libtraceevent's tep_set_function_resolver() */ char *machine__resolve_kernel_addr (void *vmachine,unsigned long long *addrp,char **modp);
tools/perf/util/trace-event-read.c +7 -7
@@ -236,12 +236,12 @@ static int read_header_files(struct tep_handle *pevent) }if (!tep_parse_header_page (pevent, header_page, size, -pevent_get_long_size (pevent))) { +tep_get_long_size (pevent))) {/* * The commit field in the page is of type long, * use that instead, since it represents the kernel. */ -pevent_set_long_size (pevent, pevent->header_page_size_size); +tep_set_long_size (pevent, pevent->header_page_size_size); }free (header_page);
@@ -439,9 +439,9 @@ ssize_t trace_report(int fd, struct trace_event *tevent, bool __repipe) pevent = tevent->pevent; -pevent_set_flag (pevent,PEVENT_NSEC_OUTPUT ); -pevent_set_file_bigendian (pevent, file_bigendian); -pevent_set_host_bigendian (pevent, host_bigendian); +tep_set_flag (pevent,PEVENT_NSEC_OUTPUT ); +tep_set_file_bigendian (pevent, file_bigendian); +tep_set_host_bigendian (pevent, host_bigendian);if (do_read (buf,1 ) <0 ) goto out;
@@ -451,8 +451,8 @@ ssize_t trace_report(int fd, struct trace_event *tevent, bool __repipe)if (!file_page_size) goto out; -pevent_set_long_size (pevent, file_long_size); -pevent_set_page_size (pevent, file_page_size); +tep_set_long_size (pevent, file_long_size); +tep_set_page_size (pevent, file_page_size); err =read_header_files (pevent);if (err)
tools/perf/util/trace-event.c +4 -4
@@ -47,9 +47,9 @@ static int trace_event__init2(void)return -1 ; pevent = tevent.pevent; -pevent_set_flag (pevent,PEVENT_NSEC_OUTPUT ); -pevent_set_file_bigendian (pevent, be); -pevent_set_host_bigendian (pevent, be); +tep_set_flag (pevent,PEVENT_NSEC_OUTPUT ); +tep_set_file_bigendian (pevent, be); +tep_set_host_bigendian (pevent, be); tevent_initialized = true;return 0 ; }
@@ -60,7 +60,7 @@ int trace_event__register_resolver(struct machine *machine,if (!tevent_initialized &&trace_event__init2 ())return -1 ; -return pevent_set_function_resolver (tevent.pevent, func, machine); +return tep_set_function_resolver (tevent.pevent, func, machine); }void trace_event__cleanup (struct trace_event *t)
RFC PATCH v2 11/24 tools/lib/traceevent, tools/perf: Rename traceevent_* APIs
In reply to Steven RostedtFrom: "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 "traceevent_". This changes
APIs: traceevent_host_bigendian, traceevent_load_plugins and traceevent_unload_plugins
--- tools/lib/traceevent/event-parse.h | 8 ++++---- tools/lib/traceevent/event-plugin.c | 8 ++++---- tools/perf/util/trace-event.c | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-)
tools/lib/traceevent/event-parse.h +4 -4
@@ -435,9 +435,9 @@ struct plugin_list;#define INVALID_PLUGIN_LIST_OPTION ((char **)((unsigned long)-1)) -struct plugin_list *traceevent_load_plugins (struct tep_handle *pevent); -void traceevent_unload_plugins (struct plugin_list *plugin_list, -struct tep_handle *pevent); +struct plugin_list *tep_load_plugins (struct tep_handle *pevent); +void tep_unload_plugins (struct plugin_list *plugin_list, +struct tep_handle *pevent);char **traceevent_plugin_list_options (void );void traceevent_plugin_free_options_list (char **list); int traceevent_plugin_add_options(const char *name,
@@ -597,7 +597,7 @@ __data2host8(struct tep_handle *pevent, unsigned long long data)__data2host8 (pevent, __val); \ }) -static inline int traceevent_host_bigendian (void ) +static inline int tep_host_bigendian (void ) {unsigned char str[] = {0x1 ,0x2 ,0x3 ,0x4 };unsigned int val;
tools/lib/traceevent/event-plugin.c +4 -4
@@ -264,10 +264,10 @@ void traceevent_plugin_remove_options(struct tep_plugin_option *options)* @s: the trace_seq descripter to write to * @prefix: The prefix string to add before listing the option name * @suffix: The suffix string ot append after the option name -* @list: The list of plugins (usually returned by traceevent_load_plugins() +* @list: The list of plugins (usually returned by tep_load_plugins() * * Writes to the trace_seq @s the list of plugins (files) that is -* returned by traceevent_load_plugins(). Use @prefix and @suffix for formating: +* returned by tep_load_plugins(). Use @prefix and @suffix for formating: * @prefix = " ", @suffix = "\n". */ void traceevent_print_plugins(struct trace_seq *s,
@@ -431,7 +431,7 @@ load_plugins(struct tep_handle *pevent, const char *suffix, }struct plugin_list * -traceevent_load_plugins (struct tep_handle *pevent) +tep_load_plugins (struct tep_handle *pevent) {struct plugin_list *list =NULL ;
@@ -440,7 +440,7 @@ traceevent_load_plugins(struct tep_handle *pevent) }void -traceevent_unload_plugins (struct plugin_list *plugin_list,struct tep_handle *pevent) +tep_unload_plugins (struct plugin_list *plugin_list,struct tep_handle *pevent) {tep_plugin_unload_func func;struct plugin_list *list;
tools/perf/util/trace-event.c +3 -3
@@ -31,7 +31,7 @@ int trace_event__init(struct trace_event *t)struct tep_handle *pevent =tep_alloc ();if (pevent) { - t->plugin_list =traceevent_load_plugins (pevent); + t->plugin_list =tep_load_plugins (pevent); t->pevent = pevent; }
@@ -40,7 +40,7 @@ int trace_event__init(struct trace_event *t)static int trace_event__init2 (void ) { -int be =traceevent_host_bigendian (); +int be =tep_host_bigendian ();struct tep_handle *pevent;if (trace_event__init (&tevent))
@@ -65,7 +65,7 @@ int trace_event__register_resolver(struct machine *machine,void trace_event__cleanup (struct trace_event *t) { -traceevent_unload_plugins (t->plugin_list, t->pevent); +tep_unload_plugins (t->plugin_list, t->pevent);tep_free (t->pevent); }
Signature · 1 line
2.18.0
tip-bot for Tzvetomir Stoyanov (VMware)
merge bot[tip:perf/urgent] tools lib traceevent, perf tools: Rename traceevent_* APIs
tools lib traceevent, perf tools: Rename traceevent_* APIs
Commit-ID: fc9b69710e0e5833c5d3e56c37cb56cfe89217c3 Gitweb: https://git.kernel.org/tip/fc9b69710e0e5833c5d3e56c37cb56cfe89217c3 Author: Tzvetomir Stoyanov (VMware) <[email protected]> AuthorDate: Wed, 8 Aug 2018 14:02:56 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Mon, 13 Aug 2018 15:22:16 -0300
tools lib traceevent, perf tools: Rename traceevent_* APIs
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 "traceevent_". This changes APIs: traceevent_host_bigendian, traceevent_load_plugins and traceevent_unload_plugins
--- tools/lib/traceevent/event-parse.h | 8 ++++---- tools/lib/traceevent/event-plugin.c | 8 ++++---- tools/perf/util/trace-event.c | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-)
tools/lib/traceevent/event-parse.h +4 -4
@@ -435,9 +435,9 @@ struct plugin_list;#define INVALID_PLUGIN_LIST_OPTION ((char **)((unsigned long)-1)) -struct plugin_list *traceevent_load_plugins (struct tep_handle *pevent); -void traceevent_unload_plugins (struct plugin_list *plugin_list, -struct tep_handle *pevent); +struct plugin_list *tep_load_plugins (struct tep_handle *pevent); +void tep_unload_plugins (struct plugin_list *plugin_list, +struct tep_handle *pevent);char **traceevent_plugin_list_options (void );void traceevent_plugin_free_options_list (char **list); int traceevent_plugin_add_options(const char *name,
@@ -597,7 +597,7 @@ __data2host8(struct tep_handle *pevent, unsigned long long data)__data2host8 (pevent, __val); \ }) -static inline int traceevent_host_bigendian (void ) +static inline int tep_host_bigendian (void ) {unsigned char str[] = {0x1 ,0x2 ,0x3 ,0x4 };unsigned int val;
tools/lib/traceevent/event-plugin.c +4 -4
@@ -264,10 +264,10 @@ void traceevent_plugin_remove_options(struct tep_plugin_option *options)* @s: the trace_seq descripter to write to * @prefix: The prefix string to add before listing the option name * @suffix: The suffix string ot append after the option name -* @list: The list of plugins (usually returned by traceevent_load_plugins() +* @list: The list of plugins (usually returned by tep_load_plugins() * * Writes to the trace_seq @s the list of plugins (files) that is -* returned by traceevent_load_plugins(). Use @prefix and @suffix for formating: +* returned by tep_load_plugins(). Use @prefix and @suffix for formating: * @prefix = " ", @suffix = "\n". */ void traceevent_print_plugins(struct trace_seq *s,
@@ -431,7 +431,7 @@ load_plugins(struct tep_handle *pevent, const char *suffix, }struct plugin_list * -traceevent_load_plugins (struct tep_handle *pevent) +tep_load_plugins (struct tep_handle *pevent) {struct plugin_list *list =NULL ;
@@ -440,7 +440,7 @@ traceevent_load_plugins(struct tep_handle *pevent) }void -traceevent_unload_plugins (struct plugin_list *plugin_list,struct tep_handle *pevent) +tep_unload_plugins (struct plugin_list *plugin_list,struct tep_handle *pevent) {tep_plugin_unload_func func;struct plugin_list *list;
tools/perf/util/trace-event.c +3 -3
@@ -31,7 +31,7 @@ int trace_event__init(struct trace_event *t)struct tep_handle *pevent =tep_alloc ();if (pevent) { - t->plugin_list =traceevent_load_plugins (pevent); + t->plugin_list =tep_load_plugins (pevent); t->pevent = pevent; }
@@ -40,7 +40,7 @@ int trace_event__init(struct trace_event *t)static int trace_event__init2 (void ) { -int be =traceevent_host_bigendian (); +int be =tep_host_bigendian ();struct tep_handle *pevent;if (trace_event__init (&tevent))
@@ -65,7 +65,7 @@ int trace_event__register_resolver(struct machine *machine,void trace_event__cleanup (struct trace_event *t) { -traceevent_unload_plugins (t->plugin_list, t->pevent); +tep_unload_plugins (t->plugin_list, t->pevent);tep_free (t->pevent); }
RFC PATCH v2 12/24 tools/lib/traceevent, tools/perf: Rename enum pevent_flag to enum tep_flag
In reply to Steven RostedtFrom: "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 pevent_get_page_size API and enum pevent_flag to enum tep_flag
--- tools/lib/traceevent/event-parse.c | 2 +- tools/lib/traceevent/event-parse.h | 10 +++++----- tools/lib/traceevent/event-plugin.c | 4 ++-- tools/perf/builtin-kmem.c | 2 +- tools/perf/util/trace-event-read.c | 2 +- tools/perf/util/trace-event.c | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-)
tools/lib/traceevent/event-parse.c +1 -1
@@ -5515,7 +5515,7 @@ void tep_print_event_time(struct tep_handle *pevent, struct trace_seq *s, }if (use_usec_format) { -if (pevent->flags &PEVENT_NSEC_OUTPUT ) { +if (pevent->flags &TEP_NSEC_OUTPUT ) { usecs = nsecs; p =9 ; }else {
tools/lib/traceevent/event-parse.h +5 -5
@@ -373,10 +373,10 @@ enum pevent_func_arg_type { PEVENT_FUNC_ARG_MAX_TYPES }; -enum pevent_flag { -PEVENT_NSEC_OUTPUT =1 ,/* output in NSECS */ -PEVENT_DISABLE_SYS_PLUGINS =1 <<1 , -PEVENT_DISABLE_PLUGINS =1 <<2 , +enum tep_flag { +TEP_NSEC_OUTPUT =1 ,/* output in NSECS */ +TEP_DISABLE_SYS_PLUGINS =1 <<1 , +TEP_DISABLE_PLUGINS =1 <<2 , };#define PEVENT_ERRORS \
@@ -751,7 +751,7 @@ static inline void tep_set_long_size(struct tep_handle *pevent, int long_size) pevent->long_size = long_size; } -static inline int pevent_get_page_size (struct tep_handle *pevent) +static inline int tep_get_page_size (struct tep_handle *pevent) {return pevent->page_size; }
tools/lib/traceevent/event-plugin.c +2 -2
@@ -390,7 +390,7 @@ load_plugins(struct tep_handle *pevent, const char *suffix,char *envdir;int ret; -if (pevent->flags &PEVENT_DISABLE_PLUGINS ) +if (pevent->flags &TEP_DISABLE_PLUGINS )return ;/*
@@ -398,7 +398,7 @@ load_plugins(struct tep_handle *pevent, const char *suffix,* check that first. */ #ifdef PLUGIN_DIR -if (!(pevent->flags &PEVENT_DISABLE_SYS_PLUGINS )) +if (!(pevent->flags &TEP_DISABLE_SYS_PLUGINS ))load_plugins_dir (pevent, suffix,PLUGIN_DIR , load_plugin, data);#endif
tools/perf/builtin-kmem.c +1 -1
@@ -1974,7 +1974,7 @@ int cmd_kmem(int argc, const char **argv) goto out_delete; } - kmem_page_size =pevent_get_page_size (evsel->tp_format->pevent); + kmem_page_size =tep_get_page_size (evsel->tp_format->pevent); symbol_conf.use_callchain = true; }
tools/perf/util/trace-event-read.c +1 -1
@@ -439,7 +439,7 @@ ssize_t trace_report(int fd, struct trace_event *tevent, bool __repipe) pevent = tevent->pevent; -tep_set_flag (pevent,PEVENT_NSEC_OUTPUT ); +tep_set_flag (pevent,TEP_NSEC_OUTPUT );tep_set_file_bigendian (pevent, file_bigendian);tep_set_host_bigendian (pevent, host_bigendian);
tools/perf/util/trace-event.c +1 -1
@@ -47,7 +47,7 @@ static int trace_event__init2(void)return -1 ; pevent = tevent.pevent; -tep_set_flag (pevent,PEVENT_NSEC_OUTPUT ); +tep_set_flag (pevent,TEP_NSEC_OUTPUT );tep_set_file_bigendian (pevent, be);tep_set_host_bigendian (pevent, be); tevent_initialized = true;
Signature · 1 line
2.18.0
tip-bot for Tzvetomir Stoyanov (VMware)
merge bot[tip:perf/urgent] tools lib traceevent, perf tools: Rename 'enum pevent_flag' to 'enum tep_flag'
tools lib traceevent, perf tools: Rename 'enum pevent_flag' to 'enum tep_flag'
Commit-ID: 6fed932e9242b55a32dd75da7c2448b9b0c48a73 Gitweb: https://git.kernel.org/tip/6fed932e9242b55a32dd75da7c2448b9b0c48a73 Author: Tzvetomir Stoyanov (VMware) <[email protected]> AuthorDate: Wed, 8 Aug 2018 14:02:57 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Mon, 13 Aug 2018 15:22:18 -0300
tools lib traceevent, perf tools: Rename 'enum pevent_flag' to 'enum tep_flag'
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 pevent_get_page_size API and enum pevent_flag to enum tep_flag
--- tools/lib/traceevent/event-parse.c | 2 +- tools/lib/traceevent/event-parse.h | 10 +++++----- tools/lib/traceevent/event-plugin.c | 4 ++-- tools/perf/builtin-kmem.c | 2 +- tools/perf/util/trace-event-read.c | 2 +- tools/perf/util/trace-event.c | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-)
tools/lib/traceevent/event-parse.c +1 -1
@@ -5515,7 +5515,7 @@ void tep_print_event_time(struct tep_handle *pevent, struct trace_seq *s, }if (use_usec_format) { -if (pevent->flags &PEVENT_NSEC_OUTPUT ) { +if (pevent->flags &TEP_NSEC_OUTPUT ) { usecs = nsecs; p =9 ; }else {
tools/lib/traceevent/event-parse.h +5 -5
@@ -373,10 +373,10 @@ enum pevent_func_arg_type { PEVENT_FUNC_ARG_MAX_TYPES }; -enum pevent_flag { -PEVENT_NSEC_OUTPUT =1 ,/* output in NSECS */ -PEVENT_DISABLE_SYS_PLUGINS =1 <<1 , -PEVENT_DISABLE_PLUGINS =1 <<2 , +enum tep_flag { +TEP_NSEC_OUTPUT =1 ,/* output in NSECS */ +TEP_DISABLE_SYS_PLUGINS =1 <<1 , +TEP_DISABLE_PLUGINS =1 <<2 , };#define PEVENT_ERRORS \
@@ -751,7 +751,7 @@ static inline void tep_set_long_size(struct tep_handle *pevent, int long_size) pevent->long_size = long_size; } -static inline int pevent_get_page_size (struct tep_handle *pevent) +static inline int tep_get_page_size (struct tep_handle *pevent) {return pevent->page_size; }
tools/lib/traceevent/event-plugin.c +2 -2
@@ -390,7 +390,7 @@ load_plugins(struct tep_handle *pevent, const char *suffix,char *envdir;int ret; -if (pevent->flags &PEVENT_DISABLE_PLUGINS ) +if (pevent->flags &TEP_DISABLE_PLUGINS )return ;/*
@@ -398,7 +398,7 @@ load_plugins(struct tep_handle *pevent, const char *suffix,* check that first. */ #ifdef PLUGIN_DIR -if (!(pevent->flags &PEVENT_DISABLE_SYS_PLUGINS )) +if (!(pevent->flags &TEP_DISABLE_SYS_PLUGINS ))load_plugins_dir (pevent, suffix,PLUGIN_DIR , load_plugin, data);#endif
tools/perf/builtin-kmem.c +1 -1
@@ -1974,7 +1974,7 @@ int cmd_kmem(int argc, const char **argv) goto out_delete; } - kmem_page_size =pevent_get_page_size (evsel->tp_format->pevent); + kmem_page_size =tep_get_page_size (evsel->tp_format->pevent); symbol_conf.use_callchain = true; }
tools/perf/util/trace-event-read.c +1 -1
@@ -439,7 +439,7 @@ ssize_t trace_report(int fd, struct trace_event *tevent, bool __repipe) pevent = tevent->pevent; -tep_set_flag (pevent,PEVENT_NSEC_OUTPUT ); +tep_set_flag (pevent,TEP_NSEC_OUTPUT );tep_set_file_bigendian (pevent, file_bigendian);tep_set_host_bigendian (pevent, host_bigendian);
tools/perf/util/trace-event.c +1 -1
@@ -47,7 +47,7 @@ static int trace_event__init2(void)return -1 ; pevent = tevent.pevent; -tep_set_flag (pevent,PEVENT_NSEC_OUTPUT ); +tep_set_flag (pevent,TEP_NSEC_OUTPUT );tep_set_file_bigendian (pevent, be);tep_set_host_bigendian (pevent, be); tevent_initialized = true;
RFC PATCH v2 13/24 tools/lib/traceevent, tools/lib/lockdep/: Rename enunm pevent_errno to enum tep_errno
In reply to Steven RostedtFrom: "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 enum pevent_errno to enum tep_errno
--- tools/lib/lockdep/Makefile | 4 +- tools/lib/traceevent/Makefile | 4 +- tools/lib/traceevent/event-parse.c | 60 +++++------ tools/lib/traceevent/event-parse.h | 48 ++++----- tools/lib/traceevent/parse-filter.c | 150 ++++++++++++++-------------- 5 files changed, 133 insertions(+), 133 deletions(-)
tools/lib/lockdep/Makefile +2 -2
@@ -129,12 +129,12 @@ $(OUTPUT)liblockdep.a: $(LIB_IN) tags: force $(RM) tags find . -name '*.[ch]' | xargs ctags --extra=+f --c-kinds=+px \ - --regex-c++='/_PE\(([^,)]*).*/PEVENT_ERRNO__\1/' + --regex-c++='/_PE\(([^,)]*).*/TEP_ERRNO__\1/' TAGS: force $(RM) TAGS find . -name '*.[ch]' | xargs etags \ - --regex='/_PE(\([^,)]*\).*/PEVENT_ERRNO__\1/' + --regex='/_PE(\([^,)]*\).*/TEP_ERRNO__\1/' define do_install $(print_install) \
tools/lib/traceevent/Makefile +2 -2
@@ -233,12 +233,12 @@ endef tags: force $(RM) tags find . -name '*.[ch]' | xargs ctags --extra=+f --c-kinds=+px \ - --regex-c++='/_PE\(([^,)]*).*/PEVENT_ERRNO__\1/' + --regex-c++='/_PE\(([^,)]*).*/TEP_ERRNO__\1/' TAGS: force $(RM) TAGS find . -name '*.[ch]' | xargs etags \ - --regex='/_PE(\([^,)]*\).*/PEVENT_ERRNO__\1/' + --regex='/_PE(\([^,)]*\).*/TEP_ERRNO__\1/' define do_install_mkdir if [ ! -d '$(DESTDIR_SQ)$1' ]; then \
tools/lib/traceevent/event-parse.c +30 -30
190 lines not on this page · raw message
tools/lib/traceevent/event-parse.h +24 -24
94 lines not on this page · raw message
tools/lib/traceevent/parse-filter.c +75 -75
558 lines not on this page · raw message
Signature · 1 line
2.18.0
tip-bot for Tzvetomir Stoyanov (VMware)
merge bot[tip:perf/urgent] tools lib traceevent, tools lib lockdep: Rename 'enum pevent_errno' to 'enum tep_errno'
tools lib traceevent, tools lib lockdep: Rename 'enum pevent_errno' to 'enum tep_errno'
Commit-ID: d97f4ef177ddf8b877de2545dbd67d1faf6878f2 Gitweb: https://git.kernel.org/tip/d97f4ef177ddf8b877de2545dbd67d1faf6878f2 Author: Tzvetomir Stoyanov (VMware) <[email protected]> AuthorDate: Wed, 8 Aug 2018 14:02:58 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Mon, 13 Aug 2018 15:23:07 -0300
tools lib traceevent, tools lib lockdep: Rename 'enum pevent_errno' to 'enum tep_errno'
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 'enum pevent_errno' to 'enum tep_errno'.
--- tools/lib/lockdep/Makefile | 4 +- tools/lib/traceevent/Makefile | 4 +- tools/lib/traceevent/event-parse.c | 60 +++++++-------- tools/lib/traceevent/event-parse.h | 48 ++++++------ tools/lib/traceevent/parse-filter.c | 150 ++++++++++++++++++------------------ 5 files changed, 133 insertions(+), 133 deletions(-)
tools/lib/lockdep/Makefile +2 -2
@@ -129,12 +129,12 @@ $(OUTPUT)liblockdep.a: $(LIB_IN) tags: force $(RM) tags find . -name '*.[ch]' | xargs ctags --extra=+f --c-kinds=+px \ - --regex-c++='/_PE\(([^,)]*).*/PEVENT_ERRNO__\1/' + --regex-c++='/_PE\(([^,)]*).*/TEP_ERRNO__\1/' TAGS: force $(RM) TAGS find . -name '*.[ch]' | xargs etags \ - --regex='/_PE(\([^,)]*\).*/PEVENT_ERRNO__\1/' + --regex='/_PE(\([^,)]*\).*/TEP_ERRNO__\1/' define do_install $(print_install) \
tools/lib/traceevent/Makefile +2 -2
@@ -233,12 +233,12 @@ endef tags: force $(RM) tags find . -name '*.[ch]' | xargs ctags --extra=+f --c-kinds=+px \ - --regex-c++='/_PE\(([^,)]*).*/PEVENT_ERRNO__\1/' + --regex-c++='/_PE\(([^,)]*).*/TEP_ERRNO__\1/' TAGS: force $(RM) TAGS find . -name '*.[ch]' | xargs etags \ - --regex='/_PE(\([^,)]*\).*/PEVENT_ERRNO__\1/' + --regex='/_PE(\([^,)]*\).*/TEP_ERRNO__\1/' define do_install_mkdir if [ ! -d '$(DESTDIR_SQ)$1' ]; then \
tools/lib/traceevent/event-parse.c +30 -30
190 lines not on this page · raw message
tools/lib/traceevent/event-parse.h +24 -24
94 lines not on this page · raw message
tools/lib/traceevent/parse-filter.c +75 -75
558 lines not on this page · raw message
RFC PATCH v2 14/24 tools/lib/traceevent: Rename pevent_function* APIs
In reply to Steven RostedtFrom: "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
APIs: pevent_function_handler, pevent_func_handler, pevent_func_arg_type, PEVENT_FUNC_ARG_VOID, PEVENT_FUNC_ARG_INT, PEVENT_FUNC_ARG_LONG, PEVENT_FUNC_ARG_STRING, PEVENT_FUNC_ARG_PTRS, PEVENT_FUNC_ARG_MAX_TYPES
--- tools/lib/traceevent/event-parse.c | 62 +++++++++++++------------- tools/lib/traceevent/event-parse.h | 30 ++++++------- tools/lib/traceevent/plugin_cfg80211.c | 6 +-- tools/lib/traceevent/plugin_jbd2.c | 12 ++--- tools/lib/traceevent/plugin_kvm.c | 6 +-- tools/lib/traceevent/plugin_scsi.c | 10 ++--- tools/lib/traceevent/plugin_xen.c | 6 +-- 7 files changed, 66 insertions(+), 66 deletions(-)
tools/lib/traceevent/event-parse.c +31 -31
@@ -94,14 +94,14 @@ struct event_handler {struct pevent_func_params {struct pevent_func_params *next; -enum pevent_func_arg_type type; +enum tep_func_arg_type type; }; -struct pevent_function_handler { -struct pevent_function_handler *next; -enum pevent_func_arg_type ret_type; +struct tep_function_handler { +struct tep_function_handler *next; +enum tep_func_arg_type ret_type;char *name; -pevent_func_handler func; +tep_func_handler func;struct pevent_func_params *params;int nr_args; };
@@ -110,7 +110,7 @@ static unsigned long long process_defined_func(struct trace_seq *s, void *data, int size, struct event_format *event, struct print_arg *arg); -static void free_func_handle (struct pevent_function_handler *func); +static void free_func_handle (struct tep_function_handler *func);/** * pevent_buffer_init - init buffer for parsing
@@ -2914,10 +2914,10 @@ process_bitmask(struct event_format *event __maybe_unused, struct print_arg *argreturn EVENT_ERROR ; } -static struct pevent_function_handler * +static struct tep_function_handler *find_func_handler (struct tep_handle *pevent,char *func_name) { -struct pevent_function_handler *func; +struct tep_function_handler *func;if (!pevent)return NULL ;
@@ -2932,8 +2932,8 @@ find_func_handler(struct tep_handle *pevent, char *func_name)static void remove_func_handler (struct tep_handle *pevent,char *func_name) { -struct pevent_function_handler *func; -struct pevent_function_handler **next; +struct tep_function_handler *func; +struct tep_function_handler **next; next = &pevent->func_handlers;while ((func = *next)) {
@@ -2947,7 +2947,7 @@ static void remove_func_handler(struct tep_handle *pevent, char *func_name) }static enum event_type -process_func_handler (struct event_format *event,struct pevent_function_handler *func, +process_func_handler (struct event_format *event,struct tep_function_handler *func,struct print_arg *arg,char **tok) {struct print_arg **next_arg;
@@ -3008,7 +3008,7 @@ static enum event_type process_function(struct event_format *event, struct print_arg *arg, char *token, char **tok) { - struct pevent_function_handler *func; + struct tep_function_handler *func;if (strcmp (token,"__print_flags" ) ==0 ) {free_token (token);
@@ -4132,7 +4132,7 @@ static unsigned long long process_defined_func(struct trace_seq *s, void *data, int size, struct event_format *event, struct print_arg *arg) { - struct pevent_function_handler *func_handle = arg->func.func; + struct tep_function_handler *func_handle = arg->func.func;struct pevent_func_params *param;unsigned long long *args;unsigned long long ret;
@@ -4159,12 +4159,12 @@ process_defined_func(struct trace_seq *s, void *data, int size,for (i =0 ; i < func_handle->nr_args; i++) {switch (param->type) { -case PEVENT_FUNC_ARG_INT : -case PEVENT_FUNC_ARG_LONG : -case PEVENT_FUNC_ARG_PTR : +case TEP_FUNC_ARG_INT : +case TEP_FUNC_ARG_LONG : +case TEP_FUNC_ARG_PTR : args[i] =eval_num_arg (data, size, event, farg);break ; -case PEVENT_FUNC_ARG_STRING : +case TEP_FUNC_ARG_STRING :trace_seq_init (&str);print_str_arg (&str, data, size, event,"%s" ,-1 , farg);trace_seq_terminate (&str);
@@ -6461,7 +6461,7 @@ int tep_print_func_field(struct trace_seq *s, const char *fmt,return -1 ; } -static void free_func_handle (struct pevent_function_handler *func) +static void free_func_handle (struct tep_function_handler *func) {struct pevent_func_params *params;
@@ -6482,24 +6482,24 @@ static void free_func_handle(struct pevent_function_handler *func)* @func: the function to process the helper function * @ret_type: the return type of the helper function * @name: the name of the helper function -* @parameters: A list of enum pevent_func_arg_type +* @parameters: A list of enum tep_func_arg_type * * Some events may have helper functions in the print format arguments. * This allows a plugin to dynamically create a way to process one * of these functions. * -* The @parameters is a variable list of pevent_func_arg_type enums that -* must end with PEVENT_FUNC_ARG_VOID. +* The @parameters is a variable list of tep_func_arg_type enums that +* must end with TEP_FUNC_ARG_VOID. */ int pevent_register_print_function (struct tep_handle *pevent, -pevent_func_handler func, -enum pevent_func_arg_type ret_type, +tep_func_handler func, +enum tep_func_arg_type ret_type,char *name, ...) { -struct pevent_function_handler *func_handle; +struct tep_function_handler *func_handle;struct pevent_func_params **next_param;struct pevent_func_params *param; -enum pevent_func_arg_type type; +enum tep_func_arg_type type;va_list ap;int ret;
@@ -6532,11 +6532,11 @@ int pevent_register_print_function(struct tep_handle *pevent, next_param = &(func_handle->params);va_start (ap, name);for (;;) { - type = va_arg(ap, enum pevent_func_arg_type); -if (type ==PEVENT_FUNC_ARG_VOID ) + type = va_arg(ap, enum tep_func_arg_type); +if (type ==TEP_FUNC_ARG_VOID )break ; -if (type >=PEVENT_FUNC_ARG_MAX_TYPES ) { +if (type >=TEP_FUNC_ARG_MAX_TYPES ) {do_warning ("Invalid argument type %d" , type); ret =TEP_ERRNO__INVALID_ARG_TYPE ; goto out_free;
@@ -6579,9 +6579,9 @@ int pevent_register_print_function(struct tep_handle *pevent,* Returns 0 if the handler was removed successully, -1 otherwise. */ int pevent_unregister_print_function (struct tep_handle *pevent, -pevent_func_handler func,char *name) +tep_func_handler func,char *name) { -struct pevent_function_handler *func_handle; +struct tep_function_handler *func_handle; func_handle =find_func_handler (pevent, name);if (func_handle && func_handle->func == func) {
@@ -6819,7 +6819,7 @@ void tep_free(struct tep_handle *pevent)struct cmdline_list *cmdlist, *cmdnext;struct func_list *funclist, *funcnext;struct printk_list *printklist, *printknext; -struct pevent_function_handler *func_handler; +struct tep_function_handler *func_handler;struct event_handler *handle;int i;
tools/lib/traceevent/event-parse.h +15 -15
@@ -269,10 +269,10 @@ struct print_arg_op {struct print_arg *right; }; -struct pevent_function_handler ; +struct tep_function_handler ;struct print_arg_func { -struct pevent_function_handler *func; +struct tep_function_handler *func;struct print_arg *args; };
@@ -361,16 +361,16 @@ enum event_type { EVENT_SQUOTE, }; -typedef unsigned long long (*pevent_func_handler )(struct trace_seq *s, -unsigned long long *args); +typedef unsigned long long (*tep_func_handler )(struct trace_seq *s, +unsigned long long *args); -enum pevent_func_arg_type { -PEVENT_FUNC_ARG_VOID , -PEVENT_FUNC_ARG_INT , -PEVENT_FUNC_ARG_LONG , -PEVENT_FUNC_ARG_STRING , -PEVENT_FUNC_ARG_PTR , -PEVENT_FUNC_ARG_MAX_TYPES +enum tep_func_arg_type { +TEP_FUNC_ARG_VOID , +TEP_FUNC_ARG_INT , +TEP_FUNC_ARG_LONG , +TEP_FUNC_ARG_STRING , +TEP_FUNC_ARG_PTR , +TEP_FUNC_ARG_MAX_TYPES };enum tep_flag {
@@ -524,7 +524,7 @@ struct tep_handle {struct format_field *bprint_buf_field;struct event_handler *handlers; -struct pevent_function_handler *func_handlers; +struct tep_function_handler *func_handlers;/* cache */ struct event_format *last_event;
@@ -680,11 +680,11 @@ int pevent_unregister_event_handler(struct tep_handle *pevent, int id, const char *sys_name, const char *event_name, tep_event_handler_func func, void *context);int pevent_register_print_function (struct tep_handle *pevent, -pevent_func_handler func, -enum pevent_func_arg_type ret_type, +tep_func_handler func, +enum tep_func_arg_type ret_type,char *name, ...);int pevent_unregister_print_function (struct tep_handle *pevent, -pevent_func_handler func,char *name); +tep_func_handler func,char *name);struct format_field *tep_find_common_field (struct event_format *event,const char *name);struct format_field *tep_find_field (struct event_format *event,const char *name);
tools/lib/traceevent/plugin_cfg80211.c +3 -3
@@ -29,10 +29,10 @@ int TEP_PLUGIN_LOADER(struct tep_handle *pevent) {pevent_register_print_function (pevent, process___le16_to_cpup, -PEVENT_FUNC_ARG_INT , +TEP_FUNC_ARG_INT ,"__le16_to_cpup" , -PEVENT_FUNC_ARG_PTR , -PEVENT_FUNC_ARG_VOID ); +TEP_FUNC_ARG_PTR , +TEP_FUNC_ARG_VOID );return 0 ; }
tools/lib/traceevent/plugin_jbd2.c +6 -6
@@ -51,17 +51,17 @@ int TEP_PLUGIN_LOADER(struct tep_handle *pevent) {pevent_register_print_function (pevent, process_jbd2_dev_to_name, -PEVENT_FUNC_ARG_STRING , +TEP_FUNC_ARG_STRING ,"jbd2_dev_to_name" , -PEVENT_FUNC_ARG_INT , -PEVENT_FUNC_ARG_VOID ); +TEP_FUNC_ARG_INT , +TEP_FUNC_ARG_VOID );pevent_register_print_function (pevent, process_jiffies_to_msecs, -PEVENT_FUNC_ARG_LONG , +TEP_FUNC_ARG_LONG ,"jiffies_to_msecs" , -PEVENT_FUNC_ARG_LONG , -PEVENT_FUNC_ARG_VOID ); +TEP_FUNC_ARG_LONG , +TEP_FUNC_ARG_VOID );return 0 ; }
tools/lib/traceevent/plugin_kvm.c +3 -3
@@ -479,10 +479,10 @@ int TEP_PLUGIN_LOADER(struct tep_handle *pevent)pevent_register_print_function (pevent, process_is_writable_pte, -PEVENT_FUNC_ARG_INT , +TEP_FUNC_ARG_INT ,"is_writable_pte" , -PEVENT_FUNC_ARG_LONG , -PEVENT_FUNC_ARG_VOID ); +TEP_FUNC_ARG_LONG , +TEP_FUNC_ARG_VOID );return 0 ; }
tools/lib/traceevent/plugin_scsi.c +5 -5
@@ -417,12 +417,12 @@ int TEP_PLUGIN_LOADER(struct tep_handle *pevent) {pevent_register_print_function (pevent, process_scsi_trace_parse_cdb, -PEVENT_FUNC_ARG_STRING , +TEP_FUNC_ARG_STRING ,"scsi_trace_parse_cdb" , -PEVENT_FUNC_ARG_PTR , -PEVENT_FUNC_ARG_PTR , -PEVENT_FUNC_ARG_INT , -PEVENT_FUNC_ARG_VOID ); +TEP_FUNC_ARG_PTR , +TEP_FUNC_ARG_PTR , +TEP_FUNC_ARG_INT , +TEP_FUNC_ARG_VOID );return 0 ; }
tools/lib/traceevent/plugin_xen.c +3 -3
@@ -123,10 +123,10 @@ int TEP_PLUGIN_LOADER(struct tep_handle *pevent) {pevent_register_print_function (pevent, process_xen_hypercall_name, -PEVENT_FUNC_ARG_STRING , +TEP_FUNC_ARG_STRING ,"xen_hypercall_name" , -PEVENT_FUNC_ARG_INT , -PEVENT_FUNC_ARG_VOID ); +TEP_FUNC_ARG_INT , +TEP_FUNC_ARG_VOID );return 0 ; }
Signature · 1 line
2.18.0
tip-bot for Tzvetomir Stoyanov (VMware)
merge bot[tip:perf/urgent] tools lib traceevent: Rename pevent_function* APIs
tools lib traceevent: Rename pevent_function* APIs
Commit-ID: 3cf477836e24187f2f3acbbf48c80a478d979093 Gitweb: https://git.kernel.org/tip/3cf477836e24187f2f3acbbf48c80a478d979093 Author: Tzvetomir Stoyanov (VMware) <[email protected]> AuthorDate: Wed, 8 Aug 2018 14:02:59 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Mon, 13 Aug 2018 15:24:26 -0300
tools lib traceevent: Rename pevent_function* APIs
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
APIs: pevent_function_handler, pevent_func_handler, pevent_func_arg_type, PEVENT_FUNC_ARG_VOID, PEVENT_FUNC_ARG_INT, PEVENT_FUNC_ARG_LONG, PEVENT_FUNC_ARG_STRING, PEVENT_FUNC_ARG_PTRS, PEVENT_FUNC_ARG_MAX_TYPES
--- tools/lib/traceevent/event-parse.c | 62 +++++++++++++++++----------------- tools/lib/traceevent/event-parse.h | 30 ++++++++-------- tools/lib/traceevent/plugin_cfg80211.c | 6 ++-- tools/lib/traceevent/plugin_jbd2.c | 12 +++---- tools/lib/traceevent/plugin_kvm.c | 6 ++-- tools/lib/traceevent/plugin_scsi.c | 10 +++--- tools/lib/traceevent/plugin_xen.c | 6 ++-- 7 files changed, 66 insertions(+), 66 deletions(-)
tools/lib/traceevent/event-parse.c +31 -31
@@ -94,14 +94,14 @@ struct event_handler {struct pevent_func_params {struct pevent_func_params *next; -enum pevent_func_arg_type type; +enum tep_func_arg_type type; }; -struct pevent_function_handler { -struct pevent_function_handler *next; -enum pevent_func_arg_type ret_type; +struct tep_function_handler { +struct tep_function_handler *next; +enum tep_func_arg_type ret_type;char *name; -pevent_func_handler func; +tep_func_handler func;struct pevent_func_params *params;int nr_args; };
@@ -110,7 +110,7 @@ static unsigned long long process_defined_func(struct trace_seq *s, void *data, int size, struct event_format *event, struct print_arg *arg); -static void free_func_handle (struct pevent_function_handler *func); +static void free_func_handle (struct tep_function_handler *func);/** * pevent_buffer_init - init buffer for parsing
@@ -2914,10 +2914,10 @@ process_bitmask(struct event_format *event __maybe_unused, struct print_arg *argreturn EVENT_ERROR ; } -static struct pevent_function_handler * +static struct tep_function_handler *find_func_handler (struct tep_handle *pevent,char *func_name) { -struct pevent_function_handler *func; +struct tep_function_handler *func;if (!pevent)return NULL ;
@@ -2932,8 +2932,8 @@ find_func_handler(struct tep_handle *pevent, char *func_name)static void remove_func_handler (struct tep_handle *pevent,char *func_name) { -struct pevent_function_handler *func; -struct pevent_function_handler **next; +struct tep_function_handler *func; +struct tep_function_handler **next; next = &pevent->func_handlers;while ((func = *next)) {
@@ -2947,7 +2947,7 @@ static void remove_func_handler(struct tep_handle *pevent, char *func_name) }static enum event_type -process_func_handler (struct event_format *event,struct pevent_function_handler *func, +process_func_handler (struct event_format *event,struct tep_function_handler *func,struct print_arg *arg,char **tok) {struct print_arg **next_arg;
@@ -3008,7 +3008,7 @@ static enum event_type process_function(struct event_format *event, struct print_arg *arg, char *token, char **tok) { - struct pevent_function_handler *func; + struct tep_function_handler *func;if (strcmp (token,"__print_flags" ) ==0 ) {free_token (token);
@@ -4132,7 +4132,7 @@ static unsigned long long process_defined_func(struct trace_seq *s, void *data, int size, struct event_format *event, struct print_arg *arg) { - struct pevent_function_handler *func_handle = arg->func.func; + struct tep_function_handler *func_handle = arg->func.func;struct pevent_func_params *param;unsigned long long *args;unsigned long long ret;
@@ -4159,12 +4159,12 @@ process_defined_func(struct trace_seq *s, void *data, int size,for (i =0 ; i < func_handle->nr_args; i++) {switch (param->type) { -case PEVENT_FUNC_ARG_INT : -case PEVENT_FUNC_ARG_LONG : -case PEVENT_FUNC_ARG_PTR : +case TEP_FUNC_ARG_INT : +case TEP_FUNC_ARG_LONG : +case TEP_FUNC_ARG_PTR : args[i] =eval_num_arg (data, size, event, farg);break ; -case PEVENT_FUNC_ARG_STRING : +case TEP_FUNC_ARG_STRING :trace_seq_init (&str);print_str_arg (&str, data, size, event,"%s" ,-1 , farg);trace_seq_terminate (&str);
@@ -6461,7 +6461,7 @@ int tep_print_func_field(struct trace_seq *s, const char *fmt,return -1 ; } -static void free_func_handle (struct pevent_function_handler *func) +static void free_func_handle (struct tep_function_handler *func) {struct pevent_func_params *params;
@@ -6482,24 +6482,24 @@ static void free_func_handle(struct pevent_function_handler *func)* @func: the function to process the helper function * @ret_type: the return type of the helper function * @name: the name of the helper function -* @parameters: A list of enum pevent_func_arg_type +* @parameters: A list of enum tep_func_arg_type * * Some events may have helper functions in the print format arguments. * This allows a plugin to dynamically create a way to process one * of these functions. * -* The @parameters is a variable list of pevent_func_arg_type enums that -* must end with PEVENT_FUNC_ARG_VOID. +* The @parameters is a variable list of tep_func_arg_type enums that +* must end with TEP_FUNC_ARG_VOID. */ int pevent_register_print_function (struct tep_handle *pevent, -pevent_func_handler func, -enum pevent_func_arg_type ret_type, +tep_func_handler func, +enum tep_func_arg_type ret_type,char *name, ...) { -struct pevent_function_handler *func_handle; +struct tep_function_handler *func_handle;struct pevent_func_params **next_param;struct pevent_func_params *param; -enum pevent_func_arg_type type; +enum tep_func_arg_type type;va_list ap;int ret;
@@ -6532,11 +6532,11 @@ int pevent_register_print_function(struct tep_handle *pevent, next_param = &(func_handle->params);va_start (ap, name);for (;;) { - type = va_arg(ap, enum pevent_func_arg_type); -if (type ==PEVENT_FUNC_ARG_VOID ) + type = va_arg(ap, enum tep_func_arg_type); +if (type ==TEP_FUNC_ARG_VOID )break ; -if (type >=PEVENT_FUNC_ARG_MAX_TYPES ) { +if (type >=TEP_FUNC_ARG_MAX_TYPES ) {do_warning ("Invalid argument type %d" , type); ret =TEP_ERRNO__INVALID_ARG_TYPE ; goto out_free;
@@ -6579,9 +6579,9 @@ int pevent_register_print_function(struct tep_handle *pevent,* Returns 0 if the handler was removed successully, -1 otherwise. */ int pevent_unregister_print_function (struct tep_handle *pevent, -pevent_func_handler func,char *name) +tep_func_handler func,char *name) { -struct pevent_function_handler *func_handle; +struct tep_function_handler *func_handle; func_handle =find_func_handler (pevent, name);if (func_handle && func_handle->func == func) {
@@ -6819,7 +6819,7 @@ void tep_free(struct tep_handle *pevent)struct cmdline_list *cmdlist, *cmdnext;struct func_list *funclist, *funcnext;struct printk_list *printklist, *printknext; -struct pevent_function_handler *func_handler; +struct tep_function_handler *func_handler;struct event_handler *handle;int i;
tools/lib/traceevent/event-parse.h +15 -15
@@ -269,10 +269,10 @@ struct print_arg_op {struct print_arg *right; }; -struct pevent_function_handler ; +struct tep_function_handler ;struct print_arg_func { -struct pevent_function_handler *func; +struct tep_function_handler *func;struct print_arg *args; };
@@ -361,16 +361,16 @@ enum event_type { EVENT_SQUOTE, }; -typedef unsigned long long (*pevent_func_handler )(struct trace_seq *s, -unsigned long long *args); +typedef unsigned long long (*tep_func_handler )(struct trace_seq *s, +unsigned long long *args); -enum pevent_func_arg_type { -PEVENT_FUNC_ARG_VOID , -PEVENT_FUNC_ARG_INT , -PEVENT_FUNC_ARG_LONG , -PEVENT_FUNC_ARG_STRING , -PEVENT_FUNC_ARG_PTR , -PEVENT_FUNC_ARG_MAX_TYPES +enum tep_func_arg_type { +TEP_FUNC_ARG_VOID , +TEP_FUNC_ARG_INT , +TEP_FUNC_ARG_LONG , +TEP_FUNC_ARG_STRING , +TEP_FUNC_ARG_PTR , +TEP_FUNC_ARG_MAX_TYPES };enum tep_flag {
@@ -524,7 +524,7 @@ struct tep_handle {struct format_field *bprint_buf_field;struct event_handler *handlers; -struct pevent_function_handler *func_handlers; +struct tep_function_handler *func_handlers;/* cache */ struct event_format *last_event;
@@ -680,11 +680,11 @@ int pevent_unregister_event_handler(struct tep_handle *pevent, int id, const char *sys_name, const char *event_name, tep_event_handler_func func, void *context);int pevent_register_print_function (struct tep_handle *pevent, -pevent_func_handler func, -enum pevent_func_arg_type ret_type, +tep_func_handler func, +enum tep_func_arg_type ret_type,char *name, ...);int pevent_unregister_print_function (struct tep_handle *pevent, -pevent_func_handler func,char *name); +tep_func_handler func,char *name);struct format_field *tep_find_common_field (struct event_format *event,const char *name);struct format_field *tep_find_field (struct event_format *event,const char *name);
tools/lib/traceevent/plugin_cfg80211.c +3 -3
@@ -29,10 +29,10 @@ int TEP_PLUGIN_LOADER(struct tep_handle *pevent) {pevent_register_print_function (pevent, process___le16_to_cpup, -PEVENT_FUNC_ARG_INT , +TEP_FUNC_ARG_INT ,"__le16_to_cpup" , -PEVENT_FUNC_ARG_PTR , -PEVENT_FUNC_ARG_VOID ); +TEP_FUNC_ARG_PTR , +TEP_FUNC_ARG_VOID );return 0 ; }
tools/lib/traceevent/plugin_jbd2.c +6 -6
@@ -51,17 +51,17 @@ int TEP_PLUGIN_LOADER(struct tep_handle *pevent) {pevent_register_print_function (pevent, process_jbd2_dev_to_name, -PEVENT_FUNC_ARG_STRING , +TEP_FUNC_ARG_STRING ,"jbd2_dev_to_name" , -PEVENT_FUNC_ARG_INT , -PEVENT_FUNC_ARG_VOID ); +TEP_FUNC_ARG_INT , +TEP_FUNC_ARG_VOID );pevent_register_print_function (pevent, process_jiffies_to_msecs, -PEVENT_FUNC_ARG_LONG , +TEP_FUNC_ARG_LONG ,"jiffies_to_msecs" , -PEVENT_FUNC_ARG_LONG , -PEVENT_FUNC_ARG_VOID ); +TEP_FUNC_ARG_LONG , +TEP_FUNC_ARG_VOID );return 0 ; }
tools/lib/traceevent/plugin_kvm.c +3 -3
@@ -479,10 +479,10 @@ int TEP_PLUGIN_LOADER(struct tep_handle *pevent)pevent_register_print_function (pevent, process_is_writable_pte, -PEVENT_FUNC_ARG_INT , +TEP_FUNC_ARG_INT ,"is_writable_pte" , -PEVENT_FUNC_ARG_LONG , -PEVENT_FUNC_ARG_VOID ); +TEP_FUNC_ARG_LONG , +TEP_FUNC_ARG_VOID );return 0 ; }
tools/lib/traceevent/plugin_scsi.c +5 -5
@@ -417,12 +417,12 @@ int TEP_PLUGIN_LOADER(struct tep_handle *pevent) {pevent_register_print_function (pevent, process_scsi_trace_parse_cdb, -PEVENT_FUNC_ARG_STRING , +TEP_FUNC_ARG_STRING ,"scsi_trace_parse_cdb" , -PEVENT_FUNC_ARG_PTR , -PEVENT_FUNC_ARG_PTR , -PEVENT_FUNC_ARG_INT , -PEVENT_FUNC_ARG_VOID ); +TEP_FUNC_ARG_PTR , +TEP_FUNC_ARG_PTR , +TEP_FUNC_ARG_INT , +TEP_FUNC_ARG_VOID );return 0 ; }
tools/lib/traceevent/plugin_xen.c +3 -3
@@ -123,10 +123,10 @@ int TEP_PLUGIN_LOADER(struct tep_handle *pevent) {pevent_register_print_function (pevent, process_xen_hypercall_name, -PEVENT_FUNC_ARG_STRING , +TEP_FUNC_ARG_STRING ,"xen_hypercall_name" , -PEVENT_FUNC_ARG_INT , -PEVENT_FUNC_ARG_VOID ); +TEP_FUNC_ARG_INT , +TEP_FUNC_ARG_VOID );return 0 ; }
RFC PATCH v2 15/24 tools/lib/traceevent, tools/perf: Rename traceevent_plugin_* APIs
In reply to Steven RostedtFrom: "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 "traceevent_". This changes
APIs: traceevent_plugin_list_options, traceevent_plugin_free_options_list, traceevent_plugin_add_options, traceevent_plugin_remove_options, traceevent_print_plugins
--- tools/lib/traceevent/event-parse.h | 16 +++++++-------- tools/lib/traceevent/event-plugin.c | 28 +++++++++++++------------- tools/lib/traceevent/plugin_function.c | 4 ++-- 3 files changed, 24 insertions(+), 24 deletions(-)
tools/lib/traceevent/event-parse.h +8 -8
@@ -438,14 +438,14 @@ struct plugin_list;struct plugin_list *tep_load_plugins (struct tep_handle *pevent);void tep_unload_plugins (struct plugin_list *plugin_list,struct tep_handle *pevent); -char **traceevent_plugin_list_options (void ); -void traceevent_plugin_free_options_list (char **list); -int traceevent_plugin_add_options (const char *name, -struct tep_plugin_option *options); -void traceevent_plugin_remove_options (struct tep_plugin_option *options); -void traceevent_print_plugins (struct trace_seq *s, -const char *prefix,const char *suffix, -const struct plugin_list *list); +char **tep_plugin_list_options (void ); +void tep_plugin_free_options_list (char **list); +int tep_plugin_add_options (const char *name, +struct tep_plugin_option *options); +void tep_plugin_remove_options (struct tep_plugin_option *options); +void tep_print_plugins (struct trace_seq *s, +const char *prefix,const char *suffix, +const struct plugin_list *list);struct cmdline ;struct cmdline_list ;
tools/lib/traceevent/event-plugin.c +14 -14
@@ -97,7 +97,7 @@ static int update_option_value(struct tep_plugin_option *op, const char *val) }/** -* traceevent_plugin_list_options - get list of plugin options +* tep_plugin_list_options - get list of plugin options * * Returns an array of char strings that list the currently registered * plugin options in the format of <plugin>:<option>. This list can be
@@ -106,9 +106,9 @@ static int update_option_value(struct tep_plugin_option *op, const char *val)* Returns NULL if there's no options registered. On error it returns * INVALID_PLUGIN_LIST_OPTION * -* Must be freed with traceevent_plugin_free_options_list(). +* Must be freed with tep_plugin_free_options_list(). */ -char **traceevent_plugin_list_options (void ) +char **tep_plugin_list_options (void ) {struct registered_plugin_options *reg;struct tep_plugin_option *op;
@@ -146,7 +146,7 @@ char **traceevent_plugin_list_options(void)return INVALID_PLUGIN_LIST_OPTION ; } -void traceevent_plugin_free_options_list (char **list) +void tep_plugin_free_options_list (char **list) {int i;
@@ -215,14 +215,14 @@ update_option(const char *file, struct tep_plugin_option *option) }/** -* traceevent_plugin_add_options - Add a set of options by a plugin +* tep_plugin_add_options - Add a set of options by a plugin * @name: The name of the plugin adding the options * @options: The set of options being loaded * * Sets the options with the values that have been added by user. */ -int traceevent_plugin_add_options (const char *name, -struct tep_plugin_option *options) +int tep_plugin_add_options (const char *name, +struct tep_plugin_option *options) {struct registered_plugin_options *reg;
@@ -241,10 +241,10 @@ 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 +* tep_plugin_remove_options - remove plugin options that were registered +* @options: Options to removed that were registered with tep_plugin_add_options */ -void traceevent_plugin_remove_options (struct tep_plugin_option *options) +void tep_plugin_remove_options (struct tep_plugin_option *options) {struct registered_plugin_options **last;struct registered_plugin_options *reg;
@@ -260,7 +260,7 @@ void traceevent_plugin_remove_options(struct tep_plugin_option *options) }/** -* traceevent_print_plugins - print out the list of plugins loaded +* tep_print_plugins - print out the list of plugins loaded * @s: the trace_seq descripter to write to * @prefix: The prefix string to add before listing the option name * @suffix: The suffix string ot append after the option name
@@ -270,9 +270,9 @@ void traceevent_plugin_remove_options(struct tep_plugin_option *options)* returned by tep_load_plugins(). Use @prefix and @suffix for formating: * @prefix = " ", @suffix = "\n". */ -void traceevent_print_plugins (struct trace_seq *s, -const char *prefix,const char *suffix, -const struct plugin_list *list) +void tep_print_plugins (struct trace_seq *s, +const char *prefix,const char *suffix, +const struct plugin_list *list) {while (list) {trace_seq_printf (s,"%s%s%s" , prefix, list->name, suffix);
tools/lib/traceevent/plugin_function.c +2 -2
@@ -168,7 +168,7 @@ int TEP_PLUGIN_LOADER(struct tep_handle *pevent)pevent_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 ; }
@@ -186,7 +186,7 @@ void TEP_PLUGIN_UNLOADER(struct tep_handle *pevent)free (fstack[i].stack); } -traceevent_plugin_remove_options (plugin_options); +tep_plugin_remove_options (plugin_options);free (fstack); fstack =NULL ;
Signature · 1 line
2.18.0
tip-bot for Tzvetomir Stoyanov (VMware)
merge bot[tip:perf/urgent] tools lib traceevent, perf tools: Rename traceevent_plugin_* APIs
tools lib traceevent, perf tools: Rename traceevent_plugin_* APIs
Commit-ID: ca2921dd90268dc37cd5096eb985da4288aa7041 Gitweb: https://git.kernel.org/tip/ca2921dd90268dc37cd5096eb985da4288aa7041 Author: Tzvetomir Stoyanov (VMware) <[email protected]> AuthorDate: Wed, 8 Aug 2018 14:03:00 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Mon, 13 Aug 2018 15:25:36 -0300
tools lib traceevent, perf tools: Rename traceevent_plugin_* APIs
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 "traceevent_". This changes
APIs: traceevent_plugin_list_options, traceevent_plugin_free_options_list, traceevent_plugin_add_options, traceevent_plugin_remove_options, traceevent_print_plugins
--- tools/lib/traceevent/event-parse.h | 16 ++++++++-------- tools/lib/traceevent/event-plugin.c | 28 ++++++++++++++-------------- tools/lib/traceevent/plugin_function.c | 4 ++-- 3 files changed, 24 insertions(+), 24 deletions(-)
tools/lib/traceevent/event-parse.h +8 -8
@@ -438,14 +438,14 @@ struct plugin_list;struct plugin_list *tep_load_plugins (struct tep_handle *pevent);void tep_unload_plugins (struct plugin_list *plugin_list,struct tep_handle *pevent); -char **traceevent_plugin_list_options (void ); -void traceevent_plugin_free_options_list (char **list); -int traceevent_plugin_add_options (const char *name, -struct tep_plugin_option *options); -void traceevent_plugin_remove_options (struct tep_plugin_option *options); -void traceevent_print_plugins (struct trace_seq *s, -const char *prefix,const char *suffix, -const struct plugin_list *list); +char **tep_plugin_list_options (void ); +void tep_plugin_free_options_list (char **list); +int tep_plugin_add_options (const char *name, +struct tep_plugin_option *options); +void tep_plugin_remove_options (struct tep_plugin_option *options); +void tep_print_plugins (struct trace_seq *s, +const char *prefix,const char *suffix, +const struct plugin_list *list);struct cmdline ;struct cmdline_list ;
tools/lib/traceevent/event-plugin.c +14 -14
@@ -97,7 +97,7 @@ static int update_option_value(struct tep_plugin_option *op, const char *val) }/** -* traceevent_plugin_list_options - get list of plugin options +* tep_plugin_list_options - get list of plugin options * * Returns an array of char strings that list the currently registered * plugin options in the format of <plugin>:<option>. This list can be
@@ -106,9 +106,9 @@ static int update_option_value(struct tep_plugin_option *op, const char *val)* Returns NULL if there's no options registered. On error it returns * INVALID_PLUGIN_LIST_OPTION * -* Must be freed with traceevent_plugin_free_options_list(). +* Must be freed with tep_plugin_free_options_list(). */ -char **traceevent_plugin_list_options (void ) +char **tep_plugin_list_options (void ) {struct registered_plugin_options *reg;struct tep_plugin_option *op;
@@ -146,7 +146,7 @@ char **traceevent_plugin_list_options(void)return INVALID_PLUGIN_LIST_OPTION ; } -void traceevent_plugin_free_options_list (char **list) +void tep_plugin_free_options_list (char **list) {int i;
@@ -215,14 +215,14 @@ update_option(const char *file, struct tep_plugin_option *option) }/** -* traceevent_plugin_add_options - Add a set of options by a plugin +* tep_plugin_add_options - Add a set of options by a plugin * @name: The name of the plugin adding the options * @options: The set of options being loaded * * Sets the options with the values that have been added by user. */ -int traceevent_plugin_add_options (const char *name, -struct tep_plugin_option *options) +int tep_plugin_add_options (const char *name, +struct tep_plugin_option *options) {struct registered_plugin_options *reg;
@@ -241,10 +241,10 @@ 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 +* tep_plugin_remove_options - remove plugin options that were registered +* @options: Options to removed that were registered with tep_plugin_add_options */ -void traceevent_plugin_remove_options (struct tep_plugin_option *options) +void tep_plugin_remove_options (struct tep_plugin_option *options) {struct registered_plugin_options **last;struct registered_plugin_options *reg;
@@ -260,7 +260,7 @@ void traceevent_plugin_remove_options(struct tep_plugin_option *options) }/** -* traceevent_print_plugins - print out the list of plugins loaded +* tep_print_plugins - print out the list of plugins loaded * @s: the trace_seq descripter to write to * @prefix: The prefix string to add before listing the option name * @suffix: The suffix string ot append after the option name
@@ -270,9 +270,9 @@ void traceevent_plugin_remove_options(struct tep_plugin_option *options)* returned by tep_load_plugins(). Use @prefix and @suffix for formating: * @prefix = " ", @suffix = "\n". */ -void traceevent_print_plugins (struct trace_seq *s, -const char *prefix,const char *suffix, -const struct plugin_list *list) +void tep_print_plugins (struct trace_seq *s, +const char *prefix,const char *suffix, +const struct plugin_list *list) {while (list) {trace_seq_printf (s,"%s%s%s" , prefix, list->name, suffix);
tools/lib/traceevent/plugin_function.c +2 -2
@@ -168,7 +168,7 @@ int TEP_PLUGIN_LOADER(struct tep_handle *pevent)pevent_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 ; }
@@ -186,7 +186,7 @@ void TEP_PLUGIN_UNLOADER(struct tep_handle *pevent)free (fstack[i].stack); } -traceevent_plugin_remove_options (plugin_options); +tep_plugin_remove_options (plugin_options);free (fstack); fstack =NULL ;
RFC PATCH v2 16/24 tools/lib/traceevent: Rename pevent_filter* APIs
In reply to Steven RostedtFrom: "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
APIs: PEVENT_FILTER_ERROR_BUFSZ, pevent_filter_alloc, pevent_filter_add_filter_str, pevent_filter_match, pevent_filter_strerror, pevent_event_filtered, pevent_filter_reset, pevent_filter_clear_trivial, pevent_filter_free, pevent_filter_make_string, pevent_filter_remove_event, pevent_filter_event_has_trivial, pevent_filter_copy, pevent_update_trivial, pevent_filter_compare
--- tools/lib/traceevent/event-parse.h | 50 ++++++++--------- tools/lib/traceevent/parse-filter.c | 84 ++++++++++++++--------------- 2 files changed, 67 insertions(+), 67 deletions(-)
tools/lib/traceevent/event-parse.h +25 -25
@@ -930,16 +930,16 @@ struct filter_type {struct filter_arg *filter; }; -#define PEVENT_FILTER_ERROR_BUFSZ 1024 +#define TEP_FILTER_ERROR_BUFSZ 1024struct event_filter {struct tep_handle *pevent;int filters;struct filter_type *event_filters; -char error_buffer[PEVENT_FILTER_ERROR_BUFSZ ]; +char error_buffer[TEP_FILTER_ERROR_BUFSZ ]; }; -struct event_filter *pevent_filter_alloc (struct tep_handle *pevent); +struct event_filter *tep_filter_alloc (struct tep_handle *pevent);/* for backward compatibility */ #define FILTER_NONE TEP_ERRNO__NO_FILTER
@@ -953,39 +953,39 @@ enum filter_trivial_type { FILTER_TRIVIAL_BOTH, }; -enum tep_errno pevent_filter_add_filter_str (struct event_filter *filter, -const char *filter_str); +enum tep_errno tep_filter_add_filter_str (struct event_filter *filter, +const char *filter_str); -enum tep_errno pevent_filter_match (struct event_filter *filter, -struct tep_record *record); +enum tep_errno tep_filter_match (struct event_filter *filter, +struct tep_record *record); -int pevent_filter_strerror (struct event_filter *filter,enum tep_errno err, -char *buf,size_t buflen); +int tep_filter_strerror (struct event_filter *filter,enum tep_errno err, +char *buf,size_t buflen); -int pevent_event_filtered (struct event_filter *filter, -int event_id); +int tep_event_filtered (struct event_filter *filter, +int event_id); -void pevent_filter_reset (struct event_filter *filter); +void tep_filter_reset (struct event_filter *filter); -int pevent_filter_clear_trivial (struct event_filter *filter, -enum filter_trivial_type type); +int tep_filter_clear_trivial (struct event_filter *filter, +enum filter_trivial_type type); -void pevent_filter_free (struct event_filter *filter); +void tep_filter_free (struct event_filter *filter); -char *pevent_filter_make_string (struct event_filter *filter,int event_id); +char *tep_filter_make_string (struct event_filter *filter,int event_id); -int pevent_filter_remove_event (struct event_filter *filter, -int event_id); +int tep_filter_remove_event (struct event_filter *filter, +int event_id); -int pevent_filter_event_has_trivial (struct event_filter *filter, -int event_id, -enum filter_trivial_type type); +int tep_filter_event_has_trivial (struct event_filter *filter, +int event_id, +enum filter_trivial_type type); -int pevent_filter_copy (struct event_filter *dest,struct event_filter *source); +int tep_filter_copy (struct event_filter *dest,struct event_filter *source); -int pevent_update_trivial (struct event_filter *dest,struct event_filter *source, -enum filter_trivial_type type); +int tep_update_trivial (struct event_filter *dest,struct event_filter *source, +enum filter_trivial_type type); -int pevent_filter_compare (struct event_filter *filter1,struct event_filter *filter2); +int tep_filter_compare (struct event_filter *filter1,struct event_filter *filter2);#endif /* _PARSE_EVENTS_H */
tools/lib/traceevent/parse-filter.c +42 -42
270 lines not on this page · raw message
Signature · 1 line
2.18.0
tip-bot for Tzvetomir Stoyanov (VMware)
merge bot[tip:perf/urgent] tools lib traceevent: Rename pevent_filter* APIs
tools lib traceevent: Rename pevent_filter* APIs
Commit-ID: 64e237906963d0c26d3b25e7751b4d6aaa01f720 Gitweb: https://git.kernel.org/tip/64e237906963d0c26d3b25e7751b4d6aaa01f720 Author: Tzvetomir Stoyanov (VMware) <[email protected]> AuthorDate: Wed, 8 Aug 2018 14:03:01 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Mon, 13 Aug 2018 15:26:31 -0300
tools lib traceevent: Rename pevent_filter* APIs
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
APIs: PEVENT_FILTER_ERROR_BUFSZ, pevent_filter_alloc, pevent_filter_add_filter_str, pevent_filter_match, pevent_filter_strerror, pevent_event_filtered, pevent_filter_reset, pevent_filter_clear_trivial, pevent_filter_free, pevent_filter_make_string, pevent_filter_remove_event, pevent_filter_event_has_trivial, pevent_filter_copy, pevent_update_trivial, pevent_filter_compare
--- tools/lib/traceevent/event-parse.h | 50 +++++++++++----------- tools/lib/traceevent/parse-filter.c | 84 ++++++++++++++++++------------------- 2 files changed, 67 insertions(+), 67 deletions(-)
tools/lib/traceevent/event-parse.h +25 -25
@@ -930,16 +930,16 @@ struct filter_type {struct filter_arg *filter; }; -#define PEVENT_FILTER_ERROR_BUFSZ 1024 +#define TEP_FILTER_ERROR_BUFSZ 1024struct event_filter {struct tep_handle *pevent;int filters;struct filter_type *event_filters; -char error_buffer[PEVENT_FILTER_ERROR_BUFSZ ]; +char error_buffer[TEP_FILTER_ERROR_BUFSZ ]; }; -struct event_filter *pevent_filter_alloc (struct tep_handle *pevent); +struct event_filter *tep_filter_alloc (struct tep_handle *pevent);/* for backward compatibility */ #define FILTER_NONE TEP_ERRNO__NO_FILTER
@@ -953,39 +953,39 @@ enum filter_trivial_type { FILTER_TRIVIAL_BOTH, }; -enum tep_errno pevent_filter_add_filter_str (struct event_filter *filter, -const char *filter_str); +enum tep_errno tep_filter_add_filter_str (struct event_filter *filter, +const char *filter_str); -enum tep_errno pevent_filter_match (struct event_filter *filter, -struct tep_record *record); +enum tep_errno tep_filter_match (struct event_filter *filter, +struct tep_record *record); -int pevent_filter_strerror (struct event_filter *filter,enum tep_errno err, -char *buf,size_t buflen); +int tep_filter_strerror (struct event_filter *filter,enum tep_errno err, +char *buf,size_t buflen); -int pevent_event_filtered (struct event_filter *filter, -int event_id); +int tep_event_filtered (struct event_filter *filter, +int event_id); -void pevent_filter_reset (struct event_filter *filter); +void tep_filter_reset (struct event_filter *filter); -int pevent_filter_clear_trivial (struct event_filter *filter, -enum filter_trivial_type type); +int tep_filter_clear_trivial (struct event_filter *filter, +enum filter_trivial_type type); -void pevent_filter_free (struct event_filter *filter); +void tep_filter_free (struct event_filter *filter); -char *pevent_filter_make_string (struct event_filter *filter,int event_id); +char *tep_filter_make_string (struct event_filter *filter,int event_id); -int pevent_filter_remove_event (struct event_filter *filter, -int event_id); +int tep_filter_remove_event (struct event_filter *filter, +int event_id); -int pevent_filter_event_has_trivial (struct event_filter *filter, -int event_id, -enum filter_trivial_type type); +int tep_filter_event_has_trivial (struct event_filter *filter, +int event_id, +enum filter_trivial_type type); -int pevent_filter_copy (struct event_filter *dest,struct event_filter *source); +int tep_filter_copy (struct event_filter *dest,struct event_filter *source); -int pevent_update_trivial (struct event_filter *dest,struct event_filter *source, -enum filter_trivial_type type); +int tep_update_trivial (struct event_filter *dest,struct event_filter *source, +enum filter_trivial_type type); -int pevent_filter_compare (struct event_filter *filter1,struct event_filter *filter2); +int tep_filter_compare (struct event_filter *filter1,struct event_filter *filter2);#endif /* _PARSE_EVENTS_H */
tools/lib/traceevent/parse-filter.c +42 -42
270 lines not on this page · raw message
RFC PATCH v2 17/24 tools/lib/traceevent: Rename pevent_register / unregister APIs
In reply to Steven RostedtFrom: "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
APIs: pevent_register_print_function, pevent_unregister_print_function, pevent_register_event_handler, pevent_unregister_event_handler, pevent_register_function, pevent_register_trace_clock
--- tools/lib/traceevent/event-parse.c | 40 +++++----- tools/lib/traceevent/event-parse.h | 30 ++++---- tools/lib/traceevent/plugin_cfg80211.c | 16 ++-- tools/lib/traceevent/plugin_function.c | 8 +- tools/lib/traceevent/plugin_hrtimer.c | 20 ++--- tools/lib/traceevent/plugin_jbd2.c | 32 ++++---- tools/lib/traceevent/plugin_kmem.c | 52 ++++++------- tools/lib/traceevent/plugin_kvm.c | 88 +++++++++++----------- tools/lib/traceevent/plugin_mac80211.c | 12 +-- tools/lib/traceevent/plugin_sched_switch.c | 24 +++--- tools/lib/traceevent/plugin_scsi.c | 20 ++--- tools/lib/traceevent/plugin_xen.c | 16 ++-- 12 files changed, 179 insertions(+), 179 deletions(-)
tools/lib/traceevent/event-parse.c +20 -20
@@ -324,7 +324,7 @@ int tep_register_comm(struct tep_handle *pevent, const char *comm, int pid)return 0 ; } -int pevent_register_trace_clock (struct tep_handle *pevent,const char *trace_clock) +int tep_register_trace_clock (struct tep_handle *pevent,const char *trace_clock) { pevent->trace_clock =strdup (trace_clock);if (!pevent->trace_clock) {
@@ -544,7 +544,7 @@ pevent_find_function_address(struct tep_handle *pevent, unsigned long long addr) }/** -* pevent_register_function - register a function with a given address +* tep_register_function - register a function with a given address * @pevent: handle for the pevent * @function: the function name to register * @addr: the address the function starts at
@@ -553,8 +553,8 @@ pevent_find_function_address(struct tep_handle *pevent, unsigned long long addr)* This registers a function name with an address and module. * The @func passed in is duplicated. */ -int pevent_register_function (struct tep_handle *pevent,char *func, -unsigned long long addr,char *mod) +int tep_register_function (struct tep_handle *pevent,char *func, +unsigned long long addr,char *mod) {struct func_list *item =malloc (sizeof (*item));
@@ -6477,7 +6477,7 @@ static void free_func_handle(struct tep_function_handler *func) }/** -* pevent_register_print_function - register a helper function +* tep_register_print_function - register a helper function * @pevent: the handle to the pevent * @func: the function to process the helper function * @ret_type: the return type of the helper function
@@ -6491,10 +6491,10 @@ static void free_func_handle(struct tep_function_handler *func)* The @parameters is a variable list of tep_func_arg_type enums that * must end with TEP_FUNC_ARG_VOID. */ -int pevent_register_print_function (struct tep_handle *pevent, -tep_func_handler func, -enum tep_func_arg_type ret_type, -char *name, ...) +int tep_register_print_function (struct tep_handle *pevent, +tep_func_handler func, +enum tep_func_arg_type ret_type, +char *name, ...) {struct tep_function_handler *func_handle;struct pevent_func_params **next_param;
@@ -6569,7 +6569,7 @@ int pevent_register_print_function(struct tep_handle *pevent, }/** -* pevent_unregister_print_function - unregister a helper function +* tep_unregister_print_function - unregister a helper function * @pevent: the handle to the pevent * @func: the function to process the helper function * @name: the name of the helper function
@@ -6578,8 +6578,8 @@ int pevent_register_print_function(struct tep_handle *pevent,* * Returns 0 if the handler was removed successully, -1 otherwise. */ -int pevent_unregister_print_function (struct tep_handle *pevent, -tep_func_handler func,char *name) +int tep_unregister_print_function (struct tep_handle *pevent, +tep_func_handler func,char *name) {struct tep_function_handler *func_handle;
@@ -6615,7 +6615,7 @@ static struct event_format *pevent_search_event(struct tep_handle *pevent, int i }/** -* pevent_register_event_handler - register a way to parse an event +* tep_register_event_handler - register a way to parse an event * @pevent: the handle to the pevent * @id: the id of the event to register * @sys_name: the system name the event belongs to
@@ -6631,9 +6631,9 @@ static struct event_format *pevent_search_event(struct tep_handle *pevent, int i* If @id is >= 0, then it is used to find the event. * else @sys_name and @event_name are used. */ -int pevent_register_event_handler (struct tep_handle *pevent,int id, -const char *sys_name,const char *event_name, -tep_event_handler_func func,void *context) +int tep_register_event_handler (struct tep_handle *pevent,int id, +const char *sys_name,const char *event_name, +tep_event_handler_func func,void *context) {struct event_format *event;struct event_handler *handle;
@@ -6700,7 +6700,7 @@ static int handle_matches(struct event_handler *handler, int id, }/** -* pevent_unregister_event_handler - unregister an existing event handler +* tep_unregister_event_handler - unregister an existing event handler * @pevent: the handle to the pevent * @id: the id of the event to unregister * @sys_name: the system name the handler belongs to
@@ -6715,9 +6715,9 @@ static int handle_matches(struct event_handler *handler, int id,* * Returns 0 if handler was removed successfully, -1 if event was not found. */ -int pevent_unregister_event_handler (struct tep_handle *pevent,int id, -const char *sys_name,const char *event_name, -tep_event_handler_func func,void *context) +int tep_unregister_event_handler (struct tep_handle *pevent,int id, +const char *sys_name,const char *event_name, +tep_event_handler_func func,void *context) {struct event_format *event;struct event_handler *handle;
tools/lib/traceevent/event-parse.h +15 -15
@@ -619,9 +619,9 @@ int tep_set_function_resolver(struct tep_handle *pevent, tep_func_resolver_t *func, void *priv);void pevent_reset_function_resolver (struct tep_handle *pevent);int tep_register_comm (struct tep_handle *pevent,const char *comm,int pid); -int pevent_register_trace_clock (struct tep_handle *pevent,const char *trace_clock); -int pevent_register_function (struct tep_handle *pevent,char *name, -unsigned long long addr,char *mod); +int tep_register_trace_clock (struct tep_handle *pevent,const char *trace_clock); +int tep_register_function (struct tep_handle *pevent,char *name, +unsigned long long addr,char *mod);int tep_register_print_string (struct tep_handle *pevent,const char *fmt,unsigned long long addr);int pevent_pid_is_registered (struct tep_handle *pevent,int pid);
@@ -673,18 +673,18 @@ int tep_print_func_field(struct trace_seq *s, const char *fmt, struct event_format *event, const char *name, struct tep_record *record, int err); -int pevent_register_event_handler (struct tep_handle *pevent,int id, -const char *sys_name,const char *event_name, -tep_event_handler_func func,void *context); -int pevent_unregister_event_handler (struct tep_handle *pevent,int id, -const char *sys_name,const char *event_name, -tep_event_handler_func func,void *context); -int pevent_register_print_function (struct tep_handle *pevent, -tep_func_handler func, -enum tep_func_arg_type ret_type, -char *name, ...); -int pevent_unregister_print_function (struct tep_handle *pevent, -tep_func_handler func,char *name); +int tep_register_event_handler (struct tep_handle *pevent,int id, +const char *sys_name,const char *event_name, +tep_event_handler_func func,void *context); +int tep_unregister_event_handler (struct tep_handle *pevent,int id, +const char *sys_name,const char *event_name, +tep_event_handler_func func,void *context); +int tep_register_print_function (struct tep_handle *pevent, +tep_func_handler func, +enum tep_func_arg_type ret_type, +char *name, ...); +int tep_unregister_print_function (struct tep_handle *pevent, +tep_func_handler func,char *name);struct format_field *tep_find_common_field (struct event_format *event,const char *name);struct format_field *tep_find_field (struct event_format *event,const char *name);
tools/lib/traceevent/plugin_cfg80211.c +8 -8
@@ -27,17 +27,17 @@ process___le16_to_cpup(struct trace_seq *s, unsigned long long *args)int TEP_PLUGIN_LOADER (struct tep_handle *pevent) { -pevent_register_print_function (pevent, - process___le16_to_cpup, -TEP_FUNC_ARG_INT , -"__le16_to_cpup" , -TEP_FUNC_ARG_PTR , -TEP_FUNC_ARG_VOID ); +tep_register_print_function (pevent, + process___le16_to_cpup, +TEP_FUNC_ARG_INT , +"__le16_to_cpup" , +TEP_FUNC_ARG_PTR , +TEP_FUNC_ARG_VOID );return 0 ; }void TEP_PLUGIN_UNLOADER (struct tep_handle *pevent) { -pevent_unregister_print_function (pevent, process___le16_to_cpup, -"__le16_to_cpup" ); +tep_unregister_print_function (pevent, process___le16_to_cpup, +"__le16_to_cpup" ); }
tools/lib/traceevent/plugin_function.c +4 -4
@@ -165,8 +165,8 @@ static int function_handler(struct trace_seq *s, struct tep_record *record,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 );tep_plugin_add_options ("ftrace" , plugin_options);
@@ -177,8 +177,8 @@ 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++)
tools/lib/traceevent/plugin_hrtimer.c +10 -10
@@ -68,21 +68,21 @@ static int timer_start_handler(struct trace_seq *s,int TEP_PLUGIN_LOADER (struct tep_handle *pevent) { -pevent_register_event_handler (pevent,-1 , -"timer" ,"hrtimer_expire_entry" , - timer_expire_handler,NULL ); +tep_register_event_handler (pevent,-1 , +"timer" ,"hrtimer_expire_entry" , + timer_expire_handler,NULL ); -pevent_register_event_handler (pevent,-1 ,"timer" ,"hrtimer_start" , - timer_start_handler,NULL ); +tep_register_event_handler (pevent,-1 ,"timer" ,"hrtimer_start" , + timer_start_handler,NULL );return 0 ; }void TEP_PLUGIN_UNLOADER (struct tep_handle *pevent) { -pevent_unregister_event_handler (pevent,-1 , -"timer" ,"hrtimer_expire_entry" , - timer_expire_handler,NULL ); +tep_unregister_event_handler (pevent,-1 , +"timer" ,"hrtimer_expire_entry" , + timer_expire_handler,NULL ); -pevent_unregister_event_handler (pevent,-1 ,"timer" ,"hrtimer_start" , - timer_start_handler,NULL ); +tep_unregister_event_handler (pevent,-1 ,"timer" ,"hrtimer_start" , + timer_start_handler,NULL ); }
tools/lib/traceevent/plugin_jbd2.c +16 -16
@@ -49,27 +49,27 @@ process_jiffies_to_msecs(struct trace_seq *s, unsigned long long *args)int TEP_PLUGIN_LOADER (struct tep_handle *pevent) { -pevent_register_print_function (pevent, - process_jbd2_dev_to_name, -TEP_FUNC_ARG_STRING , -"jbd2_dev_to_name" , -TEP_FUNC_ARG_INT , -TEP_FUNC_ARG_VOID ); +tep_register_print_function (pevent, + process_jbd2_dev_to_name, +TEP_FUNC_ARG_STRING , +"jbd2_dev_to_name" , +TEP_FUNC_ARG_INT , +TEP_FUNC_ARG_VOID ); -pevent_register_print_function (pevent, - process_jiffies_to_msecs, -TEP_FUNC_ARG_LONG , -"jiffies_to_msecs" , -TEP_FUNC_ARG_LONG , -TEP_FUNC_ARG_VOID ); +tep_register_print_function (pevent, + process_jiffies_to_msecs, +TEP_FUNC_ARG_LONG , +"jiffies_to_msecs" , +TEP_FUNC_ARG_LONG , +TEP_FUNC_ARG_VOID );return 0 ; }void TEP_PLUGIN_UNLOADER (struct tep_handle *pevent) { -pevent_unregister_print_function (pevent, process_jbd2_dev_to_name, -"jbd2_dev_to_name" ); +tep_unregister_print_function (pevent, process_jbd2_dev_to_name, +"jbd2_dev_to_name" ); -pevent_unregister_print_function (pevent, process_jiffies_to_msecs, -"jiffies_to_msecs" ); +tep_unregister_print_function (pevent, process_jiffies_to_msecs, +"jiffies_to_msecs" ); }
tools/lib/traceevent/plugin_kmem.c +26 -26
71 lines not on this page · raw message
tools/lib/traceevent/plugin_kvm.c +44 -44
119 lines not on this page · raw message
tools/lib/traceevent/plugin_mac80211.c +6 -6
@@ -88,15 +88,15 @@ static int drv_bss_info_changed(struct trace_seq *s,int TEP_PLUGIN_LOADER (struct tep_handle *pevent) { -pevent_register_event_handler (pevent,-1 ,"mac80211" , -"drv_bss_info_changed" , - drv_bss_info_changed,NULL ); +tep_register_event_handler (pevent,-1 ,"mac80211" , +"drv_bss_info_changed" , + drv_bss_info_changed,NULL );return 0 ; }void TEP_PLUGIN_UNLOADER (struct tep_handle *pevent) { -pevent_unregister_event_handler (pevent,-1 ,"mac80211" , -"drv_bss_info_changed" , - drv_bss_info_changed,NULL ); +tep_unregister_event_handler (pevent,-1 ,"mac80211" , +"drv_bss_info_changed" , + drv_bss_info_changed,NULL ); }
tools/lib/traceevent/plugin_sched_switch.c +12 -12
@@ -136,25 +136,25 @@ static int sched_switch_handler(struct trace_seq *s,int TEP_PLUGIN_LOADER (struct tep_handle *pevent) { -pevent_register_event_handler (pevent,-1 ,"sched" ,"sched_switch" , - sched_switch_handler,NULL ); +tep_register_event_handler (pevent,-1 ,"sched" ,"sched_switch" , + sched_switch_handler,NULL ); -pevent_register_event_handler (pevent,-1 ,"sched" ,"sched_wakeup" , - sched_wakeup_handler,NULL ); +tep_register_event_handler (pevent,-1 ,"sched" ,"sched_wakeup" , + sched_wakeup_handler,NULL ); -pevent_register_event_handler (pevent,-1 ,"sched" ,"sched_wakeup_new" , - sched_wakeup_handler,NULL ); +tep_register_event_handler (pevent,-1 ,"sched" ,"sched_wakeup_new" , + sched_wakeup_handler,NULL );return 0 ; }void TEP_PLUGIN_UNLOADER (struct tep_handle *pevent) { -pevent_unregister_event_handler (pevent,-1 ,"sched" ,"sched_switch" , - sched_switch_handler,NULL ); +tep_unregister_event_handler (pevent,-1 ,"sched" ,"sched_switch" , + sched_switch_handler,NULL ); -pevent_unregister_event_handler (pevent,-1 ,"sched" ,"sched_wakeup" , - sched_wakeup_handler,NULL ); +tep_unregister_event_handler (pevent,-1 ,"sched" ,"sched_wakeup" , + sched_wakeup_handler,NULL ); -pevent_unregister_event_handler (pevent,-1 ,"sched" ,"sched_wakeup_new" , - sched_wakeup_handler,NULL ); +tep_unregister_event_handler (pevent,-1 ,"sched" ,"sched_wakeup_new" , + sched_wakeup_handler,NULL ); }
tools/lib/traceevent/plugin_scsi.c +10 -10
@@ -415,19 +415,19 @@ unsigned long long process_scsi_trace_parse_cdb(struct trace_seq *s,int TEP_PLUGIN_LOADER (struct tep_handle *pevent) { -pevent_register_print_function (pevent, - process_scsi_trace_parse_cdb, -TEP_FUNC_ARG_STRING , -"scsi_trace_parse_cdb" , -TEP_FUNC_ARG_PTR , -TEP_FUNC_ARG_PTR , -TEP_FUNC_ARG_INT , -TEP_FUNC_ARG_VOID ); +tep_register_print_function (pevent, + process_scsi_trace_parse_cdb, +TEP_FUNC_ARG_STRING , +"scsi_trace_parse_cdb" , +TEP_FUNC_ARG_PTR , +TEP_FUNC_ARG_PTR , +TEP_FUNC_ARG_INT , +TEP_FUNC_ARG_VOID );return 0 ; }void TEP_PLUGIN_UNLOADER (struct tep_handle *pevent) { -pevent_unregister_print_function (pevent, process_scsi_trace_parse_cdb, -"scsi_trace_parse_cdb" ); +tep_unregister_print_function (pevent, process_scsi_trace_parse_cdb, +"scsi_trace_parse_cdb" ); }
tools/lib/traceevent/plugin_xen.c +8 -8
@@ -121,17 +121,17 @@ unsigned long long process_xen_hypercall_name(struct trace_seq *s,int TEP_PLUGIN_LOADER (struct tep_handle *pevent) { -pevent_register_print_function (pevent, - process_xen_hypercall_name, -TEP_FUNC_ARG_STRING , -"xen_hypercall_name" , -TEP_FUNC_ARG_INT , -TEP_FUNC_ARG_VOID ); +tep_register_print_function (pevent, + process_xen_hypercall_name, +TEP_FUNC_ARG_STRING , +"xen_hypercall_name" , +TEP_FUNC_ARG_INT , +TEP_FUNC_ARG_VOID );return 0 ; }void TEP_PLUGIN_UNLOADER (struct tep_handle *pevent) { -pevent_unregister_print_function (pevent, process_xen_hypercall_name, -"xen_hypercall_name" ); +tep_unregister_print_function (pevent, process_xen_hypercall_name, +"xen_hypercall_name" ); }
Signature · 1 line
2.18.0
tip-bot for Tzvetomir Stoyanov (VMware)
merge bot[tip:perf/urgent] tools lib traceevent: Rename pevent_register / unregister APIs
tools lib traceevent: Rename pevent_register / unregister APIs
Commit-ID: b843e9c3a271a068b67df74ef24abb7c81f2463c Gitweb: https://git.kernel.org/tip/b843e9c3a271a068b67df74ef24abb7c81f2463c Author: Tzvetomir Stoyanov (VMware) <[email protected]> AuthorDate: Wed, 8 Aug 2018 14:03:02 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Mon, 13 Aug 2018 15:27:35 -0300
tools lib traceevent: Rename pevent_register / unregister APIs
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
APIs: pevent_register_print_function, pevent_unregister_print_function, pevent_register_event_handler, pevent_unregister_event_handler, pevent_register_function, pevent_register_trace_clock
--- tools/lib/traceevent/event-parse.c | 40 +++++++------- tools/lib/traceevent/event-parse.h | 30 +++++----- tools/lib/traceevent/plugin_cfg80211.c | 16 +++--- tools/lib/traceevent/plugin_function.c | 8 +-- tools/lib/traceevent/plugin_hrtimer.c | 20 +++---- tools/lib/traceevent/plugin_jbd2.c | 32 +++++------ tools/lib/traceevent/plugin_kmem.c | 52 +++++++++--------- tools/lib/traceevent/plugin_kvm.c | 88 +++++++++++++++--------------- tools/lib/traceevent/plugin_mac80211.c | 12 ++-- tools/lib/traceevent/plugin_sched_switch.c | 24 ++++---- tools/lib/traceevent/plugin_scsi.c | 20 +++---- tools/lib/traceevent/plugin_xen.c | 16 +++--- 12 files changed, 179 insertions(+), 179 deletions(-)
tools/lib/traceevent/event-parse.c +20 -20
@@ -324,7 +324,7 @@ int tep_register_comm(struct tep_handle *pevent, const char *comm, int pid)return 0 ; } -int pevent_register_trace_clock (struct tep_handle *pevent,const char *trace_clock) +int tep_register_trace_clock (struct tep_handle *pevent,const char *trace_clock) { pevent->trace_clock =strdup (trace_clock);if (!pevent->trace_clock) {
@@ -544,7 +544,7 @@ pevent_find_function_address(struct tep_handle *pevent, unsigned long long addr) }/** -* pevent_register_function - register a function with a given address +* tep_register_function - register a function with a given address * @pevent: handle for the pevent * @function: the function name to register * @addr: the address the function starts at
@@ -553,8 +553,8 @@ pevent_find_function_address(struct tep_handle *pevent, unsigned long long addr)* This registers a function name with an address and module. * The @func passed in is duplicated. */ -int pevent_register_function (struct tep_handle *pevent,char *func, -unsigned long long addr,char *mod) +int tep_register_function (struct tep_handle *pevent,char *func, +unsigned long long addr,char *mod) {struct func_list *item =malloc (sizeof (*item));
@@ -6477,7 +6477,7 @@ static void free_func_handle(struct tep_function_handler *func) }/** -* pevent_register_print_function - register a helper function +* tep_register_print_function - register a helper function * @pevent: the handle to the pevent * @func: the function to process the helper function * @ret_type: the return type of the helper function
@@ -6491,10 +6491,10 @@ static void free_func_handle(struct tep_function_handler *func)* The @parameters is a variable list of tep_func_arg_type enums that * must end with TEP_FUNC_ARG_VOID. */ -int pevent_register_print_function (struct tep_handle *pevent, -tep_func_handler func, -enum tep_func_arg_type ret_type, -char *name, ...) +int tep_register_print_function (struct tep_handle *pevent, +tep_func_handler func, +enum tep_func_arg_type ret_type, +char *name, ...) {struct tep_function_handler *func_handle;struct pevent_func_params **next_param;
@@ -6569,7 +6569,7 @@ int pevent_register_print_function(struct tep_handle *pevent, }/** -* pevent_unregister_print_function - unregister a helper function +* tep_unregister_print_function - unregister a helper function * @pevent: the handle to the pevent * @func: the function to process the helper function * @name: the name of the helper function
@@ -6578,8 +6578,8 @@ int pevent_register_print_function(struct tep_handle *pevent,* * Returns 0 if the handler was removed successully, -1 otherwise. */ -int pevent_unregister_print_function (struct tep_handle *pevent, -tep_func_handler func,char *name) +int tep_unregister_print_function (struct tep_handle *pevent, +tep_func_handler func,char *name) {struct tep_function_handler *func_handle;
@@ -6615,7 +6615,7 @@ static struct event_format *pevent_search_event(struct tep_handle *pevent, int i }/** -* pevent_register_event_handler - register a way to parse an event +* tep_register_event_handler - register a way to parse an event * @pevent: the handle to the pevent * @id: the id of the event to register * @sys_name: the system name the event belongs to
@@ -6631,9 +6631,9 @@ static struct event_format *pevent_search_event(struct tep_handle *pevent, int i* If @id is >= 0, then it is used to find the event. * else @sys_name and @event_name are used. */ -int pevent_register_event_handler (struct tep_handle *pevent,int id, -const char *sys_name,const char *event_name, -tep_event_handler_func func,void *context) +int tep_register_event_handler (struct tep_handle *pevent,int id, +const char *sys_name,const char *event_name, +tep_event_handler_func func,void *context) {struct event_format *event;struct event_handler *handle;
@@ -6700,7 +6700,7 @@ static int handle_matches(struct event_handler *handler, int id, }/** -* pevent_unregister_event_handler - unregister an existing event handler +* tep_unregister_event_handler - unregister an existing event handler * @pevent: the handle to the pevent * @id: the id of the event to unregister * @sys_name: the system name the handler belongs to
@@ -6715,9 +6715,9 @@ static int handle_matches(struct event_handler *handler, int id,* * Returns 0 if handler was removed successfully, -1 if event was not found. */ -int pevent_unregister_event_handler (struct tep_handle *pevent,int id, -const char *sys_name,const char *event_name, -tep_event_handler_func func,void *context) +int tep_unregister_event_handler (struct tep_handle *pevent,int id, +const char *sys_name,const char *event_name, +tep_event_handler_func func,void *context) {struct event_format *event;struct event_handler *handle;
tools/lib/traceevent/event-parse.h +15 -15
@@ -619,9 +619,9 @@ int tep_set_function_resolver(struct tep_handle *pevent, tep_func_resolver_t *func, void *priv);void pevent_reset_function_resolver (struct tep_handle *pevent);int tep_register_comm (struct tep_handle *pevent,const char *comm,int pid); -int pevent_register_trace_clock (struct tep_handle *pevent,const char *trace_clock); -int pevent_register_function (struct tep_handle *pevent,char *name, -unsigned long long addr,char *mod); +int tep_register_trace_clock (struct tep_handle *pevent,const char *trace_clock); +int tep_register_function (struct tep_handle *pevent,char *name, +unsigned long long addr,char *mod);int tep_register_print_string (struct tep_handle *pevent,const char *fmt,unsigned long long addr);int pevent_pid_is_registered (struct tep_handle *pevent,int pid);
@@ -673,18 +673,18 @@ int tep_print_func_field(struct trace_seq *s, const char *fmt, struct event_format *event, const char *name, struct tep_record *record, int err); -int pevent_register_event_handler (struct tep_handle *pevent,int id, -const char *sys_name,const char *event_name, -tep_event_handler_func func,void *context); -int pevent_unregister_event_handler (struct tep_handle *pevent,int id, -const char *sys_name,const char *event_name, -tep_event_handler_func func,void *context); -int pevent_register_print_function (struct tep_handle *pevent, -tep_func_handler func, -enum tep_func_arg_type ret_type, -char *name, ...); -int pevent_unregister_print_function (struct tep_handle *pevent, -tep_func_handler func,char *name); +int tep_register_event_handler (struct tep_handle *pevent,int id, +const char *sys_name,const char *event_name, +tep_event_handler_func func,void *context); +int tep_unregister_event_handler (struct tep_handle *pevent,int id, +const char *sys_name,const char *event_name, +tep_event_handler_func func,void *context); +int tep_register_print_function (struct tep_handle *pevent, +tep_func_handler func, +enum tep_func_arg_type ret_type, +char *name, ...); +int tep_unregister_print_function (struct tep_handle *pevent, +tep_func_handler func,char *name);struct format_field *tep_find_common_field (struct event_format *event,const char *name);struct format_field *tep_find_field (struct event_format *event,const char *name);
tools/lib/traceevent/plugin_cfg80211.c +8 -8
@@ -27,17 +27,17 @@ process___le16_to_cpup(struct trace_seq *s, unsigned long long *args)int TEP_PLUGIN_LOADER (struct tep_handle *pevent) { -pevent_register_print_function (pevent, - process___le16_to_cpup, -TEP_FUNC_ARG_INT , -"__le16_to_cpup" , -TEP_FUNC_ARG_PTR , -TEP_FUNC_ARG_VOID ); +tep_register_print_function (pevent, + process___le16_to_cpup, +TEP_FUNC_ARG_INT , +"__le16_to_cpup" , +TEP_FUNC_ARG_PTR , +TEP_FUNC_ARG_VOID );return 0 ; }void TEP_PLUGIN_UNLOADER (struct tep_handle *pevent) { -pevent_unregister_print_function (pevent, process___le16_to_cpup, -"__le16_to_cpup" ); +tep_unregister_print_function (pevent, process___le16_to_cpup, +"__le16_to_cpup" ); }
tools/lib/traceevent/plugin_function.c +4 -4
@@ -165,8 +165,8 @@ static int function_handler(struct trace_seq *s, struct tep_record *record,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 );tep_plugin_add_options ("ftrace" , plugin_options);
@@ -177,8 +177,8 @@ 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++)
tools/lib/traceevent/plugin_hrtimer.c +10 -10
@@ -68,21 +68,21 @@ static int timer_start_handler(struct trace_seq *s,int TEP_PLUGIN_LOADER (struct tep_handle *pevent) { -pevent_register_event_handler (pevent,-1 , -"timer" ,"hrtimer_expire_entry" , - timer_expire_handler,NULL ); +tep_register_event_handler (pevent,-1 , +"timer" ,"hrtimer_expire_entry" , + timer_expire_handler,NULL ); -pevent_register_event_handler (pevent,-1 ,"timer" ,"hrtimer_start" , - timer_start_handler,NULL ); +tep_register_event_handler (pevent,-1 ,"timer" ,"hrtimer_start" , + timer_start_handler,NULL );return 0 ; }void TEP_PLUGIN_UNLOADER (struct tep_handle *pevent) { -pevent_unregister_event_handler (pevent,-1 , -"timer" ,"hrtimer_expire_entry" , - timer_expire_handler,NULL ); +tep_unregister_event_handler (pevent,-1 , +"timer" ,"hrtimer_expire_entry" , + timer_expire_handler,NULL ); -pevent_unregister_event_handler (pevent,-1 ,"timer" ,"hrtimer_start" , - timer_start_handler,NULL ); +tep_unregister_event_handler (pevent,-1 ,"timer" ,"hrtimer_start" , + timer_start_handler,NULL ); }
tools/lib/traceevent/plugin_jbd2.c +16 -16
@@ -49,27 +49,27 @@ process_jiffies_to_msecs(struct trace_seq *s, unsigned long long *args)int TEP_PLUGIN_LOADER (struct tep_handle *pevent) { -pevent_register_print_function (pevent, - process_jbd2_dev_to_name, -TEP_FUNC_ARG_STRING , -"jbd2_dev_to_name" , -TEP_FUNC_ARG_INT , -TEP_FUNC_ARG_VOID ); +tep_register_print_function (pevent, + process_jbd2_dev_to_name, +TEP_FUNC_ARG_STRING , +"jbd2_dev_to_name" , +TEP_FUNC_ARG_INT , +TEP_FUNC_ARG_VOID ); -pevent_register_print_function (pevent, - process_jiffies_to_msecs, -TEP_FUNC_ARG_LONG , -"jiffies_to_msecs" , -TEP_FUNC_ARG_LONG , -TEP_FUNC_ARG_VOID ); +tep_register_print_function (pevent, + process_jiffies_to_msecs, +TEP_FUNC_ARG_LONG , +"jiffies_to_msecs" , +TEP_FUNC_ARG_LONG , +TEP_FUNC_ARG_VOID );return 0 ; }void TEP_PLUGIN_UNLOADER (struct tep_handle *pevent) { -pevent_unregister_print_function (pevent, process_jbd2_dev_to_name, -"jbd2_dev_to_name" ); +tep_unregister_print_function (pevent, process_jbd2_dev_to_name, +"jbd2_dev_to_name" ); -pevent_unregister_print_function (pevent, process_jiffies_to_msecs, -"jiffies_to_msecs" ); +tep_unregister_print_function (pevent, process_jiffies_to_msecs, +"jiffies_to_msecs" ); }
tools/lib/traceevent/plugin_kmem.c +26 -26
71 lines not on this page · raw message
tools/lib/traceevent/plugin_kvm.c +44 -44
119 lines not on this page · raw message
tools/lib/traceevent/plugin_mac80211.c +6 -6
@@ -88,15 +88,15 @@ static int drv_bss_info_changed(struct trace_seq *s,int TEP_PLUGIN_LOADER (struct tep_handle *pevent) { -pevent_register_event_handler (pevent,-1 ,"mac80211" , -"drv_bss_info_changed" , - drv_bss_info_changed,NULL ); +tep_register_event_handler (pevent,-1 ,"mac80211" , +"drv_bss_info_changed" , + drv_bss_info_changed,NULL );return 0 ; }void TEP_PLUGIN_UNLOADER (struct tep_handle *pevent) { -pevent_unregister_event_handler (pevent,-1 ,"mac80211" , -"drv_bss_info_changed" , - drv_bss_info_changed,NULL ); +tep_unregister_event_handler (pevent,-1 ,"mac80211" , +"drv_bss_info_changed" , + drv_bss_info_changed,NULL ); }
tools/lib/traceevent/plugin_sched_switch.c +12 -12
@@ -136,25 +136,25 @@ static int sched_switch_handler(struct trace_seq *s,int TEP_PLUGIN_LOADER (struct tep_handle *pevent) { -pevent_register_event_handler (pevent,-1 ,"sched" ,"sched_switch" , - sched_switch_handler,NULL ); +tep_register_event_handler (pevent,-1 ,"sched" ,"sched_switch" , + sched_switch_handler,NULL ); -pevent_register_event_handler (pevent,-1 ,"sched" ,"sched_wakeup" , - sched_wakeup_handler,NULL ); +tep_register_event_handler (pevent,-1 ,"sched" ,"sched_wakeup" , + sched_wakeup_handler,NULL ); -pevent_register_event_handler (pevent,-1 ,"sched" ,"sched_wakeup_new" , - sched_wakeup_handler,NULL ); +tep_register_event_handler (pevent,-1 ,"sched" ,"sched_wakeup_new" , + sched_wakeup_handler,NULL );return 0 ; }void TEP_PLUGIN_UNLOADER (struct tep_handle *pevent) { -pevent_unregister_event_handler (pevent,-1 ,"sched" ,"sched_switch" , - sched_switch_handler,NULL ); +tep_unregister_event_handler (pevent,-1 ,"sched" ,"sched_switch" , + sched_switch_handler,NULL ); -pevent_unregister_event_handler (pevent,-1 ,"sched" ,"sched_wakeup" , - sched_wakeup_handler,NULL ); +tep_unregister_event_handler (pevent,-1 ,"sched" ,"sched_wakeup" , + sched_wakeup_handler,NULL ); -pevent_unregister_event_handler (pevent,-1 ,"sched" ,"sched_wakeup_new" , - sched_wakeup_handler,NULL ); +tep_unregister_event_handler (pevent,-1 ,"sched" ,"sched_wakeup_new" , + sched_wakeup_handler,NULL ); }
tools/lib/traceevent/plugin_scsi.c +10 -10
@@ -415,19 +415,19 @@ unsigned long long process_scsi_trace_parse_cdb(struct trace_seq *s,int TEP_PLUGIN_LOADER (struct tep_handle *pevent) { -pevent_register_print_function (pevent, - process_scsi_trace_parse_cdb, -TEP_FUNC_ARG_STRING , -"scsi_trace_parse_cdb" , -TEP_FUNC_ARG_PTR , -TEP_FUNC_ARG_PTR , -TEP_FUNC_ARG_INT , -TEP_FUNC_ARG_VOID ); +tep_register_print_function (pevent, + process_scsi_trace_parse_cdb, +TEP_FUNC_ARG_STRING , +"scsi_trace_parse_cdb" , +TEP_FUNC_ARG_PTR , +TEP_FUNC_ARG_PTR , +TEP_FUNC_ARG_INT , +TEP_FUNC_ARG_VOID );return 0 ; }void TEP_PLUGIN_UNLOADER (struct tep_handle *pevent) { -pevent_unregister_print_function (pevent, process_scsi_trace_parse_cdb, -"scsi_trace_parse_cdb" ); +tep_unregister_print_function (pevent, process_scsi_trace_parse_cdb, +"scsi_trace_parse_cdb" ); }
tools/lib/traceevent/plugin_xen.c +8 -8
@@ -121,17 +121,17 @@ unsigned long long process_xen_hypercall_name(struct trace_seq *s,int TEP_PLUGIN_LOADER (struct tep_handle *pevent) { -pevent_register_print_function (pevent, - process_xen_hypercall_name, -TEP_FUNC_ARG_STRING , -"xen_hypercall_name" , -TEP_FUNC_ARG_INT , -TEP_FUNC_ARG_VOID ); +tep_register_print_function (pevent, + process_xen_hypercall_name, +TEP_FUNC_ARG_STRING , +"xen_hypercall_name" , +TEP_FUNC_ARG_INT , +TEP_FUNC_ARG_VOID );return 0 ; }void TEP_PLUGIN_UNLOADER (struct tep_handle *pevent) { -pevent_unregister_print_function (pevent, process_xen_hypercall_name, -"xen_hypercall_name" ); +tep_unregister_print_function (pevent, process_xen_hypercall_name, +"xen_hypercall_name" ); }
RFC PATCH v2 18/24 tools/lib/traceevent: Rename pevent_data_ APIs
In reply to Steven RostedtFrom: "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
APIs: pevent_data_lat_fmt, pevent_data_type, pevent_data_event_from_type, pevent_data_pid, pevent_data_preempt_count, pevent_data_flags, pevent_data_comm_from_pid, pevent_data_pid_from_comm, pevent_cmdline_pid
--- tools/lib/traceevent/event-parse.c | 44 ++++++++++++++--------------- tools/lib/traceevent/event-parse.h | 22 +++++++-------- tools/lib/traceevent/parse-filter.c | 6 ++-- 3 files changed, 36 insertions(+), 36 deletions(-)
tools/lib/traceevent/event-parse.c +22 -22
@@ -5140,7 +5140,7 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct event }/** -* pevent_data_lat_fmt - parse the data for the latency format +* tep_data_lat_fmt - parse the data for the latency format * @pevent: a handle to the pevent * @s: the trace_seq to write to * @record: the record to read from
@@ -5149,8 +5149,8 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct event* need rescheduling, in hard/soft interrupt, preempt count * and lock depth) and places it into the trace_seq. */ -void pevent_data_lat_fmt (struct tep_handle *pevent, -struct trace_seq *s,struct tep_record *record) +void tep_data_lat_fmt (struct tep_handle *pevent, +struct trace_seq *s,struct tep_record *record) {static int check_lock_depth =1 ;static int check_migrate_disable =1 ;
@@ -5223,55 +5223,55 @@ void pevent_data_lat_fmt(struct tep_handle *pevent, }/** -* pevent_data_type - parse out the given event type +* tep_data_type - parse out the given event type * @pevent: a handle to the pevent * @rec: the record to read from * * This returns the event id from the @rec. */ -int pevent_data_type (struct tep_handle *pevent,struct tep_record *rec) +int tep_data_type (struct tep_handle *pevent,struct tep_record *rec) {return trace_parse_common_type (pevent, rec->data); }/** -* pevent_data_event_from_type - find the event by a given type +* tep_data_event_from_type - find the event by a given type * @pevent: a handle to the pevent * @type: the type of the event. * * This returns the event form a given @type; */ -struct event_format *pevent_data_event_from_type (struct tep_handle *pevent,int type) +struct event_format *tep_data_event_from_type (struct tep_handle *pevent,int type) {return tep_find_event (pevent, type); }/** -* pevent_data_pid - parse the PID from record +* tep_data_pid - parse the PID from record * @pevent: a handle to the pevent * @rec: the record to parse * * This returns the PID from a record. */ -int pevent_data_pid (struct tep_handle *pevent,struct tep_record *rec) +int tep_data_pid (struct tep_handle *pevent,struct tep_record *rec) {return parse_common_pid (pevent, rec->data); }/** -* pevent_data_preempt_count - parse the preempt count from the record +* tep_data_preempt_count - parse the preempt count from the record * @pevent: a handle to the pevent * @rec: the record to parse * * This returns the preempt count from a record. */ -int pevent_data_preempt_count (struct tep_handle *pevent,struct tep_record *rec) +int tep_data_preempt_count (struct tep_handle *pevent,struct tep_record *rec) {return parse_common_pc (pevent, rec->data); }/** -* pevent_data_flags - parse the latency flags from the record +* tep_data_flags - parse the latency flags from the record * @pevent: a handle to the pevent * @rec: the record to parse *
@@ -5279,20 +5279,20 @@ int pevent_data_preempt_count(struct tep_handle *pevent, struct tep_record *rec)* * Use trace_flag_type enum for the flags (see event-parse.h). */ -int pevent_data_flags (struct tep_handle *pevent,struct tep_record *rec) +int tep_data_flags (struct tep_handle *pevent,struct tep_record *rec) {return parse_common_flags (pevent, rec->data); }/** -* pevent_data_comm_from_pid - return the command line from PID +* tep_data_comm_from_pid - return the command line from PID * @pevent: a handle to the pevent * @pid: the PID of the task to search for * * This returns a pointer to the command line that has the given * @pid. */ -const char *pevent_data_comm_from_pid (struct tep_handle *pevent,int pid) +const char *tep_data_comm_from_pid (struct tep_handle *pevent,int pid) {const char *comm;
@@ -5317,7 +5317,7 @@ pid_from_cmdlist(struct tep_handle *pevent, const char *comm, struct cmdline *ne }/** -* pevent_data_pid_from_comm - return the pid from a given comm +* tep_data_pid_from_comm - return the pid from a given comm * @pevent: a handle to the pevent * @comm: the cmdline to find the pid from * @next: the cmdline structure to find the next comm
@@ -5329,8 +5329,8 @@ pid_from_cmdlist(struct tep_handle *pevent, const char *comm, struct cmdline *ne* next pid. * Also, it does a linear seach, so it may be slow. */ -struct cmdline *pevent_data_pid_from_comm (struct tep_handle *pevent,const char *comm, -struct cmdline *next) +struct cmdline *tep_data_pid_from_comm (struct tep_handle *pevent,const char *comm, +struct cmdline *next) {struct cmdline *cmdline;
@@ -5365,13 +5365,13 @@ struct cmdline *pevent_data_pid_from_comm(struct tep_handle *pevent, const char }/** -* pevent_cmdline_pid - return the pid associated to a given cmdline +* tep_cmdline_pid - return the pid associated to a given cmdline * @cmdline: The cmdline structure to get the pid from * * Returns the pid for a give cmdline. If @cmdline is NULL, then * -1 is returned. */ -int pevent_cmdline_pid (struct tep_handle *pevent,struct cmdline *cmdline) +int tep_cmdline_pid (struct tep_handle *pevent,struct cmdline *cmdline) {struct cmdline_list *cmdlist = (struct cmdline_list *)cmdline;
@@ -5391,7 +5391,7 @@ int pevent_cmdline_pid(struct tep_handle *pevent, struct cmdline *cmdline) }/** -* pevent_data_comm_from_pid - parse the data into the print format +* tep_event_info - parse the data into the print format * @s: the trace_seq to write to * @event: the handle to the event * @record: the record to read from
@@ -5511,7 +5511,7 @@ void tep_print_event_time(struct tep_handle *pevent, struct trace_seq *s, }if (pevent->latency_format) { -pevent_data_lat_fmt (pevent, s, record); +tep_data_lat_fmt (pevent, s, record); }if (use_usec_format) {
tools/lib/traceevent/event-parse.h +11 -11
@@ -705,18 +705,18 @@ pevent_find_event_by_name(struct tep_handle *pevent, const char *sys, const charstruct event_format *pevent_find_event_by_record (struct tep_handle *pevent,struct tep_record *record); -void pevent_data_lat_fmt (struct tep_handle *pevent, -struct trace_seq *s,struct tep_record *record); -int pevent_data_type (struct tep_handle *pevent,struct tep_record *rec); -struct event_format *pevent_data_event_from_type (struct tep_handle *pevent,int type); -int pevent_data_pid (struct tep_handle *pevent,struct tep_record *rec); -int pevent_data_preempt_count (struct tep_handle *pevent,struct tep_record *rec); -int pevent_data_flags (struct tep_handle *pevent,struct tep_record *rec); -const char *pevent_data_comm_from_pid (struct tep_handle *pevent,int pid); +void tep_data_lat_fmt (struct tep_handle *pevent, +struct trace_seq *s,struct tep_record *record); +int tep_data_type (struct tep_handle *pevent,struct tep_record *rec); +struct event_format *tep_data_event_from_type (struct tep_handle *pevent,int type); +int tep_data_pid (struct tep_handle *pevent,struct tep_record *rec); +int tep_data_preempt_count (struct tep_handle *pevent,struct tep_record *rec); +int tep_data_flags (struct tep_handle *pevent,struct tep_record *rec); +const char *tep_data_comm_from_pid (struct tep_handle *pevent,int pid);struct cmdline ; -struct cmdline *pevent_data_pid_from_comm (struct tep_handle *pevent,const char *comm, -struct cmdline *next); -int pevent_cmdline_pid (struct tep_handle *pevent,struct cmdline *cmdline); +struct cmdline *tep_data_pid_from_comm (struct tep_handle *pevent,const char *comm, +struct cmdline *next); +int tep_cmdline_pid (struct tep_handle *pevent,struct cmdline *cmdline);void tep_print_field (struct trace_seq *s,void *data,struct format_field *field);
tools/lib/traceevent/parse-filter.c +3 -3
@@ -1705,8 +1705,8 @@ get_comm(struct event_format *event, struct tep_record *record)const char *comm;int pid; - pid =pevent_data_pid (event->pevent, record); - comm =pevent_data_comm_from_pid (event->pevent, pid); + pid =tep_data_pid (event->pevent, record); + comm =tep_data_comm_from_pid (event->pevent, pid);return comm; }
@@ -2060,7 +2060,7 @@ enum tep_errno tep_filter_match(struct event_filter *filter,if (!filter->filters)return TEP_ERRNO__NO_FILTER ; - event_id =pevent_data_type (pevent, record); + event_id =tep_data_type (pevent, record); filter_type =find_filter_type (filter, event_id);if (!filter_type)
Signature · 1 line
2.18.0
tip-bot for Tzvetomir Stoyanov (VMware)
merge bot[tip:perf/urgent] tools lib traceevent: Rename pevent_data_ APIs
tools lib traceevent: Rename pevent_data_ APIs
Commit-ID: dc05ebf373e9e66c27aae0d9059e5d4ac56f3be0 Gitweb: https://git.kernel.org/tip/dc05ebf373e9e66c27aae0d9059e5d4ac56f3be0 Author: Tzvetomir Stoyanov (VMware) <[email protected]> AuthorDate: Wed, 8 Aug 2018 14:03:03 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Mon, 13 Aug 2018 15:28:36 -0300
tools lib traceevent: Rename pevent_data_ APIs
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
APIs: pevent_data_lat_fmt, pevent_data_type, pevent_data_event_from_type, pevent_data_pid, pevent_data_preempt_count, pevent_data_flags, pevent_data_comm_from_pid, pevent_data_pid_from_comm, pevent_cmdline_pid
--- tools/lib/traceevent/event-parse.c | 44 ++++++++++++++++++------------------- tools/lib/traceevent/event-parse.h | 22 +++++++++---------- tools/lib/traceevent/parse-filter.c | 6 ++--- 3 files changed, 36 insertions(+), 36 deletions(-)
tools/lib/traceevent/event-parse.c +22 -22
@@ -5140,7 +5140,7 @@ out_failed: }/** -* pevent_data_lat_fmt - parse the data for the latency format +* tep_data_lat_fmt - parse the data for the latency format * @pevent: a handle to the pevent * @s: the trace_seq to write to * @record: the record to read from
@@ -5149,8 +5149,8 @@ out_failed:* need rescheduling, in hard/soft interrupt, preempt count * and lock depth) and places it into the trace_seq. */ -void pevent_data_lat_fmt (struct tep_handle *pevent, -struct trace_seq *s,struct tep_record *record) +void tep_data_lat_fmt (struct tep_handle *pevent, +struct trace_seq *s,struct tep_record *record) {static int check_lock_depth =1 ;static int check_migrate_disable =1 ;
@@ -5223,55 +5223,55 @@ void pevent_data_lat_fmt(struct tep_handle *pevent, }/** -* pevent_data_type - parse out the given event type +* tep_data_type - parse out the given event type * @pevent: a handle to the pevent * @rec: the record to read from * * This returns the event id from the @rec. */ -int pevent_data_type (struct tep_handle *pevent,struct tep_record *rec) +int tep_data_type (struct tep_handle *pevent,struct tep_record *rec) {return trace_parse_common_type (pevent, rec->data); }/** -* pevent_data_event_from_type - find the event by a given type +* tep_data_event_from_type - find the event by a given type * @pevent: a handle to the pevent * @type: the type of the event. * * This returns the event form a given @type; */ -struct event_format *pevent_data_event_from_type (struct tep_handle *pevent,int type) +struct event_format *tep_data_event_from_type (struct tep_handle *pevent,int type) {return tep_find_event (pevent, type); }/** -* pevent_data_pid - parse the PID from record +* tep_data_pid - parse the PID from record * @pevent: a handle to the pevent * @rec: the record to parse * * This returns the PID from a record. */ -int pevent_data_pid (struct tep_handle *pevent,struct tep_record *rec) +int tep_data_pid (struct tep_handle *pevent,struct tep_record *rec) {return parse_common_pid (pevent, rec->data); }/** -* pevent_data_preempt_count - parse the preempt count from the record +* tep_data_preempt_count - parse the preempt count from the record * @pevent: a handle to the pevent * @rec: the record to parse * * This returns the preempt count from a record. */ -int pevent_data_preempt_count (struct tep_handle *pevent,struct tep_record *rec) +int tep_data_preempt_count (struct tep_handle *pevent,struct tep_record *rec) {return parse_common_pc (pevent, rec->data); }/** -* pevent_data_flags - parse the latency flags from the record +* tep_data_flags - parse the latency flags from the record * @pevent: a handle to the pevent * @rec: the record to parse *
@@ -5279,20 +5279,20 @@ int pevent_data_preempt_count(struct tep_handle *pevent, struct tep_record *rec)* * Use trace_flag_type enum for the flags (see event-parse.h). */ -int pevent_data_flags (struct tep_handle *pevent,struct tep_record *rec) +int tep_data_flags (struct tep_handle *pevent,struct tep_record *rec) {return parse_common_flags (pevent, rec->data); }/** -* pevent_data_comm_from_pid - return the command line from PID +* tep_data_comm_from_pid - return the command line from PID * @pevent: a handle to the pevent * @pid: the PID of the task to search for * * This returns a pointer to the command line that has the given * @pid. */ -const char *pevent_data_comm_from_pid (struct tep_handle *pevent,int pid) +const char *tep_data_comm_from_pid (struct tep_handle *pevent,int pid) {const char *comm;
@@ -5317,7 +5317,7 @@ pid_from_cmdlist(struct tep_handle *pevent, const char *comm, struct cmdline *ne }/** -* pevent_data_pid_from_comm - return the pid from a given comm +* tep_data_pid_from_comm - return the pid from a given comm * @pevent: a handle to the pevent * @comm: the cmdline to find the pid from * @next: the cmdline structure to find the next comm
@@ -5329,8 +5329,8 @@ pid_from_cmdlist(struct tep_handle *pevent, const char *comm, struct cmdline *ne* next pid. * Also, it does a linear seach, so it may be slow. */ -struct cmdline *pevent_data_pid_from_comm (struct tep_handle *pevent,const char *comm, -struct cmdline *next) +struct cmdline *tep_data_pid_from_comm (struct tep_handle *pevent,const char *comm, +struct cmdline *next) {struct cmdline *cmdline;
@@ -5365,13 +5365,13 @@ struct cmdline *pevent_data_pid_from_comm(struct tep_handle *pevent, const char }/** -* pevent_cmdline_pid - return the pid associated to a given cmdline +* tep_cmdline_pid - return the pid associated to a given cmdline * @cmdline: The cmdline structure to get the pid from * * Returns the pid for a give cmdline. If @cmdline is NULL, then * -1 is returned. */ -int pevent_cmdline_pid (struct tep_handle *pevent,struct cmdline *cmdline) +int tep_cmdline_pid (struct tep_handle *pevent,struct cmdline *cmdline) {struct cmdline_list *cmdlist = (struct cmdline_list *)cmdline;
@@ -5391,7 +5391,7 @@ int pevent_cmdline_pid(struct tep_handle *pevent, struct cmdline *cmdline) }/** -* pevent_data_comm_from_pid - parse the data into the print format +* tep_event_info - parse the data into the print format * @s: the trace_seq to write to * @event: the handle to the event * @record: the record to read from
@@ -5511,7 +5511,7 @@ void tep_print_event_time(struct tep_handle *pevent, struct trace_seq *s, }if (pevent->latency_format) { -pevent_data_lat_fmt (pevent, s, record); +tep_data_lat_fmt (pevent, s, record); }if (use_usec_format) {
tools/lib/traceevent/event-parse.h +11 -11
@@ -705,18 +705,18 @@ pevent_find_event_by_name(struct tep_handle *pevent, const char *sys, const charstruct event_format *pevent_find_event_by_record (struct tep_handle *pevent,struct tep_record *record); -void pevent_data_lat_fmt (struct tep_handle *pevent, -struct trace_seq *s,struct tep_record *record); -int pevent_data_type (struct tep_handle *pevent,struct tep_record *rec); -struct event_format *pevent_data_event_from_type (struct tep_handle *pevent,int type); -int pevent_data_pid (struct tep_handle *pevent,struct tep_record *rec); -int pevent_data_preempt_count (struct tep_handle *pevent,struct tep_record *rec); -int pevent_data_flags (struct tep_handle *pevent,struct tep_record *rec); -const char *pevent_data_comm_from_pid (struct tep_handle *pevent,int pid); +void tep_data_lat_fmt (struct tep_handle *pevent, +struct trace_seq *s,struct tep_record *record); +int tep_data_type (struct tep_handle *pevent,struct tep_record *rec); +struct event_format *tep_data_event_from_type (struct tep_handle *pevent,int type); +int tep_data_pid (struct tep_handle *pevent,struct tep_record *rec); +int tep_data_preempt_count (struct tep_handle *pevent,struct tep_record *rec); +int tep_data_flags (struct tep_handle *pevent,struct tep_record *rec); +const char *tep_data_comm_from_pid (struct tep_handle *pevent,int pid);struct cmdline ; -struct cmdline *pevent_data_pid_from_comm (struct tep_handle *pevent,const char *comm, -struct cmdline *next); -int pevent_cmdline_pid (struct tep_handle *pevent,struct cmdline *cmdline); +struct cmdline *tep_data_pid_from_comm (struct tep_handle *pevent,const char *comm, +struct cmdline *next); +int tep_cmdline_pid (struct tep_handle *pevent,struct cmdline *cmdline);void tep_print_field (struct trace_seq *s,void *data,struct format_field *field);
tools/lib/traceevent/parse-filter.c +3 -3
@@ -1705,8 +1705,8 @@ get_comm(struct event_format *event, struct tep_record *record)const char *comm;int pid; - pid =pevent_data_pid (event->pevent, record); - comm =pevent_data_comm_from_pid (event->pevent, pid); + pid =tep_data_pid (event->pevent, record); + comm =tep_data_comm_from_pid (event->pevent, pid);return comm; }
@@ -2060,7 +2060,7 @@ enum tep_errno tep_filter_match(struct event_filter *filter,if (!filter->filters)return TEP_ERRNO__NO_FILTER ; - event_id =pevent_data_type (pevent, record); + event_id =tep_data_type (pevent, record); filter_type =find_filter_type (filter, event_id);if (!filter_type)
RFC PATCH v2 19/24 tools/lib/traceevent: Rename pevent field APIs
In reply to Steven RostedtFrom: "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
APIs: pevent_free_format, pevent_free_format_field, pevent_get_field_raw, pevent_get_field_val, pevent_get_common_field_val, pevent_get_any_field_val
--- tools/lib/traceevent/event-parse.c | 42 +++++++++++----------- tools/lib/traceevent/event-parse.h | 28 +++++++-------- tools/lib/traceevent/plugin_function.c | 4 +-- tools/lib/traceevent/plugin_kvm.c | 28 +++++++-------- tools/lib/traceevent/plugin_sched_switch.c | 18 +++++----- 5 files changed, 60 insertions(+), 60 deletions(-)
tools/lib/traceevent/event-parse.c +21 -21
@@ -6166,7 +6166,7 @@ __pevent_parse_event(struct tep_handle *pevent,return 0 ; event_add_failed: -pevent_free_format (event); +tep_free_format (event);return ret; }
@@ -6263,7 +6263,7 @@ int get_field_val(struct trace_seq *s, struct format_field *field, }/** -* pevent_get_field_raw - return the raw pointer into the data field +* tep_get_field_raw - return the raw pointer into the data field * @s: The seq to print to on error * @event: the event that the field is for * @name: The name of the field
@@ -6276,9 +6276,9 @@ int get_field_val(struct trace_seq *s, struct format_field *field,* * On failure, it returns NULL. */ -void *pevent_get_field_raw (struct trace_seq *s,struct event_format *event, -const char *name,struct tep_record *record, -int *len,int err) +void *tep_get_field_raw (struct trace_seq *s,struct event_format *event, +const char *name,struct tep_record *record, +int *len,int err) {struct format_field *field;void *data = record->data;
@@ -6313,7 +6313,7 @@ void *pevent_get_field_raw(struct trace_seq *s, struct event_format *event, }/** -* pevent_get_field_val - find a field and return its value +* tep_get_field_val - find a field and return its value * @s: The seq to print to on error * @event: the event that the field is for * @name: The name of the field
@@ -6323,9 +6323,9 @@ void *pevent_get_field_raw(struct trace_seq *s, struct event_format *event,* * Returns 0 on success -1 on field not found. */ -int pevent_get_field_val (struct trace_seq *s,struct event_format *event, -const char *name,struct tep_record *record, -unsigned long long *val,int err) +int tep_get_field_val (struct trace_seq *s,struct event_format *event, +const char *name,struct tep_record *record, +unsigned long long *val,int err) {struct format_field *field;
@@ -6338,7 +6338,7 @@ int pevent_get_field_val(struct trace_seq *s, struct event_format *event, }/** -* pevent_get_common_field_val - find a common field and return its value +* tep_get_common_field_val - find a common field and return its value * @s: The seq to print to on error * @event: the event that the field is for * @name: The name of the field
@@ -6348,9 +6348,9 @@ int pevent_get_field_val(struct trace_seq *s, struct event_format *event,* * Returns 0 on success -1 on field not found. */ -int pevent_get_common_field_val (struct trace_seq *s,struct event_format *event, -const char *name,struct tep_record *record, -unsigned long long *val,int err) +int tep_get_common_field_val (struct trace_seq *s,struct event_format *event, +const char *name,struct tep_record *record, +unsigned long long *val,int err) {struct format_field *field;
@@ -6363,7 +6363,7 @@ int pevent_get_common_field_val(struct trace_seq *s, struct event_format *event, }/** -* pevent_get_any_field_val - find a any field and return its value +* tep_get_any_field_val - find a any field and return its value * @s: The seq to print to on error * @event: the event that the field is for * @name: The name of the field
@@ -6373,9 +6373,9 @@ int pevent_get_common_field_val(struct trace_seq *s, struct event_format *event,* * Returns 0 on success -1 on field not found. */ -int pevent_get_any_field_val (struct trace_seq *s,struct event_format *event, -const char *name,struct tep_record *record, -unsigned long long *val,int err) +int tep_get_any_field_val (struct trace_seq *s,struct event_format *event, +const char *name,struct tep_record *record, +unsigned long long *val,int err) {struct format_field *field;
@@ -6771,7 +6771,7 @@ void pevent_ref(struct tep_handle *pevent) pevent->ref_count++; } -void pevent_free_format_field (struct format_field *field) +void tep_free_format_field (struct format_field *field) {free (field->type);if (field->alias != field->name)
@@ -6786,7 +6786,7 @@ static void free_format_fields(struct format_field *field)while (field) { next = field->next; -pevent_free_format_field (field); +tep_free_format_field (field); field = next; } }
@@ -6797,7 +6797,7 @@ static void free_formats(struct format *format)free_format_fields (format->fields); } -void pevent_free_format (struct event_format *event) +void tep_free_format (struct event_format *event) {free (event->name);free (event->system);
@@ -6883,7 +6883,7 @@ void tep_free(struct tep_handle *pevent) }for (i =0 ; i < pevent->nr_events; i++) -pevent_free_format (pevent->events[i]); +tep_free_format (pevent->events[i]);while (pevent->handlers) { handle = pevent->handlers;
tools/lib/traceevent/event-parse.h +14 -14
@@ -648,22 +648,22 @@ enum tep_errno tep_parse_format(struct tep_handle *pevent,struct event_format **eventp, const char *buf, unsigned long size, const char *sys); -void pevent_free_format (struct event_format *event); -void pevent_free_format_field (struct format_field *field); - -void *pevent_get_field_raw (struct trace_seq *s,struct event_format *event, -const char *name,struct tep_record *record, -int *len,int err); - -int pevent_get_field_val (struct trace_seq *s,struct event_format *event, -const char *name,struct tep_record *record, -unsigned long long *val,int err); -int pevent_get_common_field_val (struct trace_seq *s,struct event_format *event, -const char *name,struct tep_record *record, -unsigned long long *val,int err); -int pevent_get_any_field_val (struct trace_seq *s,struct event_format *event, +void tep_free_format (struct event_format *event); +void tep_free_format_field (struct format_field *field); + +void *tep_get_field_raw (struct trace_seq *s,struct event_format *event, +const char *name,struct tep_record *record, +int *len,int err); + +int tep_get_field_val (struct trace_seq *s,struct event_format *event, +const char *name,struct tep_record *record, +unsigned long long *val,int err); +int tep_get_common_field_val (struct trace_seq *s,struct event_format *event,const char *name,struct tep_record *record,unsigned long long *val,int err); +int tep_get_any_field_val (struct trace_seq *s,struct event_format *event, +const char *name,struct tep_record *record, +unsigned long long *val,int err); int tep_print_num_field(struct trace_seq *s, const char *fmt, struct event_format *event, const char *name,
tools/lib/traceevent/plugin_function.c +2 -2
@@ -132,12 +132,12 @@ static int function_handler(struct trace_seq *s, struct tep_record *record,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); -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);
tools/lib/traceevent/plugin_kvm.c +14 -14
@@ -254,10 +254,10 @@ static int print_exit_reason(struct trace_seq *s, struct tep_record *record,unsigned long long val;const char *reason; -if (pevent_get_field_val (s, event, field, record, &val,1 ) <0 ) +if (tep_get_field_val (s, event, field, record, &val,1 ) <0 )return -1 ; -if (pevent_get_field_val (s, event,"isa" , record, &isa,0 ) <0 ) +if (tep_get_field_val (s, event,"isa" , record, &isa,0 ) <0 ) isa =1 ; reason =find_exit_reason (isa, val);
@@ -278,8 +278,8 @@ static int kvm_exit_handler(struct trace_seq *s, struct tep_record *record,tep_print_num_field (s," rip 0x%lx" , event,"guest_rip" , record,1 ); -if (pevent_get_field_val (s, event,"info1" , record, &info1,0 ) >=0 - &&pevent_get_field_val (s, event,"info2" , record, &info2,0 ) >=0 ) +if (tep_get_field_val (s, event,"info1" , record, &info1,0 ) >=0 + &&tep_get_field_val (s, event,"info2" , record, &info2,0 ) >=0 )trace_seq_printf (s," info %llx %llx" , info1, info2);return 0 ;
@@ -299,22 +299,22 @@ static int kvm_emulate_insn_handler(struct trace_seq *s,uint8_t *insn;const char *disasm; -if (pevent_get_field_val (s, event,"rip" , record, &rip,1 ) <0 ) +if (tep_get_field_val (s, event,"rip" , record, &rip,1 ) <0 )return -1 ; -if (pevent_get_field_val (s, event,"csbase" , record, &csbase,1 ) <0 ) +if (tep_get_field_val (s, event,"csbase" , record, &csbase,1 ) <0 )return -1 ; -if (pevent_get_field_val (s, event,"len" , record, &len,1 ) <0 ) +if (tep_get_field_val (s, event,"len" , record, &len,1 ) <0 )return -1 ; -if (pevent_get_field_val (s, event,"flags" , record, &flags,1 ) <0 ) +if (tep_get_field_val (s, event,"flags" , record, &flags,1 ) <0 )return -1 ; -if (pevent_get_field_val (s, event,"failed" , record, &failed,1 ) <0 ) +if (tep_get_field_val (s, event,"failed" , record, &failed,1 ) <0 )return -1 ; - insn =pevent_get_field_raw (s, event,"insn" , record, &llen,1 ); + insn =tep_get_field_raw (s, event,"insn" , record, &llen,1 );if (!insn)return -1 ;
@@ -379,7 +379,7 @@ static int kvm_mmu_print_role(struct trace_seq *s, struct tep_record *record, };union kvm_mmu_page_role role; -if (pevent_get_field_val (s, event,"role" , record, &val,1 ) <0 ) +if (tep_get_field_val (s, event,"role" , record, &val,1 ) <0 )return -1 ; role.word = (int )val;
@@ -409,7 +409,7 @@ static int kvm_mmu_print_role(struct trace_seq *s, struct tep_record *record,tep_print_num_field (s," root %u " , event,"root_count" , record,1 ); -if (pevent_get_field_val (s, event,"unsync" , record, &val,1 ) <0 ) +if (tep_get_field_val (s, event,"unsync" , record, &val,1 ) <0 )return -1 ;trace_seq_printf (s,"%s%c" , val ?"unsync" :"sync" ,0 );
@@ -422,12 +422,12 @@ static int kvm_mmu_get_page_handler(struct trace_seq *s, {unsigned long long val; -if (pevent_get_field_val (s, event,"created" , record, &val,1 ) <0 ) +if (tep_get_field_val (s, event,"created" , record, &val,1 ) <0 )return -1 ;trace_seq_printf (s,"%s " , val ?"new" :"existing" ); -if (pevent_get_field_val (s, event,"gfn" , record, &val,1 ) <0 ) +if (tep_get_field_val (s, event,"gfn" , record, &val,1 ) <0 )return -1 ;trace_seq_printf (s,"sp gfn %llx " , val);
tools/lib/traceevent/plugin_sched_switch.c +9 -9
@@ -71,7 +71,7 @@ static int sched_wakeup_handler(struct trace_seq *s,struct format_field *field;unsigned long long val; -if (pevent_get_field_val (s, event,"pid" , record, &val,1 )) +if (tep_get_field_val (s, event,"pid" , record, &val,1 ))return trace_seq_putc (s,'!' ); field =tep_find_any_field (event,"comm" );
@@ -81,13 +81,13 @@ static int sched_wakeup_handler(struct trace_seq *s, }trace_seq_printf (s,"%lld" , val); -if (pevent_get_field_val (s, event,"prio" , record, &val,0 ) ==0 ) +if (tep_get_field_val (s, event,"prio" , record, &val,0 ) ==0 )trace_seq_printf (s," [%lld]" , val); -if (pevent_get_field_val (s, event,"success" , record, &val,1 ) ==0 ) +if (tep_get_field_val (s, event,"success" , record, &val,1 ) ==0 )trace_seq_printf (s," success=%lld" , val); -if (pevent_get_field_val (s, event,"target_cpu" , record, &val,0 ) ==0 ) +if (tep_get_field_val (s, event,"target_cpu" , record, &val,0 ) ==0 )trace_seq_printf (s," CPU:%03llu" , val);return 0 ;
@@ -100,7 +100,7 @@ static int sched_switch_handler(struct trace_seq *s,struct format_field *field;unsigned long long val; -if (pevent_get_field_val (s, event,"prev_pid" , record, &val,1 )) +if (tep_get_field_val (s, event,"prev_pid" , record, &val,1 ))return trace_seq_putc (s,'!' ); field =tep_find_any_field (event,"prev_comm" );
@@ -110,15 +110,15 @@ static int sched_switch_handler(struct trace_seq *s, }trace_seq_printf (s,"%lld " , val); -if (pevent_get_field_val (s, event,"prev_prio" , record, &val,0 ) ==0 ) +if (tep_get_field_val (s, event,"prev_prio" , record, &val,0 ) ==0 )trace_seq_printf (s,"[%d] " , (int ) val); -if (pevent_get_field_val (s, event,"prev_state" , record, &val,0 ) ==0 ) +if (tep_get_field_val (s, event,"prev_state" , record, &val,0 ) ==0 )write_state (s, val);trace_seq_puts (s," ==> " ); -if (pevent_get_field_val (s, event,"next_pid" , record, &val,1 )) +if (tep_get_field_val (s, event,"next_pid" , record, &val,1 ))return trace_seq_putc (s,'!' ); field =tep_find_any_field (event,"next_comm" );
@@ -128,7 +128,7 @@ static int sched_switch_handler(struct trace_seq *s, }trace_seq_printf (s,"%lld" , val); -if (pevent_get_field_val (s, event,"next_prio" , record, &val,0 ) ==0 ) +if (tep_get_field_val (s, event,"next_prio" , record, &val,0 ) ==0 )trace_seq_printf (s," [%d]" , (int ) val);return 0 ;
Signature · 1 line
2.18.0
tip-bot for Tzvetomir Stoyanov (VMware)
merge bot[tip:perf/urgent] tools lib traceevent: Rename pevent field APIs
tools lib traceevent: Rename pevent field APIs
Commit-ID: 8b3e08722ec8b288066eab66193736a65645c0a2 Gitweb: https://git.kernel.org/tip/8b3e08722ec8b288066eab66193736a65645c0a2 Author: Tzvetomir Stoyanov (VMware) <[email protected]> AuthorDate: Wed, 8 Aug 2018 14:03:04 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Mon, 13 Aug 2018 15:30:30 -0300
tools lib traceevent: Rename pevent field APIs
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
APIs: pevent_free_format, pevent_free_format_field, pevent_get_field_raw, pevent_get_field_val, pevent_get_common_field_val, pevent_get_any_field_val
--- tools/lib/traceevent/event-parse.c | 42 +++++++++++++++--------------- tools/lib/traceevent/event-parse.h | 28 ++++++++++---------- tools/lib/traceevent/plugin_function.c | 4 +-- tools/lib/traceevent/plugin_kvm.c | 28 ++++++++++---------- tools/lib/traceevent/plugin_sched_switch.c | 18 ++++++------- 5 files changed, 60 insertions(+), 60 deletions(-)
tools/lib/traceevent/event-parse.c +21 -21
@@ -6166,7 +6166,7 @@ __pevent_parse_event(struct tep_handle *pevent,return 0 ; event_add_failed: -pevent_free_format (event); +tep_free_format (event);return ret; }
@@ -6263,7 +6263,7 @@ int get_field_val(struct trace_seq *s, struct format_field *field, }/** -* pevent_get_field_raw - return the raw pointer into the data field +* tep_get_field_raw - return the raw pointer into the data field * @s: The seq to print to on error * @event: the event that the field is for * @name: The name of the field
@@ -6276,9 +6276,9 @@ int get_field_val(struct trace_seq *s, struct format_field *field,* * On failure, it returns NULL. */ -void *pevent_get_field_raw (struct trace_seq *s,struct event_format *event, -const char *name,struct tep_record *record, -int *len,int err) +void *tep_get_field_raw (struct trace_seq *s,struct event_format *event, +const char *name,struct tep_record *record, +int *len,int err) {struct format_field *field;void *data = record->data;
@@ -6313,7 +6313,7 @@ void *pevent_get_field_raw(struct trace_seq *s, struct event_format *event, }/** -* pevent_get_field_val - find a field and return its value +* tep_get_field_val - find a field and return its value * @s: The seq to print to on error * @event: the event that the field is for * @name: The name of the field
@@ -6323,9 +6323,9 @@ void *pevent_get_field_raw(struct trace_seq *s, struct event_format *event,* * Returns 0 on success -1 on field not found. */ -int pevent_get_field_val (struct trace_seq *s,struct event_format *event, -const char *name,struct tep_record *record, -unsigned long long *val,int err) +int tep_get_field_val (struct trace_seq *s,struct event_format *event, +const char *name,struct tep_record *record, +unsigned long long *val,int err) {struct format_field *field;
@@ -6338,7 +6338,7 @@ int pevent_get_field_val(struct trace_seq *s, struct event_format *event, }/** -* pevent_get_common_field_val - find a common field and return its value +* tep_get_common_field_val - find a common field and return its value * @s: The seq to print to on error * @event: the event that the field is for * @name: The name of the field
@@ -6348,9 +6348,9 @@ int pevent_get_field_val(struct trace_seq *s, struct event_format *event,* * Returns 0 on success -1 on field not found. */ -int pevent_get_common_field_val (struct trace_seq *s,struct event_format *event, -const char *name,struct tep_record *record, -unsigned long long *val,int err) +int tep_get_common_field_val (struct trace_seq *s,struct event_format *event, +const char *name,struct tep_record *record, +unsigned long long *val,int err) {struct format_field *field;
@@ -6363,7 +6363,7 @@ int pevent_get_common_field_val(struct trace_seq *s, struct event_format *event, }/** -* pevent_get_any_field_val - find a any field and return its value +* tep_get_any_field_val - find a any field and return its value * @s: The seq to print to on error * @event: the event that the field is for * @name: The name of the field
@@ -6373,9 +6373,9 @@ int pevent_get_common_field_val(struct trace_seq *s, struct event_format *event,* * Returns 0 on success -1 on field not found. */ -int pevent_get_any_field_val (struct trace_seq *s,struct event_format *event, -const char *name,struct tep_record *record, -unsigned long long *val,int err) +int tep_get_any_field_val (struct trace_seq *s,struct event_format *event, +const char *name,struct tep_record *record, +unsigned long long *val,int err) {struct format_field *field;
@@ -6771,7 +6771,7 @@ void pevent_ref(struct tep_handle *pevent) pevent->ref_count++; } -void pevent_free_format_field (struct format_field *field) +void tep_free_format_field (struct format_field *field) {free (field->type);if (field->alias != field->name)
@@ -6786,7 +6786,7 @@ static void free_format_fields(struct format_field *field)while (field) { next = field->next; -pevent_free_format_field (field); +tep_free_format_field (field); field = next; } }
@@ -6797,7 +6797,7 @@ static void free_formats(struct format *format)free_format_fields (format->fields); } -void pevent_free_format (struct event_format *event) +void tep_free_format (struct event_format *event) {free (event->name);free (event->system);
@@ -6883,7 +6883,7 @@ void tep_free(struct tep_handle *pevent) }for (i =0 ; i < pevent->nr_events; i++) -pevent_free_format (pevent->events[i]); +tep_free_format (pevent->events[i]);while (pevent->handlers) { handle = pevent->handlers;
tools/lib/traceevent/event-parse.h +14 -14
@@ -648,22 +648,22 @@ enum tep_errno tep_parse_format(struct tep_handle *pevent,struct event_format **eventp, const char *buf, unsigned long size, const char *sys); -void pevent_free_format (struct event_format *event); -void pevent_free_format_field (struct format_field *field); - -void *pevent_get_field_raw (struct trace_seq *s,struct event_format *event, -const char *name,struct tep_record *record, -int *len,int err); - -int pevent_get_field_val (struct trace_seq *s,struct event_format *event, -const char *name,struct tep_record *record, -unsigned long long *val,int err); -int pevent_get_common_field_val (struct trace_seq *s,struct event_format *event, -const char *name,struct tep_record *record, -unsigned long long *val,int err); -int pevent_get_any_field_val (struct trace_seq *s,struct event_format *event, +void tep_free_format (struct event_format *event); +void tep_free_format_field (struct format_field *field); + +void *tep_get_field_raw (struct trace_seq *s,struct event_format *event, +const char *name,struct tep_record *record, +int *len,int err); + +int tep_get_field_val (struct trace_seq *s,struct event_format *event, +const char *name,struct tep_record *record, +unsigned long long *val,int err); +int tep_get_common_field_val (struct trace_seq *s,struct event_format *event,const char *name,struct tep_record *record,unsigned long long *val,int err); +int tep_get_any_field_val (struct trace_seq *s,struct event_format *event, +const char *name,struct tep_record *record, +unsigned long long *val,int err); int tep_print_num_field(struct trace_seq *s, const char *fmt, struct event_format *event, const char *name,
tools/lib/traceevent/plugin_function.c +2 -2
@@ -132,12 +132,12 @@ static int function_handler(struct trace_seq *s, struct tep_record *record,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); -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);
tools/lib/traceevent/plugin_kvm.c +14 -14
@@ -254,10 +254,10 @@ static int print_exit_reason(struct trace_seq *s, struct tep_record *record,unsigned long long val;const char *reason; -if (pevent_get_field_val (s, event, field, record, &val,1 ) <0 ) +if (tep_get_field_val (s, event, field, record, &val,1 ) <0 )return -1 ; -if (pevent_get_field_val (s, event,"isa" , record, &isa,0 ) <0 ) +if (tep_get_field_val (s, event,"isa" , record, &isa,0 ) <0 ) isa =1 ; reason =find_exit_reason (isa, val);
@@ -278,8 +278,8 @@ static int kvm_exit_handler(struct trace_seq *s, struct tep_record *record,tep_print_num_field (s," rip 0x%lx" , event,"guest_rip" , record,1 ); -if (pevent_get_field_val (s, event,"info1" , record, &info1,0 ) >=0 - &&pevent_get_field_val (s, event,"info2" , record, &info2,0 ) >=0 ) +if (tep_get_field_val (s, event,"info1" , record, &info1,0 ) >=0 + &&tep_get_field_val (s, event,"info2" , record, &info2,0 ) >=0 )trace_seq_printf (s," info %llx %llx" , info1, info2);return 0 ;
@@ -299,22 +299,22 @@ static int kvm_emulate_insn_handler(struct trace_seq *s,uint8_t *insn;const char *disasm; -if (pevent_get_field_val (s, event,"rip" , record, &rip,1 ) <0 ) +if (tep_get_field_val (s, event,"rip" , record, &rip,1 ) <0 )return -1 ; -if (pevent_get_field_val (s, event,"csbase" , record, &csbase,1 ) <0 ) +if (tep_get_field_val (s, event,"csbase" , record, &csbase,1 ) <0 )return -1 ; -if (pevent_get_field_val (s, event,"len" , record, &len,1 ) <0 ) +if (tep_get_field_val (s, event,"len" , record, &len,1 ) <0 )return -1 ; -if (pevent_get_field_val (s, event,"flags" , record, &flags,1 ) <0 ) +if (tep_get_field_val (s, event,"flags" , record, &flags,1 ) <0 )return -1 ; -if (pevent_get_field_val (s, event,"failed" , record, &failed,1 ) <0 ) +if (tep_get_field_val (s, event,"failed" , record, &failed,1 ) <0 )return -1 ; - insn =pevent_get_field_raw (s, event,"insn" , record, &llen,1 ); + insn =tep_get_field_raw (s, event,"insn" , record, &llen,1 );if (!insn)return -1 ;
@@ -379,7 +379,7 @@ static int kvm_mmu_print_role(struct trace_seq *s, struct tep_record *record, };union kvm_mmu_page_role role; -if (pevent_get_field_val (s, event,"role" , record, &val,1 ) <0 ) +if (tep_get_field_val (s, event,"role" , record, &val,1 ) <0 )return -1 ; role.word = (int )val;
@@ -409,7 +409,7 @@ static int kvm_mmu_print_role(struct trace_seq *s, struct tep_record *record,tep_print_num_field (s," root %u " , event,"root_count" , record,1 ); -if (pevent_get_field_val (s, event,"unsync" , record, &val,1 ) <0 ) +if (tep_get_field_val (s, event,"unsync" , record, &val,1 ) <0 )return -1 ;trace_seq_printf (s,"%s%c" , val ?"unsync" :"sync" ,0 );
@@ -422,12 +422,12 @@ static int kvm_mmu_get_page_handler(struct trace_seq *s, {unsigned long long val; -if (pevent_get_field_val (s, event,"created" , record, &val,1 ) <0 ) +if (tep_get_field_val (s, event,"created" , record, &val,1 ) <0 )return -1 ;trace_seq_printf (s,"%s " , val ?"new" :"existing" ); -if (pevent_get_field_val (s, event,"gfn" , record, &val,1 ) <0 ) +if (tep_get_field_val (s, event,"gfn" , record, &val,1 ) <0 )return -1 ;trace_seq_printf (s,"sp gfn %llx " , val);
tools/lib/traceevent/plugin_sched_switch.c +9 -9
@@ -71,7 +71,7 @@ static int sched_wakeup_handler(struct trace_seq *s,struct format_field *field;unsigned long long val; -if (pevent_get_field_val (s, event,"pid" , record, &val,1 )) +if (tep_get_field_val (s, event,"pid" , record, &val,1 ))return trace_seq_putc (s,'!' ); field =tep_find_any_field (event,"comm" );
@@ -81,13 +81,13 @@ static int sched_wakeup_handler(struct trace_seq *s, }trace_seq_printf (s,"%lld" , val); -if (pevent_get_field_val (s, event,"prio" , record, &val,0 ) ==0 ) +if (tep_get_field_val (s, event,"prio" , record, &val,0 ) ==0 )trace_seq_printf (s," [%lld]" , val); -if (pevent_get_field_val (s, event,"success" , record, &val,1 ) ==0 ) +if (tep_get_field_val (s, event,"success" , record, &val,1 ) ==0 )trace_seq_printf (s," success=%lld" , val); -if (pevent_get_field_val (s, event,"target_cpu" , record, &val,0 ) ==0 ) +if (tep_get_field_val (s, event,"target_cpu" , record, &val,0 ) ==0 )trace_seq_printf (s," CPU:%03llu" , val);return 0 ;
@@ -100,7 +100,7 @@ static int sched_switch_handler(struct trace_seq *s,struct format_field *field;unsigned long long val; -if (pevent_get_field_val (s, event,"prev_pid" , record, &val,1 )) +if (tep_get_field_val (s, event,"prev_pid" , record, &val,1 ))return trace_seq_putc (s,'!' ); field =tep_find_any_field (event,"prev_comm" );
@@ -110,15 +110,15 @@ static int sched_switch_handler(struct trace_seq *s, }trace_seq_printf (s,"%lld " , val); -if (pevent_get_field_val (s, event,"prev_prio" , record, &val,0 ) ==0 ) +if (tep_get_field_val (s, event,"prev_prio" , record, &val,0 ) ==0 )trace_seq_printf (s,"[%d] " , (int ) val); -if (pevent_get_field_val (s, event,"prev_state" , record, &val,0 ) ==0 ) +if (tep_get_field_val (s, event,"prev_state" , record, &val,0 ) ==0 )write_state (s, val);trace_seq_puts (s," ==> " ); -if (pevent_get_field_val (s, event,"next_pid" , record, &val,1 )) +if (tep_get_field_val (s, event,"next_pid" , record, &val,1 ))return trace_seq_putc (s,'!' ); field =tep_find_any_field (event,"next_comm" );
@@ -128,7 +128,7 @@ static int sched_switch_handler(struct trace_seq *s, }trace_seq_printf (s,"%lld" , val); -if (pevent_get_field_val (s, event,"next_prio" , record, &val,0 ) ==0 ) +if (tep_get_field_val (s, event,"next_prio" , record, &val,0 ) ==0 )trace_seq_printf (s," [%d]" , (int ) val);return 0 ;