Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
Cc: linux-trace-devel@vger.kernel.org
Link: http://lkml.kernel.org/r/20180808180703.426198047@goodmis.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Tzvetomir Stoyanov (VMware) and committed by
Arnaldo Carvalho de Melo
c99eeaf5 1634e460

+21 -21
+11 -11
tools/lib/traceevent/event-parse.c
··· 471 471 } 472 472 473 473 /** 474 - * pevent_reset_function_resolver - reset alternative function resolver 474 + * tep_reset_function_resolver - reset alternative function resolver 475 475 * @pevent: handle for the pevent 476 476 * 477 477 * Stop using whatever alternative resolver was set, use the default 478 478 * one instead. 479 479 */ 480 - void pevent_reset_function_resolver(struct tep_handle *pevent) 480 + void tep_reset_function_resolver(struct tep_handle *pevent) 481 481 { 482 482 free(pevent->func_resolver); 483 483 pevent->func_resolver = NULL; ··· 5630 5630 return events_id_cmp(a, b); 5631 5631 } 5632 5632 5633 - struct event_format **pevent_list_events(struct tep_handle *pevent, enum event_sort_type sort_type) 5633 + struct event_format **tep_list_events(struct tep_handle *pevent, enum event_sort_type sort_type) 5634 5634 { 5635 5635 struct event_format **events; 5636 5636 int (*sort)(const void *a, const void *b); ··· 5709 5709 } 5710 5710 5711 5711 /** 5712 - * pevent_event_common_fields - return a list of common fields for an event 5712 + * tep_event_common_fields - return a list of common fields for an event 5713 5713 * @event: the event to return the common fields of. 5714 5714 * 5715 5715 * Returns an allocated array of fields. The last item in the array is NULL. 5716 5716 * The array must be freed with free(). 5717 5717 */ 5718 - struct format_field **pevent_event_common_fields(struct event_format *event) 5718 + struct format_field **tep_event_common_fields(struct event_format *event) 5719 5719 { 5720 5720 return get_event_fields("common", event->name, 5721 5721 event->format.nr_common, ··· 5723 5723 } 5724 5724 5725 5725 /** 5726 - * pevent_event_fields - return a list of event specific fields for an event 5726 + * tep_event_fields - return a list of event specific fields for an event 5727 5727 * @event: the event to return the fields of. 5728 5728 * 5729 5729 * Returns an allocated array of fields. The last item in the array is NULL. 5730 5730 * The array must be freed with free(). 5731 5731 */ 5732 - struct format_field **pevent_event_fields(struct event_format *event) 5732 + struct format_field **tep_event_fields(struct event_format *event) 5733 5733 { 5734 5734 return get_event_fields("event", event->name, 5735 5735 event->format.nr_fields, ··· 6221 6221 }; 6222 6222 #undef _PE 6223 6223 6224 - int pevent_strerror(struct tep_handle *pevent __maybe_unused, 6225 - enum tep_errno errnum, char *buf, size_t buflen) 6224 + int tep_strerror(struct tep_handle *pevent __maybe_unused, 6225 + enum tep_errno errnum, char *buf, size_t buflen) 6226 6226 { 6227 6227 int idx; 6228 6228 const char *msg; ··· 6766 6766 return pevent; 6767 6767 } 6768 6768 6769 - void pevent_ref(struct tep_handle *pevent) 6769 + void tep_ref(struct tep_handle *pevent) 6770 6770 { 6771 6771 pevent->ref_count++; 6772 6772 } ··· 6899 6899 free(pevent); 6900 6900 } 6901 6901 6902 - void pevent_unref(struct tep_handle *pevent) 6902 + void tep_unref(struct tep_handle *pevent) 6903 6903 { 6904 6904 tep_free(pevent); 6905 6905 }
+7 -7
tools/lib/traceevent/event-parse.h
··· 617 617 618 618 int tep_set_function_resolver(struct tep_handle *pevent, 619 619 tep_func_resolver_t *func, void *priv); 620 - void pevent_reset_function_resolver(struct tep_handle *pevent); 620 + void tep_reset_function_resolver(struct tep_handle *pevent); 621 621 int tep_register_comm(struct tep_handle *pevent, const char *comm, int pid); 622 622 int tep_register_trace_clock(struct tep_handle *pevent, const char *trace_clock); 623 623 int tep_register_function(struct tep_handle *pevent, char *name, ··· 724 724 int size __maybe_unused, struct event_format *event); 725 725 void tep_event_info(struct trace_seq *s, struct event_format *event, 726 726 struct tep_record *record); 727 - int pevent_strerror(struct tep_handle *pevent, enum tep_errno errnum, 727 + int tep_strerror(struct tep_handle *pevent, enum tep_errno errnum, 728 728 char *buf, size_t buflen); 729 729 730 - struct event_format **pevent_list_events(struct tep_handle *pevent, enum event_sort_type); 731 - struct format_field **pevent_event_common_fields(struct event_format *event); 732 - struct format_field **pevent_event_fields(struct event_format *event); 730 + struct event_format **tep_list_events(struct tep_handle *pevent, enum event_sort_type); 731 + struct format_field **tep_event_common_fields(struct event_format *event); 732 + struct format_field **tep_event_fields(struct event_format *event); 733 733 734 734 static inline int tep_get_cpus(struct tep_handle *pevent) 735 735 { ··· 793 793 794 794 struct tep_handle *tep_alloc(void); 795 795 void tep_free(struct tep_handle *pevent); 796 - void pevent_ref(struct tep_handle *pevent); 797 - void pevent_unref(struct tep_handle *pevent); 796 + void tep_ref(struct tep_handle *pevent); 797 + void tep_unref(struct tep_handle *pevent); 798 798 799 799 /* access to the internal parser */ 800 800 void tep_buffer_init(const char *buf, unsigned long long size);
+3 -3
tools/lib/traceevent/parse-filter.c
··· 189 189 190 190 memset(filter, 0, sizeof(*filter)); 191 191 filter->pevent = pevent; 192 - pevent_ref(pevent); 192 + tep_ref(pevent); 193 193 194 194 return filter; 195 195 } ··· 1393 1393 return 0; 1394 1394 } 1395 1395 1396 - return pevent_strerror(filter->pevent, err, buf, buflen); 1396 + return tep_strerror(filter->pevent, err, buf, buflen); 1397 1397 } 1398 1398 1399 1399 /** ··· 1456 1456 1457 1457 void tep_filter_free(struct event_filter *filter) 1458 1458 { 1459 - pevent_unref(filter->pevent); 1459 + tep_unref(filter->pevent); 1460 1460 1461 1461 tep_filter_reset(filter); 1462 1462