tools lib traceevent: Rename pevent to tep for preparation for library
RFC PATCH v2 20/24 tools/lib/traceevent: 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_function, pevent_find_function_address, pevent_find_event_by_name, pevent_find_event_by_record
--- tools/lib/traceevent/event-parse.c | 24 ++++++++++++------------ tools/lib/traceevent/event-parse.h | 8 ++++---- tools/lib/traceevent/parse-filter.c | 10 +++++----- tools/lib/traceevent/plugin_function.c | 4 ++-- tools/lib/traceevent/plugin_kmem.c | 4 ++-- 5 files changed, 25 insertions(+), 25 deletions(-)
tools/lib/traceevent/event-parse.c +12 -12
@@ -503,7 +503,7 @@ find_func(struct tep_handle *pevent, unsigned long long addr) }/** -* pevent_find_function - find a function by a given address +* tep_find_function - find a function by a given address * @pevent: handle for the pevent * @addr: the address to find the function with *
@@ -511,7 +511,7 @@ find_func(struct tep_handle *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 tep_handle *pevent,unsigned long long addr) +const char *tep_find_function (struct tep_handle *pevent,unsigned long long addr) {struct func_map *map;
@@ -523,16 +523,16 @@ const char *pevent_find_function(struct tep_handle *pevent, unsigned long long a }/** -* pevent_find_function_address - find a function address by a given address +* tep_find_function_address - find a function address by a given address * @pevent: handle for the pevent * @addr: the address to find the function with * * Returns the address the function starts at. This can be used in -* conjunction with pevent_find_function to print both the function +* conjunction with tep_find_function to print both the function * name and the function offset. */ unsigned long long -pevent_find_function_address (struct tep_handle *pevent,unsigned long long addr) +tep_find_function_address (struct tep_handle *pevent,unsigned long long addr) {struct func_map *map;
@@ -3498,7 +3498,7 @@ struct event_format *tep_find_event(struct tep_handle *pevent, int id) }/** -* pevent_find_event_by_name - find an event by given name +* tep_find_event_by_name - find an event by given name * @pevent: a handle to the pevent * @sys: the system name to search for * @name: the name of the event to search for
@@ -3507,8 +3507,8 @@ struct event_format *tep_find_event(struct tep_handle *pevent, int id)* @sys. If @sys is NULL the first event with @name is returned. */ struct event_format * -pevent_find_event_by_name (struct tep_handle *pevent, -const char *sys,const char *name) +tep_find_event_by_name (struct tep_handle *pevent, +const char *sys,const char *name) {struct event_format *event;int i;
@@ -5433,7 +5433,7 @@ static bool is_timestamp_in_us(char *trace_clock, bool use_trace_clock) }/** -* pevent_find_event_by_record - return the event from a given record +* tep_find_event_by_record - return the event from a given record * @pevent: a handle to the pevent * @record: The record to get the event from *
@@ -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 tep_record *record) +tep_find_event_by_record (struct tep_handle *pevent,struct tep_record *record) {int type;
@@ -5564,7 +5564,7 @@ void tep_print_event(struct tep_handle *pevent, struct trace_seq *s, {struct event_format *event; - event =pevent_find_event_by_record (pevent, record); + event =tep_find_event_by_record (pevent, record);if (!event) {int i;int type =trace_parse_common_type (pevent, record->data);
@@ -6607,7 +6607,7 @@ static struct event_format *pevent_search_event(struct tep_handle *pevent, int iif (sys_name && (strcmp (sys_name, event->system) !=0 ))return NULL ; }else { - event =pevent_find_event_by_name (pevent, sys_name, event_name); + event =tep_find_event_by_name (pevent, sys_name, event_name);if (!event)return NULL ; }
tools/lib/traceevent/event-parse.h +4 -4
@@ -690,9 +690,9 @@ struct format_field *tep_find_common_field(struct event_format *event, const chastruct 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); +const char *tep_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); +tep_find_function_address (struct tep_handle *pevent,unsigned long long addr);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);
@@ -700,10 +700,10 @@ int tep_read_number_field(struct format_field *field, const void *data,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); +tep_find_event_by_name (struct tep_handle *pevent,const char *sys,const char *name);struct event_format * -pevent_find_event_by_record (struct tep_handle *pevent,struct tep_record *record); +tep_find_event_by_record (struct tep_handle *pevent,struct tep_record *record);void tep_data_lat_fmt (struct tep_handle *pevent,struct trace_seq *s,struct tep_record *record);
tools/lib/traceevent/parse-filter.c +5 -5
@@ -1478,7 +1478,7 @@ static int copy_filter_type(struct event_filter *filter,/* Can't assume that the pevent's are the same */ sys = filter_type->event->system; name = filter_type->event->name; - event =pevent_find_event_by_name (filter->pevent, sys, name); + event =tep_find_event_by_name (filter->pevent, sys, name);if (!event)return -1 ;
@@ -1578,9 +1578,9 @@ int tep_update_trivial(struct event_filter *dest, struct event_filter *source,if (src_pevent != dest_pevent) {/* do a look up */ - event =pevent_find_event_by_name (src_pevent, - event->system, - event->name); + event =tep_find_event_by_name (src_pevent, + event->system, + event->name);if (!event)return -1 ; }
@@ -1909,7 +1909,7 @@ static const char *get_field_str(struct filter_arg *arg, struct tep_record *recoif (arg->str.field->flags & (FIELD_IS_POINTER |FIELD_IS_LONG ))/* convert to a kernel symbol */ - val =pevent_find_function (pevent, addr); + val =tep_find_function (pevent, addr);if (val ==NULL ) {/* just use the hex of the string name */
tools/lib/traceevent/plugin_function.c +2 -2
@@ -135,12 +135,12 @@ static int function_handler(struct trace_seq *s, struct tep_record *record,if (tep_get_field_val (s, event,"ip" , record, &function,1 ))return trace_seq_putc (s,'!' ); - func =pevent_find_function (pevent, function); + func =tep_find_function (pevent, function);if (tep_get_field_val (s, event,"parent_ip" , record, &pfunction,1 ))return trace_seq_putc (s,'!' ); - parent =pevent_find_function (pevent, pfunction); + parent =tep_find_function (pevent, pfunction);if (parent && ftrace_indent->set) index =add_and_get_index (parent, func, record->cpu);
tools/lib/traceevent/plugin_kmem.c +2 -2
@@ -38,11 +38,11 @@ static int call_site_handler(struct trace_seq *s, struct tep_record *record,if (tep_read_number_field (field, data, &val))return 1 ; - func =pevent_find_function (event->pevent, val); + func =tep_find_function (event->pevent, val);if (!func)return 1 ; - addr =pevent_find_function_address (event->pevent, val); + addr =tep_find_function_address (event->pevent, val);trace_seq_printf (s,"(%s+0x%x) " , func, (int )(val - addr));return 1 ;
Signature · 1 line
2.18.0
tip-bot for Tzvetomir Stoyanov (VMware)
merge bot[tip:perf/urgent] tools lib traceevent: Rename pevent_find_* APIs
tools lib traceevent: Rename pevent_find_* APIs
Commit-ID: 610e1e4ff0431b3a86a0ebfcdb47828b8e082329 Gitweb: https://git.kernel.org/tip/610e1e4ff0431b3a86a0ebfcdb47828b8e082329 Author: Tzvetomir Stoyanov (VMware) <[email protected]> AuthorDate: Wed, 8 Aug 2018 14:03:05 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Mon, 13 Aug 2018 15:31:28 -0300
tools lib traceevent: 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_function, pevent_find_function_address, pevent_find_event_by_name, pevent_find_event_by_record
--- tools/lib/traceevent/event-parse.c | 24 ++++++++++++------------ tools/lib/traceevent/event-parse.h | 8 ++++---- tools/lib/traceevent/parse-filter.c | 10 +++++----- tools/lib/traceevent/plugin_function.c | 4 ++-- tools/lib/traceevent/plugin_kmem.c | 4 ++-- 5 files changed, 25 insertions(+), 25 deletions(-)
tools/lib/traceevent/event-parse.c +12 -12
@@ -503,7 +503,7 @@ find_func(struct tep_handle *pevent, unsigned long long addr) }/** -* pevent_find_function - find a function by a given address +* tep_find_function - find a function by a given address * @pevent: handle for the pevent * @addr: the address to find the function with *
@@ -511,7 +511,7 @@ find_func(struct tep_handle *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 tep_handle *pevent,unsigned long long addr) +const char *tep_find_function (struct tep_handle *pevent,unsigned long long addr) {struct func_map *map;
@@ -523,16 +523,16 @@ const char *pevent_find_function(struct tep_handle *pevent, unsigned long long a }/** -* pevent_find_function_address - find a function address by a given address +* tep_find_function_address - find a function address by a given address * @pevent: handle for the pevent * @addr: the address to find the function with * * Returns the address the function starts at. This can be used in -* conjunction with pevent_find_function to print both the function +* conjunction with tep_find_function to print both the function * name and the function offset. */ unsigned long long -pevent_find_function_address (struct tep_handle *pevent,unsigned long long addr) +tep_find_function_address (struct tep_handle *pevent,unsigned long long addr) {struct func_map *map;
@@ -3498,7 +3498,7 @@ struct event_format *tep_find_event(struct tep_handle *pevent, int id) }/** -* pevent_find_event_by_name - find an event by given name +* tep_find_event_by_name - find an event by given name * @pevent: a handle to the pevent * @sys: the system name to search for * @name: the name of the event to search for
@@ -3507,8 +3507,8 @@ struct event_format *tep_find_event(struct tep_handle *pevent, int id)* @sys. If @sys is NULL the first event with @name is returned. */ struct event_format * -pevent_find_event_by_name (struct tep_handle *pevent, -const char *sys,const char *name) +tep_find_event_by_name (struct tep_handle *pevent, +const char *sys,const char *name) {struct event_format *event;int i;
@@ -5433,7 +5433,7 @@ static bool is_timestamp_in_us(char *trace_clock, bool use_trace_clock) }/** -* pevent_find_event_by_record - return the event from a given record +* tep_find_event_by_record - return the event from a given record * @pevent: a handle to the pevent * @record: The record to get the event from *
@@ -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 tep_record *record) +tep_find_event_by_record (struct tep_handle *pevent,struct tep_record *record) {int type;
@@ -5564,7 +5564,7 @@ void tep_print_event(struct tep_handle *pevent, struct trace_seq *s, {struct event_format *event; - event =pevent_find_event_by_record (pevent, record); + event =tep_find_event_by_record (pevent, record);if (!event) {int i;int type =trace_parse_common_type (pevent, record->data);
@@ -6607,7 +6607,7 @@ static struct event_format *pevent_search_event(struct tep_handle *pevent, int iif (sys_name && (strcmp (sys_name, event->system) !=0 ))return NULL ; }else { - event =pevent_find_event_by_name (pevent, sys_name, event_name); + event =tep_find_event_by_name (pevent, sys_name, event_name);if (!event)return NULL ; }
tools/lib/traceevent/event-parse.h +4 -4
@@ -690,9 +690,9 @@ struct format_field *tep_find_common_field(struct event_format *event, const chastruct 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); +const char *tep_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); +tep_find_function_address (struct tep_handle *pevent,unsigned long long addr);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);
@@ -700,10 +700,10 @@ int tep_read_number_field(struct format_field *field, const void *data,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); +tep_find_event_by_name (struct tep_handle *pevent,const char *sys,const char *name);struct event_format * -pevent_find_event_by_record (struct tep_handle *pevent,struct tep_record *record); +tep_find_event_by_record (struct tep_handle *pevent,struct tep_record *record);void tep_data_lat_fmt (struct tep_handle *pevent,struct trace_seq *s,struct tep_record *record);
tools/lib/traceevent/parse-filter.c +5 -5
@@ -1478,7 +1478,7 @@ static int copy_filter_type(struct event_filter *filter,/* Can't assume that the pevent's are the same */ sys = filter_type->event->system; name = filter_type->event->name; - event =pevent_find_event_by_name (filter->pevent, sys, name); + event =tep_find_event_by_name (filter->pevent, sys, name);if (!event)return -1 ;
@@ -1578,9 +1578,9 @@ int tep_update_trivial(struct event_filter *dest, struct event_filter *source,if (src_pevent != dest_pevent) {/* do a look up */ - event =pevent_find_event_by_name (src_pevent, - event->system, - event->name); + event =tep_find_event_by_name (src_pevent, + event->system, + event->name);if (!event)return -1 ; }
@@ -1909,7 +1909,7 @@ static const char *get_field_str(struct filter_arg *arg, struct tep_record *recoif (arg->str.field->flags & (FIELD_IS_POINTER |FIELD_IS_LONG ))/* convert to a kernel symbol */ - val =pevent_find_function (pevent, addr); + val =tep_find_function (pevent, addr);if (val ==NULL ) {/* just use the hex of the string name */
tools/lib/traceevent/plugin_function.c +2 -2
@@ -135,12 +135,12 @@ static int function_handler(struct trace_seq *s, struct tep_record *record,if (tep_get_field_val (s, event,"ip" , record, &function,1 ))return trace_seq_putc (s,'!' ); - func =pevent_find_function (pevent, function); + func =tep_find_function (pevent, function);if (tep_get_field_val (s, event,"parent_ip" , record, &pfunction,1 ))return trace_seq_putc (s,'!' ); - parent =pevent_find_function (pevent, pfunction); + parent =tep_find_function (pevent, pfunction);if (parent && ftrace_indent->set) index =add_and_get_index (parent, func, record->cpu);
tools/lib/traceevent/plugin_kmem.c +2 -2
@@ -38,11 +38,11 @@ static int call_site_handler(struct trace_seq *s, struct tep_record *record,if (tep_read_number_field (field, data, &val))return 1 ; - func =pevent_find_function (event->pevent, val); + func =tep_find_function (event->pevent, val);if (!func)return 1 ; - addr =pevent_find_function_address (event->pevent, val); + addr =tep_find_function_address (event->pevent, val);trace_seq_printf (s,"(%s+0x%x) " , func, (int )(val - addr));return 1 ;
RFC PATCH v2 21/24 tools/lib/traceevent: Rename various pevent get/set/is 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_pid_is_registered, pevent_get_cpus, pevent_set_cpus, pevent_is_file_bigendian, pevent_is_host_bigendian, pevent_is_latency_format, pevent_set_latency_format
--- tools/lib/traceevent/event-parse.c | 4 ++-- tools/lib/traceevent/event-parse.h | 14 +++++++------- tools/lib/traceevent/plugin_kvm.c | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-)
tools/lib/traceevent/event-parse.c +2 -2
@@ -211,14 +211,14 @@ static const char *find_cmdline(struct tep_handle *pevent, int pid) }/** -* pevent_pid_is_registered - return if a pid has a cmdline registered +* tep_pid_is_registered - return if a pid has a cmdline registered * @pevent: handle for the pevent * @pid: The pid to check if it has a cmdline registered with. * * Returns 1 if the pid has a cmdline mapped to it * 0 otherwise. */ -int pevent_pid_is_registered (struct tep_handle *pevent,int pid) +int tep_pid_is_registered (struct tep_handle *pevent,int pid) {const struct cmdline *comm;struct cmdline key;
tools/lib/traceevent/event-parse.h +7 -7
@@ -624,7 +624,7 @@ 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); +int tep_pid_is_registered (struct tep_handle *pevent,int pid); void tep_print_event_task(struct tep_handle *pevent, struct trace_seq *s, struct event_format *event,
@@ -731,12 +731,12 @@ struct event_format **pevent_list_events(struct tep_handle *pevent, enum event_sstruct format_field **pevent_event_common_fields (struct event_format *event);struct format_field **pevent_event_fields (struct event_format *event); -static inline int pevent_get_cpus (struct tep_handle *pevent) +static inline int tep_get_cpus (struct tep_handle *pevent) {return pevent->cpus; } -static inline void pevent_set_cpus (struct tep_handle *pevent,int cpus) +static inline void tep_set_cpus (struct tep_handle *pevent,int cpus) { pevent->cpus = cpus; }
@@ -761,7 +761,7 @@ static inline void tep_set_page_size(struct tep_handle *pevent, int _page_size) pevent->page_size = _page_size; } -static inline int pevent_is_file_bigendian (struct tep_handle *pevent) +static inline int tep_is_file_bigendian (struct tep_handle *pevent) {return pevent->file_bigendian; }
@@ -771,7 +771,7 @@ static inline void tep_set_file_bigendian(struct tep_handle *pevent, int endian) pevent->file_bigendian = endian; } -static inline int pevent_is_host_bigendian (struct tep_handle *pevent) +static inline int tep_is_host_bigendian (struct tep_handle *pevent) {return pevent->host_bigendian; }
@@ -781,12 +781,12 @@ static inline void tep_set_host_bigendian(struct tep_handle *pevent, int endian) pevent->host_bigendian = endian; } -static inline int pevent_is_latency_format (struct tep_handle *pevent) +static inline int tep_is_latency_format (struct tep_handle *pevent) {return pevent->latency_format; } -static inline void pevent_set_latency_format (struct tep_handle *pevent,int lat) +static inline void tep_set_latency_format (struct tep_handle *pevent,int lat) { pevent->latency_format = lat; }
tools/lib/traceevent/plugin_kvm.c +2 -2
@@ -388,8 +388,8 @@ static int kvm_mmu_print_role(struct trace_seq *s, struct tep_record *record,* We can only use the structure if file is of the same * endianess. */ -if (pevent_is_file_bigendian (event->pevent) == -pevent_is_host_bigendian (event->pevent)) { +if (tep_is_file_bigendian (event->pevent) == +tep_is_host_bigendian (event->pevent)) { trace_seq_printf(s, "%u q%u%s %s%s %spae %snxe %swp%s%s%s", role.level,
Signature · 1 line
2.18.0
tip-bot for Tzvetomir Stoyanov (VMware)
merge bot[tip:perf/urgent] tools lib traceevent: Rename various pevent get/set/is APIs
tools lib traceevent: Rename various pevent get/set/is APIs
Commit-ID: 413af01c8d9d5d688df3244401cbddfe98bafe2a Gitweb: https://git.kernel.org/tip/413af01c8d9d5d688df3244401cbddfe98bafe2a Author: Tzvetomir Stoyanov (VMware) <[email protected]> AuthorDate: Wed, 8 Aug 2018 14:03:06 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Mon, 13 Aug 2018 15:35:02 -0300
tools lib traceevent: Rename various pevent get/set/is 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_pid_is_registered, pevent_get_cpus, pevent_set_cpus, pevent_is_file_bigendian, pevent_is_host_bigendian, pevent_is_latency_format, pevent_set_latency_format
--- tools/lib/traceevent/event-parse.c | 4 ++-- tools/lib/traceevent/event-parse.h | 14 +++++++------- tools/lib/traceevent/plugin_kvm.c | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-)
tools/lib/traceevent/event-parse.c +2 -2
@@ -211,14 +211,14 @@ static const char *find_cmdline(struct tep_handle *pevent, int pid) }/** -* pevent_pid_is_registered - return if a pid has a cmdline registered +* tep_pid_is_registered - return if a pid has a cmdline registered * @pevent: handle for the pevent * @pid: The pid to check if it has a cmdline registered with. * * Returns 1 if the pid has a cmdline mapped to it * 0 otherwise. */ -int pevent_pid_is_registered (struct tep_handle *pevent,int pid) +int tep_pid_is_registered (struct tep_handle *pevent,int pid) {const struct cmdline *comm;struct cmdline key;
tools/lib/traceevent/event-parse.h +7 -7
@@ -624,7 +624,7 @@ 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); +int tep_pid_is_registered (struct tep_handle *pevent,int pid); void tep_print_event_task(struct tep_handle *pevent, struct trace_seq *s, struct event_format *event,
@@ -731,12 +731,12 @@ struct event_format **pevent_list_events(struct tep_handle *pevent, enum event_sstruct format_field **pevent_event_common_fields (struct event_format *event);struct format_field **pevent_event_fields (struct event_format *event); -static inline int pevent_get_cpus (struct tep_handle *pevent) +static inline int tep_get_cpus (struct tep_handle *pevent) {return pevent->cpus; } -static inline void pevent_set_cpus (struct tep_handle *pevent,int cpus) +static inline void tep_set_cpus (struct tep_handle *pevent,int cpus) { pevent->cpus = cpus; }
@@ -761,7 +761,7 @@ static inline void tep_set_page_size(struct tep_handle *pevent, int _page_size) pevent->page_size = _page_size; } -static inline int pevent_is_file_bigendian (struct tep_handle *pevent) +static inline int tep_is_file_bigendian (struct tep_handle *pevent) {return pevent->file_bigendian; }
@@ -771,7 +771,7 @@ static inline void tep_set_file_bigendian(struct tep_handle *pevent, int endian) pevent->file_bigendian = endian; } -static inline int pevent_is_host_bigendian (struct tep_handle *pevent) +static inline int tep_is_host_bigendian (struct tep_handle *pevent) {return pevent->host_bigendian; }
@@ -781,12 +781,12 @@ static inline void tep_set_host_bigendian(struct tep_handle *pevent, int endian) pevent->host_bigendian = endian; } -static inline int pevent_is_latency_format (struct tep_handle *pevent) +static inline int tep_is_latency_format (struct tep_handle *pevent) {return pevent->latency_format; } -static inline void pevent_set_latency_format (struct tep_handle *pevent,int lat) +static inline void tep_set_latency_format (struct tep_handle *pevent,int lat) { pevent->latency_format = lat; }
tools/lib/traceevent/plugin_kvm.c +2 -2
@@ -388,8 +388,8 @@ static int kvm_mmu_print_role(struct trace_seq *s, struct tep_record *record,* We can only use the structure if file is of the same * endianess. */ -if (pevent_is_file_bigendian (event->pevent) == -pevent_is_host_bigendian (event->pevent)) { +if (tep_is_file_bigendian (event->pevent) == +tep_is_host_bigendian (event->pevent)) { trace_seq_printf(s, "%u q%u%s %s%s %spae %snxe %swp%s%s%s", role.level,
Re: [tip:perf/urgent] tools lib traceevent: Rename various pevent get/set/is APIs
Quoted 16 lines · On Sat, 18 Aug 2018 04:53:45 -0700 "tip-bot for Tzvetomir Stoyanov (VMware)"…
Commit-ID: 413af01c8d9d5d688df3244401cbddfe98bafe2a Gitweb: https://git.kernel.org/tip/413af01c8d9d5d688df3244401cbddfe98bafe2a Author: Tzvetomir Stoyanov (VMware) <[email protected]> AuthorDate: Wed, 8 Aug 2018 14:03:06 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Mon, 13 Aug 2018 15:35:02 -0300tools lib traceevent: Rename various pevent get/set/is 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_pid_is_registered,pevent_get_cpus,pevent_set_cpus,pevent_is_file_bigendian,pevent_is_host_bigendian,pevent_is_latency_format,pevent_set_latency_format
Quoted 7 lines
Signed-off-by Tzvetomir Stoyanov (VMware) <[email protected]>Cc Andrew Morton <[email protected]>Cc Peter Zijlstra <[email protected]>Cc Yordan Karadzhov (VMware) <[email protected]>Signed-off-by Steven Rostedt <[email protected]>
Hi Arnaldo,
I'm curious to why the "(VMware)" part of my Signed-off-by was stripped off on all these patches? It's required that is added to denote that my work is done on my company time, otherwise I will have to use my vmware email address which I really don't want to do.
-- Steve
Quoted 8 lines
Signed-off-by Arnaldo Carvalho de Melo <[email protected]>--- tools/lib/traceevent/event-parse.c | 4 ++-- tools/lib/traceevent/event-parse.h | 14 +++++++------- tools/lib/traceevent/plugin_kvm.c | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-)
Re: [tip:perf/urgent] tools lib traceevent: Rename various pevent get/set/is APIs
Em Wed, Aug 22, 2018 at 10:36:12AM -0400, Steven Rostedt escreveu:
Quoted 27 lines
Quoted 16 lines · On Sat, 18 Aug 2018 04:53:45 -0700 "tip-bot for Tzvetomir Stoyanov (VMware)"…
Commit-ID: 413af01c8d9d5d688df3244401cbddfe98bafe2a Gitweb: https://git.kernel.org/tip/413af01c8d9d5d688df3244401cbddfe98bafe2a Author: Tzvetomir Stoyanov (VMware) <[email protected]> AuthorDate: Wed, 8 Aug 2018 14:03:06 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Mon, 13 Aug 2018 15:35:02 -0300tools lib traceevent: Rename various pevent get/set/is 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_pid_is_registered,pevent_get_cpus,pevent_set_cpus,pevent_is_file_bigendian,pevent_is_host_bigendian,pevent_is_latency_format,pevent_set_latency_formatQuoted 7 lines
Signed-off-by Tzvetomir Stoyanov (VMware) <[email protected]>Cc Andrew Morton <[email protected]>Cc Peter Zijlstra <[email protected]>Cc Yordan Karadzhov (VMware) <[email protected]>Signed-off-by Steven Rostedt <[email protected]>
Quoted 6 lines
Hi Arnaldo,
I'm curious to why the "(VMware)" part of my Signed-off-by was stripped off on all these patches? It's required that is added to denote that my work is done on my company time, otherwise I will have to use my vmware email address which I really don't want to do.
I'll make sure it is kept, fixing my scripts,
Thanks,
- Arnaldo
RFC PATCH v2 22/24 tools/lib/traceevent: Rename internal parser 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
APIs: pevent_buffer_init, pevent_read_token, pevent_free_token, pevent_peek_char, pevent_get_input_buf, pevent_get_input_buf_ptr
--- tools/lib/traceevent/event-parse.c | 24 ++++++++++++------------ tools/lib/traceevent/event-parse.h | 12 ++++++------ tools/lib/traceevent/parse-filter.c | 16 ++++++++-------- 3 files changed, 26 insertions(+), 26 deletions(-)
tools/lib/traceevent/event-parse.c +12 -12
@@ -73,12 +73,12 @@ static void init_input_buf(const char *buf, unsigned long long size) input_buf_ptr =0 ; } -const char *pevent_get_input_buf (void ) +const char *tep_get_input_buf (void ) {return input_buf; } -unsigned long long pevent_get_input_buf_ptr (void ) +unsigned long long tep_get_input_buf_ptr (void ) {return input_buf_ptr; }
@@ -113,14 +113,14 @@ process_defined_func(struct trace_seq *s, void *data, int size,static void free_func_handle (struct tep_function_handler *func);/** -* pevent_buffer_init - init buffer for parsing +* tep_buffer_init - init buffer for parsing * @buf: buffer to parse * @size: the size of the buffer * -* For use with pevent_read_token(), this initializes the internal -* buffer that pevent_read_token() will parse. +* For use with tep_read_token(), this initializes the internal +* buffer that tep_read_token() will parse. */ -void pevent_buffer_init (const char *buf,unsigned long long size) +void tep_buffer_init (const char *buf,unsigned long long size) {init_input_buf (buf, size); }
@@ -913,11 +913,11 @@ static int __peek_char(void) }/** -* pevent_peek_char - peek at the next character that will be read +* tep_peek_char - peek at the next character that will be read * * Returns the next character read, or -1 if end of buffer. */ -int pevent_peek_char (void ) +int tep_peek_char (void ) {return __peek_char (); }
@@ -1157,7 +1157,7 @@ static enum event_type read_token(char **tok) }/** -* pevent_read_token - access to utilites to use the pevent parser +* tep_read_token - access to utilites to use the pevent parser * @tok: The token to return * * This will parse tokens from the string given by
@@ -1165,16 +1165,16 @@ static enum event_type read_token(char **tok)* * Returns the token type. */ -enum event_type pevent_read_token (char **tok) +enum event_type tep_read_token (char **tok) {return read_token (tok); }/** -* pevent_free_token - free a token returned by pevent_read_token +* tep_free_token - free a token returned by tep_read_token * @token: the token to free */ -void pevent_free_token (char *token) +void tep_free_token (char *token) {free_token (token); }
tools/lib/traceevent/event-parse.h +6 -6
@@ -797,12 +797,12 @@ void pevent_ref(struct tep_handle *pevent);void pevent_unref (struct tep_handle *pevent);/* access to the internal parser */ -void pevent_buffer_init (const char *buf,unsigned long long size); -enum event_type pevent_read_token (char **tok); -void pevent_free_token (char *token); -int pevent_peek_char (void ); -const char *pevent_get_input_buf (void ); -unsigned long long pevent_get_input_buf_ptr (void ); +void tep_buffer_init (const char *buf,unsigned long long size); +enum event_type tep_read_token (char **tok); +void tep_free_token (char *token); +int tep_peek_char (void ); +const char *tep_get_input_buf (void ); +unsigned long long tep_get_input_buf_ptr (void );/* for debugging */ void tep_print_funcs (struct tep_handle *pevent);
tools/lib/traceevent/parse-filter.c +8 -8
@@ -51,8 +51,8 @@ static void show_error(char *error_buf, const char *fmt, ...)int len;int i; - input =pevent_get_input_buf (); - index =pevent_get_input_buf_ptr (); + input =tep_get_input_buf (); + index =tep_get_input_buf_ptr (); len = input ?strlen (input) :0 ;if (len) {
@@ -72,7 +72,7 @@ static void show_error(char *error_buf, const char *fmt, ...)static void free_token (char *token) { -pevent_free_token (token); +tep_free_token (token); }static enum event_type read_token (char **tok)
@@ -82,13 +82,13 @@ static enum event_type read_token(char **tok)do {free_token (token); - type =pevent_read_token (&token); + type =tep_read_token (&token); }while (type ==EVENT_NEWLINE || type ==EVENT_SPACE );/* If token is = or ! check to see if the next char is ~ */ if (token && (strcmp (token,"=" ) ==0 ||strcmp (token,"!" ) ==0 ) && -pevent_peek_char () =='~' ) { +tep_peek_char () =='~' ) {/* append it */ *tok =malloc (3 );if (*tok ==NULL ) {
@@ -98,7 +98,7 @@ static enum event_type read_token(char **tok)sprintf (*tok,"%c%c" , *token,'~' );free_token (token);/* Now remove the '~' from the buffer */ -pevent_read_token (&token); +tep_read_token (&token);free_token (token); }else *tok = token;
@@ -1198,7 +1198,7 @@ process_event(struct event_format *event, const char *filter_str, {int ret; -pevent_buffer_init (filter_str,strlen (filter_str)); +tep_buffer_init (filter_str,strlen (filter_str)); ret =process_filter (event, parg, error_str,0 );if (ret <0 )
@@ -1254,7 +1254,7 @@ filter_event(struct event_filter *filter, struct event_format *event,static void filter_init_error_buf (struct event_filter *filter) {/* clear buffer to reset show error */ -pevent_buffer_init ("" ,0 ); +tep_buffer_init ("" ,0 ); filter->error_buffer[0 ] ='\0' ; }
Signature · 1 line
2.18.0
tip-bot for Tzvetomir Stoyanov (VMware)
merge bot[tip:perf/urgent] tools lib traceevent: Rename internal parser related APIs
tools lib traceevent: Rename internal parser related APIs
Commit-ID: 1634e4604cccbe6394dd858fb973604d2313336b Gitweb: https://git.kernel.org/tip/1634e4604cccbe6394dd858fb973604d2313336b Author: Tzvetomir Stoyanov (VMware) <[email protected]> AuthorDate: Wed, 8 Aug 2018 14:03:07 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Mon, 13 Aug 2018 15:35:58 -0300
tools lib traceevent: Rename internal parser 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
APIs: pevent_buffer_init, pevent_read_token, pevent_free_token, pevent_peek_char, pevent_get_input_buf, pevent_get_input_buf_ptr
--- tools/lib/traceevent/event-parse.c | 24 ++++++++++++------------ tools/lib/traceevent/event-parse.h | 12 ++++++------ tools/lib/traceevent/parse-filter.c | 16 ++++++++-------- 3 files changed, 26 insertions(+), 26 deletions(-)
tools/lib/traceevent/event-parse.c +12 -12
@@ -73,12 +73,12 @@ static void init_input_buf(const char *buf, unsigned long long size) input_buf_ptr =0 ; } -const char *pevent_get_input_buf (void ) +const char *tep_get_input_buf (void ) {return input_buf; } -unsigned long long pevent_get_input_buf_ptr (void ) +unsigned long long tep_get_input_buf_ptr (void ) {return input_buf_ptr; }
@@ -113,14 +113,14 @@ process_defined_func(struct trace_seq *s, void *data, int size,static void free_func_handle (struct tep_function_handler *func);/** -* pevent_buffer_init - init buffer for parsing +* tep_buffer_init - init buffer for parsing * @buf: buffer to parse * @size: the size of the buffer * -* For use with pevent_read_token(), this initializes the internal -* buffer that pevent_read_token() will parse. +* For use with tep_read_token(), this initializes the internal +* buffer that tep_read_token() will parse. */ -void pevent_buffer_init (const char *buf,unsigned long long size) +void tep_buffer_init (const char *buf,unsigned long long size) {init_input_buf (buf, size); }
@@ -913,11 +913,11 @@ static int __peek_char(void) }/** -* pevent_peek_char - peek at the next character that will be read +* tep_peek_char - peek at the next character that will be read * * Returns the next character read, or -1 if end of buffer. */ -int pevent_peek_char (void ) +int tep_peek_char (void ) {return __peek_char (); }
@@ -1157,7 +1157,7 @@ static enum event_type read_token(char **tok) }/** -* pevent_read_token - access to utilites to use the pevent parser +* tep_read_token - access to utilites to use the pevent parser * @tok: The token to return * * This will parse tokens from the string given by
@@ -1165,16 +1165,16 @@ static enum event_type read_token(char **tok)* * Returns the token type. */ -enum event_type pevent_read_token (char **tok) +enum event_type tep_read_token (char **tok) {return read_token (tok); }/** -* pevent_free_token - free a token returned by pevent_read_token +* tep_free_token - free a token returned by tep_read_token * @token: the token to free */ -void pevent_free_token (char *token) +void tep_free_token (char *token) {free_token (token); }
tools/lib/traceevent/event-parse.h +6 -6
@@ -797,12 +797,12 @@ void pevent_ref(struct tep_handle *pevent);void pevent_unref (struct tep_handle *pevent);/* access to the internal parser */ -void pevent_buffer_init (const char *buf,unsigned long long size); -enum event_type pevent_read_token (char **tok); -void pevent_free_token (char *token); -int pevent_peek_char (void ); -const char *pevent_get_input_buf (void ); -unsigned long long pevent_get_input_buf_ptr (void ); +void tep_buffer_init (const char *buf,unsigned long long size); +enum event_type tep_read_token (char **tok); +void tep_free_token (char *token); +int tep_peek_char (void ); +const char *tep_get_input_buf (void ); +unsigned long long tep_get_input_buf_ptr (void );/* for debugging */ void tep_print_funcs (struct tep_handle *pevent);
tools/lib/traceevent/parse-filter.c +8 -8
@@ -51,8 +51,8 @@ static void show_error(char *error_buf, const char *fmt, ...)int len;int i; - input =pevent_get_input_buf (); - index =pevent_get_input_buf_ptr (); + input =tep_get_input_buf (); + index =tep_get_input_buf_ptr (); len = input ?strlen (input) :0 ;if (len) {
@@ -72,7 +72,7 @@ static void show_error(char *error_buf, const char *fmt, ...)static void free_token (char *token) { -pevent_free_token (token); +tep_free_token (token); }static enum event_type read_token (char **tok)
@@ -82,13 +82,13 @@ static enum event_type read_token(char **tok)do {free_token (token); - type =pevent_read_token (&token); + type =tep_read_token (&token); }while (type ==EVENT_NEWLINE || type ==EVENT_SPACE );/* If token is = or ! check to see if the next char is ~ */ if (token && (strcmp (token,"=" ) ==0 ||strcmp (token,"!" ) ==0 ) && -pevent_peek_char () =='~' ) { +tep_peek_char () =='~' ) {/* append it */ *tok =malloc (3 );if (*tok ==NULL ) {
@@ -98,7 +98,7 @@ static enum event_type read_token(char **tok)sprintf (*tok,"%c%c" , *token,'~' );free_token (token);/* Now remove the '~' from the buffer */ -pevent_read_token (&token); +tep_read_token (&token);free_token (token); }else *tok = token;
@@ -1198,7 +1198,7 @@ process_event(struct event_format *event, const char *filter_str, {int ret; -pevent_buffer_init (filter_str,strlen (filter_str)); +tep_buffer_init (filter_str,strlen (filter_str)); ret =process_filter (event, parg, error_str,0 );if (ret <0 )
@@ -1254,7 +1254,7 @@ filter_event(struct event_filter *filter, struct event_format *event,static void filter_init_error_buf (struct event_filter *filter) {/* clear buffer to reset show error */ -pevent_buffer_init ("" ,0 ); +tep_buffer_init ("" ,0 ); filter->error_buffer[0 ] ='\0' ; }
RFC PATCH v2 23/24 tools/lib/traceevent: Rename various pevent 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_reset_function_resolver, pevent_strerror, pevent_list_events, pevent_event_common_fields, pevent_event_fields, pevent_ref, pevent_unref
--- tools/lib/traceevent/event-parse.c | 22 +++++++++++----------- tools/lib/traceevent/event-parse.h | 14 +++++++------- tools/lib/traceevent/parse-filter.c | 6 +++--- 3 files changed, 21 insertions(+), 21 deletions(-)
tools/lib/traceevent/event-parse.c +11 -11
@@ -471,13 +471,13 @@ int tep_set_function_resolver(struct tep_handle *pevent, }/** -* pevent_reset_function_resolver - reset alternative function resolver +* tep_reset_function_resolver - reset alternative function resolver * @pevent: handle for the pevent * * Stop using whatever alternative resolver was set, use the default * one instead. */ -void pevent_reset_function_resolver (struct tep_handle *pevent) +void tep_reset_function_resolver (struct tep_handle *pevent) {free (pevent->func_resolver); pevent->func_resolver =NULL ;
@@ -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 tep_handle *pevent,enum event_sort_type sort_type) +struct event_format **tep_list_events (struct tep_handle *pevent,enum event_sort_type sort_type) {struct event_format **events;int (*sort)(const void *a,const void *b);
@@ -5709,13 +5709,13 @@ get_event_fields(const char *type, const char *name, }/** -* pevent_event_common_fields - return a list of common fields for an event +* tep_event_common_fields - return a list of common fields for an event * @event: the event to return the common fields of. * * Returns an allocated array of fields. The last item in the array is NULL. * The array must be freed with free(). */ -struct format_field **pevent_event_common_fields (struct event_format *event) +struct format_field **tep_event_common_fields (struct event_format *event) { return get_event_fields("common", event->name, event->format.nr_common,
@@ -5723,13 +5723,13 @@ struct format_field **pevent_event_common_fields(struct event_format *event) }/** -* pevent_event_fields - return a list of event specific fields for an event +* tep_event_fields - return a list of event specific fields for an event * @event: the event to return the fields of. * * Returns an allocated array of fields. The last item in the array is NULL. * The array must be freed with free(). */ -struct format_field **pevent_event_fields (struct event_format *event) +struct format_field **tep_event_fields (struct event_format *event) { return get_event_fields("event", event->name, event->format.nr_fields,
@@ -6221,8 +6221,8 @@ static const char * const pevent_error_str[] = { };#undef _PE -int pevent_strerror (struct tep_handle *pevent__maybe_unused , -enum tep_errno errnum,char *buf,size_t buflen) +int tep_strerror (struct tep_handle *pevent__maybe_unused , +enum tep_errno errnum,char *buf,size_t buflen) {int idx;const char *msg;
@@ -6766,7 +6766,7 @@ struct tep_handle *tep_alloc(void)return pevent; } -void pevent_ref (struct tep_handle *pevent) +void tep_ref (struct tep_handle *pevent) { pevent->ref_count++; }
@@ -6899,7 +6899,7 @@ void tep_free(struct tep_handle *pevent)free (pevent); } -void pevent_unref (struct tep_handle *pevent) +void tep_unref (struct tep_handle *pevent) {tep_free (pevent); }
tools/lib/traceevent/event-parse.h +7 -7
@@ -617,7 +617,7 @@ enum trace_flag_type {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); +void tep_reset_function_resolver (struct tep_handle *pevent);int tep_register_comm (struct tep_handle *pevent,const char *comm,int pid);int tep_register_trace_clock (struct tep_handle *pevent,const char *trace_clock); int tep_register_function(struct tep_handle *pevent, char *name,
@@ -724,12 +724,12 @@ void tep_print_fields(struct trace_seq *s, void *data, int size __maybe_unused, 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 tep_errno errnum, +int tep_strerror (struct tep_handle *pevent,enum tep_errno errnum,char *buf,size_t buflen); -struct event_format **pevent_list_events (struct tep_handle *pevent,enum event_sort_type ); -struct format_field **pevent_event_common_fields (struct event_format *event); -struct format_field **pevent_event_fields (struct event_format *event); +struct event_format **tep_list_events (struct tep_handle *pevent,enum event_sort_type ); +struct format_field **tep_event_common_fields (struct event_format *event); +struct format_field **tep_event_fields (struct event_format *event);static inline int tep_get_cpus (struct tep_handle *pevent) {
@@ -793,8 +793,8 @@ static inline void tep_set_latency_format(struct tep_handle *pevent, int lat)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); +void tep_ref (struct tep_handle *pevent); +void tep_unref (struct tep_handle *pevent);/* access to the internal parser */ void tep_buffer_init (const char *buf,unsigned long long size);
tools/lib/traceevent/parse-filter.c +3 -3
@@ -189,7 +189,7 @@ struct event_filter *tep_filter_alloc(struct tep_handle *pevent)memset (filter,0 ,sizeof (*filter)); filter->pevent = pevent; -pevent_ref (pevent); +tep_ref (pevent);return filter; }
@@ -1393,7 +1393,7 @@ int tep_filter_strerror(struct event_filter *filter, enum tep_errno err,return 0 ; } -return pevent_strerror (filter->pevent, err, buf, buflen); +return tep_strerror (filter->pevent, err, buf, buflen); }/**
@@ -1456,7 +1456,7 @@ void tep_filter_reset(struct event_filter *filter)void tep_filter_free (struct event_filter *filter) { -pevent_unref (filter->pevent); +tep_unref (filter->pevent);tep_filter_reset (filter);
Signature · 1 line
2.18.0
tip-bot for Tzvetomir Stoyanov (VMware)
merge bot[tip:perf/urgent] tools lib traceevent: Rename various pevent APIs
tools lib traceevent: Rename various pevent APIs
Commit-ID: c99eeaf5497288d4e0fbca7ee0c401fd35860481 Gitweb: https://git.kernel.org/tip/c99eeaf5497288d4e0fbca7ee0c401fd35860481 Author: Tzvetomir Stoyanov (VMware) <[email protected]> AuthorDate: Wed, 8 Aug 2018 14:03:08 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Mon, 13 Aug 2018 15:36:43 -0300
tools lib traceevent: Rename various pevent 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_reset_function_resolver, pevent_strerror, pevent_list_events, pevent_event_common_fields, pevent_event_fields, pevent_ref, pevent_unref
--- tools/lib/traceevent/event-parse.c | 22 +++++++++++----------- tools/lib/traceevent/event-parse.h | 14 +++++++------- tools/lib/traceevent/parse-filter.c | 6 +++--- 3 files changed, 21 insertions(+), 21 deletions(-)
tools/lib/traceevent/event-parse.c +11 -11
@@ -471,13 +471,13 @@ int tep_set_function_resolver(struct tep_handle *pevent, }/** -* pevent_reset_function_resolver - reset alternative function resolver +* tep_reset_function_resolver - reset alternative function resolver * @pevent: handle for the pevent * * Stop using whatever alternative resolver was set, use the default * one instead. */ -void pevent_reset_function_resolver (struct tep_handle *pevent) +void tep_reset_function_resolver (struct tep_handle *pevent) {free (pevent->func_resolver); pevent->func_resolver =NULL ;
@@ -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 tep_handle *pevent,enum event_sort_type sort_type) +struct event_format **tep_list_events (struct tep_handle *pevent,enum event_sort_type sort_type) {struct event_format **events;int (*sort)(const void *a,const void *b);
@@ -5709,13 +5709,13 @@ get_event_fields(const char *type, const char *name, }/** -* pevent_event_common_fields - return a list of common fields for an event +* tep_event_common_fields - return a list of common fields for an event * @event: the event to return the common fields of. * * Returns an allocated array of fields. The last item in the array is NULL. * The array must be freed with free(). */ -struct format_field **pevent_event_common_fields (struct event_format *event) +struct format_field **tep_event_common_fields (struct event_format *event) { return get_event_fields("common", event->name, event->format.nr_common,
@@ -5723,13 +5723,13 @@ struct format_field **pevent_event_common_fields(struct event_format *event) }/** -* pevent_event_fields - return a list of event specific fields for an event +* tep_event_fields - return a list of event specific fields for an event * @event: the event to return the fields of. * * Returns an allocated array of fields. The last item in the array is NULL. * The array must be freed with free(). */ -struct format_field **pevent_event_fields (struct event_format *event) +struct format_field **tep_event_fields (struct event_format *event) { return get_event_fields("event", event->name, event->format.nr_fields,
@@ -6221,8 +6221,8 @@ static const char * const pevent_error_str[] = { };#undef _PE -int pevent_strerror (struct tep_handle *pevent__maybe_unused , -enum tep_errno errnum,char *buf,size_t buflen) +int tep_strerror (struct tep_handle *pevent__maybe_unused , +enum tep_errno errnum,char *buf,size_t buflen) {int idx;const char *msg;
@@ -6766,7 +6766,7 @@ struct tep_handle *tep_alloc(void)return pevent; } -void pevent_ref (struct tep_handle *pevent) +void tep_ref (struct tep_handle *pevent) { pevent->ref_count++; }
@@ -6899,7 +6899,7 @@ void tep_free(struct tep_handle *pevent)free (pevent); } -void pevent_unref (struct tep_handle *pevent) +void tep_unref (struct tep_handle *pevent) {tep_free (pevent); }
tools/lib/traceevent/event-parse.h +7 -7
@@ -617,7 +617,7 @@ enum trace_flag_type {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); +void tep_reset_function_resolver (struct tep_handle *pevent);int tep_register_comm (struct tep_handle *pevent,const char *comm,int pid);int tep_register_trace_clock (struct tep_handle *pevent,const char *trace_clock); int tep_register_function(struct tep_handle *pevent, char *name,
@@ -724,12 +724,12 @@ void tep_print_fields(struct trace_seq *s, void *data, int size __maybe_unused, 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 tep_errno errnum, +int tep_strerror (struct tep_handle *pevent,enum tep_errno errnum,char *buf,size_t buflen); -struct event_format **pevent_list_events (struct tep_handle *pevent,enum event_sort_type ); -struct format_field **pevent_event_common_fields (struct event_format *event); -struct format_field **pevent_event_fields (struct event_format *event); +struct event_format **tep_list_events (struct tep_handle *pevent,enum event_sort_type ); +struct format_field **tep_event_common_fields (struct event_format *event); +struct format_field **tep_event_fields (struct event_format *event);static inline int tep_get_cpus (struct tep_handle *pevent) {
@@ -793,8 +793,8 @@ static inline void tep_set_latency_format(struct tep_handle *pevent, int lat)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); +void tep_ref (struct tep_handle *pevent); +void tep_unref (struct tep_handle *pevent);/* access to the internal parser */ void tep_buffer_init (const char *buf,unsigned long long size);
tools/lib/traceevent/parse-filter.c +3 -3
@@ -189,7 +189,7 @@ struct event_filter *tep_filter_alloc(struct tep_handle *pevent)memset (filter,0 ,sizeof (*filter)); filter->pevent = pevent; -pevent_ref (pevent); +tep_ref (pevent);return filter; }
@@ -1393,7 +1393,7 @@ int tep_filter_strerror(struct event_filter *filter, enum tep_errno err,return 0 ; } -return pevent_strerror (filter->pevent, err, buf, buflen); +return tep_strerror (filter->pevent, err, buf, buflen); }/**
@@ -1456,7 +1456,7 @@ void tep_filter_reset(struct event_filter *filter)void tep_filter_free (struct event_filter *filter) { -pevent_unref (filter->pevent); +tep_unref (filter->pevent);tep_filter_reset (filter);
RFC PATCH v2 24/24 tools/lib/traceevent: Rename static variables and functions in event-parse.c
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 static variables and functions in event-parse.c: pevent_func_params, __pevent_parse_format, __pevent_parse_event, pevent_error_str, pevent_search_event
--- tools/lib/traceevent/event-parse.c | 54 +++++++++++++++--------------- 1 file changed, 27 insertions(+), 27 deletions(-)
tools/lib/traceevent/event-parse.c +27 -27
@@ -92,9 +92,9 @@ struct event_handler {void *context; }; -struct pevent_func_params { -struct pevent_func_params *next; -enum tep_func_arg_type type; +struct func_params { +struct func_params *next; +enum tep_func_arg_type type; };struct tep_function_handler {
@@ -102,7 +102,7 @@ struct tep_function_handler {enum tep_func_arg_type ret_type;char *name;tep_func_handler func; -struct pevent_func_params *params; +struct func_params *params;int nr_args; };
@@ -1161,7 +1161,7 @@ static enum event_type read_token(char **tok)* @tok: The token to return * * This will parse tokens from the string given by -* pevent_init_data(). +* tep_init_data(). * * Returns the token type. */
@@ -4133,7 +4133,7 @@ process_defined_func(struct trace_seq *s, void *data, int size, struct event_format *event, struct print_arg *arg) { struct tep_function_handler *func_handle = arg->func.func; -struct pevent_func_params *param; +struct func_params *param;unsigned long long *args;unsigned long long ret;struct print_arg *farg;
@@ -6023,7 +6023,7 @@ static int find_event_handle(struct tep_handle *pevent, struct event_format *eve }/** -* __pevent_parse_format - parse the event format +* __tep_parse_format - parse the event format * @buf: the buffer storing the event format string * @size: the size of @buf * @sys: the system the event belongs to
@@ -6035,9 +6035,9 @@ static int find_event_handle(struct tep_handle *pevent, struct event_format *eve* * /sys/kernel/debug/tracing/events/.../.../format */ -enum tep_errno __pevent_parse_format (struct event_format **eventp, -struct tep_handle *pevent,const char *buf, -unsigned long size,const char *sys) +enum tep_errno __tep_parse_format (struct event_format **eventp, +struct tep_handle *pevent,const char *buf, +unsigned long size,const char *sys) {struct event_format *event;int ret;
@@ -6143,12 +6143,12 @@ enum tep_errno __pevent_parse_format(struct event_format **eventp, }static enum tep_errno -__pevent_parse_event (struct tep_handle *pevent, -struct event_format **eventp, -const char *buf,unsigned long size, -const char *sys) +__parse_event (struct tep_handle *pevent, +struct event_format **eventp, +const char *buf,unsigned long size, +const char *sys) { -int ret =__pevent_parse_format (eventp, pevent, buf, size, sys); +int ret =__tep_parse_format (eventp, pevent, buf, size, sys);struct event_format *event = *eventp;if (event ==NULL )
@@ -6190,7 +6190,7 @@ enum tep_errno tep_parse_format(struct tep_handle *pevent,const char *buf, unsigned long size, const char *sys) { - return __pevent_parse_event(pevent, eventp, buf, size, sys); + return __parse_event(pevent, eventp, buf, size, sys); }/**
@@ -6211,12 +6211,12 @@ enum tep_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); +return __parse_event (pevent, &event, buf, size, sys); }#undef _PE#define _PE (code, str) str -static const char *const pevent_error_str[] = { +static const char *const tep_error_str[] = {TEP_ERRORS };#undef _PE
@@ -6237,7 +6237,7 @@ int tep_strerror(struct tep_handle *pevent __maybe_unused,return -1 ; idx = errnum - __TEP_ERRNO__START -1 ; - msg = pevent_error_str[idx]; + msg = tep_error_str[idx];snprintf (buf, buflen,"%s" , msg);return 0 ;
@@ -6463,7 +6463,7 @@ int tep_print_func_field(struct trace_seq *s, const char *fmt,static void free_func_handle (struct tep_function_handler *func) { -struct pevent_func_params *params; +struct func_params *params;free (func->name);
@@ -6497,8 +6497,8 @@ int tep_register_print_function(struct tep_handle *pevent, char *name, ...) {struct tep_function_handler *func_handle; -struct pevent_func_params **next_param; -struct pevent_func_params *param; +struct func_params **next_param; +struct func_params *param;enum tep_func_arg_type type;va_list ap;int ret;
@@ -6591,9 +6591,9 @@ int tep_unregister_print_function(struct tep_handle *pevent,return -1 ; } -static struct event_format *pevent_search_event (struct tep_handle *pevent,int id, -const char *sys_name, -const char *event_name) +static struct event_format *search_event (struct tep_handle *pevent,int id, +const char *sys_name, +const char *event_name) {struct event_format *event;
@@ -6638,7 +6638,7 @@ int tep_register_event_handler(struct tep_handle *pevent, int id,struct event_format *event;struct event_handler *handle; - event =pevent_search_event (pevent, id, sys_name, event_name); + event =search_event (pevent, id, sys_name, event_name);if (event ==NULL ) goto not_found;
@@ -6723,7 +6723,7 @@ int tep_unregister_event_handler(struct tep_handle *pevent, int id,struct event_handler *handle;struct event_handler **next; - event =pevent_search_event (pevent, id, sys_name, event_name); + event =search_event (pevent, id, sys_name, event_name);if (event ==NULL ) goto not_found;
Signature · 1 line
2.18.0
tip-bot for Tzvetomir Stoyanov (VMware)
merge bot[tip:perf/urgent] tools lib traceevent: Rename static variables and functions in event-parse.c
tools lib traceevent: Rename static variables and functions in event-parse.c
Commit-ID: 0ae98637b611c51737eadd9cc6e041746dbb11ef Gitweb: https://git.kernel.org/tip/0ae98637b611c51737eadd9cc6e041746dbb11ef Author: Tzvetomir Stoyanov (VMware) <[email protected]> AuthorDate: Wed, 8 Aug 2018 14:03:09 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Mon, 13 Aug 2018 15:37:26 -0300
tools lib traceevent: Rename static variables and functions in event-parse.c
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 static variables and functions in event-parse.c: pevent_func_params, __pevent_parse_format, __pevent_parse_event, pevent_error_str, pevent_search_event
--- tools/lib/traceevent/event-parse.c | 54 +++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 27 deletions(-)
tools/lib/traceevent/event-parse.c +27 -27
@@ -92,9 +92,9 @@ struct event_handler {void *context; }; -struct pevent_func_params { -struct pevent_func_params *next; -enum tep_func_arg_type type; +struct func_params { +struct func_params *next; +enum tep_func_arg_type type; };struct tep_function_handler {
@@ -102,7 +102,7 @@ struct tep_function_handler {enum tep_func_arg_type ret_type;char *name;tep_func_handler func; -struct pevent_func_params *params; +struct func_params *params;int nr_args; };
@@ -1161,7 +1161,7 @@ static enum event_type read_token(char **tok)* @tok: The token to return * * This will parse tokens from the string given by -* pevent_init_data(). +* tep_init_data(). * * Returns the token type. */
@@ -4133,7 +4133,7 @@ process_defined_func(struct trace_seq *s, void *data, int size, struct event_format *event, struct print_arg *arg) { struct tep_function_handler *func_handle = arg->func.func; -struct pevent_func_params *param; +struct func_params *param;unsigned long long *args;unsigned long long ret;struct print_arg *farg;
@@ -6023,7 +6023,7 @@ static int find_event_handle(struct tep_handle *pevent, struct event_format *eve }/** -* __pevent_parse_format - parse the event format +* __tep_parse_format - parse the event format * @buf: the buffer storing the event format string * @size: the size of @buf * @sys: the system the event belongs to
@@ -6035,9 +6035,9 @@ static int find_event_handle(struct tep_handle *pevent, struct event_format *eve* * /sys/kernel/debug/tracing/events/.../.../format */ -enum tep_errno __pevent_parse_format (struct event_format **eventp, -struct tep_handle *pevent,const char *buf, -unsigned long size,const char *sys) +enum tep_errno __tep_parse_format (struct event_format **eventp, +struct tep_handle *pevent,const char *buf, +unsigned long size,const char *sys) {struct event_format *event;int ret;
@@ -6143,12 +6143,12 @@ enum tep_errno __pevent_parse_format(struct event_format **eventp, }static enum tep_errno -__pevent_parse_event (struct tep_handle *pevent, -struct event_format **eventp, -const char *buf,unsigned long size, -const char *sys) +__parse_event (struct tep_handle *pevent, +struct event_format **eventp, +const char *buf,unsigned long size, +const char *sys) { -int ret =__pevent_parse_format (eventp, pevent, buf, size, sys); +int ret =__tep_parse_format (eventp, pevent, buf, size, sys);struct event_format *event = *eventp;if (event ==NULL )
@@ -6190,7 +6190,7 @@ enum tep_errno tep_parse_format(struct tep_handle *pevent,const char *buf, unsigned long size, const char *sys) { - return __pevent_parse_event(pevent, eventp, buf, size, sys); + return __parse_event(pevent, eventp, buf, size, sys); }/**
@@ -6211,12 +6211,12 @@ enum tep_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); +return __parse_event (pevent, &event, buf, size, sys); }#undef _PE#define _PE (code, str) str -static const char *const pevent_error_str[] = { +static const char *const tep_error_str[] = {TEP_ERRORS };#undef _PE
@@ -6237,7 +6237,7 @@ int tep_strerror(struct tep_handle *pevent __maybe_unused,return -1 ; idx = errnum - __TEP_ERRNO__START -1 ; - msg = pevent_error_str[idx]; + msg = tep_error_str[idx];snprintf (buf, buflen,"%s" , msg);return 0 ;
@@ -6463,7 +6463,7 @@ int tep_print_func_field(struct trace_seq *s, const char *fmt,static void free_func_handle (struct tep_function_handler *func) { -struct pevent_func_params *params; +struct func_params *params;free (func->name);
@@ -6497,8 +6497,8 @@ int tep_register_print_function(struct tep_handle *pevent, char *name, ...) {struct tep_function_handler *func_handle; -struct pevent_func_params **next_param; -struct pevent_func_params *param; +struct func_params **next_param; +struct func_params *param;enum tep_func_arg_type type;va_list ap;int ret;
@@ -6591,9 +6591,9 @@ int tep_unregister_print_function(struct tep_handle *pevent,return -1 ; } -static struct event_format *pevent_search_event (struct tep_handle *pevent,int id, -const char *sys_name, -const char *event_name) +static struct event_format *search_event (struct tep_handle *pevent,int id, +const char *sys_name, +const char *event_name) {struct event_format *event;
@@ -6638,7 +6638,7 @@ int tep_register_event_handler(struct tep_handle *pevent, int id,struct event_format *event;struct event_handler *handle; - event =pevent_search_event (pevent, id, sys_name, event_name); + event =search_event (pevent, id, sys_name, event_name);if (event ==NULL ) goto not_found;
@@ -6723,7 +6723,7 @@ int tep_unregister_event_handler(struct tep_handle *pevent, int id,struct event_handler *handle;struct event_handler **next; - event =pevent_search_event (pevent, id, sys_name, event_name); + event =search_event (pevent, id, sys_name, event_name);if (event ==NULL ) goto not_found;