diff options
| author | Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com> | 2018-08-08 14:03:08 -0400 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-08-13 14:36:43 -0400 |
| commit | c99eeaf5497288d4e0fbca7ee0c401fd35860481 (patch) | |
| tree | 2799f4bef6ed70505b3fad764600a71cc4442b87 /tools | |
| parent | 1634e4604cccbe6394dd858fb973604d2313336b (diff) | |
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>
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/lib/traceevent/event-parse.c | 22 | ||||
| -rw-r--r-- | tools/lib/traceevent/event-parse.h | 14 | ||||
| -rw-r--r-- | tools/lib/traceevent/parse-filter.c | 6 |
3 files changed, 21 insertions, 21 deletions
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index 8215e6ff36eb..f723c088acca 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c | |||
| @@ -471,13 +471,13 @@ int tep_set_function_resolver(struct tep_handle *pevent, | |||
| 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 | * @pevent: handle for the pevent | 475 | * @pevent: handle for the pevent |
| 476 | * | 476 | * |
| 477 | * Stop using whatever alternative resolver was set, use the default | 477 | * Stop using whatever alternative resolver was set, use the default |
| 478 | * one instead. | 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 | free(pevent->func_resolver); | 482 | free(pevent->func_resolver); |
| 483 | pevent->func_resolver = NULL; | 483 | pevent->func_resolver = NULL; |
| @@ -5630,7 +5630,7 @@ static int events_system_cmp(const void *a, const void *b) | |||
| 5630 | return events_id_cmp(a, b); | 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 | struct event_format **events; | 5635 | struct event_format **events; |
| 5636 | int (*sort)(const void *a, const void *b); | 5636 | int (*sort)(const void *a, const void *b); |
| @@ -5709,13 +5709,13 @@ get_event_fields(const char *type, const char *name, | |||
| 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 | * @event: the event to return the common fields of. | 5713 | * @event: the event to return the common fields of. |
| 5714 | * | 5714 | * |
| 5715 | * Returns an allocated array of fields. The last item in the array is NULL. | 5715 | * Returns an allocated array of fields. The last item in the array is NULL. |
| 5716 | * The array must be freed with free(). | 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 | return get_event_fields("common", event->name, | 5720 | return get_event_fields("common", event->name, |
| 5721 | event->format.nr_common, | 5721 | event->format.nr_common, |
| @@ -5723,13 +5723,13 @@ struct format_field **pevent_event_common_fields(struct event_format *event) | |||
| 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 | * @event: the event to return the fields of. | 5727 | * @event: the event to return the fields of. |
| 5728 | * | 5728 | * |
| 5729 | * Returns an allocated array of fields. The last item in the array is NULL. | 5729 | * Returns an allocated array of fields. The last item in the array is NULL. |
| 5730 | * The array must be freed with free(). | 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 | return get_event_fields("event", event->name, | 5734 | return get_event_fields("event", event->name, |
| 5735 | event->format.nr_fields, | 5735 | event->format.nr_fields, |
| @@ -6221,8 +6221,8 @@ static const char * const pevent_error_str[] = { | |||
| 6221 | }; | 6221 | }; |
| 6222 | #undef _PE | 6222 | #undef _PE |
| 6223 | 6223 | ||
| 6224 | int pevent_strerror(struct tep_handle *pevent __maybe_unused, | 6224 | int tep_strerror(struct tep_handle *pevent __maybe_unused, |
| 6225 | enum tep_errno errnum, char *buf, size_t buflen) | 6225 | enum tep_errno errnum, char *buf, size_t buflen) |
| 6226 | { | 6226 | { |
| 6227 | int idx; | 6227 | int idx; |
| 6228 | const char *msg; | 6228 | const char *msg; |
| @@ -6766,7 +6766,7 @@ struct tep_handle *tep_alloc(void) | |||
| 6766 | return pevent; | 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 | pevent->ref_count++; | 6771 | pevent->ref_count++; |
| 6772 | } | 6772 | } |
| @@ -6899,7 +6899,7 @@ void tep_free(struct tep_handle *pevent) | |||
| 6899 | free(pevent); | 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 | tep_free(pevent); | 6904 | tep_free(pevent); |
| 6905 | } | 6905 | } |
diff --git a/tools/lib/traceevent/event-parse.h b/tools/lib/traceevent/event-parse.h index c41547353b4c..44b7c2d41f9f 100644 --- a/tools/lib/traceevent/event-parse.h +++ b/tools/lib/traceevent/event-parse.h | |||
| @@ -617,7 +617,7 @@ enum trace_flag_type { | |||
| 617 | 617 | ||
| 618 | int tep_set_function_resolver(struct tep_handle *pevent, | 618 | int tep_set_function_resolver(struct tep_handle *pevent, |
| 619 | tep_func_resolver_t *func, void *priv); | 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 | int tep_register_comm(struct tep_handle *pevent, const char *comm, int pid); | 621 | int tep_register_comm(struct tep_handle *pevent, const char *comm, int pid); |
| 622 | int tep_register_trace_clock(struct tep_handle *pevent, const char *trace_clock); | 622 | int tep_register_trace_clock(struct tep_handle *pevent, const char *trace_clock); |
| 623 | int tep_register_function(struct tep_handle *pevent, char *name, | 623 | int tep_register_function(struct tep_handle *pevent, char *name, |
| @@ -724,12 +724,12 @@ void tep_print_fields(struct trace_seq *s, void *data, | |||
| 724 | int size __maybe_unused, struct event_format *event); | 724 | int size __maybe_unused, struct event_format *event); |
| 725 | void tep_event_info(struct trace_seq *s, struct event_format *event, | 725 | void tep_event_info(struct trace_seq *s, struct event_format *event, |
| 726 | struct tep_record *record); | 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 | char *buf, size_t buflen); | 728 | char *buf, size_t buflen); |
| 729 | 729 | ||
| 730 | struct event_format **pevent_list_events(struct tep_handle *pevent, enum event_sort_type); | 730 | struct event_format **tep_list_events(struct tep_handle *pevent, enum event_sort_type); |
| 731 | struct format_field **pevent_event_common_fields(struct event_format *event); | 731 | struct format_field **tep_event_common_fields(struct event_format *event); |
| 732 | struct format_field **pevent_event_fields(struct event_format *event); | 732 | struct format_field **tep_event_fields(struct event_format *event); |
| 733 | 733 | ||
| 734 | static inline int tep_get_cpus(struct tep_handle *pevent) | 734 | static inline int tep_get_cpus(struct tep_handle *pevent) |
| 735 | { | 735 | { |
| @@ -793,8 +793,8 @@ static inline void tep_set_latency_format(struct tep_handle *pevent, int lat) | |||
| 793 | 793 | ||
| 794 | struct tep_handle *tep_alloc(void); | 794 | struct tep_handle *tep_alloc(void); |
| 795 | void tep_free(struct tep_handle *pevent); | 795 | void tep_free(struct tep_handle *pevent); |
| 796 | void pevent_ref(struct tep_handle *pevent); | 796 | void tep_ref(struct tep_handle *pevent); |
| 797 | void pevent_unref(struct tep_handle *pevent); | 797 | void tep_unref(struct tep_handle *pevent); |
| 798 | 798 | ||
| 799 | /* access to the internal parser */ | 799 | /* access to the internal parser */ |
| 800 | void tep_buffer_init(const char *buf, unsigned long long size); | 800 | void tep_buffer_init(const char *buf, unsigned long long size); |
diff --git a/tools/lib/traceevent/parse-filter.c b/tools/lib/traceevent/parse-filter.c index 5e3f29736a25..682a50e8b5f7 100644 --- a/tools/lib/traceevent/parse-filter.c +++ b/tools/lib/traceevent/parse-filter.c | |||
| @@ -189,7 +189,7 @@ struct event_filter *tep_filter_alloc(struct tep_handle *pevent) | |||
| 189 | 189 | ||
| 190 | memset(filter, 0, sizeof(*filter)); | 190 | memset(filter, 0, sizeof(*filter)); |
| 191 | filter->pevent = pevent; | 191 | filter->pevent = pevent; |
| 192 | pevent_ref(pevent); | 192 | tep_ref(pevent); |
| 193 | 193 | ||
| 194 | return filter; | 194 | return filter; |
| 195 | } | 195 | } |
| @@ -1393,7 +1393,7 @@ int tep_filter_strerror(struct event_filter *filter, enum tep_errno err, | |||
| 1393 | return 0; | 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,7 +1456,7 @@ void tep_filter_reset(struct event_filter *filter) | |||
| 1456 | 1456 | ||
| 1457 | void tep_filter_free(struct event_filter *filter) | 1457 | void tep_filter_free(struct event_filter *filter) |
| 1458 | { | 1458 | { |
| 1459 | pevent_unref(filter->pevent); | 1459 | tep_unref(filter->pevent); |
| 1460 | 1460 | ||
| 1461 | tep_filter_reset(filter); | 1461 | tep_filter_reset(filter); |
| 1462 | 1462 | ||
