All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 00/24] trace-cmd: rename variables, data structures and functions in lib/traceevent
@ 2018-08-27  8:17 Tzvetomir Stoyanov (VMware)
  2018-08-27  8:17 ` [PATCH v3 02/24] tools lib traceevent, perf tools: Rename 'struct pevent_record' to 'struct tep_record' Tzvetomir Stoyanov (VMware)
                   ` (22 more replies)
  0 siblings, 23 replies; 30+ messages in thread
From: Tzvetomir Stoyanov (VMware) @ 2018-08-27  8:17 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel

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 series of patches perform the renaming in the trace-cmd code.
This is v3 of the patches, fixed few kernel-shark-qt files. 

Tzvetomir Stoyanov (VMware) (24):
  tools lib traceevent, perf tools: Rename struct pevent to struct
    tep_handle
  tools lib traceevent, perf tools: Rename 'struct pevent_record' to
    'struct tep_record'
  tools lib traceevent, perf tools: Rename pevent plugin related APIs
  tools lib traceevent, perf tools: Rename pevent alloc / free APIs
  tools lib traceevent, perf tools: Rename pevent find APIs
  tools lib traceevent, perf tools: Rename pevent parse APIs
  tools lib traceevent, perf tools: Rename pevent print APIs
  tools lib traceevent, perf tools: Rename pevent_read_number_* APIs
  tools lib traceevent, perf tools: Rename pevent_register_* APIs
  tools lib traceevent, perf tools: Rename pevent_set_* APIs
  tools lib traceevent, perf tools: Rename traceevent_* APIs
  tools lib traceevent, perf tools: Rename 'enum pevent_flag' to 'enum
    tep_flag'
  tools lib traceevent, tools lib lockdep: Rename 'enum pevent_errno' to
    'enum tep_errno'
  tools lib traceevent: Rename pevent_function* APIs
  tools lib traceevent, perf tools: 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

 include/trace-cmd/trace-cmd.h            |  82 +--
 include/traceevent/event-parse.h         | 458 +++++++--------
 kernel-shark-qt/examples/datafilter.c    |   8 +-
 kernel-shark-qt/examples/dataload.c      |   4 +-
 kernel-shark-qt/src/libkshark-configio.c |  18 +-
 kernel-shark-qt/src/libkshark.c          |  56 +-
 kernel-shark-qt/src/libkshark.h          |  10 +-
 kernel-shark/include/trace-filter.h      |   6 +-
 kernel-shark/include/trace-graph.h       |  20 +-
 kernel-shark/include/trace-gui.h         |   8 +-
 kernel-shark/kernel-shark.c              |  14 +-
 kernel-shark/trace-capture.c             |  16 +-
 kernel-shark/trace-dialog.c              |  16 +-
 kernel-shark/trace-filter.c              | 104 ++--
 kernel-shark/trace-graph.c               | 126 ++--
 kernel-shark/trace-plot-cpu.c            |  56 +-
 kernel-shark/trace-plot-task.c           |  92 +--
 kernel-shark/trace-plot.c                |   4 +-
 kernel-shark/trace-view-main.c           |   8 +-
 kernel-shark/trace-view-store.c          |  66 +--
 kernel-shark/trace-view.c                |  10 +-
 lib/trace-cmd/trace-blk-hack.c           |  20 +-
 lib/trace-cmd/trace-ftrace.c             |  98 ++--
 lib/trace-cmd/trace-input.c              | 132 ++---
 lib/trace-cmd/trace-util.c               | 116 ++--
 lib/traceevent/event-parse.c             | 696 +++++++++++------------
 lib/traceevent/event-plugin.c            |  70 +--
 lib/traceevent/parse-filter.c            | 288 +++++-----
 plugins/plugin_blk.c                     |  46 +-
 plugins/plugin_cfg80211.c                |  20 +-
 plugins/plugin_function.c                |  36 +-
 plugins/plugin_futex.c                   |  26 +-
 plugins/plugin_hrtimer.c                 |  44 +-
 plugins/plugin_jbd2.c                    |  38 +-
 plugins/plugin_kmem.c                    |  64 +--
 plugins/plugin_kvm.c                     | 152 ++---
 plugins/plugin_mac80211.c                |  34 +-
 plugins/plugin_python.c                  |   8 +-
 plugins/plugin_sched_switch.c            |  60 +-
 plugins/plugin_scsi.c                    |  24 +-
 plugins/plugin_tlb.c                     |  20 +-
 plugins/plugin_xen.c                     |  20 +-
 python/ctracecmd.i                       |  34 +-
 python/tracecmd.py                       |  34 +-
 tracecmd/include/trace-local.h           |   4 +-
 tracecmd/trace-check-events.c            |   6 +-
 tracecmd/trace-hist.c                    | 148 ++---
 tracecmd/trace-list.c                    |  12 +-
 tracecmd/trace-mem.c                     |  82 +--
 tracecmd/trace-output.c                  |  26 +-
 tracecmd/trace-profile.c                 | 144 ++---
 tracecmd/trace-read.c                    | 156 ++---
 tracecmd/trace-record.c                  |  24 +-
 tracecmd/trace-split.c                   |  20 +-
 tracecmd/trace-stream.c                  |   2 +-
 55 files changed, 1943 insertions(+), 1943 deletions(-)

-- 
2.17.1

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH v3 02/24] tools lib traceevent, perf tools: Rename 'struct pevent_record' to 'struct tep_record'
  2018-08-27  8:17 [PATCH v3 00/24] trace-cmd: rename variables, data structures and functions in lib/traceevent Tzvetomir Stoyanov (VMware)
@ 2018-08-27  8:17 ` Tzvetomir Stoyanov (VMware)
  2018-08-27  8:17 ` [PATCH v3 03/24] tools lib traceevent, perf tools: Rename pevent plugin related APIs Tzvetomir Stoyanov (VMware)
                   ` (21 subsequent siblings)
  22 siblings, 0 replies; 30+ messages in thread
From: Tzvetomir Stoyanov (VMware) @ 2018-08-27  8:17 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel

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'.

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/20180808180659.866021298@goodmis.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 include/trace-cmd/trace-cmd.h      | 48 ++++++++--------
 include/traceevent/event-parse.h   | 44 +++++++--------
 kernel-shark-qt/src/libkshark.c    | 28 +++++-----
 kernel-shark-qt/src/libkshark.h    |  4 +-
 kernel-shark/include/trace-graph.h | 18 +++---
 kernel-shark/include/trace-gui.h   |  4 +-
 kernel-shark/kernel-shark.c        |  4 +-
 kernel-shark/trace-dialog.c        |  4 +-
 kernel-shark/trace-graph.c         | 16 +++---
 kernel-shark/trace-plot-cpu.c      | 30 +++++-----
 kernel-shark/trace-plot-task.c     | 60 ++++++++++----------
 kernel-shark/trace-plot.c          |  4 +-
 kernel-shark/trace-view-main.c     |  2 +-
 kernel-shark/trace-view-store.c    | 14 ++---
 lib/trace-cmd/trace-ftrace.c       | 20 +++----
 lib/trace-cmd/trace-input.c        | 88 +++++++++++++++---------------
 lib/traceevent/event-parse.c       | 36 ++++++------
 lib/traceevent/parse-filter.c      | 24 ++++----
 plugins/plugin_blk.c               |  2 +-
 plugins/plugin_function.c          |  2 +-
 plugins/plugin_futex.c             |  2 +-
 plugins/plugin_hrtimer.c           |  4 +-
 plugins/plugin_kmem.c              |  2 +-
 plugins/plugin_kvm.c               | 14 ++---
 plugins/plugin_mac80211.c          |  4 +-
 plugins/plugin_sched_switch.c      |  6 +-
 plugins/plugin_tlb.c               |  2 +-
 python/ctracecmd.i                 | 12 ++--
 tracecmd/include/trace-local.h     |  4 +-
 tracecmd/trace-hist.c              | 20 +++----
 tracecmd/trace-mem.c               |  8 +--
 tracecmd/trace-profile.c           | 36 ++++++------
 tracecmd/trace-read.c              | 34 ++++++------
 tracecmd/trace-record.c            |  4 +-
 tracecmd/trace-split.c             | 12 ++--
 tracecmd/trace-stream.c            |  2 +-
 36 files changed, 309 insertions(+), 309 deletions(-)

diff --git a/include/trace-cmd/trace-cmd.h b/include/trace-cmd/trace-cmd.h
index 2560bc4..ade21b1 100644
--- a/include/trace-cmd/trace-cmd.h
+++ b/include/trace-cmd/trace-cmd.h
@@ -45,8 +45,8 @@ enum {
 	RINGBUF_TYPE_TIME_STAMP		= 31,
 };
 
-void tracecmd_record_ref(struct pevent_record *record);
-void free_record(struct pevent_record *record);
+void tracecmd_record_ref(struct tep_record *record);
+void free_record(struct tep_record *record);
 
 struct tracecmd_input;
 struct tracecmd_output;
@@ -96,7 +96,7 @@ struct tracecmd_ftrace {
 };
 
 typedef void (*tracecmd_show_data_func)(struct tracecmd_input *handle,
-					struct pevent_record *record);
+					struct tep_record *record);
 typedef void (*tracecmd_handle_init_func)(struct tracecmd_input *handle,
 					  struct hook_list *hook, int global);
 
@@ -136,45 +136,45 @@ int tracecmd_init_data(struct tracecmd_input *handle);
 void tracecmd_print_stats(struct tracecmd_input *handle);
 void tracecmd_print_uname(struct tracecmd_input *handle);
 
-struct pevent_record *
+struct tep_record *
 tracecmd_read_page_record(struct tep_handle *pevent, void *page, int size,
-			  struct pevent_record *last_record);
-struct pevent_record *
+			  struct tep_record *last_record);
+struct tep_record *
 tracecmd_peek_data(struct tracecmd_input *handle, int cpu);
 
-static inline struct pevent_record *
+static inline struct tep_record *
 tracecmd_peek_data_ref(struct tracecmd_input *handle, int cpu)
 {
-	struct pevent_record *rec = tracecmd_peek_data(handle, cpu);
+	struct tep_record *rec = tracecmd_peek_data(handle, cpu);
 	if (rec)
 		rec->ref_count++;
 	return rec;
 }
 
-struct pevent_record *
+struct tep_record *
 tracecmd_read_data(struct tracecmd_input *handle, int cpu);
 
-struct pevent_record *
-tracecmd_read_prev(struct tracecmd_input *handle, struct pevent_record *record);
+struct tep_record *
+tracecmd_read_prev(struct tracecmd_input *handle, struct tep_record *record);
 
-struct pevent_record *
+struct tep_record *
 tracecmd_read_next_data(struct tracecmd_input *handle, int *rec_cpu);
 
-struct pevent_record *
+struct tep_record *
 tracecmd_peek_next_data(struct tracecmd_input *handle, int *rec_cpu);
 
-struct pevent_record *
+struct tep_record *
 tracecmd_read_at(struct tracecmd_input *handle, unsigned long long offset,
 		 int *cpu);
-struct pevent_record *
+struct tep_record *
 tracecmd_translate_data(struct tracecmd_input *handle,
 			void *ptr, int size);
-struct pevent_record *
+struct tep_record *
 tracecmd_read_cpu_first(struct tracecmd_input *handle, int cpu);
-struct pevent_record *
+struct tep_record *
 tracecmd_read_cpu_last(struct tracecmd_input *handle, int cpu);
 int tracecmd_refresh_record(struct tracecmd_input *handle,
-			    struct pevent_record *record);
+			    struct tep_record *record);
 
 int tracecmd_set_cpu_to_timestamp(struct tracecmd_input *handle,
 				  int cpu, unsigned long long ts);
@@ -198,11 +198,11 @@ void tracecmd_set_show_data_func(struct tracecmd_input *handle,
 char *tracecmd_get_tracing_file(const char *name);
 void tracecmd_put_tracing_file(char *name);
 
-int tracecmd_record_at_buffer_start(struct tracecmd_input *handle, struct pevent_record *record);
+int tracecmd_record_at_buffer_start(struct tracecmd_input *handle, struct tep_record *record);
 unsigned long long tracecmd_page_ts(struct tracecmd_input *handle,
-				    struct pevent_record *record);
+				    struct tep_record *record);
 unsigned int tracecmd_record_ts_delta(struct tracecmd_input *handle,
-				      struct pevent_record *record);
+				      struct tep_record *record);
 
 #ifndef SWIG
 /* hack for function graph work around */
@@ -385,10 +385,10 @@ int tracecmd_stack_tracer_status(int *status);
 
 /* --- Debugging --- */
 struct kbuffer *tracecmd_record_kbuf(struct tracecmd_input *handle,
-				     struct pevent_record *record);
+				     struct tep_record *record);
 void *tracecmd_record_page(struct tracecmd_input *handle,
-			   struct pevent_record *record);
+			   struct tep_record *record);
 void *tracecmd_record_offset(struct tracecmd_input *handle,
-			     struct pevent_record *record);
+			     struct tep_record *record);
 
 #endif /* _TRACE_CMD_H */
diff --git a/include/traceevent/event-parse.h b/include/traceevent/event-parse.h
index 4c6c43d..3b99120 100644
--- a/include/traceevent/event-parse.h
+++ b/include/traceevent/event-parse.h
@@ -27,7 +27,7 @@
 #define DEBUG_RECORD 0
 #endif
 
-struct pevent_record {
+struct tep_record {
 	unsigned long long	ts;
 	unsigned long long	offset;
 	long long		missed_events;	/* buffer dropped events before */
@@ -39,8 +39,8 @@ struct pevent_record {
 	int			locked;		/* Do not free, even if ref_count is zero */
 	void			*priv;
 #if DEBUG_RECORD
-	struct pevent_record	*prev;
-	struct pevent_record	*next;
+	struct tep_record	*prev;
+	struct tep_record	*next;
 	long			alloc_addr;
 #endif
 };
@@ -88,7 +88,7 @@ struct tep_handle;
 struct event_format;
 
 typedef int (*pevent_event_handler_func)(struct trace_seq *s,
-					 struct pevent_record *record,
+					 struct tep_record *record,
 					 struct event_format *event,
 					 void *context);
 
@@ -616,16 +616,16 @@ int pevent_pid_is_registered(struct tep_handle *pevent, int pid);
 
 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 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);
 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);
 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);
 
 int pevent_parse_header_page(struct tep_handle *pevent, char *buf, unsigned long size,
 			     int long_size);
@@ -640,26 +640,26 @@ 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 pevent_record *record,
+			   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 pevent_record *record,
+			 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 pevent_record *record,
+				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,
-			     const char *name, struct pevent_record *record,
+			     const char *name, struct tep_record *record,
 			     unsigned long long *val, int err);
 
 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);
 
 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);
 
 int pevent_register_event_handler(struct tep_handle *pevent, int id,
 				  const char *sys_name, const char *event_name,
@@ -691,15 +691,15 @@ struct event_format *
 pevent_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 pevent_record *record);
+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 pevent_record *record);
-int pevent_data_type(struct tep_handle *pevent, struct pevent_record *rec);
+			 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 pevent_record *rec);
-int pevent_data_preempt_count(struct tep_handle *pevent, struct pevent_record *rec);
-int pevent_data_flags(struct tep_handle *pevent, struct pevent_record *rec);
+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);
 struct cmdline;
 struct cmdline *pevent_data_pid_from_comm(struct tep_handle *pevent, const char *comm,
@@ -711,7 +711,7 @@ 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 pevent_event_info(struct trace_seq *s, struct event_format *event,
-		       struct pevent_record *record);
+		       struct tep_record *record);
 int pevent_strerror(struct tep_handle *pevent, enum pevent_errno errnum,
 		    char *buf, size_t buflen);
 
@@ -945,7 +945,7 @@ enum pevent_errno pevent_filter_add_filter_str(struct event_filter *filter,
 					       const char *filter_str);
 
 enum pevent_errno pevent_filter_match(struct event_filter *filter,
-				      struct pevent_record *record);
+				      struct tep_record *record);
 
 int pevent_filter_strerror(struct event_filter *filter, enum pevent_errno err,
 			   char *buf, size_t buflen);
diff --git a/kernel-shark-qt/src/libkshark.c b/kernel-shark-qt/src/libkshark.c
index cf80c1b..230ba77 100644
--- a/kernel-shark-qt/src/libkshark.c
+++ b/kernel-shark-qt/src/libkshark.c
@@ -491,7 +491,7 @@ void kshark_filter_entries(struct kshark_context *kshark_ctx,
 }
 
 static void kshark_set_entry_values(struct kshark_context *kshark_ctx,
-				    struct pevent_record *record,
+				    struct tep_record *record,
 				    struct kshark_entry *entry)
 {
 	/* Offset of the record */
@@ -528,7 +528,7 @@ struct rec_list {
 			/** next pointer, matches entry->next */
 			struct rec_list		*next;
 			/** pointer to the raw record data */
-			struct pevent_record	*rec;
+			struct tep_record	*rec;
 		};
 		/** entry - Used for kshark_load_data_entries() */
 		struct kshark_entry		entry;
@@ -566,7 +566,7 @@ static size_t get_records(struct kshark_context *kshark_ctx,
 {
 	struct event_filter *adv_filter;
 	struct kshark_task_list *task;
-	struct pevent_record *rec;
+	struct tep_record *rec;
 	struct rec_list **temp_next;
 	struct rec_list **cpu_list;
 	struct rec_list *temp_rec;
@@ -770,10 +770,10 @@ ssize_t kshark_load_data_entries(struct kshark_context *kshark_ctx,
  *	    negative error code on failure.
  */
 ssize_t kshark_load_data_records(struct kshark_context *kshark_ctx,
-				struct pevent_record ***data_rows)
+				struct tep_record ***data_rows)
 {
-	struct pevent_record **rows;
-	struct pevent_record *rec;
+	struct tep_record **rows;
+	struct tep_record *rec;
 	struct rec_list **rec_list;
 	struct rec_list *temp_rec;
 	enum rec_type type = REC_RECORD;
@@ -784,7 +784,7 @@ ssize_t kshark_load_data_records(struct kshark_context *kshark_ctx,
 	if (total < 0)
 		goto fail;
 
-	rows = calloc(total, sizeof(struct pevent_record *));
+	rows = calloc(total, sizeof(struct tep_record *));
 	if (!rows)
 		goto fail;
 
@@ -816,8 +816,8 @@ ssize_t kshark_load_data_records(struct kshark_context *kshark_ctx,
 	return -ENOMEM;
 }
 
-static struct pevent_record *kshark_read_at(struct kshark_context *kshark_ctx,
-					    uint64_t offset)
+static struct tep_record *kshark_read_at(struct kshark_context *kshark_ctx,
+					 uint64_t offset)
 {
 	/*
 	 * It turns that tracecmd_read_at() is not thread-safe.
@@ -826,7 +826,7 @@ static struct pevent_record *kshark_read_at(struct kshark_context *kshark_ctx,
 	 */
 	pthread_mutex_lock(&kshark_ctx->input_mutex);
 
-	struct pevent_record *data = tracecmd_read_at(kshark_ctx->handle,
+	struct tep_record *data = tracecmd_read_at(kshark_ctx->handle,
 						      offset, NULL);
 
 	pthread_mutex_unlock(&kshark_ctx->input_mutex);
@@ -835,7 +835,7 @@ static struct pevent_record *kshark_read_at(struct kshark_context *kshark_ctx,
 }
 
 static const char *kshark_get_latency(struct tep_handle *pe,
-				      struct pevent_record *record)
+				      struct tep_record *record)
 {
 	if (!record)
 		return NULL;
@@ -846,7 +846,7 @@ static const char *kshark_get_latency(struct tep_handle *pe,
 }
 
 static const char *kshark_get_info(struct tep_handle *pe,
-				   struct pevent_record *record,
+				   struct tep_record *record,
 				   struct event_format *event)
 {
 	char *pos;
@@ -881,7 +881,7 @@ char* kshark_dump_entry(const struct kshark_entry *entry)
 {
 	const char *event_name, *task, *lat, *info;
 	struct kshark_context *kshark_ctx;
-	struct pevent_record *data;
+	struct tep_record *data;
 	struct event_format *event;
 	char *temp_str, *entry_str;
 	int event_id, size = 0;
@@ -977,7 +977,7 @@ ssize_t kshark_find_entry_by_time(uint64_t time,
 	    the function returns BSEARCH_ALL_SMALLER (negative value).
  */
 ssize_t kshark_find_record_by_time(uint64_t time,
-				   struct pevent_record **data,
+				   struct tep_record **data,
 				   size_t l, size_t h)
 {
 	size_t mid;
diff --git a/kernel-shark-qt/src/libkshark.h b/kernel-shark-qt/src/libkshark.h
index 98f2bc5..2580449 100644
--- a/kernel-shark-qt/src/libkshark.h
+++ b/kernel-shark-qt/src/libkshark.h
@@ -131,7 +131,7 @@ ssize_t kshark_load_data_entries(struct kshark_context *kshark_ctx,
 				 struct kshark_entry ***data_rows);
 
 ssize_t kshark_load_data_records(struct kshark_context *kshark_ctx,
-				 struct pevent_record ***data_rows);
+				 struct tep_record ***data_rows);
 
 ssize_t kshark_get_task_pids(struct kshark_context *kshark_ctx, int **pids);
 
@@ -222,7 +222,7 @@ ssize_t kshark_find_entry_by_time(uint64_t time,
 				  size_t l, size_t h);
 
 ssize_t kshark_find_record_by_time(uint64_t time,
-				   struct pevent_record **data_rows,
+				   struct tep_record **data_rows,
 				   size_t l, size_t h);
 
 bool kshark_match_pid(struct kshark_context *kshark_ctx,
diff --git a/kernel-shark/include/trace-graph.h b/kernel-shark/include/trace-graph.h
index cc3d660..6686675 100644
--- a/kernel-shark/include/trace-graph.h
+++ b/kernel-shark/include/trace-graph.h
@@ -97,12 +97,12 @@ struct plot_callbacks {
 		      unsigned long long time);
 	int (*plot_event)(struct graph_info *ginfo,
 			  struct graph_plot *plot,
-			  struct pevent_record *record);
+			  struct tep_record *record);
 	void (*end)(struct graph_info *, struct graph_plot *);
 	int (*display_last_event)(struct graph_info *ginfo, struct graph_plot *plot,
 				  struct trace_seq *s, unsigned long long time);
-	struct pevent_record *(*find_record)(struct graph_info *, struct graph_plot *,
-				      unsigned long long time);
+	struct tep_record *(*find_record)(struct graph_info *, struct graph_plot *,
+					  unsigned long long time);
 	int (*display_info)(struct graph_info *, struct graph_plot *,
 			    struct trace_seq *s,
 			    unsigned long long time);
@@ -297,15 +297,15 @@ int trace_graph_load_handle(struct graph_info *ginfo,
 			    struct tracecmd_input *handle);
 
 int trace_graph_check_sched_switch(struct graph_info *ginfo,
-				   struct pevent_record *record,
+				   struct tep_record *record,
 				   gint *pid, const char **comm);
 int trace_graph_check_sched_wakeup(struct graph_info *ginfo,
-				   struct pevent_record *record,
+				   struct tep_record *record,
 				   gint *pid);
 enum graph_irq_type trace_graph_check_irq(struct graph_info *ginfo,
-		      struct pevent_record *record);
+		      struct tep_record *record);
 gboolean trace_graph_filter_on_task(struct graph_info *ginfo, gint pid);
-gboolean trace_graph_filter_on_event(struct graph_info *ginfo, struct pevent_record *record);
+gboolean trace_graph_filter_on_event(struct graph_info *ginfo, struct tep_record *record);
 
 void trace_graph_copy_filter(struct graph_info *ginfo,
 			     gboolean all_events,
@@ -368,12 +368,12 @@ void trace_graph_plot_start(struct graph_info *ginfo,
 
 int trace_graph_plot_event(struct graph_info *ginfo,
 			   struct graph_plot *plot,
-			   struct pevent_record *record);
+			   struct tep_record *record);
 
 void trace_graph_plot_end(struct graph_info *ginfo,
 			  struct graph_plot *plot);
 
-struct pevent_record *
+struct tep_record *
 trace_graph_plot_find_record(struct graph_info *ginfo,
 			     struct graph_plot *plot,
 			     unsigned long long time);
diff --git a/kernel-shark/include/trace-gui.h b/kernel-shark/include/trace-gui.h
index 720683e..e9bfbd6 100644
--- a/kernel-shark/include/trace-gui.h
+++ b/kernel-shark/include/trace-gui.h
@@ -49,9 +49,9 @@ trace_create_combo_box(GtkWidget *hbox, const gchar *text,
 		       gpointer data);
 
 struct tep_handle;
-struct pevent_record;
+struct tep_record;
 
 void trace_show_record_dialog(GtkWindow *parent, struct tep_handle *pevent,
-			      struct pevent_record *record, gboolean raw);
+			      struct tep_record *record, gboolean raw);
 
 #endif /* _TRACE_GUI */
diff --git a/kernel-shark/kernel-shark.c b/kernel-shark/kernel-shark.c
index 8893504..6b43296 100644
--- a/kernel-shark/kernel-shark.c
+++ b/kernel-shark/kernel-shark.c
@@ -1440,7 +1440,7 @@ static void
 handle_display_event_clicked (gpointer data, gboolean raw)
 {
 	struct shark_info *info = data;
-	struct pevent_record *record;
+	struct tep_record *record;
 	struct tep_handle *pevent;
 	TraceViewRecord *vrec;
 	GtkTreeModel *model;
@@ -1547,7 +1547,7 @@ do_tree_popup(GtkWidget *widget, GdkEventButton *event, gpointer data)
 	static GtkWidget *menu_filter_graph_clear_tasks;
 	static GtkWidget *menu_display_event;
 	static GtkWidget *menu_display_raw_event;
-	struct pevent_record *record;
+	struct tep_record *record;
 	TraceViewRecord *vrec;
 	GtkTreeModel *model;
 	const char *comm;
diff --git a/kernel-shark/trace-dialog.c b/kernel-shark/trace-dialog.c
index ec27550..c9f8eec 100644
--- a/kernel-shark/trace-dialog.c
+++ b/kernel-shark/trace-dialog.c
@@ -374,7 +374,7 @@ GtkResponseType trace_dialog(GtkWindow *parent, enum trace_dialog_type type,
 
 static void read_raw_events(struct trace_seq *s,
 			    struct event_format *event,
-			    struct pevent_record *record)
+			    struct tep_record *record)
 {
 	struct format_field **fields;
 	int i;
@@ -393,7 +393,7 @@ static void read_raw_events(struct trace_seq *s,
 }
 
 void trace_show_record_dialog(GtkWindow *parent, struct tep_handle *pevent,
-			      struct pevent_record *record, gboolean raw)
+			      struct tep_record *record, gboolean raw)
 {
 	struct event_format *event;
 	struct trace_seq s;
diff --git a/kernel-shark/trace-graph.c b/kernel-shark/trace-graph.c
index 92ac782..2c6d00b 100644
--- a/kernel-shark/trace-graph.c
+++ b/kernel-shark/trace-graph.c
@@ -269,7 +269,7 @@ static void graph_filter_task_clear(struct graph_info *ginfo)
 	ginfo->filter_enabled = 0;
 }
 
-gboolean trace_graph_filter_on_event(struct graph_info *ginfo, struct pevent_record *record)
+gboolean trace_graph_filter_on_event(struct graph_info *ginfo, struct tep_record *record)
 {
 	int ret;
 
@@ -653,7 +653,7 @@ do_pop_up(GtkWidget *widget, GdkEventButton *event, gpointer data)
 	static GtkWidget *menu_filter_clear_tasks;
 	static GtkWidget *menu_plot_task;
 	static GtkWidget *menu_remove_plot;
-	struct pevent_record *record = NULL;
+	struct tep_record *record = NULL;
 	struct graph_plot *plot;
 	const char *comm;
 	guint64 time;
@@ -1004,7 +1004,7 @@ info_button_release_event(GtkWidget *widget, GdkEventMotion *event, gpointer dat
 #define PLOT_BOARDER 5
 
 int trace_graph_check_sched_wakeup(struct graph_info *ginfo,
-				   struct pevent_record *record,
+				   struct tep_record *record,
 				   gint *pid)
 {
 	struct event_format *event;
@@ -1070,7 +1070,7 @@ int trace_graph_check_sched_wakeup(struct graph_info *ginfo,
 }
 
 int trace_graph_check_sched_switch(struct graph_info *ginfo,
-				   struct pevent_record *record,
+				   struct tep_record *record,
 				   gint *pid, const char **comm)
 {
 	unsigned long long val;
@@ -1151,7 +1151,7 @@ static void enter_id(gint **ids, gint id, gint *len)
 
 enum graph_irq_type
 trace_graph_check_irq(struct graph_info *ginfo,
-		      struct pevent_record *record)
+		      struct tep_record *record)
 {
 	struct event_format *event;
 	struct event_format **events;
@@ -1832,7 +1832,7 @@ static void draw_plot_box(struct graph_info *ginfo, int i,
 }
 
 static void draw_plot(struct graph_info *ginfo, struct graph_plot *plot,
-		      struct pevent_record *record)
+		      struct tep_record *record)
 {
 	static PangoFontDescription *font;
 	PangoLayout *layout;
@@ -1926,7 +1926,7 @@ static void draw_plots(struct graph_info *ginfo, gint new_width)
 	struct timeval tv_start, tv_stop;
 	struct plot_list *list;
 	struct graph_plot *plot;
-	struct pevent_record *record;
+	struct tep_record *record;
 	struct plot_hash *hash;
 	gint pid;
 	gint cpu;
@@ -2533,7 +2533,7 @@ void trace_graph_free_info(struct graph_info *ginfo)
 static int load_handle(struct graph_info *ginfo,
 		       struct tracecmd_input *handle)
 {
-	struct pevent_record *record;
+	struct tep_record *record;
 	unsigned long sec, usec;
 	gint cpu;
 
diff --git a/kernel-shark/trace-plot-cpu.c b/kernel-shark/trace-plot-cpu.c
index 2d184e7..dc161a4 100644
--- a/kernel-shark/trace-plot-cpu.c
+++ b/kernel-shark/trace-plot-cpu.c
@@ -15,7 +15,7 @@ struct cpu_plot_info {
 	int			cpu;
 	unsigned long long	last_time;
 	int			last_pid;
-	struct pevent_record	*last_record;
+	struct tep_record	*last_record;
 };
 
 static gint hash_pid(gint val)
@@ -34,10 +34,10 @@ static void convert_nano(unsigned long long time, unsigned long *sec,
 	*usec = (time / 1000) % 1000000;
 }
 
-static struct pevent_record *get_record_from_time(struct graph_info *ginfo, int cpu,
-					   unsigned long long time)
+static struct tep_record *get_record_from_time(struct graph_info *ginfo, int cpu,
+					       unsigned long long time)
 {
-	struct pevent_record *record;
+	struct tep_record *record;
 
 	tracecmd_set_cpu_to_timestamp(ginfo->handle, cpu, time);
 	record = tracecmd_read_data(ginfo->handle, cpu);
@@ -53,7 +53,7 @@ static int cpu_plot_match_time(struct graph_info *ginfo, struct graph_plot *plot
 			       unsigned long long time)
 {
 	struct cpu_plot_info *cpu_info = plot->private;
-	struct pevent_record *record;
+	struct tep_record *record;
 	int ret = 0;
 
 	record = get_record_from_time(ginfo, cpu_info->cpu, time);
@@ -74,7 +74,7 @@ static int cpu_plot_match_time(struct graph_info *ginfo, struct graph_plot *plot
  * @is_sched_switch returns 1 on context switch, otherwise 0
  */
 static int filter_record(struct graph_info *ginfo,
-			 struct pevent_record *record,
+			 struct tep_record *record,
 			 int *orig_pid, int *sched_pid,
 			 gboolean *sched_switch)
 {
@@ -118,7 +118,7 @@ static int cpu_plot_display_last_event(struct graph_info *ginfo,
 {
 	struct cpu_plot_info *cpu_info = plot->private;
 	struct event_format *event;
-	struct pevent_record *record;
+	struct tep_record *record;
 	int cpu = cpu_info->cpu;
 	unsigned long long offset = 0;
 	gboolean is_sched_switch;
@@ -192,10 +192,10 @@ static void cpu_plot_start(struct graph_info *ginfo, struct graph_plot *plot,
 
 static void update_last_record(struct graph_info *ginfo,
 			       struct cpu_plot_info *cpu_info,
-			       struct pevent_record *record)
+			       struct tep_record *record)
 {
 	struct tracecmd_input *handle = ginfo->handle;
-	struct pevent_record *trecord;
+	struct tep_record *trecord;
 	int sched_pid;
 	int orig_pid;
 	int is_sched_switch;
@@ -225,7 +225,7 @@ static void update_last_record(struct graph_info *ginfo,
 
 static int cpu_plot_event(struct graph_info *ginfo,
 			  struct graph_plot *plot,
-			  struct pevent_record *record)
+			  struct tep_record *record)
 {
 	struct cpu_plot_info *cpu_info = plot->private;
 	struct plot_info *info = &plot->info;
@@ -310,10 +310,10 @@ static int cpu_plot_event(struct graph_info *ginfo,
 	return ret;
 }
 
-static struct pevent_record *
+static struct tep_record *
 find_record_on_cpu(struct graph_info *ginfo, gint cpu, guint64 time)
 {
-	struct pevent_record *record = NULL;
+	struct tep_record *record = NULL;
 	guint64 offset = 0;
 
 	tracecmd_set_cpu_to_timestamp(ginfo->handle, cpu, time);
@@ -335,7 +335,7 @@ find_record_on_cpu(struct graph_info *ginfo, gint cpu, guint64 time)
 	return record;
 }
 
-static struct pevent_record *
+static struct tep_record *
 cpu_plot_find_record(struct graph_info *ginfo, struct graph_plot *plot,
 		     unsigned long long time)
 {
@@ -354,8 +354,8 @@ int cpu_plot_display_info(struct graph_info *ginfo,
 {
 	struct cpu_plot_info *cpu_info = plot->private;
 	struct event_format *event;
-	struct pevent_record *record;
-	struct pevent_record *next_record;
+	struct tep_record *record;
+	struct tep_record *next_record;
 	struct tep_handle *pevent;
 	unsigned long sec, usec;
 	const char *comm;
diff --git a/kernel-shark/trace-plot-task.c b/kernel-shark/trace-plot-task.c
index fa30ce6..4dedd8a 100644
--- a/kernel-shark/trace-plot-task.c
+++ b/kernel-shark/trace-plot-task.c
@@ -17,7 +17,7 @@
 struct task_plot_info {
 	int			pid;
 	struct cpu_data		*cpu_data;
-	struct pevent_record	**last_records;
+	struct tep_record	**last_records;
 	unsigned long long	last_time;
 	unsigned long long	wake_time;
 	unsigned long long	display_wake_time;
@@ -49,7 +49,7 @@ static int hash_cpu(int cpu)
 	return trace_hash(cpu);
 }
 
-static gboolean is_running(struct graph_info *ginfo, struct pevent_record *record)
+static gboolean is_running(struct graph_info *ginfo, struct tep_record *record)
 {
 	unsigned long long val;
 	int id;
@@ -63,7 +63,7 @@ static gboolean is_running(struct graph_info *ginfo, struct pevent_record *recor
 }
 
 static gboolean record_matches_pid(struct graph_info *ginfo,
-				   struct pevent_record *record, int match_pid,
+				   struct tep_record *record, int match_pid,
 				   int *pid, int *sched_pid,
 				   gboolean *is_sched,
 				   gboolean *wakeup)
@@ -98,7 +98,7 @@ static gboolean record_matches_pid(struct graph_info *ginfo,
 
 static void set_cpu_to_time(int cpu, struct graph_info *ginfo, unsigned long long time)
 {
-	struct pevent_record *record;
+	struct tep_record *record;
 
 	tracecmd_set_cpu_to_timestamp(ginfo->handle, cpu, time);
 
@@ -127,7 +127,7 @@ static int task_plot_match_time(struct graph_info *ginfo, struct graph_plot *plo
 			       unsigned long long time)
 {
 	struct task_plot_info *task_info = plot->private;
-	struct pevent_record *record = NULL;
+	struct tep_record *record = NULL;
 	gboolean is_wakeup;
 	gboolean is_sched;
 	gboolean match;
@@ -169,7 +169,7 @@ struct offset_cache {
 static struct offset_cache *save_offsets(struct graph_info *ginfo)
 {
 	struct offset_cache *offsets;
-	struct pevent_record *record;
+	struct tep_record *record;
 	int cpu;
 
 	offsets = malloc_or_die(sizeof(*offsets));
@@ -187,7 +187,7 @@ static struct offset_cache *save_offsets(struct graph_info *ginfo)
 
 static void restore_offsets(struct graph_info *ginfo, struct offset_cache *offsets)
 {
-	struct pevent_record *record;
+	struct tep_record *record;
 	int cpu;
 
 	for (cpu = 0; cpu < ginfo->cpus; cpu++) {
@@ -204,10 +204,10 @@ static void restore_offsets(struct graph_info *ginfo, struct offset_cache *offse
 	free(offsets);
 }
 
-static struct pevent_record *
+static struct tep_record *
 find_record(struct graph_info *ginfo, gint pid, guint64 time)
 {
-	struct pevent_record *record = NULL;
+	struct tep_record *record = NULL;
 	gboolean is_wakeup;
 	gboolean is_sched;
 	gboolean match;
@@ -241,7 +241,7 @@ static int task_plot_display_last_event(struct graph_info *ginfo,
 {
 	struct task_plot_info *task_info = plot->private;
 	struct event_format *event;
-	struct pevent_record *record;
+	struct tep_record *record;
 	struct offset_cache *offsets;
 	gboolean is_sched;
 	gboolean is_wakeup;
@@ -312,7 +312,7 @@ static void task_plot_start(struct graph_info *ginfo, struct graph_plot *plot,
 {
 	struct task_plot_info *task_info = plot->private;
 
-	memset(task_info->last_records, 0, sizeof(struct pevent_record *) * ginfo->cpus);
+	memset(task_info->last_records, 0, sizeof(struct tep_record *) * ginfo->cpus);
 
 	task_info->last_time = 0ULL;
 	task_info->last_cpu = -1;
@@ -322,7 +322,7 @@ static void task_plot_start(struct graph_info *ginfo, struct graph_plot *plot,
 }
 
 static gboolean record_is_interrupt(struct graph_info *ginfo,
-				    struct pevent_record *record,
+				    struct tep_record *record,
 				    gboolean check_type)
 {
 	gboolean in_irq;
@@ -353,11 +353,11 @@ static gboolean record_is_interrupt(struct graph_info *ginfo,
 
 static void update_last_record(struct graph_info *ginfo,
 			       struct task_plot_info *task_info,
-			       struct pevent_record *record)
+			       struct tep_record *record)
 {
 	struct tracecmd_input *handle = ginfo->handle;
-	struct pevent_record *trecord, *t2record;
-	struct pevent_record *saved;
+	struct tep_record *trecord, *t2record;
+	struct tep_record *saved;
 	unsigned long long ts;
 	int sched_pid;
 	int pid;
@@ -435,11 +435,11 @@ static void update_last_record(struct graph_info *ginfo,
 
 static int task_plot_event(struct graph_info *ginfo,
 			   struct graph_plot *plot,
-			   struct pevent_record *record)
+			   struct tep_record *record)
 {
 	struct task_plot_info *task_info = plot->private;
 	struct plot_info *info = &plot->info;
-	struct pevent_record *next_record;
+	struct tep_record *next_record;
 	gboolean match;
 	gboolean in_irq;
 	int sched_pid;
@@ -605,7 +605,7 @@ static int task_plot_event(struct graph_info *ginfo,
 }
 
 
-static struct pevent_record *
+static struct tep_record *
 task_plot_find_record(struct graph_info *ginfo, struct graph_plot *plot,
 		      unsigned long long time)
 {
@@ -619,12 +619,12 @@ task_plot_find_record(struct graph_info *ginfo, struct graph_plot *plot,
 
 #define MAX_SEARCH 20
 
-static struct pevent_record *
-find_previous_record(struct graph_info *ginfo, struct pevent_record *start_record,
+static struct tep_record *
+find_previous_record(struct graph_info *ginfo, struct tep_record *start_record,
 		     int pid, int cpu)
 {
-	struct pevent_record *last_record = start_record;
-	struct pevent_record *record;
+	struct tep_record *last_record = start_record;
+	struct tep_record *record;
 	gboolean match;
 	gboolean is_sched;
 	gboolean is_wakeup;
@@ -659,11 +659,11 @@ find_previous_record(struct graph_info *ginfo, struct pevent_record *start_recor
 	return record;
 }
 
-static struct pevent_record *
+static struct tep_record *
 get_display_record(struct graph_info *ginfo, int pid, unsigned long long time)
 {
-	struct pevent_record *record;
-	struct pevent_record **records;
+	struct tep_record *record;
+	struct tep_record **records;
 	unsigned long long ts;
 	int next_cpu;
 	int cpu;
@@ -735,7 +735,7 @@ int task_plot_display_info(struct graph_info *ginfo,
 {
 	struct task_plot_info *task_info = plot->private;
 	struct event_format *event;
-	struct pevent_record *record;
+	struct tep_record *record;
 	struct tep_handle *pevent;
 	unsigned long sec, usec;
 	const char *comm;
@@ -778,7 +778,7 @@ int task_plot_display_info(struct graph_info *ginfo,
 		trace_seq_printf(s, " CPU: %03d", cpu);
 
 	if (record_is_interrupt(ginfo, record, TRUE)) {
-		struct pevent_record *next_record;
+		struct tep_record *next_record;
 
 		next_record = tracecmd_peek_data(ginfo->handle, record->cpu);
 		if (record_is_interrupt(ginfo, next_record, FALSE))
@@ -901,7 +901,7 @@ void graph_plot_init_tasks(struct graph_info *ginfo)
 {
 	struct task_plot_info *task_info;
 	char label[100];
-	struct pevent_record *record;
+	struct tep_record *record;
 	int pid;
 
 	/* Just for testing */
@@ -916,7 +916,7 @@ void graph_plot_init_tasks(struct graph_info *ginfo)
 
 	task_info = malloc_or_die(sizeof(*task_info));
 	task_info->last_records =
-		malloc_or_die(sizeof(struct pevent_record *) * ginfo->cpus);
+		malloc_or_die(sizeof(struct tep_record *) * ginfo->cpus);
 	task_info->pid = pid;
 
 	snprintf(label, 100, "TASK %d", pid);
@@ -934,7 +934,7 @@ void graph_plot_task(struct graph_info *ginfo, int pid, int pos)
 
 	task_info = malloc_or_die(sizeof(*task_info));
 	task_info->last_records =
-		malloc_or_die(sizeof(struct pevent_record *) * ginfo->cpus);
+		malloc_or_die(sizeof(struct tep_record *) * ginfo->cpus);
 	task_info->pid = pid;
 	comm = pevent_data_comm_from_pid(ginfo->pevent, pid);
 
diff --git a/kernel-shark/trace-plot.c b/kernel-shark/trace-plot.c
index ca6f52f..fb55178 100644
--- a/kernel-shark/trace-plot.c
+++ b/kernel-shark/trace-plot.c
@@ -325,7 +325,7 @@ void trace_graph_plot_start(struct graph_info *ginfo,
 
 int trace_graph_plot_event(struct graph_info *ginfo,
 			   struct graph_plot *plot,
-			   struct pevent_record *record)
+			   struct tep_record *record)
 
 {
 	struct plot_info *info = &plot->info;
@@ -360,7 +360,7 @@ int trace_graph_plot_display_last_event(struct graph_info *ginfo,
 	return plot->cb->display_last_event(ginfo, plot, s, time);
 }
 
-struct pevent_record *
+struct tep_record *
 trace_graph_plot_find_record(struct graph_info *ginfo,
 			     struct graph_plot *plot,
 			     unsigned long long time)
diff --git a/kernel-shark/trace-view-main.c b/kernel-shark/trace-view-main.c
index 08e8c1c..00f53e0 100644
--- a/kernel-shark/trace-view-main.c
+++ b/kernel-shark/trace-view-main.c
@@ -302,7 +302,7 @@ do_tree_popup(GtkWidget *widget, GdkEventButton *event, gpointer data)
 	static GtkWidget *menu_display_event;
 	static GtkWidget *menu_display_raw_event;
 	struct tep_handle *pevent;
-	struct pevent_record *record;
+	struct tep_record *record;
 	TraceViewRecord *vrec;
 	GtkTreeModel *model;
 	const char *comm;
diff --git a/kernel-shark/trace-view-store.c b/kernel-shark/trace-view-store.c
index 4a5614b..2e2a125 100644
--- a/kernel-shark/trace-view-store.c
+++ b/kernel-shark/trace-view-store.c
@@ -407,7 +407,7 @@ trace_view_store_get_value (GtkTreeModel *tree_model,
 	struct trace_seq s;
 	struct tep_handle *pevent;
 	struct event_format *event;
-	struct pevent_record *data;
+	struct tep_record *data;
 	const gchar *comm;
 	gchar *str;
 	guint64 secs, usecs;
@@ -840,7 +840,7 @@ TraceViewStore *
 trace_view_store_new (struct tracecmd_input *handle)
 {
 	TraceViewStore *newstore;
-	struct pevent_record *data;
+	struct tep_record *data;
 	gint cpu, count, total=0;
 	struct temp {
 		guint64		offset;
@@ -1139,7 +1139,7 @@ gint trace_view_store_get_num_actual_rows(TraceViewStore *store)
 	return store->actual_rows;
 }
 
-gint get_next_pid(TraceViewStore *store, struct tep_handle *pevent, struct pevent_record *record)
+gint get_next_pid(TraceViewStore *store, struct tep_handle *pevent, struct tep_record *record)
 {
 	unsigned long long val;
 
@@ -1148,7 +1148,7 @@ gint get_next_pid(TraceViewStore *store, struct tep_handle *pevent, struct peven
 	return val;
 }
 
-gint get_wakeup_pid(TraceViewStore *store, struct tep_handle *pevent, struct pevent_record *record)
+gint get_wakeup_pid(TraceViewStore *store, struct tep_handle *pevent, struct tep_record *record)
 {
 	unsigned long long val;
 
@@ -1157,7 +1157,7 @@ gint get_wakeup_pid(TraceViewStore *store, struct tep_handle *pevent, struct pev
 	return val;
 }
 
-gint get_wakeup_new_pid(TraceViewStore *store, struct tep_handle *pevent, struct pevent_record *record)
+gint get_wakeup_new_pid(TraceViewStore *store, struct tep_handle *pevent, struct tep_record *record)
 {
 	unsigned long long val;
 
@@ -1177,7 +1177,7 @@ static gboolean view_task(TraceViewStore *store, gint pid)
 }
 
 static gboolean show_task(TraceViewStore *store, struct tep_handle *pevent,
-			  struct pevent_record *record, gint pid)
+			  struct tep_record *record, gint pid)
 {
 	gint event_id;
 
@@ -1217,7 +1217,7 @@ static void update_filter_tasks(TraceViewStore *store)
 {
 	struct tracecmd_input *handle;
 	struct tep_handle *pevent;
-	struct pevent_record *record;
+	struct tep_record *record;
 	gint pid;
 	gint cpu;
 	gint i;
diff --git a/lib/trace-cmd/trace-ftrace.c b/lib/trace-cmd/trace-ftrace.c
index 20dd00f..3b87071 100644
--- a/lib/trace-cmd/trace-ftrace.c
+++ b/lib/trace-cmd/trace-ftrace.c
@@ -62,7 +62,7 @@ static int find_ret_event(struct tracecmd_ftrace *finfo, struct tep_handle *peve
 			return -1;					\
 	} while (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;
@@ -92,9 +92,9 @@ static int function_handler(struct trace_seq *s, struct pevent_record *record,
 
 #define TRACE_GRAPH_INDENT		2
 
-static struct pevent_record *
+static struct tep_record *
 get_return_for_leaf(struct trace_seq *s, int cpu, int cur_pid,
-		    unsigned long long cur_func, struct pevent_record *next,
+		    unsigned long long cur_func, struct tep_record *next,
 		    struct tracecmd_ftrace *finfo)
 {
 	unsigned long long val;
@@ -188,8 +188,8 @@ static void print_graph_duration(struct trace_seq *s, unsigned long long duratio
 static int
 print_graph_entry_leaf(struct trace_seq *s,
 		       struct event_format *event,
-		       struct pevent_record *record,
-		       struct pevent_record *ret_rec,
+		       struct tep_record *record,
+		       struct tep_record *ret_rec,
 		       struct tracecmd_ftrace *finfo)
 {
 	struct tep_handle *pevent = event->pevent;
@@ -238,7 +238,7 @@ print_graph_entry_leaf(struct trace_seq *s,
 
 static int print_graph_nested(struct trace_seq *s,
 			      struct event_format *event,
-			      struct pevent_record *record)
+			      struct tep_record *record)
 {
 	struct tep_handle *pevent = event->pevent;
 	unsigned long long depth;
@@ -277,11 +277,11 @@ static int print_graph_nested(struct trace_seq *s,
 }
 
 static int
-fgraph_ent_handler(struct trace_seq *s, struct pevent_record *record,
+fgraph_ent_handler(struct trace_seq *s, struct tep_record *record,
 		   struct event_format *event, void *context)
 {
 	struct tracecmd_ftrace *finfo = context;
-	struct pevent_record *rec;
+	struct tep_record *rec;
 	unsigned long long val, pid;
 	int cpu;
 
@@ -311,7 +311,7 @@ fgraph_ent_handler(struct trace_seq *s, struct pevent_record *record,
 }
 
 static int
-fgraph_ret_handler(struct trace_seq *s, struct pevent_record *record,
+fgraph_ret_handler(struct trace_seq *s, struct tep_record *record,
 		   struct event_format *event, void *context)
 {
 	struct tracecmd_ftrace *finfo = context;
@@ -362,7 +362,7 @@ fgraph_ret_handler(struct trace_seq *s, struct pevent_record *record,
 }
 
 static int
-trace_stack_handler(struct trace_seq *s, struct pevent_record *record,
+trace_stack_handler(struct trace_seq *s, struct tep_record *record,
 		    struct event_format *event, void *context)
 {
 	struct tracecmd_ftrace *finfo = context;
diff --git a/lib/trace-cmd/trace-input.c b/lib/trace-cmd/trace-input.c
index 635d8b6..7354bbf 100644
--- a/lib/trace-cmd/trace-input.c
+++ b/lib/trace-cmd/trace-input.c
@@ -57,7 +57,7 @@ struct page {
 	int			cpu;
 	long long		lost_events;
 #if DEBUG_RECORD
-	struct pevent_record	*records;
+	struct tep_record	*records;
 #endif
 };
 
@@ -71,7 +71,7 @@ struct cpu_data {
 	struct list_head	page_maps;
 	struct page_map		*page_map;
 	struct page		**pages;
-	struct pevent_record	*next;
+	struct tep_record	*next;
 	struct page		*page;
 	struct kbuffer		*kbuf;
 	int			page_cnt;
@@ -137,7 +137,7 @@ unsigned long tracecmd_get_flags(struct tracecmd_input *handle)
 }
 
 #if DEBUG_RECORD
-static void remove_record(struct page *page, struct pevent_record *record)
+static void remove_record(struct page *page, struct tep_record *record)
 {
 	if (record->prev)
 		record->prev->next = record->next;
@@ -146,7 +146,7 @@ static void remove_record(struct page *page, struct pevent_record *record)
 	if (record->next)
 		record->next->prev = record->prev;
 }
-static void add_record(struct page *page, struct pevent_record *record)
+static void add_record(struct page *page, struct tep_record *record)
 {
 	if (page->records)
 		page->records->prev = record;
@@ -157,7 +157,7 @@ static void add_record(struct page *page, struct pevent_record *record)
 static const char *show_records(struct page **pages)
 {
 	static char buf[BUFSIZ + 1];
-	struct pevent_record *record;
+	struct tep_record *record;
 	struct page *page;
 	int len;
 
@@ -178,8 +178,8 @@ static const char *show_records(struct page **pages)
 	return buf;
 }
 #else
-static inline void remove_record(struct page *page, struct pevent_record *record) {}
-static inline void add_record(struct page *page, struct pevent_record *record) {}
+static inline void remove_record(struct page *page, struct tep_record *record) {}
+static inline void add_record(struct page *page, struct tep_record *record) {}
 static const char *show_records(struct page **pages)
 {
 	return "";
@@ -979,7 +979,7 @@ static void free_page(struct tracecmd_input *handle, int cpu)
 	handle->cpu_data[cpu].page = NULL;
 }
 
-static void __free_record(struct pevent_record *record)
+static void __free_record(struct tep_record *record)
 {
 	if (record->priv) {
 		struct page *page = record->priv;
@@ -990,7 +990,7 @@ static void __free_record(struct pevent_record *record)
 	free(record);
 }
 
-void free_record(struct pevent_record *record)
+void free_record(struct tep_record *record)
 {
 	if (!record)
 		return;
@@ -1011,7 +1011,7 @@ void free_record(struct pevent_record *record)
 	__free_record(record);
 }
 
-void tracecmd_record_ref(struct pevent_record *record)
+void tracecmd_record_ref(struct tep_record *record)
 {
 	record->ref_count++;
 #if DEBUG_RECORD
@@ -1022,7 +1022,7 @@ void tracecmd_record_ref(struct pevent_record *record)
 
 static void free_next(struct tracecmd_input *handle, int cpu)
 {
-	struct pevent_record *record;
+	struct tep_record *record;
 
 	if (!handle->cpu_data || cpu >= handle->cpus)
 		return;
@@ -1135,11 +1135,11 @@ static int get_next_page(struct tracecmd_input *handle, int cpu)
 	return get_page(handle, cpu, offset);
 }
 
-static struct pevent_record *
+static struct tep_record *
 peek_event(struct tracecmd_input *handle, unsigned long long offset,
 	   int cpu)
 {
-	struct pevent_record *record = NULL;
+	struct tep_record *record = NULL;
 
 	/*
 	 * Since the timestamp is calculated from the beginning
@@ -1159,11 +1159,11 @@ peek_event(struct tracecmd_input *handle, unsigned long long offset,
 	return record;
 }
 
-static struct pevent_record *
+static struct tep_record *
 read_event(struct tracecmd_input *handle, unsigned long long offset,
 	   int cpu)
 {
-	struct pevent_record *record;
+	struct tep_record *record;
 
 	record = peek_event(handle, offset, cpu);
 	if (record)
@@ -1171,7 +1171,7 @@ read_event(struct tracecmd_input *handle, unsigned long long offset,
 	return record;
 }
 
-static struct pevent_record *
+static struct tep_record *
 find_and_peek_event(struct tracecmd_input *handle, unsigned long long offset,
 		    int *pcpu)
 {
@@ -1203,11 +1203,11 @@ find_and_peek_event(struct tracecmd_input *handle, unsigned long long offset,
 }
 
 
-static struct pevent_record *
+static struct tep_record *
 find_and_read_event(struct tracecmd_input *handle, unsigned long long offset,
 		    int *pcpu)
 {
-	struct pevent_record *record;
+	struct tep_record *record;
 	int cpu;
 
 	record = find_and_peek_event(handle, offset, &cpu);
@@ -1232,7 +1232,7 @@ find_and_read_event(struct tracecmd_input *handle, unsigned long long offset,
  *
  * The record returned must be freed.
  */
-struct pevent_record *
+struct tep_record *
 tracecmd_read_at(struct tracecmd_input *handle, unsigned long long offset,
 		 int *pcpu)
 {
@@ -1274,7 +1274,7 @@ tracecmd_read_at(struct tracecmd_input *handle, unsigned long long offset,
  *        -1 on error.
  */
 int tracecmd_refresh_record(struct tracecmd_input *handle,
-			    struct pevent_record *record)
+			    struct tep_record *record)
 {
 	unsigned long long page_offset;
 	int cpu = record->cpu;
@@ -1308,7 +1308,7 @@ int tracecmd_refresh_record(struct tracecmd_input *handle,
  *
  * The record returned must be freed.
  */
-struct pevent_record *
+struct tep_record *
 tracecmd_read_cpu_first(struct tracecmd_input *handle, int cpu)
 {
 	int ret;
@@ -1335,10 +1335,10 @@ tracecmd_read_cpu_first(struct tracecmd_input *handle, int cpu)
  *
  * The record returned must be freed.
  */
-struct pevent_record *
+struct tep_record *
 tracecmd_read_cpu_last(struct tracecmd_input *handle, int cpu)
 {
-	struct pevent_record *record = NULL;
+	struct tep_record *record = NULL;
 	off64_t offset, page_offset;
 
 	offset = handle->cpu_data[cpu].file_offset +
@@ -1600,12 +1600,12 @@ tracecmd_get_cursor(struct tracecmd_input *handle, int cpu)
  *
  * The record returned must be freed.
  */
-struct pevent_record *
+struct tep_record *
 tracecmd_translate_data(struct tracecmd_input *handle,
 			void *ptr, int size)
 {
 	struct tep_handle *pevent = handle->pevent;
-	struct pevent_record *record;
+	struct tep_record *record;
 	unsigned int length;
 	int swap = 1;
 
@@ -1650,13 +1650,13 @@ tracecmd_translate_data(struct tracecmd_input *handle,
  *  a record is found. Otherwise NULL is returned if the record is bad
  *  or no more records exist.
  */
-struct pevent_record *
+struct tep_record *
 tracecmd_read_page_record(struct tep_handle *pevent, void *page, int size,
-			  struct pevent_record *last_record)
+			  struct tep_record *last_record)
 {
 	unsigned long long ts;
 	struct kbuffer *kbuf;
-	struct pevent_record *record = NULL;
+	struct tep_record *record = NULL;
 	enum kbuffer_long_size long_size;
 	enum kbuffer_endian endian;
 	void *ptr;
@@ -1728,10 +1728,10 @@ tracecmd_read_page_record(struct tep_handle *pevent, void *page, int size,
  * This returns the record at the current location of the CPU
  * iterator. It does not increment the CPU iterator.
  */
-struct pevent_record *
+struct tep_record *
 tracecmd_peek_data(struct tracecmd_input *handle, int cpu)
 {
-	struct pevent_record *record;
+	struct tep_record *record;
 	unsigned long long ts;
 	struct kbuffer *kbuf;
 	struct page *page;
@@ -1826,10 +1826,10 @@ read_again:
  *
  * The record returned must be freed.
  */
-struct pevent_record *
+struct tep_record *
 tracecmd_read_data(struct tracecmd_input *handle, int cpu)
 {
-	struct pevent_record *record;
+	struct tep_record *record;
 
 	record = tracecmd_peek_data(handle, cpu);
 	handle->cpu_data[cpu].next = NULL;
@@ -1859,10 +1859,10 @@ tracecmd_read_data(struct tracecmd_input *handle, int cpu)
  *
  * The record returned must be freed.
  */
-struct pevent_record *
+struct tep_record *
 tracecmd_read_next_data(struct tracecmd_input *handle, int *rec_cpu)
 {
-	struct pevent_record *record;
+	struct tep_record *record;
 	int next_cpu;
 
 	record = tracecmd_peek_next_data(handle, &next_cpu);
@@ -1886,11 +1886,11 @@ tracecmd_read_next_data(struct tracecmd_input *handle, int *rec_cpu)
  * returned. If @rec_cpu is not NULL it gets the CPU id the record was
  * on. It does not increment the CPU iterator.
  */
-struct pevent_record *
+struct tep_record *
 tracecmd_peek_next_data(struct tracecmd_input *handle, int *rec_cpu)
 {
 	unsigned long long ts;
-	struct pevent_record *record, *next_record = NULL;
+	struct tep_record *record, *next_record = NULL;
 	int next_cpu;
 	int cpu;
 
@@ -1935,8 +1935,8 @@ tracecmd_peek_next_data(struct tracecmd_input *handle, int *rec_cpu)
  *
  * The record returned must be freed with free_record().
  */
-struct pevent_record *
-tracecmd_read_prev(struct tracecmd_input *handle, struct pevent_record *record)
+struct tep_record *
+tracecmd_read_prev(struct tracecmd_input *handle, struct tep_record *record)
 {
 	unsigned long long offset, page_offset;;
 	struct cpu_data *cpu_data;
@@ -3028,7 +3028,7 @@ int tracecmd_copy_headers(struct tracecmd_input *handle, int fd)
  * Returns true if the record is the first record on the page.
  */
 int tracecmd_record_at_buffer_start(struct tracecmd_input *handle,
-				    struct pevent_record *record)
+				    struct tep_record *record)
 {
 	struct page *page = record->priv;
 	struct kbuffer *kbuf = handle->cpu_data[record->cpu].kbuf;
@@ -3042,7 +3042,7 @@ int tracecmd_record_at_buffer_start(struct tracecmd_input *handle,
 }
 
 unsigned long long tracecmd_page_ts(struct tracecmd_input *handle,
-				    struct pevent_record *record)
+				    struct tep_record *record)
 {
 	struct page *page = record->priv;
 	struct kbuffer *kbuf = handle->cpu_data[record->cpu].kbuf;
@@ -3054,7 +3054,7 @@ unsigned long long tracecmd_page_ts(struct tracecmd_input *handle,
 }
 
 unsigned int tracecmd_record_ts_delta(struct tracecmd_input *handle,
-				      struct pevent_record *record)
+				      struct tep_record *record)
 {
 	struct kbuffer *kbuf = handle->cpu_data[record->cpu].kbuf;
 	struct page *page = record->priv;
@@ -3069,13 +3069,13 @@ unsigned int tracecmd_record_ts_delta(struct tracecmd_input *handle,
 }
 
 struct kbuffer *tracecmd_record_kbuf(struct tracecmd_input *handle,
-				     struct pevent_record *record)
+				     struct tep_record *record)
 {
 	return handle->cpu_data[record->cpu].kbuf;
 }
 
 void *tracecmd_record_page(struct tracecmd_input *handle,
-			   struct pevent_record *record)
+			   struct tep_record *record)
 {
 	struct page *page = record->priv;
 
@@ -3083,7 +3083,7 @@ void *tracecmd_record_page(struct tracecmd_input *handle,
 }
 
 void *tracecmd_record_offset(struct tracecmd_input *handle,
-			     struct pevent_record *record)
+			     struct tep_record *record)
 {
 	struct page *page = record->priv;
 	int offset;
diff --git a/lib/traceevent/event-parse.c b/lib/traceevent/event-parse.c
index 62deefb..9088b99 100644
--- a/lib/traceevent/event-parse.c
+++ b/lib/traceevent/event-parse.c
@@ -5136,7 +5136,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;
@@ -5215,7 +5215,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);
 }
@@ -5239,7 +5239,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);
 }
@@ -5251,7 +5251,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);
 }
@@ -5265,7 +5265,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);
 }
@@ -5386,7 +5386,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;
 
@@ -5427,7 +5427,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;
 
@@ -5452,7 +5452,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;
@@ -5480,7 +5480,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;
@@ -5530,7 +5530,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;
@@ -5546,7 +5546,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;
 
@@ -6230,7 +6230,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) {
@@ -6263,7 +6263,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;
@@ -6310,7 +6310,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;
@@ -6335,7 +6335,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;
@@ -6360,7 +6360,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;
@@ -6386,7 +6386,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;
@@ -6418,7 +6418,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;
diff --git a/lib/traceevent/parse-filter.c b/lib/traceevent/parse-filter.c
index 21e74b0..5ca0803 100644
--- a/lib/traceevent/parse-filter.c
+++ b/lib/traceevent/parse-filter.c
@@ -1683,10 +1683,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;
@@ -1698,7 +1698,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;
 
@@ -1734,11 +1734,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;
 
@@ -1793,7 +1793,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:
@@ -1817,7 +1817,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;
 
@@ -1857,7 +1857,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;
@@ -1908,7 +1908,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;
 
@@ -1939,7 +1939,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:
@@ -1961,7 +1961,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) {
 		/*
@@ -2033,7 +2033,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;
diff --git a/plugins/plugin_blk.c b/plugins/plugin_blk.c
index 8fb5de3..6cb6151 100644
--- a/plugins/plugin_blk.c
+++ b/plugins/plugin_blk.c
@@ -278,7 +278,7 @@ static const struct {
 	[__BLK_TA_REMAP]	= {{  "A", "remap" },	   blk_log_remap },
 };
 
-static int blktrace_handler(struct trace_seq *s, struct pevent_record *record,
+static int blktrace_handler(struct trace_seq *s, struct tep_record *record,
 			    struct event_format *event, void *context)
 {
 	struct format_field *field;
diff --git a/plugins/plugin_function.c b/plugins/plugin_function.c
index 4ac669e..058144e 100644
--- a/plugins/plugin_function.c
+++ b/plugins/plugin_function.c
@@ -127,7 +127,7 @@ static void show_function(struct trace_seq *s, struct tep_handle *pevent,
 	}
 }
 
-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;
diff --git a/plugins/plugin_futex.c b/plugins/plugin_futex.c
index b73670a..60babce 100644
--- a/plugins/plugin_futex.c
+++ b/plugins/plugin_futex.c
@@ -64,7 +64,7 @@ static void futex_print(struct trace_seq *s, const struct futex_args *args,
 		trace_seq_printf(s, fop->fmt_val3, args->val3);
 }
 
-static int futex_handler(struct trace_seq *s, struct pevent_record *record,
+static int futex_handler(struct trace_seq *s, struct tep_record *record,
 			 struct event_format *event, void *context)
 {
 	const struct futex_op *fop;
diff --git a/plugins/plugin_hrtimer.c b/plugins/plugin_hrtimer.c
index da85bb1..176788c 100644
--- a/plugins/plugin_hrtimer.c
+++ b/plugins/plugin_hrtimer.c
@@ -9,7 +9,7 @@
 
 #include "event-parse.h"
 
-static int timer_expire_handler(struct trace_seq *s, struct pevent_record *record,
+static int timer_expire_handler(struct trace_seq *s, struct tep_record *record,
 				struct event_format *event, void *context)
 {
 	trace_seq_printf(s, "hrtimer=");
@@ -26,7 +26,7 @@ static int timer_expire_handler(struct trace_seq *s, struct pevent_record *recor
 	return 0;
 }
 
-static int timer_start_handler(struct trace_seq *s, struct pevent_record *record,
+static int timer_start_handler(struct trace_seq *s, struct tep_record *record,
 			       struct event_format *event, void *context)
 {
 	trace_seq_printf(s, "hrtimer=");
diff --git a/plugins/plugin_kmem.c b/plugins/plugin_kmem.c
index a4a2135..c913cc7 100644
--- a/plugins/plugin_kmem.c
+++ b/plugins/plugin_kmem.c
@@ -8,7 +8,7 @@
 
 #include "trace-cmd.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;
diff --git a/plugins/plugin_kvm.c b/plugins/plugin_kvm.c
index 5007b36..f5024db 100644
--- a/plugins/plugin_kvm.c
+++ b/plugins/plugin_kvm.c
@@ -248,7 +248,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;
@@ -269,7 +269,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_D   (1 << 2)
 #define KVM_EMUL_INSN_F_CS_L   (1 << 3)
 
-static int kvm_emulate_insn_handler(struct trace_seq *s, struct pevent_record *record,
+static int kvm_emulate_insn_handler(struct trace_seq *s, struct tep_record *record,
 				    struct event_format *event, void *context)
 {
 	unsigned long long rip, csbase, len, flags, failed;
@@ -331,7 +331,7 @@ static int kvm_emulate_insn_handler(struct trace_seq *s, struct pevent_record *r
 }
 
 
-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)
@@ -345,7 +345,7 @@ static int kvm_nested_vmexit_inject_handler(struct trace_seq *s, struct pevent_r
 	return 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 %lx ", event, "rip", record, 1);
@@ -368,7 +368,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;
@@ -410,7 +410,7 @@ static int kvm_mmu_print_role(struct trace_seq *s, struct pevent_record *record,
 
 	return 0;
 }
-static int kvm_mmu_get_page_handler(struct trace_seq *s, struct pevent_record *record,
+static int kvm_mmu_get_page_handler(struct trace_seq *s, struct tep_record *record,
 				    struct event_format *event, void *context)
 {
 	unsigned long long val;
diff --git a/plugins/plugin_mac80211.c b/plugins/plugin_mac80211.c
index 455cb85..b98803b 100644
--- a/plugins/plugin_mac80211.c
+++ b/plugins/plugin_mac80211.c
@@ -123,7 +123,7 @@ static void _print_flag(struct trace_seq *s, struct event_format *event,
 #define SFX(fn)	pevent_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, struct pevent_record *record,
+static int drv_bss_info_changed(struct trace_seq *s, struct tep_record *record,
 				struct event_format *event, void *context)
 {
 	void *data = record->data;
@@ -151,7 +151,7 @@ static int drv_bss_info_changed(struct trace_seq *s, struct pevent_record *recor
 	return 0;
 }
 
-static int drv_config(struct trace_seq *s, struct pevent_record *record,
+static int drv_config(struct trace_seq *s, struct tep_record *record,
 		      struct event_format *event, void *context)
 {
 	void *data = record->data;
diff --git a/plugins/plugin_sched_switch.c b/plugins/plugin_sched_switch.c
index be60308..6c6e9f5 100644
--- a/plugins/plugin_sched_switch.c
+++ b/plugins/plugin_sched_switch.c
@@ -30,7 +30,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;
@@ -49,7 +49,7 @@ static void write_and_save_comm(struct format_field *field,
 	pevent_register_comm(field->event->pevent, comm, pid);
 }
 
-static int sched_wakeup_handler(struct trace_seq *s, struct pevent_record *record,
+static int sched_wakeup_handler(struct trace_seq *s, struct tep_record *record,
 				struct event_format *event, void *context)
 {
 	struct format_field *field;
@@ -77,7 +77,7 @@ static int sched_wakeup_handler(struct trace_seq *s, struct pevent_record *recor
 	return 0;
 }
 
-static int sched_switch_handler(struct trace_seq *s, struct pevent_record *record,
+static int sched_switch_handler(struct trace_seq *s, struct tep_record *record,
 				struct event_format *event, void *context)
 {
 	struct format_field *field;
diff --git a/plugins/plugin_tlb.c b/plugins/plugin_tlb.c
index 781d6fe..4a750aa 100644
--- a/plugins/plugin_tlb.c
+++ b/plugins/plugin_tlb.c
@@ -16,7 +16,7 @@ enum tlb_flush_reason {
 	NR_TLB_FLUSH_REASONS,
 };
 
-static int tlb_flush_handler(struct trace_seq *s, struct pevent_record *record,
+static int tlb_flush_handler(struct trace_seq *s, struct tep_record *record,
 			     struct event_format *event, void *context)
 {
 	unsigned long long val;
diff --git a/python/ctracecmd.i b/python/ctracecmd.i
index 04ab547..eb6dbd6 100644
--- a/python/ctracecmd.i
+++ b/python/ctracecmd.i
@@ -31,7 +31,7 @@
 
 %inline %{
 static int python_callback(struct trace_seq *s,
-			   struct pevent_record *record,
+			   struct tep_record *record,
 			   struct event_format *event,
 			   void *context);
 
@@ -81,7 +81,7 @@ void py_pevent_register_event_handler(struct tep_handle *pevent, int id,
 }
 
 static PyObject *py_field_get_stack(struct tep_handle *pevent,
-				    struct pevent_record *record,
+				    struct tep_record *record,
 				    struct event_format *event,
 				    int long_size)
 {
@@ -117,7 +117,7 @@ static PyObject *py_field_get_stack(struct tep_handle *pevent,
 	return list;
 }
 
-static PyObject *py_field_get_data(struct format_field *f, struct pevent_record *r)
+static PyObject *py_field_get_data(struct format_field *f, struct tep_record *r)
 {
 	if (!strncmp(f->type, "__data_loc ", 11)) {
 		unsigned long long val;
@@ -143,7 +143,7 @@ static PyObject *py_field_get_data(struct format_field *f, struct pevent_record
 	return PyBuffer_FromMemory((char *)r->data + f->offset, f->size);
 }
 
-static PyObject *py_field_get_str(struct format_field *f, struct pevent_record *r)
+static PyObject *py_field_get_str(struct format_field *f, struct tep_record *r)
 {
 	if (!strncmp(f->type, "__data_loc ", 11)) {
 		unsigned long long val;
@@ -190,7 +190,7 @@ static PyObject *py_format_get_keys(struct event_format *ef)
 
 %wrapper %{
 static int python_callback(struct trace_seq *s,
-			   struct pevent_record *record,
+			   struct tep_record *record,
 			   struct event_format *event,
 			   void *context)
 {
@@ -203,7 +203,7 @@ static int python_callback(struct trace_seq *s,
 		SWIG_NewPointerObj(SWIG_as_voidptr(s),
 				   SWIGTYPE_p_trace_seq, 0),
 		SWIG_NewPointerObj(SWIG_as_voidptr(record),
-				   SWIGTYPE_p_pevent_record, 0),
+				   SWIGTYPE_p_tep_record, 0),
 		SWIG_NewPointerObj(SWIG_as_voidptr(event),
 				   SWIGTYPE_p_event_format, 0));
 
diff --git a/tracecmd/include/trace-local.h b/tracecmd/include/trace-local.h
index 18c457d..a1a06e9 100644
--- a/tracecmd/include/trace-local.h
+++ b/tracecmd/include/trace-local.h
@@ -34,7 +34,7 @@ struct pid_record_data {
 	int			closed;
 	struct tracecmd_input	*stream;
 	struct buffer_instance	*instance;
-	struct pevent_record	*record;
+	struct tep_record	*record;
 };
 
 void show_file(const char *name);
@@ -101,7 +101,7 @@ trace_stream_init(struct buffer_instance *instance, int cpu, int fd, int cpus,
 		  tracecmd_handle_init_func handle_init, int global);
 int trace_stream_read(struct pid_record_data *pids, int nr_pids, struct timeval *tv);
 
-void trace_show_data(struct tracecmd_input *handle, struct pevent_record *record);
+void trace_show_data(struct tracecmd_input *handle, struct tep_record *record);
 
 /* --- event interation --- */
 
diff --git a/tracecmd/trace-hist.c b/tracecmd/trace-hist.c
index 81bac87..b8ff77d 100644
--- a/tracecmd/trace-hist.c
+++ b/tracecmd/trace-hist.c
@@ -252,7 +252,7 @@ static void pop_stack_func(void)
 }
 
 static void
-process_function(struct tep_handle *pevent, struct pevent_record *record)
+process_function(struct tep_handle *pevent, struct tep_record *record)
 {
 	unsigned long long parent_ip;
 	unsigned long long ip;
@@ -309,7 +309,7 @@ process_function(struct tep_handle *pevent, struct pevent_record *record)
 }
 
 static void
-process_function_graph_entry(struct tep_handle *pevent, struct pevent_record *record)
+process_function_graph_entry(struct tep_handle *pevent, struct tep_record *record)
 {
 	unsigned long long depth;
 	unsigned long long ip;
@@ -355,7 +355,7 @@ process_function_graph_entry(struct tep_handle *pevent, struct pevent_record *re
 }
 
 static void
-process_function_graph_exit(struct tep_handle *pevent, struct pevent_record *record)
+process_function_graph_exit(struct tep_handle *pevent, struct tep_record *record)
 {
 	unsigned long long depth;
 	unsigned long long val;
@@ -410,7 +410,7 @@ static void copy_stack_to_pending(int pid)
 }
 
 static void
-process_kernel_stack(struct tep_handle *pevent, struct pevent_record *record)
+process_kernel_stack(struct tep_handle *pevent, struct tep_record *record)
 {
 	struct format_field *field = kernel_stack_caller_field;
 	unsigned long long val;
@@ -480,7 +480,7 @@ process_kernel_stack(struct tep_handle *pevent, struct pevent_record *record)
 }
 
 static void
-process_sched_wakeup(struct tep_handle *pevent, struct pevent_record *record, int type)
+process_sched_wakeup(struct tep_handle *pevent, struct tep_record *record, int type)
 {
 	unsigned long long val;
 	const char *comm;
@@ -505,7 +505,7 @@ process_sched_wakeup(struct tep_handle *pevent, struct pevent_record *record, in
 }
 
 static void
-process_sched_switch(struct tep_handle *pevent, struct pevent_record *record)
+process_sched_switch(struct tep_handle *pevent, struct tep_record *record)
 {
 	unsigned long long val;
 	const char *comm;
@@ -528,7 +528,7 @@ process_sched_switch(struct tep_handle *pevent, struct pevent_record *record)
 }
 
 static void
-process_event(struct tep_handle *pevent, struct pevent_record *record, int type)
+process_event(struct tep_handle *pevent, struct tep_record *record, int type)
 {
 	struct event_format *event;
 	const char *event_name;
@@ -563,7 +563,7 @@ process_event(struct tep_handle *pevent, struct pevent_record *record, int type)
 }
 
 static void
-process_record(struct tep_handle *pevent, struct pevent_record *record)
+process_record(struct tep_handle *pevent, struct tep_record *record)
 {
 	unsigned long long val;
 	int type;
@@ -935,7 +935,7 @@ static void do_trace_hist(struct tracecmd_input *handle)
 {
 	struct tep_handle *pevent = tracecmd_get_pevent(handle);
 	struct event_format *event;
-	struct pevent_record *record;
+	struct tep_record *record;
 	int cpus;
 	int cpu;
 	int ret;
@@ -974,7 +974,7 @@ static void do_trace_hist(struct tracecmd_input *handle)
 
 	for (cpu = 0; cpu < cpus; cpu++) {
 		for (;;) {
-			struct pevent_record *record;
+			struct tep_record *record;
 
 			record = tracecmd_read_data(handle, cpu);
 			if (!record)
diff --git a/tracecmd/trace-mem.c b/tracecmd/trace-mem.c
index f9658e5..42953b2 100644
--- a/tracecmd/trace-mem.c
+++ b/tracecmd/trace-mem.c
@@ -327,7 +327,7 @@ static void remove_kmalloc(unsigned long long ptr)
 }
 
 static void
-process_kmalloc(struct tep_handle *pevent, struct pevent_record *record,
+process_kmalloc(struct tep_handle *pevent, struct tep_record *record,
 		struct format_field *callsite_field,
 		struct format_field *bytes_req_field,
 		struct format_field *bytes_alloc_field,
@@ -353,7 +353,7 @@ process_kmalloc(struct tep_handle *pevent, struct pevent_record *record,
 }
 
 static void
-process_kfree(struct tep_handle *pevent, struct pevent_record *record,
+process_kfree(struct tep_handle *pevent, struct tep_record *record,
 	      struct format_field *ptr_field)
 {
 	unsigned long long ptr;
@@ -364,7 +364,7 @@ process_kfree(struct tep_handle *pevent, struct pevent_record *record,
 }
 
 static void
-process_record(struct tep_handle *pevent, struct pevent_record *record)
+process_record(struct tep_handle *pevent, struct tep_record *record)
 {
 	unsigned long long val;
 	int type;
@@ -463,7 +463,7 @@ static void do_trace_mem(struct tracecmd_input *handle)
 {
 	struct tep_handle *pevent = tracecmd_get_pevent(handle);
 	struct event_format *event;
-	struct pevent_record *record;
+	struct tep_record *record;
 	int missed_events = 0;
 	int cpus;
 	int cpu;
diff --git a/tracecmd/trace-profile.c b/tracecmd/trace-profile.c
index 246520a..964a65f 100644
--- a/tracecmd/trace-profile.c
+++ b/tracecmd/trace-profile.c
@@ -51,7 +51,7 @@ struct event_data;
 typedef void (*event_data_print)(struct trace_seq *s, struct event_hash *hash);
 typedef int (*handle_event_func)(struct handle_data *h, unsigned long long pid,
 				 struct event_data *data,
-				 struct pevent_record *record, int cpu);
+				 struct tep_record *record, int cpu);
 
 enum event_data_type {
 	EVENT_TYPE_UNDEFINED,
@@ -105,7 +105,7 @@ struct stack_data {
 struct stack_holder {
 	unsigned long		size;
 	void			*caller;
-	struct pevent_record	*record;
+	struct tep_record	*record;
 };
 
 struct start_data {
@@ -158,7 +158,7 @@ struct task_data {
 	struct task_data	*proxy;
 	struct start_data	*last_start;
 	struct event_hash	*last_event;
-	struct pevent_record	*last_stack;
+	struct tep_record	*last_stack;
 	struct handle_data	*handle;
 	struct group_data	*group;
 };
@@ -211,7 +211,7 @@ void trace_profile_set_merge_like_comms(void)
 
 static struct start_data *
 add_start(struct task_data *task,
-	  struct event_data *event_data, struct pevent_record *record,
+	  struct event_data *event_data, struct tep_record *record,
 	  unsigned long long search_val, unsigned long long val)
 {
 	struct start_data *start;
@@ -532,7 +532,7 @@ static int match_group(struct trace_hash_item *item, void *data)
 
 static void
 add_task_comm(struct task_data *task, struct format_field *field,
-	      struct pevent_record *record)
+	      struct tep_record *record)
 {
 	const char *comm;
 
@@ -548,7 +548,7 @@ add_task_comm(struct task_data *task, struct format_field *field,
 
 /* Account for tasks that don't have starts */
 static void account_task(struct task_data *task, struct event_data *event_data,
-			 struct pevent_record *record)
+			 struct tep_record *record)
 {
 	struct event_data_match edata;
 	struct event_hash *event_hash;
@@ -601,7 +601,7 @@ static void account_task(struct task_data *task, struct event_data *event_data,
 
 static struct task_data *
 find_event_task(struct handle_data *h, struct event_data *event_data,
-		struct pevent_record *record, unsigned long long pid)
+		struct tep_record *record, unsigned long long pid)
 {
 	if (event_data->global) {
 		if (event_data->migrate)
@@ -619,7 +619,7 @@ find_event_task(struct handle_data *h, struct event_data *event_data,
 
 static struct task_data *
 handle_end_event(struct handle_data *h, struct event_data *event_data,
-		 struct pevent_record *record, int pid)
+		 struct tep_record *record, int pid)
 {
 	struct event_hash *event_hash;
 	struct task_data *task;
@@ -640,7 +640,7 @@ handle_end_event(struct handle_data *h, struct event_data *event_data,
 
 static struct task_data *
 handle_start_event(struct handle_data *h, struct event_data *event_data,
-		   struct pevent_record *record, unsigned long long pid)
+		   struct tep_record *record, unsigned long long pid)
 {
 	struct start_data *start;
 	struct task_data *task;
@@ -667,7 +667,7 @@ handle_start_event(struct handle_data *h, struct event_data *event_data,
 static int handle_event_data(struct handle_data *h,
 			     unsigned long long pid,
 			     struct event_data *event_data,
-			     struct pevent_record *record, int cpu)
+			     struct tep_record *record, int cpu)
 {
 	struct task_data *task = NULL;
 
@@ -734,10 +734,10 @@ find_event_data(struct handle_data *h, int id)
 }
 
 static void trace_profile_record(struct tracecmd_input *handle,
-				struct pevent_record *record)
+				 struct tep_record *record)
 {
 	static struct handle_data *last_handle;
-	struct pevent_record *stack_record;
+	struct tep_record *stack_record;
 	struct event_data *event_data;
 	struct task_data *task;
 	struct handle_data *h;
@@ -989,7 +989,7 @@ static void sched_switch_print(struct trace_seq *s, struct event_hash *event_has
 static int handle_sched_switch_event(struct handle_data *h,
 				     unsigned long long pid,
 				     struct event_data *event_data,
-				     struct pevent_record *record, int cpu)
+				     struct tep_record *record, int cpu)
 {
 	struct task_data *task;
 	unsigned long long prev_pid;
@@ -1054,7 +1054,7 @@ static int handle_sched_switch_event(struct handle_data *h,
 static int handle_stacktrace_event(struct handle_data *h,
 				   unsigned long long pid,
 				   struct event_data *event_data,
-				   struct pevent_record *record, int cpu)
+				   struct tep_record *record, int cpu)
 {
 	struct task_data *orig_task;
 	struct task_data *proxy;
@@ -1124,7 +1124,7 @@ static int handle_stacktrace_event(struct handle_data *h,
 static int handle_fgraph_entry_event(struct handle_data *h,
 				    unsigned long long pid,
 				    struct event_data *event_data,
-				    struct pevent_record *record, int cpu)
+				    struct tep_record *record, int cpu)
 {
 	unsigned long long size;
 	struct start_data *start;
@@ -1163,7 +1163,7 @@ static int handle_fgraph_entry_event(struct handle_data *h,
 static int handle_fgraph_exit_event(struct handle_data *h,
 				    unsigned long long pid,
 				    struct event_data *event_data,
-				    struct pevent_record *record, int cpu)
+				    struct tep_record *record, int cpu)
 {
 	struct task_data *task;
 
@@ -1179,7 +1179,7 @@ static int handle_fgraph_exit_event(struct handle_data *h,
 static int handle_process_exec(struct handle_data *h,
 			       unsigned long long pid,
 			       struct event_data *event_data,
-			       struct pevent_record *record, int cpu)
+			       struct tep_record *record, int cpu)
 {
 	struct task_data *task;
 	unsigned long long val;
@@ -1204,7 +1204,7 @@ static int handle_process_exec(struct handle_data *h,
 static int handle_sched_wakeup_event(struct handle_data *h,
 				     unsigned long long pid,
 				     struct event_data *event_data,
-				     struct pevent_record *record, int cpu)
+				     struct tep_record *record, int cpu)
 {
 	struct task_data *proxy;
 	struct task_data *task = NULL;
diff --git a/tracecmd/trace-read.c b/tracecmd/trace-read.c
index c1dbd77..ac74876 100644
--- a/tracecmd/trace-read.c
+++ b/tracecmd/trace-read.c
@@ -50,7 +50,7 @@ struct handle_list {
 	const char		*file;
 	int			cpus;
 	int			done;
-	struct pevent_record	*record;
+	struct tep_record	*record;
 	struct filter		*event_filters;
 	struct filter		*event_filter_out;
 };
@@ -135,7 +135,7 @@ static int test_read_at_index;
 static void show_test(struct tracecmd_input *handle)
 {
 	struct tep_handle *pevent;
-	struct pevent_record *record;
+	struct tep_record *record;
 	struct trace_seq s;
 	int cpu;
 
@@ -157,7 +157,7 @@ static void show_test(struct tracecmd_input *handle)
 	free_record(record);
 }
 
-static void test_save(struct pevent_record *record, int cpu)
+static void test_save(struct tep_record *record, int cpu)
 {
 	if (test_read_at_index++ == test_read_at_copy) {
 		test_read_at_offset = record->offset;
@@ -177,7 +177,7 @@ static int test_at_timestamp_index;
 static void show_test(struct tracecmd_input *handle)
 {
 	struct tep_handle *pevent;
-	struct pevent_record *record;
+	struct tep_record *record;
 	struct trace_seq s;
 	int cpu = test_at_timestamp_cpu;
 
@@ -204,7 +204,7 @@ static void show_test(struct tracecmd_input *handle)
 	free_record(record);
 }
 
-static void test_save(struct pevent_record *record, int cpu)
+static void test_save(struct tep_record *record, int cpu)
 {
 	if (test_at_timestamp_index++ == test_at_timestamp_copy) {
 		test_at_timestamp_ts = record->ts;
@@ -222,7 +222,7 @@ static void test_save(struct pevent_record *record, int cpu)
 static void show_test(struct tracecmd_input *handle)
 {
 	struct tep_handle *pevent;
-	struct pevent_record *record;
+	struct tep_record *record;
 	struct trace_seq s;
 	int cpu = 0;
 
@@ -260,7 +260,7 @@ static void show_test(struct tracecmd_input *handle)
 
 	free_record(record);
 }
-static void test_save(struct pevent_record *record, int cpu)
+static void test_save(struct tep_record *record, int cpu)
 {
 }
 #endif /* TEST_FIRST_LAST */
@@ -269,7 +269,7 @@ static void test_save(struct pevent_record *record, int cpu)
 static void show_test(struct tracecmd_input *handle)
 {
 }
-static void test_save(struct pevent_record *record, int cpu)
+static void test_save(struct tep_record *record, int cpu)
 {
 }
 #endif
@@ -661,7 +661,7 @@ static void add_sched(unsigned int val, unsigned long long end, int rt)
 	free(info);
 }
 
-static void process_wakeup(struct tep_handle *pevent, struct pevent_record *record)
+static void process_wakeup(struct tep_handle *pevent, struct tep_record *record)
 {
 	unsigned long long val;
 	int id;
@@ -749,7 +749,7 @@ static void finish_wakeup(void)
 	trace_hash_free(&wakeup_hash);
 }
 
-void trace_show_data(struct tracecmd_input *handle, struct pevent_record *record)
+void trace_show_data(struct tracecmd_input *handle, struct tep_record *record)
 {
 	tracecmd_show_data_func func = tracecmd_get_show_data_func(handle);
 	struct tep_handle *pevent;
@@ -876,7 +876,7 @@ static void read_rest(void)
 
 static int
 test_filters(struct tep_handle *pevent, struct filter *event_filters,
-	     struct pevent_record *record, int neg)
+	     struct tep_record *record, int neg)
 {
 	int found = 0;
 	int ret = FILTER_NONE;
@@ -920,7 +920,7 @@ struct stack_info {
 };
 
 static int
-test_stacktrace(struct handle_list *handles, struct pevent_record *record,
+test_stacktrace(struct handle_list *handles, struct tep_record *record,
 		int last_printed)
 {
 	static struct stack_info *infos;
@@ -994,9 +994,9 @@ test_stacktrace(struct handle_list *handles, struct pevent_record *record,
 	return 0;
 }
 
-static struct pevent_record *get_next_record(struct handle_list *handles)
+static struct tep_record *get_next_record(struct handle_list *handles)
 {
-	struct pevent_record *record;
+	struct tep_record *record;
 	struct tep_handle *pevent;
 	int found = 0;
 	int cpu;
@@ -1013,7 +1013,7 @@ static struct pevent_record *get_next_record(struct handle_list *handles)
 	do {
 		if (filter_cpus) {
 			long long last_stamp = -1;
-			struct pevent_record *precord;
+			struct tep_record *precord;
 			int first_record = 1;
 			int next_cpu = -1;
 			int i;
@@ -1115,8 +1115,8 @@ static void read_data_info(struct list_head *handle_list, enum output_type otype
 {
 	struct handle_list *handles;
 	struct handle_list *last_handle;
-	struct pevent_record *record;
-	struct pevent_record *last_record;
+	struct tep_record *record;
+	struct tep_record *last_record;
 	struct event_format *event;
 	struct tep_handle *pevent;
 	int cpus;
diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c
index 4531a97..45e5feb 100644
--- a/tracecmd/trace-record.c
+++ b/tracecmd/trace-record.c
@@ -3348,8 +3348,8 @@ find_ts_in_page(struct tep_handle *pevent, void *page, int size)
 {
 	struct event_format *event;
 	struct format_field *field;
-	struct pevent_record *last_record = NULL;
-	struct pevent_record *record;
+	struct tep_record *last_record = NULL;
+	struct tep_record *record;
 	unsigned long long ts = 0;
 	int id;
 
diff --git a/tracecmd/trace-split.c b/tracecmd/trace-split.c
index bd7a33c..cabcc3d 100644
--- a/tracecmd/trace-split.c
+++ b/tracecmd/trace-split.c
@@ -41,7 +41,7 @@ enum split_types {
 struct cpu_data {
 	unsigned long long		ts;
 	unsigned long long		offset;
-	struct pevent_record		*record;
+	struct tep_record		*record;
 	int				cpu;
 	int				fd;
 	int				index;
@@ -74,7 +74,7 @@ static int create_type_len(struct tep_handle *pevent, int time, int len)
 }
 
 static int write_record(struct tracecmd_input *handle,
-			struct pevent_record *record,
+			struct tep_record *record,
 			struct cpu_data *cpu_data,
 			enum split_types type)
 {
@@ -151,8 +151,8 @@ static void write_page(struct tep_handle *pevent,
 	write(cpu_data->fd, cpu_data->page, page_size);
 }
 
-static struct pevent_record *read_record(struct tracecmd_input *handle,
-				  int percpu, int *cpu)
+static struct tep_record *read_record(struct tracecmd_input *handle,
+				      int percpu, int *cpu)
 {
 	if (percpu)
 		return tracecmd_read_data(handle, *cpu);
@@ -180,7 +180,7 @@ static int parse_cpu(struct tracecmd_input *handle,
 		     int count_limit, int percpu, int cpu,
 		     enum split_types type)
 {
-	struct pevent_record *record;
+	struct tep_record *record;
 	struct tep_handle *pevent;
 	void *ptr;
 	int page_size;
@@ -333,7 +333,7 @@ static double parse_file(struct tracecmd_input *handle,
 	unsigned long long current;
 	struct tracecmd_output *ohandle;
 	struct cpu_data *cpu_data;
-	struct pevent_record *record;
+	struct tep_record *record;
 	char **cpu_list;
 	char *output;
 	char *base;
diff --git a/tracecmd/trace-stream.c b/tracecmd/trace-stream.c
index 795f666..dad3466 100644
--- a/tracecmd/trace-stream.c
+++ b/tracecmd/trace-stream.c
@@ -87,7 +87,7 @@ trace_stream_init(struct buffer_instance *instance, int cpu, int fd, int cpus,
 
 int trace_stream_read(struct pid_record_data *pids, int nr_pids, struct timeval *tv)
 {
-	struct pevent_record *record;
+	struct tep_record *record;
 	struct pid_record_data *pid;
 	struct pid_record_data *last_pid;
 	fd_set rfds;
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH v3 03/24] tools lib traceevent, perf tools: Rename pevent plugin related APIs
  2018-08-27  8:17 [PATCH v3 00/24] trace-cmd: rename variables, data structures and functions in lib/traceevent Tzvetomir Stoyanov (VMware)
  2018-08-27  8:17 ` [PATCH v3 02/24] tools lib traceevent, perf tools: Rename 'struct pevent_record' to 'struct tep_record' Tzvetomir Stoyanov (VMware)
@ 2018-08-27  8:17 ` Tzvetomir Stoyanov (VMware)
  2018-08-28  9:10   ` [PATCH v3.5 " Tzvetomir Stoyanov (VMware)
  2018-08-27  8:17 ` [PATCH v3 04/24] tools lib traceevent, perf tools: Rename pevent alloc / free APIs Tzvetomir Stoyanov (VMware)
                   ` (20 subsequent siblings)
  22 siblings, 1 reply; 30+ messages in thread
From: Tzvetomir Stoyanov (VMware) @ 2018-08-27  8:17 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel

In order to make libtraceevent into a proper library, variables, data
structures and functions require a unique prefix to prevent name space
conflicts. That prefix will be "tep_" and not "pevent_". This changes
the pevent plugin related API.

Signed-off-by: Tzvetomir Stoyanov (VMware) <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/20180808180700.005287044@goodmis.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 include/trace-cmd/trace-cmd.h    | 10 +++---
 include/traceevent/event-parse.h | 56 ++++++++++++++---------------
 lib/trace-cmd/trace-ftrace.c     |  6 ++--
 lib/trace-cmd/trace-util.c       | 62 ++++++++++++++++----------------
 lib/traceevent/event-parse.c     |  8 ++---
 lib/traceevent/event-plugin.c    | 24 ++++++-------
 plugins/plugin_cfg80211.c        |  4 +--
 plugins/plugin_function.c        | 12 +++----
 plugins/plugin_hrtimer.c         |  4 +--
 plugins/plugin_jbd2.c            |  4 +--
 plugins/plugin_kmem.c            |  4 +--
 plugins/plugin_kvm.c             |  4 +--
 plugins/plugin_mac80211.c        |  2 +-
 plugins/plugin_sched_switch.c    |  4 +--
 plugins/plugin_scsi.c            |  4 +--
 plugins/plugin_xen.c             |  4 +--
 16 files changed, 106 insertions(+), 106 deletions(-)

diff --git a/include/trace-cmd/trace-cmd.h b/include/trace-cmd/trace-cmd.h
index ade21b1..1f5ef81 100644
--- a/include/trace-cmd/trace-cmd.h
+++ b/include/trace-cmd/trace-cmd.h
@@ -330,10 +330,10 @@ bool tracecmd_msg_done(struct tracecmd_msg_handle *msg_handle);
 void tracecmd_msg_set_done(struct tracecmd_msg_handle *msg_handle);
 
 /* --- Plugin handling --- */
-extern struct pevent_plugin_option trace_ftrace_options[];
+extern struct tep_plugin_option trace_ftrace_options[];
 
-int trace_util_add_options(const char *name, struct pevent_plugin_option *options);
-void trace_util_remove_options(struct pevent_plugin_option *options);
+int trace_util_add_options(const char *name, struct tep_plugin_option *options);
+void trace_util_remove_options(struct tep_plugin_option *options);
 int trace_util_add_option(const char *name, const char *val);
 int trace_util_load_plugins(struct tep_handle *pevent, const char *suffix,
 			    int (*load_plugin)(struct tep_handle *pevent,
@@ -341,8 +341,8 @@ int trace_util_load_plugins(struct tep_handle *pevent, const char *suffix,
 					       const char *name,
 					       void *data),
 			    void *data);
-struct pevent_plugin_option *trace_util_read_plugin_options(void);
-void trace_util_free_options(struct pevent_plugin_option *options);
+struct tep_plugin_option *trace_util_read_plugin_options(void);
+void trace_util_free_options(struct tep_plugin_option *options);
 char **trace_util_find_plugin_files(const char *suffix);
 void trace_util_free_plugin_files(char **files);
 void trace_util_print_plugins(struct trace_seq *s, const char *prefix, const char *suffix,
diff --git a/include/traceevent/event-parse.h b/include/traceevent/event-parse.h
index 3b99120..ada1efa 100644
--- a/include/traceevent/event-parse.h
+++ b/include/traceevent/event-parse.h
@@ -87,16 +87,16 @@ extern int trace_seq_do_printf(struct trace_seq *s);
 struct tep_handle;
 struct event_format;
 
-typedef int (*pevent_event_handler_func)(struct trace_seq *s,
-					 struct tep_record *record,
-					 struct event_format *event,
-					 void *context);
+typedef int (*tep_event_handler_func)(struct trace_seq *s,
+				      struct tep_record *record,
+				      struct event_format *event,
+				      void *context);
 
-typedef int (*pevent_plugin_load_func)(struct tep_handle *pevent);
-typedef int (*pevent_plugin_unload_func)(struct tep_handle *pevent);
+typedef int (*tep_plugin_load_func)(struct tep_handle *pevent);
+typedef int (*tep_plugin_unload_func)(struct tep_handle *pevent);
 
-struct pevent_plugin_option {
-	struct pevent_plugin_option	*next;
+struct tep_plugin_option {
+	struct tep_plugin_option	*next;
 	void				*handle;
 	char				*file;
 	char				*name;
@@ -110,20 +110,20 @@ struct pevent_plugin_option {
 /*
  * Plugin hooks that can be called:
  *
- * PEVENT_PLUGIN_LOADER:  (required)
+ * TEP_PLUGIN_LOADER:  (required)
  *   The function name to initialized the plugin.
  *
- *   int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent)
+ *   int TEP_PLUGIN_LOADER(struct tep_handle *pevent)
  *
- * PEVENT_PLUGIN_UNLOADER:  (optional)
+ * TEP_PLUGIN_UNLOADER:  (optional)
  *   The function called just before unloading
  *
- *   int PEVENT_PLUGIN_UNLOADER(struct tep_handle *pevent)
+ *   int TEP_PLUGIN_UNLOADER(struct tep_handle *pevent)
  *
- * PEVENT_PLUGIN_OPTIONS:  (optional)
+ * TEP_PLUGIN_OPTIONS:  (optional)
  *   Plugin options that can be set before loading
  *
- *   struct pevent_plugin_option PEVENT_PLUGIN_OPTIONS[] = {
+ *   struct tep_plugin_option TEP_PLUGIN_OPTIONS[] = {
  *	{
  *		.name = "option-name",
  *		.plugin_alias = "override-file-name", (optional)
@@ -144,19 +144,19 @@ struct pevent_plugin_option {
  *   .set will be processed. If .value is defined, then it is considered
  *   a string option and .set will be ignored.
  *
- * PEVENT_PLUGIN_ALIAS: (optional)
+ * TEP_PLUGIN_ALIAS: (optional)
  *   The name to use for finding options (uses filename if not defined)
  */
-#define PEVENT_PLUGIN_LOADER pevent_plugin_loader
-#define PEVENT_PLUGIN_UNLOADER pevent_plugin_unloader
-#define PEVENT_PLUGIN_OPTIONS pevent_plugin_options
-#define PEVENT_PLUGIN_ALIAS pevent_plugin_alias
+#define TEP_PLUGIN_LOADER tep_plugin_loader
+#define TEP_PLUGIN_UNLOADER tep_plugin_unloader
+#define TEP_PLUGIN_OPTIONS tep_plugin_options
+#define TEP_PLUGIN_ALIAS tep_plugin_alias
 #define _MAKE_STR(x)	#x
 #define MAKE_STR(x)	_MAKE_STR(x)
-#define PEVENT_PLUGIN_LOADER_NAME MAKE_STR(PEVENT_PLUGIN_LOADER)
-#define PEVENT_PLUGIN_UNLOADER_NAME MAKE_STR(PEVENT_PLUGIN_UNLOADER)
-#define PEVENT_PLUGIN_OPTIONS_NAME MAKE_STR(PEVENT_PLUGIN_OPTIONS)
-#define PEVENT_PLUGIN_ALIAS_NAME MAKE_STR(PEVENT_PLUGIN_ALIAS)
+#define TEP_PLUGIN_LOADER_NAME MAKE_STR(TEP_PLUGIN_LOADER)
+#define TEP_PLUGIN_UNLOADER_NAME MAKE_STR(TEP_PLUGIN_UNLOADER)
+#define TEP_PLUGIN_OPTIONS_NAME MAKE_STR(TEP_PLUGIN_OPTIONS)
+#define TEP_PLUGIN_ALIAS_NAME MAKE_STR(TEP_PLUGIN_ALIAS)
 
 enum format_flags {
 	FIELD_IS_ARRAY		= 1,
@@ -313,7 +313,7 @@ struct event_format {
 	struct format		format;
 	struct print_fmt	print_fmt;
 	char			*system;
-	pevent_event_handler_func handler;
+	tep_event_handler_func	handler;
 	void			*context;
 };
 
@@ -427,8 +427,8 @@ void traceevent_unload_plugins(struct plugin_list *plugin_list,
 char **traceevent_plugin_list_options(void);
 void traceevent_plugin_free_options_list(char **list);
 int traceevent_plugin_add_options(const char *name,
-				  struct pevent_plugin_option *options);
-void traceevent_plugin_remove_options(struct pevent_plugin_option *options);
+				  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);
@@ -663,10 +663,10 @@ int pevent_print_func_field(struct trace_seq *s, const char *fmt,
 
 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);
 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);
 int pevent_register_print_function(struct tep_handle *pevent,
 				   pevent_func_handler func,
 				   enum pevent_func_arg_type ret_type,
diff --git a/lib/trace-cmd/trace-ftrace.c b/lib/trace-cmd/trace-ftrace.c
index 3b87071..8c706f3 100644
--- a/lib/trace-cmd/trace-ftrace.c
+++ b/lib/trace-cmd/trace-ftrace.c
@@ -10,7 +10,7 @@
 
 #include "trace-cmd.h"
 
-struct pevent_plugin_option trace_ftrace_options[] = {
+struct tep_plugin_option trace_ftrace_options[] = {
 	{
 		.name = "tailprint",
 		.plugin_alias = "fgraph",
@@ -28,8 +28,8 @@ struct pevent_plugin_option trace_ftrace_options[] = {
 	}
 };
 
-static struct pevent_plugin_option *fgraph_tail = &trace_ftrace_options[0];
-static struct pevent_plugin_option *fgraph_depth = &trace_ftrace_options[1];
+static struct tep_plugin_option *fgraph_tail = &trace_ftrace_options[0];
+static struct tep_plugin_option *fgraph_depth = &trace_ftrace_options[1];
 
 static void find_long_size(struct tracecmd_ftrace *finfo)
 {
diff --git a/lib/trace-cmd/trace-util.c b/lib/trace-cmd/trace-util.c
index ed1c008..4a66457 100644
--- a/lib/trace-cmd/trace-util.c
+++ b/lib/trace-cmd/trace-util.c
@@ -30,7 +30,7 @@ int tracecmd_disable_plugins;
 
 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 {
@@ -63,7 +63,7 @@ struct plugin_list {
 char **trace_util_list_plugin_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;
@@ -101,7 +101,7 @@ void trace_util_free_plugin_options_list(char **list)
 }
 
 static int process_option(const char *plugin, const char *option, const char *val);
-static int update_option(const char *file, struct pevent_plugin_option *option);
+static int update_option(const char *file, struct tep_plugin_option *option);
 
 /**
  * trace_util_add_options - Add a set of options by a plugin
@@ -110,7 +110,7 @@ static int update_option(const char *file, struct pevent_plugin_option *option);
  *
  * Sets the options with the values that have been added by user.
  */
-int trace_util_add_options(const char *name, struct pevent_plugin_option *options)
+int trace_util_add_options(const char *name, struct tep_plugin_option *options)
 {
 	struct registered_plugin_options *reg;
 	int ret;
@@ -135,7 +135,7 @@ int trace_util_add_options(const char *name, struct pevent_plugin_option *option
  * trace_util_remove_options - remove plugin options that were registered
  * @options: Options to removed that were registered with trace_util_add_options
  */
-void trace_util_remove_options(struct pevent_plugin_option *options)
+void trace_util_remove_options(struct tep_plugin_option *options)
 {
 	struct registered_plugin_options **last;
 	struct registered_plugin_options *reg;
@@ -187,11 +187,11 @@ static void parse_option_name(char **option, char **plugin)
 	}
 }
 
-static struct pevent_plugin_option *
+static struct tep_plugin_option *
 find_registered_option(const char *plugin, const char *option)
 {
 	struct registered_plugin_options *reg;
-	struct pevent_plugin_option *op;
+	struct tep_plugin_option *op;
 	const char *op_plugin;
 
 	for (reg = registered_options; reg; reg = reg->next) {
@@ -213,10 +213,10 @@ find_registered_option(const char *plugin, const char *option)
 	return NULL;
 }
 
-static struct pevent_plugin_option *
+static struct tep_plugin_option *
 find_registered_option_parse(const char *name)
 {
-	struct pevent_plugin_option *option;
+	struct tep_plugin_option *option;
 	char *option_str;
 	char *plugin;
 
@@ -243,7 +243,7 @@ find_registered_option_parse(const char *name)
  */
 const char *trace_util_plugin_option_value(const char *name)
 {
-	struct pevent_plugin_option *option;
+	struct tep_plugin_option *option;
 
 	option = find_registered_option_parse(name);
 	if (!option)
@@ -345,7 +345,7 @@ static void print_op_data(struct trace_seq *s, const char *name,
 void trace_util_print_plugin_options(struct trace_seq *s)
 {
 	struct registered_plugin_options *reg;
-	struct pevent_plugin_option *op;
+	struct tep_plugin_option *op;
 
 	for (reg = registered_options; reg; reg = reg->next) {
 		if (reg != registered_options)
@@ -486,7 +486,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;
 	int ret = 1;
@@ -530,7 +530,7 @@ static int update_option_value(struct pevent_plugin_option *op, const char *val)
 
 static int process_option(const char *plugin, const char *option, const char *val)
 {
-	struct pevent_plugin_option *op;
+	struct tep_plugin_option *op;
 
 	op = find_registered_option(plugin, option);
 	if (!op)
@@ -539,7 +539,7 @@ static int process_option(const char *plugin, const char *option, const char *va
 	return update_option_value(op, val);
 }
 
-static int update_option(const char *file, struct pevent_plugin_option *option)
+static int update_option(const char *file, struct tep_plugin_option *option)
 {
 	struct trace_plugin_options *op;
 	char *plugin;
@@ -593,9 +593,9 @@ static int 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;
-	struct pevent_plugin_option *options;
+	struct tep_plugin_option *options;
 	const char *alias;
 	char *plugin;
 	void *handle;
@@ -612,11 +612,11 @@ static int 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;
 
-	options = dlsym(handle, PEVENT_PLUGIN_OPTIONS_NAME);
+	options = dlsym(handle, TEP_PLUGIN_OPTIONS_NAME);
 	if (options) {
 		while (options->name) {
 			ret = update_option(alias, options);
@@ -626,10 +626,10 @@ static int load_plugin(struct tep_handle *pevent, const char *path,
 		}
 	}
 
-	func = dlsym(handle, PEVENT_PLUGIN_LOADER_NAME);
+	func = dlsym(handle, TEP_PLUGIN_LOADER_NAME);
 	if (!func) {
 		warning("cound 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;
 	}
 
@@ -1453,14 +1453,14 @@ void trace_util_free_plugin_files(char **files)
 }
 
 struct plugin_option_read {
-	struct pevent_plugin_option	*options;
+	struct tep_plugin_option	*options;
 };
 
 static int append_option(struct plugin_option_read *options,
-			 struct pevent_plugin_option *option,
+			 struct tep_plugin_option *option,
 			 const char *alias, void *handle)
 {
-	struct pevent_plugin_option *op;
+	struct tep_plugin_option *op;
 
 	while (option->name) {
 		op = malloc(sizeof(*op));
@@ -1480,7 +1480,7 @@ static int read_options(struct tep_handle *pevent, const char *path,
 			 const char *file, void *data)
 {
 	struct plugin_option_read *options = data;
-	struct pevent_plugin_option *option;
+	struct tep_plugin_option *option;
 	const char *alias;
 	int unload = 0;
 	char *plugin;
@@ -1498,11 +1498,11 @@ static int read_options(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;
 
-	option = dlsym(handle, PEVENT_PLUGIN_OPTIONS_NAME);
+	option = dlsym(handle, TEP_PLUGIN_OPTIONS_NAME);
 	if (!option) {
 		unload = 1;
 		goto out_unload;
@@ -1518,7 +1518,7 @@ static int read_options(struct tep_handle *pevent, const char *path,
 	return 0;
 }
 
-struct pevent_plugin_option *trace_util_read_plugin_options(void)
+struct tep_plugin_option *trace_util_read_plugin_options(void)
 {
 	struct plugin_option_read option = {
 		.options = NULL,
@@ -1531,9 +1531,9 @@ struct pevent_plugin_option *trace_util_read_plugin_options(void)
 	return option.options;
 }
 
-void trace_util_free_options(struct pevent_plugin_option *options)
+void trace_util_free_options(struct tep_plugin_option *options)
 {
-	struct pevent_plugin_option *op;
+	struct tep_plugin_option *op;
 	void *last_handle = NULL;
 
 	while (options) {
@@ -1560,13 +1560,13 @@ struct plugin_list *tracecmd_load_plugins(struct tep_handle *pevent)
 void
 tracecmd_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);
diff --git a/lib/traceevent/event-parse.c b/lib/traceevent/event-parse.c
index 9088b99..f00a02b 100644
--- a/lib/traceevent/event-parse.c
+++ b/lib/traceevent/event-parse.c
@@ -74,7 +74,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;
 };
 
@@ -6619,7 +6619,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;
@@ -6668,7 +6668,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;
@@ -6703,7 +6703,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;
diff --git a/lib/traceevent/event-plugin.c b/lib/traceevent/event-plugin.c
index b2ef017..ccda700 100644
--- a/lib/traceevent/event-plugin.c
+++ b/lib/traceevent/event-plugin.c
@@ -20,7 +20,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 {
@@ -44,7 +44,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;
 
@@ -97,7 +97,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;
@@ -149,7 +149,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;
@@ -208,7 +208,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;
 
@@ -230,7 +230,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;
@@ -271,7 +271,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;
@@ -291,14 +291,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;
 	}
 
@@ -428,13 +428,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);
diff --git a/plugins/plugin_cfg80211.c b/plugins/plugin_cfg80211.c
index 959d94f..c189bbc 100644
--- a/plugins/plugin_cfg80211.c
+++ b/plugins/plugin_cfg80211.c
@@ -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");
diff --git a/plugins/plugin_function.c b/plugins/plugin_function.c
index 058144e..5434a5f 100644
--- a/plugins/plugin_function.c
+++ b/plugins/plugin_function.c
@@ -18,7 +18,7 @@ static int cpus = -1;
 
 #define STK_BLK 10
 
-struct pevent_plugin_option plugin_options[] =
+struct tep_plugin_option plugin_options[] =
 {
 	{
 		.name = "parent",
@@ -45,9 +45,9 @@ 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 pevent_plugin_option *ftrace_offset = &plugin_options[2];
+static struct tep_plugin_option *ftrace_parent = &plugin_options[0];
+static struct tep_plugin_option *ftrace_indent = &plugin_options[1];
+static struct tep_plugin_option *ftrace_offset = &plugin_options[2];
 
 static void add_child(struct func_stack *stack, const char *child, int pos)
 {
@@ -168,7 +168,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);
@@ -178,7 +178,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;
 
diff --git a/plugins/plugin_hrtimer.c b/plugins/plugin_hrtimer.c
index 176788c..fd067e0 100644
--- a/plugins/plugin_hrtimer.c
+++ b/plugins/plugin_hrtimer.c
@@ -46,7 +46,7 @@ static int timer_start_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, "timer", "hrtimer_expire_entry",
 				      timer_expire_handler, NULL);
@@ -57,7 +57,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",
diff --git a/plugins/plugin_jbd2.c b/plugins/plugin_jbd2.c
index a29a0af..c942229 100644
--- a/plugins/plugin_jbd2.c
+++ b/plugins/plugin_jbd2.c
@@ -34,7 +34,7 @@ process_jiffies_to_msecs(struct trace_seq *s,
 	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,
@@ -52,7 +52,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");
diff --git a/plugins/plugin_kmem.c b/plugins/plugin_kmem.c
index c913cc7..d4478f5 100644
--- a/plugins/plugin_kmem.c
+++ b/plugins/plugin_kmem.c
@@ -33,7 +33,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);
@@ -56,7 +56,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);
diff --git a/plugins/plugin_kvm.c b/plugins/plugin_kvm.c
index f5024db..686ba6a 100644
--- a/plugins/plugin_kvm.c
+++ b/plugins/plugin_kvm.c
@@ -438,7 +438,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();
 
@@ -479,7 +479,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);
diff --git a/plugins/plugin_mac80211.c b/plugins/plugin_mac80211.c
index b98803b..a830b25 100644
--- a/plugins/plugin_mac80211.c
+++ b/plugins/plugin_mac80211.c
@@ -176,7 +176,7 @@ static int drv_config(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, "mac80211", "drv_bss_info_changed",
 				      drv_bss_info_changed, NULL);
diff --git a/plugins/plugin_sched_switch.c b/plugins/plugin_sched_switch.c
index 6c6e9f5..26fa5c8 100644
--- a/plugins/plugin_sched_switch.c
+++ b/plugins/plugin_sched_switch.c
@@ -117,7 +117,7 @@ static int sched_switch_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, "sched", "sched_switch",
 				      sched_switch_handler, NULL);
@@ -131,7 +131,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);
diff --git a/plugins/plugin_scsi.c b/plugins/plugin_scsi.c
index e430a49..bb9aea6 100644
--- a/plugins/plugin_scsi.c
+++ b/plugins/plugin_scsi.c
@@ -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");
diff --git a/plugins/plugin_xen.c b/plugins/plugin_xen.c
index 11dbddd..1973dd8 100644
--- a/plugins/plugin_xen.c
+++ b/plugins/plugin_xen.c
@@ -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");
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH v3 04/24] tools lib traceevent, perf tools: Rename pevent alloc / free APIs
  2018-08-27  8:17 [PATCH v3 00/24] trace-cmd: rename variables, data structures and functions in lib/traceevent Tzvetomir Stoyanov (VMware)
  2018-08-27  8:17 ` [PATCH v3 02/24] tools lib traceevent, perf tools: Rename 'struct pevent_record' to 'struct tep_record' Tzvetomir Stoyanov (VMware)
  2018-08-27  8:17 ` [PATCH v3 03/24] tools lib traceevent, perf tools: Rename pevent plugin related APIs Tzvetomir Stoyanov (VMware)
@ 2018-08-27  8:17 ` Tzvetomir Stoyanov (VMware)
  2018-08-27  8:17 ` [PATCH v3 05/24] tools lib traceevent, perf tools: Rename pevent find APIs Tzvetomir Stoyanov (VMware)
                   ` (19 subsequent siblings)
  22 siblings, 0 replies; 30+ messages in thread
From: Tzvetomir Stoyanov (VMware) @ 2018-08-27  8:17 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel

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

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/20180808180700.152609945@goodmis.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 include/traceevent/event-parse.h | 12 ++++++------
 kernel-shark-qt/src/libkshark.c  |  2 +-
 kernel-shark/trace-capture.c     |  2 +-
 kernel-shark/trace-plot-cpu.c    |  2 +-
 kernel-shark/trace-plot-task.c   |  2 +-
 kernel-shark/trace-view-store.c  |  2 +-
 lib/trace-cmd/trace-input.c      |  4 ++--
 lib/trace-cmd/trace-util.c       |  4 ++--
 lib/traceevent/event-parse.c     | 24 ++++++++++++------------
 tracecmd/trace-check-events.c    |  4 ++--
 tracecmd/trace-list.c            |  8 ++++----
 tracecmd/trace-record.c          |  4 ++--
 12 files changed, 35 insertions(+), 35 deletions(-)

diff --git a/include/traceevent/event-parse.h b/include/traceevent/event-parse.h
index ada1efa..a4a2bc9 100644
--- a/include/traceevent/event-parse.h
+++ b/include/traceevent/event-parse.h
@@ -440,8 +440,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;
@@ -604,7 +604,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);
@@ -710,7 +710,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);
@@ -779,8 +779,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);
 
diff --git a/kernel-shark-qt/src/libkshark.c b/kernel-shark-qt/src/libkshark.c
index 230ba77..bb23afe 100644
--- a/kernel-shark-qt/src/libkshark.c
+++ b/kernel-shark-qt/src/libkshark.c
@@ -855,7 +855,7 @@ static const char *kshark_get_info(struct tep_handle *pe,
 		return NULL;
 
 	trace_seq_reset(&seq);
-	pevent_event_info(&seq, event, record);
+	tep_event_info(&seq, event, record);
 
 	/*
 	 * The event info string contains a trailing newline.
diff --git a/kernel-shark/trace-capture.c b/kernel-shark/trace-capture.c
index 19df28a..d80a5c2 100644
--- a/kernel-shark/trace-capture.c
+++ b/kernel-shark/trace-capture.c
@@ -1561,7 +1561,7 @@ static void tracing_dialog(struct shark_info *info, const char *tracing)
 	gtk_widget_destroy(dialog);
 
 	if (pevent)
-		pevent_free(pevent);
+		tep_free(pevent);
 
 	if (plugins)
 		tracecmd_free_list(plugins);
diff --git a/kernel-shark/trace-plot-cpu.c b/kernel-shark/trace-plot-cpu.c
index dc161a4..39b96f7 100644
--- a/kernel-shark/trace-plot-cpu.c
+++ b/kernel-shark/trace-plot-cpu.c
@@ -406,7 +406,7 @@ int cpu_plot_display_info(struct graph_info *ginfo,
 			trace_seq_putc(s, '\n');
 			pevent_data_lat_fmt(pevent, s, record);
 			trace_seq_putc(s, '\n');
-			pevent_event_info(s, event, record);
+			tep_event_info(s, event, record);
 			trace_seq_putc(s, '\n');
 		} else
 			trace_seq_printf(s, "UNKNOW EVENT %d\n", type);
diff --git a/kernel-shark/trace-plot-task.c b/kernel-shark/trace-plot-task.c
index 4dedd8a..11930ed 100644
--- a/kernel-shark/trace-plot-task.c
+++ b/kernel-shark/trace-plot-task.c
@@ -766,7 +766,7 @@ int task_plot_display_info(struct graph_info *ginfo,
 			trace_seq_putc(s, '\n');
 			pevent_data_lat_fmt(pevent, s, record);
 			trace_seq_putc(s, '\n');
-			pevent_event_info(s, event, record);
+			tep_event_info(s, event, record);
 			trace_seq_putc(s, '\n');
 		} else
 			trace_seq_printf(s, "UNKNOW EVENT %d\n", type);
diff --git a/kernel-shark/trace-view-store.c b/kernel-shark/trace-view-store.c
index 2e2a125..3f0bbf1 100644
--- a/kernel-shark/trace-view-store.c
+++ b/kernel-shark/trace-view-store.c
@@ -499,7 +499,7 @@ trace_view_store_get_value (GtkTreeModel *tree_model,
 			}
 
 			trace_seq_init(&s);
-			pevent_event_info(&s, event, data);
+			tep_event_info(&s, event, data);
 			g_value_set_string(value, s.buffer);
 			trace_seq_destroy(&s);
 			break;
diff --git a/lib/trace-cmd/trace-input.c b/lib/trace-cmd/trace-input.c
index 7354bbf..ad6fc90 100644
--- a/lib/trace-cmd/trace-input.c
+++ b/lib/trace-cmd/trace-input.c
@@ -2635,7 +2635,7 @@ struct tracecmd_input *tracecmd_alloc_fd(int fd)
 	if (do_read_check(handle, buf, 1))
 		goto failed_read;
 
-	handle->pevent = pevent_alloc();
+	handle->pevent = tep_alloc();
 	if (!handle->pevent)
 		goto failed_read;
 
@@ -2804,7 +2804,7 @@ void tracecmd_close(struct tracecmd_input *handle)
 	else {
 		/* Only main handle frees plugins and pevent */
 		tracecmd_unload_plugins(handle->plugin_list, handle->pevent);
-		pevent_free(handle->pevent);
+		tep_free(handle->pevent);
 	}
 	free(handle);
 }
diff --git a/lib/trace-cmd/trace-util.c b/lib/trace-cmd/trace-util.c
index 4a66457..2058dc3 100644
--- a/lib/trace-cmd/trace-util.c
+++ b/lib/trace-cmd/trace-util.c
@@ -1130,12 +1130,12 @@ struct tep_handle *tracecmd_local_events(const char *tracing_dir)
 {
 	struct tep_handle *pevent = NULL;
 
-	pevent = pevent_alloc();
+	pevent = tep_alloc();
 	if (!pevent)
 		return NULL;
 
 	if (tracecmd_fill_local_events(tracing_dir, pevent)) {
-		pevent_free(pevent);
+		tep_free(pevent);
 		pevent = NULL;
 	}
 
diff --git a/lib/traceevent/event-parse.c b/lib/traceevent/event-parse.c
index f00a02b..f67af97 100644
--- a/lib/traceevent/event-parse.c
+++ b/lib/traceevent/event-parse.c
@@ -424,9 +424,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;
 };
 
 /**
@@ -440,7 +440,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));
 
@@ -5385,8 +5385,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;
 
@@ -5542,7 +5542,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,
@@ -6740,9 +6740,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));
 
@@ -6797,10 +6797,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;
@@ -6887,5 +6887,5 @@ void pevent_free(struct tep_handle *pevent)
 
 void pevent_unref(struct tep_handle *pevent)
 {
-	pevent_free(pevent);
+	tep_free(pevent);
 }
diff --git a/tracecmd/trace-check-events.c b/tracecmd/trace-check-events.c
index a8e7711..63c9918 100644
--- a/tracecmd/trace-check-events.c
+++ b/tracecmd/trace-check-events.c
@@ -38,7 +38,7 @@ void trace_check_events(int argc, char **argv)
 		exit(EINVAL);
 	}
 
-	pevent = pevent_alloc();
+	pevent = tep_alloc();
 	if (!pevent)
 		exit(EINVAL);
 	list = tracecmd_load_plugins(pevent);
@@ -46,7 +46,7 @@ void trace_check_events(int argc, char **argv)
 	if (ret || pevent->parsing_failures)
 		ret = EINVAL;
 	tracecmd_unload_plugins(list, pevent);
-	pevent_free(pevent);
+	tep_free(pevent);
 
 	return;
 }
diff --git a/tracecmd/trace-list.c b/tracecmd/trace-list.c
index 1368dae..1eae38b 100644
--- a/tracecmd/trace-list.c
+++ b/tracecmd/trace-list.c
@@ -313,7 +313,7 @@ static void show_plugin_options(void)
 
 	tracecmd_ftrace_load_options();
 
-	pevent = pevent_alloc();
+	pevent = tep_alloc();
 	if (!pevent)
 		die("Can not allocate pevent\n");
 
@@ -323,7 +323,7 @@ static void show_plugin_options(void)
 	trace_util_print_plugin_options(&s);
 	trace_seq_do_printf(&s);
 	tracecmd_unload_plugins(list, pevent);
-	pevent_free(pevent);
+	tep_free(pevent);
 }
 
 
@@ -339,7 +339,7 @@ static void show_plugins(void)
 	struct plugin_list *list;
 	struct trace_seq s;
 
-	pevent = pevent_alloc();
+	pevent = tep_alloc();
 	if (!pevent)
 		die("Can not allocate pevent\n");
 
@@ -349,7 +349,7 @@ static void show_plugins(void)
 	trace_util_print_plugins(&s, "  ", "\n", list);
 	trace_seq_do_printf(&s);
 	tracecmd_unload_plugins(list, pevent);
-	pevent_free(pevent);
+	tep_free(pevent);
 }
 
 
diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c
index 45e5feb..8fb923e 100644
--- a/tracecmd/trace-record.c
+++ b/tracecmd/trace-record.c
@@ -3497,7 +3497,7 @@ static char *get_date_to_ts(void)
 	int i;
 
 	/* Set up a pevent to read the raw format */
-	pevent = pevent_alloc();
+	pevent = tep_alloc();
 	if (!pevent) {
 		warning("failed to alloc pevent, --date ignored");
 		return NULL;
@@ -3578,7 +3578,7 @@ static char *get_date_to_ts(void)
 	snprintf(date2ts, 19, "0x%llx", min_stamp - min_ts / 1000);
 
  out_pevent:
-	pevent_free(pevent);
+	tep_free(pevent);
 
 	return date2ts;
 }
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH v3 05/24] tools lib traceevent, perf tools: Rename pevent find APIs
  2018-08-27  8:17 [PATCH v3 00/24] trace-cmd: rename variables, data structures and functions in lib/traceevent Tzvetomir Stoyanov (VMware)
                   ` (2 preceding siblings ...)
  2018-08-27  8:17 ` [PATCH v3 04/24] tools lib traceevent, perf tools: Rename pevent alloc / free APIs Tzvetomir Stoyanov (VMware)
@ 2018-08-27  8:17 ` Tzvetomir Stoyanov (VMware)
  2018-08-27  8:17 ` [PATCH v3 06/24] tools lib traceevent, perf tools: Rename pevent parse APIs Tzvetomir Stoyanov (VMware)
                   ` (18 subsequent siblings)
  22 siblings, 0 replies; 30+ messages in thread
From: Tzvetomir Stoyanov (VMware) @ 2018-08-27  8:17 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel

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

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/20180808180700.316995920@goodmis.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 include/traceevent/event-parse.h |  8 ++--
 kernel-shark/trace-capture.c     |  4 +-
 kernel-shark/trace-filter.c      |  4 +-
 kernel-shark/trace-graph.c       | 18 ++++----
 kernel-shark/trace-view-store.c  |  6 +--
 lib/trace-cmd/trace-blk-hack.c   | 10 ++---
 lib/trace-cmd/trace-ftrace.c     |  2 +-
 lib/traceevent/event-parse.c     | 76 ++++++++++++++++----------------
 lib/traceevent/parse-filter.c    |  4 +-
 plugins/plugin_blk.c             | 16 +++----
 plugins/plugin_kmem.c            |  2 +-
 plugins/plugin_mac80211.c        |  6 +--
 plugins/plugin_sched_switch.c    |  6 +--
 python/ctracecmd.i               |  2 +-
 python/tracecmd.py               |  6 +--
 tracecmd/trace-hist.c            | 40 ++++++++---------
 tracecmd/trace-mem.c             | 38 ++++++++--------
 tracecmd/trace-profile.c         | 24 +++++-----
 tracecmd/trace-read.c            | 12 ++---
 tracecmd/trace-record.c          |  2 +-
 20 files changed, 143 insertions(+), 143 deletions(-)

diff --git a/include/traceevent/event-parse.h b/include/traceevent/event-parse.h
index a4a2bc9..db910b5 100644
--- a/include/traceevent/event-parse.h
+++ b/include/traceevent/event-parse.h
@@ -674,9 +674,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
@@ -685,7 +685,7 @@ unsigned long long pevent_read_number(struct tep_handle *pevent, const void *ptr
 int 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);
diff --git a/kernel-shark/trace-capture.c b/kernel-shark/trace-capture.c
index d80a5c2..27cea40 100644
--- a/kernel-shark/trace-capture.c
+++ b/kernel-shark/trace-capture.c
@@ -385,7 +385,7 @@ static int add_trace_cmd_words(struct trace_capture *cap, char **args)
 
 		if (events) {
 			for (i = 0; events[i] >= 0; i++) {
-				event = pevent_find_event(cap->pevent, events[i]);
+				event = tep_find_event(cap->pevent, events[i]);
 				if (!event)
 					continue;
 				args[words++] = strdup("-e");
@@ -1012,7 +1012,7 @@ static void save_events(struct trace_capture *cap,
 
 	tracecmd_xml_start_sub_system(handle, "Events");
 	for (i = 0; events[i] > 0; i++) {
-		event = pevent_find_event(pevent, events[i]);
+		event = tep_find_event(pevent, events[i]);
 		if (event) {
 			tracecmd_xml_start_sub_system(handle, "Event");
 			tracecmd_xml_write_element(handle, "System", "%s", event->system);
diff --git a/kernel-shark/trace-filter.c b/kernel-shark/trace-filter.c
index 6202802..7216702 100644
--- a/kernel-shark/trace-filter.c
+++ b/kernel-shark/trace-filter.c
@@ -2004,7 +2004,7 @@ void trace_filter_convert_char_to_filter(struct event_filter *filter,
 
 	if (events) {
 		for (i = 0; events[i] >= 0; i++) {
-			event = pevent_find_event(filter->pevent, events[i]);
+			event = tep_find_event(filter->pevent, events[i]);
 			if (event)
 				pevent_filter_add_filter_str(filter,
 							     event->name);
@@ -2036,7 +2036,7 @@ int trace_filter_save_events(struct tracecmd_xml_handle *handle,
 		if (!str)
 			continue;
 
-		event = pevent_find_event(filter->pevent, event_ids[i]);
+		event = tep_find_event(filter->pevent, event_ids[i]);
 		if (event) {
 
 			/* skip not filtered items */
diff --git a/kernel-shark/trace-graph.c b/kernel-shark/trace-graph.c
index 2c6d00b..0bf0dba 100644
--- a/kernel-shark/trace-graph.c
+++ b/kernel-shark/trace-graph.c
@@ -1021,8 +1021,8 @@ int trace_graph_check_sched_wakeup(struct graph_info *ginfo,
 		if (event) {
 			found = TRUE;
 			ginfo->event_wakeup_id = event->id;
-			ginfo->wakeup_pid_field = pevent_find_field(event, "pid");
-			ginfo->wakeup_success_field = pevent_find_field(event, "success");
+			ginfo->wakeup_pid_field = tep_find_field(event, "pid");
+			ginfo->wakeup_success_field = tep_find_field(event, "success");
 		}
 
 
@@ -1031,8 +1031,8 @@ int trace_graph_check_sched_wakeup(struct graph_info *ginfo,
 		if (event) {
 			found = TRUE;
 			ginfo->event_wakeup_new_id = event->id;
-			ginfo->wakeup_new_pid_field = pevent_find_field(event, "pid");
-			ginfo->wakeup_new_success_field = pevent_find_field(event, "success");
+			ginfo->wakeup_new_pid_field = tep_find_field(event, "pid");
+			ginfo->wakeup_new_success_field = tep_find_field(event, "success");
 		}
 		if (!found)
 			return 0;
@@ -1092,16 +1092,16 @@ int trace_graph_check_sched_switch(struct graph_info *ginfo,
 			return 0;
 
 		ginfo->event_sched_switch_id = event->id;
-		ginfo->event_prev_state = pevent_find_field(event, "prev_state");
-		ginfo->event_pid_field = pevent_find_field(event, "next_pid");
-		ginfo->event_comm_field = pevent_find_field(event, "next_comm");
+		ginfo->event_prev_state = tep_find_field(event, "prev_state");
+		ginfo->event_pid_field = tep_find_field(event, "next_pid");
+		ginfo->event_comm_field = tep_find_field(event, "next_comm");
 
 		event = pevent_find_event_by_name(ginfo->pevent,
 						  "ftrace", "context_switch");
 		if (event) {
 			ginfo->ftrace_sched_switch_id = event->id;
-			ginfo->ftrace_pid_field = pevent_find_field(event, "next_pid");
-			ginfo->ftrace_comm_field = pevent_find_field(event, "next_comm");
+			ginfo->ftrace_pid_field = tep_find_field(event, "next_pid");
+			ginfo->ftrace_comm_field = tep_find_field(event, "next_comm");
 		}
 	}
 
diff --git a/kernel-shark/trace-view-store.c b/kernel-shark/trace-view-store.c
index 3f0bbf1..c6ddad8 100644
--- a/kernel-shark/trace-view-store.c
+++ b/kernel-shark/trace-view-store.c
@@ -1230,20 +1230,20 @@ static void update_filter_tasks(TraceViewStore *store)
 			pevent_find_event_by_name(pevent, "sched", "sched_switch");
 		if (store->sched_switch_event)
 			store->sched_switch_next_field =
-				pevent_find_any_field(store->sched_switch_event,
+				tep_find_any_field(store->sched_switch_event,
 						      "next_pid");
 		store->sched_wakeup_event =
 			pevent_find_event_by_name(pevent, "sched", "sched_wakeup");
 		if (store->sched_wakeup_event)
 			store->sched_wakeup_pid_field =
-				pevent_find_any_field(store->sched_wakeup_event,
+				tep_find_any_field(store->sched_wakeup_event,
 						      "pid");
 
 		store->sched_wakeup_new_event =
 			pevent_find_event_by_name(pevent, "sched", "sched_wakeup_new");
 		if (store->sched_wakeup_new_event)
 			store->sched_wakeup_new_pid_field =
-				pevent_find_any_field(store->sched_wakeup_new_event,
+				tep_find_any_field(store->sched_wakeup_new_event,
 						      "pid");
 	}
 
diff --git a/lib/trace-cmd/trace-blk-hack.c b/lib/trace-cmd/trace-blk-hack.c
index b964bc4..9dec648 100644
--- a/lib/trace-cmd/trace-blk-hack.c
+++ b/lib/trace-cmd/trace-blk-hack.c
@@ -111,23 +111,23 @@ int tracecmd_blk_hack(struct tracecmd_input *handle)
 	 */
 
 	/* Make sure the common fields exist */
-	field = pevent_find_common_field(event, "common_type");
+	field = tep_find_common_field(event, "common_type");
 	if (!field || field->offset != 0 || field->size != 2)
 		goto fail;
-	field = pevent_find_common_field(event, "common_flags");
+	field = tep_find_common_field(event, "common_flags");
 	if (!field || field->offset != 2 || field->size != 1)
 		goto fail;
-	field = pevent_find_common_field(event, "common_preempt_count");
+	field = tep_find_common_field(event, "common_preempt_count");
 	if (!field || field->offset != 3 || field->size != 1)
 		goto fail;
-	field = pevent_find_common_field(event, "common_pid");
+	field = tep_find_common_field(event, "common_pid");
 	if (!field || field->offset != 4 || field->size != 4)
 		goto fail;
 	r = sprintf(buf, blk_event_start, id);
 	l = r;
 
 	/* lock depth is optional */
-	field = pevent_find_common_field(event, "common_lock_depth");
+	field = tep_find_common_field(event, "common_lock_depth");
 	if (field) {
 		if (field->offset != 8 || field->size != 4)
 			return -1;
diff --git a/lib/trace-cmd/trace-ftrace.c b/lib/trace-cmd/trace-ftrace.c
index 8c706f3..76f8f56 100644
--- a/lib/trace-cmd/trace-ftrace.c
+++ b/lib/trace-cmd/trace-ftrace.c
@@ -371,7 +371,7 @@ trace_stack_handler(struct trace_seq *s, struct tep_record *record,
 	const char *func;
 	void *data = record->data;
 
-	field = pevent_find_any_field(event, "caller");
+	field = tep_find_any_field(event, "caller");
 	if (!field) {
 		trace_seq_printf(s, "<CANT FIND FIELD %s>", "caller");
 		return 0;
diff --git a/lib/traceevent/event-parse.c b/lib/traceevent/event-parse.c
index f67af97..9142f28 100644
--- a/lib/traceevent/event-parse.c
+++ b/lib/traceevent/event-parse.c
@@ -2087,11 +2087,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;
 	}
@@ -2700,7 +2700,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;
 
@@ -2757,7 +2757,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;
 
@@ -3251,7 +3251,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
  *
@@ -3259,7 +3259,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;
 
@@ -3273,7 +3273,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
  *
@@ -3281,7 +3281,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;
 
@@ -3295,7 +3295,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
  *
@@ -3304,14 +3304,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);
 }
 
 /**
@@ -3386,7 +3386,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;
 
@@ -3454,13 +3454,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;
@@ -3539,7 +3539,7 @@ eval_num_arg(void *data, int size, struct event_format *event, struct print_arg
 		return 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;
 			
@@ -3605,7 +3605,7 @@ eval_num_arg(void *data, int size, struct event_format *event, struct print_arg
 			case 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;
@@ -3885,7 +3885,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;
@@ -3986,7 +3986,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;
@@ -4017,7 +4017,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;
@@ -4057,7 +4057,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);
@@ -4075,7 +4075,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);
@@ -4225,12 +4225,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;
@@ -4399,7 +4399,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;
@@ -4443,7 +4443,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);
@@ -4593,7 +4593,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);
@@ -4639,7 +4639,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);
@@ -4697,7 +4697,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);
@@ -5229,7 +5229,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);
 }
 
 /**
@@ -5438,7 +5438,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);
 }
 
 /**
@@ -6274,7 +6274,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)
@@ -6318,7 +6318,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);
 }
@@ -6343,7 +6343,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);
 }
@@ -6368,7 +6368,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);
 }
@@ -6388,7 +6388,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)
@@ -6420,7 +6420,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;
@@ -6585,7 +6585,7 @@ static struct event_format *pevent_search_event(struct tep_handle *pevent, int i
 
 	if (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))
diff --git a/lib/traceevent/parse-filter.c b/lib/traceevent/parse-filter.c
index 5ca0803..68d8d0e 100644
--- a/lib/traceevent/parse-filter.c
+++ b/lib/traceevent/parse-filter.c
@@ -153,7 +153,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++;
@@ -368,7 +368,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) {
diff --git a/plugins/plugin_blk.c b/plugins/plugin_blk.c
index 6cb6151..81cce73 100644
--- a/plugins/plugin_blk.c
+++ b/plugins/plugin_blk.c
@@ -288,53 +288,53 @@ static int blktrace_handler(struct trace_seq *s, struct tep_record *record,
 	unsigned short what;
 	int long_act = 0;
 
-	field = pevent_find_field(event, "action");
+	field = tep_find_field(event, "action");
 	if (!field)
 		return 1;
 	if (pevent_read_number_field(field, data, &val))
 		return 1;
 	blk_data.action = val;
 
-	field = pevent_find_field(event, "bytes");
+	field = tep_find_field(event, "bytes");
 	if (!field)
 		return 1;
 	if (pevent_read_number_field(field, data, &val))
 		return 1;
 	blk_data.bytes = val;
 
-	field = pevent_find_field(event, "device");
+	field = tep_find_field(event, "device");
 	if (!field)
 		return 1;
 	if (pevent_read_number_field(field, data, &val))
 		return 1;
 	blk_data.device = val;
 
-	field = pevent_find_field(event, "pdu_len");
+	field = tep_find_field(event, "pdu_len");
 	if (!field)
 		return 1;
 	if (pevent_read_number_field(field, data, &val))
 		return 1;
 	blk_data.pdu_len = val;
 
-	field = pevent_find_field(event, "data");
+	field = tep_find_field(event, "data");
 	if (!field)
 		return 1;
 	blk_data.pdu_data = data + field->offset;
 
-	field = pevent_find_field(event, "sector");
+	field = tep_find_field(event, "sector");
 	if (!field)
 		return 1;
 	if (pevent_read_number_field(field, data, &blk_data.sector))
 		return 1;
 
-	field = pevent_find_field(event, "pid");
+	field = tep_find_field(event, "pid");
 	if (!field)
 		return 1;
 	if (pevent_read_number_field(field, data, &val))
 		return 1;
 	blk_data.pid = val;
 
-	field = pevent_find_field(event, "error");
+	field = tep_find_field(event, "error");
 	if (!field)
 		return 1;
 	if (pevent_read_number_field(field, data, &val))
diff --git a/plugins/plugin_kmem.c b/plugins/plugin_kmem.c
index d4478f5..5691b71 100644
--- a/plugins/plugin_kmem.c
+++ b/plugins/plugin_kmem.c
@@ -16,7 +16,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;
 
diff --git a/plugins/plugin_mac80211.c b/plugins/plugin_mac80211.c
index a830b25..ba81e29 100644
--- a/plugins/plugin_mac80211.c
+++ b/plugins/plugin_mac80211.c
@@ -13,7 +13,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;
 
@@ -47,7 +47,7 @@ static void _print_enum(struct trace_seq *s, struct event_format *event,
 			const char *name, const void *data,
 			const struct value_name *names, int n_names)
 {
-	struct format_field *f = pevent_find_field(event, name);
+	struct format_field *f = tep_find_field(event, name);
 	unsigned long long val;
 	int i;
 
@@ -80,7 +80,7 @@ static void _print_flag(struct trace_seq *s, struct event_format *event,
 			const char *name, const void *data,
 			const struct value_name *names, int n_names)
 {
-	struct format_field *f = pevent_find_field(event, name);
+	struct format_field *f = tep_find_field(event, name);
 	unsigned long long val;
 	int i, j, found, first = 1;
 
diff --git a/plugins/plugin_sched_switch.c b/plugins/plugin_sched_switch.c
index 26fa5c8..fa3add1 100644
--- a/plugins/plugin_sched_switch.c
+++ b/plugins/plugin_sched_switch.c
@@ -58,7 +58,7 @@ static int sched_wakeup_handler(struct trace_seq *s, struct tep_record *record,
 	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, ':');
@@ -86,7 +86,7 @@ static int sched_switch_handler(struct trace_seq *s, struct tep_record *record,
 	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, ':');
@@ -104,7 +104,7 @@ static int sched_switch_handler(struct trace_seq *s, struct tep_record *record,
 	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, ':');
diff --git a/python/ctracecmd.i b/python/ctracecmd.i
index eb6dbd6..df757af 100644
--- a/python/ctracecmd.i
+++ b/python/ctracecmd.i
@@ -91,7 +91,7 @@ static PyObject *py_field_get_stack(struct tep_handle *pevent,
 	const char *func = NULL;
 	unsigned long addr;
 
-	field = pevent_find_any_field(event, "caller");
+	field = tep_find_any_field(event, "caller");
 	if (!field) {
 		PyErr_SetString(PyExc_TypeError,
 				"Event doesn't have caller field");
diff --git a/python/tracecmd.py b/python/tracecmd.py
index 358185b..7da113e 100644
--- a/python/tracecmd.py
+++ b/python/tracecmd.py
@@ -70,7 +70,7 @@ class Event(object, DictMixin):
         free_record(self._record)
 
     def __getitem__(self, n):
-        f = pevent_find_field(self._format, n)
+        f = tep_find_field(self._format, n)
         if f is None:
             raise KeyError("no field '%s'" % n)
         return Field(self._record, f)
@@ -103,7 +103,7 @@ class Event(object, DictMixin):
         return pevent_data_type(self._pevent, self._record)
 
     def num_field(self, name):
-        f = pevent_find_any_field(self._format, name)
+        f = tep_find_any_field(self._format, name)
         if f is None:
             return None
         ret, val = pevent_read_number_field(f, pevent_record_data_get(self._record))
@@ -112,7 +112,7 @@ class Event(object, DictMixin):
         return val
 
     def str_field(self, name):
-        f = pevent_find_any_field(self._format, name)
+        f = tep_find_any_field(self._format, name)
         if f is None:
             return None
         return py_field_get_str(f, self._record)
diff --git a/tracecmd/trace-hist.c b/tracecmd/trace-hist.c
index b8ff77d..d2adda9 100644
--- a/tracecmd/trace-hist.c
+++ b/tracecmd/trace-hist.c
@@ -615,8 +615,8 @@ static void update_sched_wakeup(struct tep_handle *pevent)
 	if (!event)
 		return;
 
-	sched_wakeup_comm_field = pevent_find_field(event, "comm");
-	sched_wakeup_pid_field = pevent_find_field(event, "pid");
+	sched_wakeup_comm_field = tep_find_field(event, "comm");
+	sched_wakeup_pid_field = tep_find_field(event, "pid");
 }
 
 static void update_sched_wakeup_new(struct tep_handle *pevent)
@@ -627,8 +627,8 @@ static void update_sched_wakeup_new(struct tep_handle *pevent)
 	if (!event)
 		return;
 
-	sched_wakeup_new_comm_field = pevent_find_field(event, "comm");
-	sched_wakeup_new_pid_field = pevent_find_field(event, "pid");
+	sched_wakeup_new_comm_field = tep_find_field(event, "comm");
+	sched_wakeup_new_pid_field = tep_find_field(event, "pid");
 }
 
 static void update_sched_switch(struct tep_handle *pevent)
@@ -639,10 +639,10 @@ static void update_sched_switch(struct tep_handle *pevent)
 	if (!event)
 		return;
 
-	sched_switch_prev_field = pevent_find_field(event, "prev_comm");
-	sched_switch_next_field = pevent_find_field(event, "next_comm");
-	sched_switch_prev_pid_field = pevent_find_field(event, "prev_pid");
-	sched_switch_next_pid_field = pevent_find_field(event, "next_pid");
+	sched_switch_prev_field = tep_find_field(event, "prev_comm");
+	sched_switch_next_field = tep_find_field(event, "next_comm");
+	sched_switch_prev_pid_field = tep_find_field(event, "prev_pid");
+	sched_switch_next_pid_field = tep_find_field(event, "next_pid");
 }
 
 static void update_function(struct tep_handle *pevent)
@@ -653,8 +653,8 @@ static void update_function(struct tep_handle *pevent)
 	if (!event)
 		return;
 
-	function_ip_field = pevent_find_field(event, "ip");
-	function_parent_ip_field = pevent_find_field(event, "parent_ip");
+	function_ip_field = tep_find_field(event, "ip");
+	function_parent_ip_field = tep_find_field(event, "parent_ip");
 }
 
 static void update_function_graph_entry(struct tep_handle *pevent)
@@ -665,8 +665,8 @@ static void update_function_graph_entry(struct tep_handle *pevent)
 	if (!event)
 		return;
 
-	function_graph_entry_func_field = pevent_find_field(event, "func");
-	function_graph_entry_depth_field = pevent_find_field(event, "depth");
+	function_graph_entry_func_field = tep_find_field(event, "func");
+	function_graph_entry_depth_field = tep_find_field(event, "depth");
 }
 
 static void update_function_graph_exit(struct tep_handle *pevent)
@@ -677,11 +677,11 @@ static void update_function_graph_exit(struct tep_handle *pevent)
 	if (!event)
 		return;
 
-	function_graph_exit_func_field = pevent_find_field(event, "func");
-	function_graph_exit_depth_field = pevent_find_field(event, "depth");
-	function_graph_exit_calltime_field = pevent_find_field(event, "calltime");
-	function_graph_exit_rettime_field = pevent_find_field(event, "rettime");
-	function_graph_exit_overrun_field = pevent_find_field(event, "overrun");
+	function_graph_exit_func_field = tep_find_field(event, "func");
+	function_graph_exit_depth_field = tep_find_field(event, "depth");
+	function_graph_exit_calltime_field = tep_find_field(event, "calltime");
+	function_graph_exit_rettime_field = tep_find_field(event, "rettime");
+	function_graph_exit_overrun_field = tep_find_field(event, "overrun");
 }
 
 static void update_kernel_stack(struct tep_handle *pevent)
@@ -692,7 +692,7 @@ static void update_kernel_stack(struct tep_handle *pevent)
 	if (!event)
 		return;
 
-	kernel_stack_caller_field = pevent_find_field(event, "caller");
+	kernel_stack_caller_field = tep_find_field(event, "caller");
 }
 
 enum field { NEXT_PTR, SIB_PTR };
@@ -956,11 +956,11 @@ static void do_trace_hist(struct tracecmd_input *handle)
 
 	long_size = tracecmd_long_size(handle);
 
-	common_type_field = pevent_find_common_field(event, "common_type");
+	common_type_field = tep_find_common_field(event, "common_type");
 	if (!common_type_field)
 		die("Can't find a 'type' field?");
 
-	common_pid_field = pevent_find_common_field(event, "common_pid");
+	common_pid_field = tep_find_common_field(event, "common_pid");
 	if (!common_pid_field)
 		die("Can't find a 'pid' field?");
 
diff --git a/tracecmd/trace-mem.c b/tracecmd/trace-mem.c
index 42953b2..d5a4df2 100644
--- a/tracecmd/trace-mem.c
+++ b/tracecmd/trace-mem.c
@@ -84,10 +84,10 @@ static void update_kmalloc(struct tep_handle *pevent)
 	if (!event)
 		return;
 
-	kmalloc_callsite_field = pevent_find_field(event, "call_site");
-	kmalloc_bytes_req_field = pevent_find_field(event, "bytes_req");
-	kmalloc_bytes_alloc_field = pevent_find_field(event, "bytes_alloc");
-	kmalloc_ptr_field = pevent_find_field(event, "ptr");
+	kmalloc_callsite_field = tep_find_field(event, "call_site");
+	kmalloc_bytes_req_field = tep_find_field(event, "bytes_req");
+	kmalloc_bytes_alloc_field = tep_find_field(event, "bytes_alloc");
+	kmalloc_ptr_field = tep_find_field(event, "ptr");
 }
 
 static void update_kmalloc_node(struct tep_handle *pevent)
@@ -98,10 +98,10 @@ static void update_kmalloc_node(struct tep_handle *pevent)
 	if (!event)
 		return;
 
-	kmalloc_node_callsite_field = pevent_find_field(event, "call_site");
-	kmalloc_node_bytes_req_field = pevent_find_field(event, "bytes_req");
-	kmalloc_node_bytes_alloc_field = pevent_find_field(event, "bytes_alloc");
-	kmalloc_node_ptr_field = pevent_find_field(event, "ptr");
+	kmalloc_node_callsite_field = tep_find_field(event, "call_site");
+	kmalloc_node_bytes_req_field = tep_find_field(event, "bytes_req");
+	kmalloc_node_bytes_alloc_field = tep_find_field(event, "bytes_alloc");
+	kmalloc_node_ptr_field = tep_find_field(event, "ptr");
 }
 
 static void update_kfree(struct tep_handle *pevent)
@@ -112,7 +112,7 @@ static void update_kfree(struct tep_handle *pevent)
 	if (!event)
 		return;
 
-	kfree_ptr_field = pevent_find_field(event, "ptr");
+	kfree_ptr_field = tep_find_field(event, "ptr");
 }
 
 static void update_kmem_cache_alloc(struct tep_handle *pevent)
@@ -123,10 +123,10 @@ static void update_kmem_cache_alloc(struct tep_handle *pevent)
 	if (!event)
 		return;
 
-	kmem_cache_callsite_field = pevent_find_field(event, "call_site");
-	kmem_cache_bytes_req_field = pevent_find_field(event, "bytes_req");
-	kmem_cache_bytes_alloc_field = pevent_find_field(event, "bytes_alloc");
-	kmem_cache_ptr_field = pevent_find_field(event, "ptr");
+	kmem_cache_callsite_field = tep_find_field(event, "call_site");
+	kmem_cache_bytes_req_field = tep_find_field(event, "bytes_req");
+	kmem_cache_bytes_alloc_field = tep_find_field(event, "bytes_alloc");
+	kmem_cache_ptr_field = tep_find_field(event, "ptr");
 }
 
 static void update_kmem_cache_alloc_node(struct tep_handle *pevent)
@@ -138,10 +138,10 @@ static void update_kmem_cache_alloc_node(struct tep_handle *pevent)
 	if (!event)
 		return;
 
-	kmem_cache_node_callsite_field = pevent_find_field(event, "call_site");
-	kmem_cache_node_bytes_req_field = pevent_find_field(event, "bytes_req");
-	kmem_cache_node_bytes_alloc_field = pevent_find_field(event, "bytes_alloc");
-	kmem_cache_node_ptr_field = pevent_find_field(event, "ptr");
+	kmem_cache_node_callsite_field = tep_find_field(event, "call_site");
+	kmem_cache_node_bytes_req_field = tep_find_field(event, "bytes_req");
+	kmem_cache_node_bytes_alloc_field = tep_find_field(event, "bytes_alloc");
+	kmem_cache_node_ptr_field = tep_find_field(event, "ptr");
 }
 
 static void update_kmem_cache_free(struct tep_handle *pevent)
@@ -152,7 +152,7 @@ static void update_kmem_cache_free(struct tep_handle *pevent)
 	if (!event)
 		return;
 
-	kmem_cache_free_ptr_field = pevent_find_field(event, "ptr");
+	kmem_cache_free_ptr_field = tep_find_field(event, "ptr");
 }
 
 struct func_descr {
@@ -490,7 +490,7 @@ static void do_trace_mem(struct tracecmd_input *handle)
 	ret = pevent_data_type(pevent, record);
 	event = pevent_data_event_from_type(pevent, ret);
 
-	common_type_field = pevent_find_common_field(event, "common_type");
+	common_type_field = tep_find_common_field(event, "common_type");
 	if (!common_type_field)
 		die("Can't find a 'type' field?");
 
diff --git a/tracecmd/trace-profile.c b/tracecmd/trace-profile.c
index 964a65f..2df208c 100644
--- a/tracecmd/trace-profile.c
+++ b/tracecmd/trace-profile.c
@@ -803,7 +803,7 @@ add_event(struct handle_data *h, const char *system, const char *event_name,
 		return NULL;
 
 	if (!h->common_pid) {
-		h->common_pid = pevent_find_common_field(event, "common_pid");
+		h->common_pid = tep_find_common_field(event, "common_pid");
 		if (!h->common_pid)
 			die("No 'common_pid' found in event");
 	}
@@ -834,20 +834,20 @@ mate_events(struct handle_data *h, struct event_data *start,
 	end->start = start;
 
 	if (pid_field) {
-		start->pid_field = pevent_find_field(start->event, pid_field);
+		start->pid_field = tep_find_field(start->event, pid_field);
 		if (!start->pid_field)
 			die("Event: %s does not have field %s",
 			    start->event->name, pid_field);
 	}
 
 	/* Field to match with end */
-	start->end_match_field = pevent_find_field(start->event, end_match_field);
+	start->end_match_field = tep_find_field(start->event, end_match_field);
 	if (!start->end_match_field)
 		die("Event: %s does not have field %s",
 		    start->event->name, end_match_field);
 
 	/* Field to match with start */
-	end->start_match_field = pevent_find_field(end->event, start_match_field);
+	end->start_match_field = tep_find_field(end->event, start_match_field);
 	if (!end->start_match_field)
 		die("Event: %s does not have field %s",
 		    end->event->name, start_match_field);
@@ -1372,7 +1372,7 @@ void trace_init_profile(struct tracecmd_input *handle, struct hook_list *hook,
 	if (stacktrace_event) {
 		stacktrace_event->handle_event = handle_stacktrace_event;
 
-		stacktrace_event->data_field = pevent_find_field(stacktrace_event->event,
+		stacktrace_event->data_field = tep_find_field(stacktrace_event->event,
 							    "caller");
 		if (!stacktrace_event->data_field)
 			die("Event: %s does not have field caller",
@@ -1381,25 +1381,25 @@ void trace_init_profile(struct tracecmd_input *handle, struct hook_list *hook,
 
 	if (process_exec) {
 		process_exec->handle_event = handle_process_exec;
-		process_exec->data_field = pevent_find_field(process_exec->event,
+		process_exec->data_field = tep_find_field(process_exec->event,
 							     "old_pid");
 	}
 
 	if (sched_switch) {
 		sched_switch->handle_event = handle_sched_switch_event;
-		sched_switch->data_field = pevent_find_field(sched_switch->event,
+		sched_switch->data_field = tep_find_field(sched_switch->event,
 							     "prev_state");
 		if (!sched_switch->data_field)
 			die("Event: %s does not have field prev_state",
 			    sched_switch->event->name);
 
-		h->switch_prev_comm = pevent_find_field(sched_switch->event,
+		h->switch_prev_comm = tep_find_field(sched_switch->event,
 							"prev_comm");
 		if (!h->switch_prev_comm)
 			die("Event: %s does not have field prev_comm",
 			    sched_switch->event->name);
 
-		h->switch_next_comm = pevent_find_field(sched_switch->event,
+		h->switch_next_comm = tep_find_field(sched_switch->event,
 							"next_comm");
 		if (!h->switch_next_comm)
 			die("Event: %s does not have field next_comm",
@@ -1416,10 +1416,10 @@ void trace_init_profile(struct tracecmd_input *handle, struct hook_list *hook,
 		sched_wakeup->handle_event = handle_sched_wakeup_event;
 
 		/* The 'success' field may or may not be present */
-		sched_wakeup->data_field = pevent_find_field(sched_wakeup->event,
+		sched_wakeup->data_field = tep_find_field(sched_wakeup->event,
 							     "success");
 
-		h->wakeup_comm = pevent_find_field(sched_wakeup->event, "comm");
+		h->wakeup_comm = tep_find_field(sched_wakeup->event, "comm");
 		if (!h->wakeup_comm)
 			die("Event: %s does not have field comm",
 			    sched_wakeup->event->name);
@@ -1466,7 +1466,7 @@ void trace_init_profile(struct tracecmd_input *handle, struct hook_list *hook,
 	event_data = add_event(h, "ftrace", "function", EVENT_TYPE_FUNC);
 	if (event_data) {
 		event_data->data_field =
-			pevent_find_field(event_data->event, "ip");
+			tep_find_field(event_data->event, "ip");
 	}
 
 	/* Add any user defined hooks */
diff --git a/tracecmd/trace-read.c b/tracecmd/trace-read.c
index ac74876..9df3f91 100644
--- a/tracecmd/trace-read.c
+++ b/tracecmd/trace-read.c
@@ -544,20 +544,20 @@ static void init_wakeup(struct tracecmd_input *handle)
 	if (!event)
 		goto fail;
 	wakeup_id = event->id;
-	wakeup_task = pevent_find_field(event, "pid");
+	wakeup_task = tep_find_field(event, "pid");
 	if (!wakeup_task)
 		goto fail;
-	wakeup_success = pevent_find_field(event, "success");
+	wakeup_success = tep_find_field(event, "success");
 
 	event = pevent_find_event_by_name(pevent, "sched", "sched_switch");
 	if (!event)
 		goto fail;
 	sched_id = event->id;
-	sched_task = pevent_find_field(event, "next_pid");
+	sched_task = tep_find_field(event, "next_pid");
 	if (!sched_task)
 		goto fail;
 
-	sched_prio = pevent_find_field(event, "next_prio");
+	sched_prio = tep_find_field(event, "next_prio");
 	if (!sched_prio)
 		goto fail;
 
@@ -568,10 +568,10 @@ static void init_wakeup(struct tracecmd_input *handle)
 	if (!event)
 		goto skip;
 	wakeup_new_id = event->id;
-	wakeup_new_task = pevent_find_field(event, "pid");
+	wakeup_new_task = tep_find_field(event, "pid");
 	if (!wakeup_new_task)
 		goto fail;
-	wakeup_new_success = pevent_find_field(event, "success");
+	wakeup_new_success = tep_find_field(event, "success");
 
  skip:
 	return;
diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c
index 8fb923e..5e57f4a 100644
--- a/tracecmd/trace-record.c
+++ b/tracecmd/trace-record.c
@@ -3366,7 +3366,7 @@ find_ts_in_page(struct tep_handle *pevent, void *page, int size)
 		event = pevent_data_event_from_type(pevent, id);
 		if (event) {
 			/* Make sure this is our event */
-			field = pevent_find_field(event, "buf");
+			field = tep_find_field(event, "buf");
 			/* the trace_marker adds a '\n' */
 			if (field && strcmp(STAMP"\n", record->data + field->offset) == 0)
 				ts = record->ts;
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH v3 06/24] tools lib traceevent, perf tools: Rename pevent parse APIs
  2018-08-27  8:17 [PATCH v3 00/24] trace-cmd: rename variables, data structures and functions in lib/traceevent Tzvetomir Stoyanov (VMware)
                   ` (3 preceding siblings ...)
  2018-08-27  8:17 ` [PATCH v3 05/24] tools lib traceevent, perf tools: Rename pevent find APIs Tzvetomir Stoyanov (VMware)
@ 2018-08-27  8:17 ` Tzvetomir Stoyanov (VMware)
  2018-08-27  8:17 ` [PATCH v3 07/24] tools lib traceevent, perf tools: Rename pevent print APIs Tzvetomir Stoyanov (VMware)
                   ` (17 subsequent siblings)
  22 siblings, 0 replies; 30+ messages in thread
From: Tzvetomir Stoyanov (VMware) @ 2018-08-27  8:17 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel

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

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/20180808180700.469749700@goodmis.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 include/traceevent/event-parse.h | 18 +++++++++---------
 lib/trace-cmd/trace-blk-hack.c   |  2 +-
 lib/trace-cmd/trace-input.c      |  6 +++---
 lib/trace-cmd/trace-util.c       |  4 ++--
 lib/traceevent/event-parse.c     | 22 +++++++++++-----------
 tracecmd/trace-record.c          |  4 ++--
 6 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/include/traceevent/event-parse.h b/include/traceevent/event-parse.h
index db910b5..93b040e 100644
--- a/include/traceevent/event-parse.h
+++ b/include/traceevent/event-parse.h
@@ -627,15 +627,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);
 
diff --git a/lib/trace-cmd/trace-blk-hack.c b/lib/trace-cmd/trace-blk-hack.c
index 9dec648..2883c68 100644
--- a/lib/trace-cmd/trace-blk-hack.c
+++ b/lib/trace-cmd/trace-blk-hack.c
@@ -139,7 +139,7 @@ int tracecmd_blk_hack(struct tracecmd_input *handle)
 
 	/* Parse this event */
 	l += r;
-	pevent_parse_event(pevent, buf, l, "ftrace");
+	tep_parse_event(pevent, buf, l, "ftrace");
 
 	return 0;
 
diff --git a/lib/trace-cmd/trace-input.c b/lib/trace-cmd/trace-input.c
index ad6fc90..ef55177 100644
--- a/lib/trace-cmd/trace-input.c
+++ b/lib/trace-cmd/trace-input.c
@@ -333,7 +333,7 @@ static int read_header_files(struct tracecmd_input *handle)
 	if (do_read_check(handle, header, size))
 		goto failed_read;
 
-	pevent_parse_header_page(pevent, header, size, handle->long_size);
+	tep_parse_header_page(pevent, header, size, handle->long_size);
 	free(header);
 
 	/*
@@ -421,7 +421,7 @@ static int read_ftrace_file(struct tracecmd_input *handle,
 		if (print || regex_event_buf(buf, size, epreg))
 			printf("%.*s\n", (int)size, buf);
 	} else {
-		if (pevent_parse_event(pevent, buf, size, "ftrace"))
+		if (tep_parse_event(pevent, buf, size, "ftrace"))
 			pevent->parsing_failures = 1;
 	}
 	free(buf);
@@ -455,7 +455,7 @@ static int read_event_file(struct tracecmd_input *handle,
 			printf("%.*s\n", (int)size, buf);
 		}
 	} else {
-		if (pevent_parse_event(pevent, buf, size, system))
+		if (tep_parse_event(pevent, buf, size, system))
 			pevent->parsing_failures = 1;
 	}
 	free(buf);
diff --git a/lib/trace-cmd/trace-util.c b/lib/trace-cmd/trace-util.c
index 2058dc3..7d4a2a4 100644
--- a/lib/trace-cmd/trace-util.c
+++ b/lib/trace-cmd/trace-util.c
@@ -1077,7 +1077,7 @@ static int load_events(struct tep_handle *pevent, const char *system,
 		if (len < 0)
 			goto free_format;
 
-		ret = pevent_parse_event(pevent, buf, len, system);
+		ret = tep_parse_event(pevent, buf, len, system);
 		free(buf);
  free_format:
 		free(format);
@@ -1109,7 +1109,7 @@ static int read_header(struct tep_handle *pevent, const char *events_dir)
 	if (len < 0)
 		goto out;
 
-	pevent_parse_header_page(pevent, buf, len, sizeof(long));
+	tep_parse_header_page(pevent, buf, len, sizeof(long));
 
 	free(buf);
 
diff --git a/lib/traceevent/event-parse.c b/lib/traceevent/event-parse.c
index 9142f28..49689b2 100644
--- a/lib/traceevent/event-parse.c
+++ b/lib/traceevent/event-parse.c
@@ -5916,7 +5916,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
@@ -5927,8 +5927,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;
 
@@ -6157,7 +6157,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
@@ -6171,16 +6171,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
@@ -6193,8 +6193,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);
diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c
index 5e57f4a..6952492 100644
--- a/tracecmd/trace-record.c
+++ b/tracecmd/trace-record.c
@@ -3506,7 +3506,7 @@ static char *get_date_to_ts(void)
 	buf = read_file("events/header_page", &size);
 	if (!buf)
 		goto out_pevent;
-	ret = pevent_parse_header_page(pevent, buf, size, sizeof(unsigned long));
+	ret = tep_parse_header_page(pevent, buf, size, sizeof(unsigned long));
 	free(buf);
 	if (ret < 0) {
 		warning("Can't parse header page, --date ignored");
@@ -3517,7 +3517,7 @@ static char *get_date_to_ts(void)
 	buf = read_file("events/ftrace/print/format", &size);
 	if (!buf)
 		goto out_pevent;
-	ret = pevent_parse_event(pevent, buf, size, "ftrace");
+	ret = tep_parse_event(pevent, buf, size, "ftrace");
 	free(buf);
 	if (ret < 0) {
 		warning("Can't parse print event, --date ignored");
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH v3 07/24] tools lib traceevent, perf tools: Rename pevent print APIs
  2018-08-27  8:17 [PATCH v3 00/24] trace-cmd: rename variables, data structures and functions in lib/traceevent Tzvetomir Stoyanov (VMware)
                   ` (4 preceding siblings ...)
  2018-08-27  8:17 ` [PATCH v3 06/24] tools lib traceevent, perf tools: Rename pevent parse APIs Tzvetomir Stoyanov (VMware)
@ 2018-08-27  8:17 ` Tzvetomir Stoyanov (VMware)
  2018-08-27  8:17 ` [PATCH v3 08/24] tools lib traceevent, perf tools: Rename pevent_read_number_* APIs Tzvetomir Stoyanov (VMware)
                   ` (16 subsequent siblings)
  22 siblings, 0 replies; 30+ messages in thread
From: Tzvetomir Stoyanov (VMware) @ 2018-08-27  8:17 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel

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

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/20180808180700.654453763@goodmis.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 include/traceevent/event-parse.h | 44 +++++++++----------
 kernel-shark/trace-dialog.c      |  4 +-
 lib/traceevent/event-parse.c     | 74 ++++++++++++++++----------------
 plugins/plugin_hrtimer.c         | 18 ++++----
 plugins/plugin_kvm.c             | 16 +++----
 plugins/plugin_mac80211.c        |  8 ++--
 plugins/plugin_tlb.c             |  2 +-
 tracecmd/trace-read.c            | 20 ++++-----
 8 files changed, 93 insertions(+), 93 deletions(-)

diff --git a/include/traceevent/event-parse.h b/include/traceevent/event-parse.h
index 93b040e..11dd41b 100644
--- a/include/traceevent/event-parse.h
+++ b/include/traceevent/event-parse.h
@@ -614,18 +614,18 @@ int pevent_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 pevent_print_event_task(struct tep_handle *pevent, struct trace_seq *s,
-			     struct event_format *event,
-			     struct tep_record *record);
-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 pevent_print_event_data(struct tep_handle *pevent, struct trace_seq *s,
-			     struct event_format *event,
-			     struct tep_record *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_task(struct tep_handle *pevent, struct trace_seq *s,
+			  struct event_format *event,
+			  struct tep_record *record);
+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);
+void tep_print_event_data(struct tep_handle *pevent, struct trace_seq *s,
+			  struct event_format *event,
+			  struct tep_record *record);
+void tep_print_event(struct tep_handle *pevent, struct trace_seq *s,
+		     struct tep_record *record, bool use_trace_clock);
 
 int tep_parse_header_page(struct tep_handle *pevent, char *buf, unsigned long size,
 			  int long_size);
@@ -653,13 +653,13 @@ 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 pevent_print_num_field(struct trace_seq *s, const char *fmt,
+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);
 
-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);
 
 int pevent_register_event_handler(struct tep_handle *pevent, int id,
 				  const char *sys_name, const char *event_name,
@@ -706,10 +706,10 @@ struct cmdline *pevent_data_pid_from_comm(struct tep_handle *pevent, const char
 					  struct cmdline *next);
 int pevent_cmdline_pid(struct tep_handle *pevent, struct cmdline *cmdline);
 
-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 tep_print_field(struct trace_seq *s, void *data,
+		     struct format_field *field);
+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 pevent_errno errnum,
@@ -793,8 +793,8 @@ const char *pevent_get_input_buf(void);
 unsigned long long pevent_get_input_buf_ptr(void);
 
 /* for debugging */
-void pevent_print_funcs(struct tep_handle *pevent);
-void pevent_print_printk(struct tep_handle *pevent);
+void tep_print_funcs(struct tep_handle *pevent);
+void tep_print_printk(struct tep_handle *pevent);
 
 /* ----------------------- filtering ----------------------- */
 
diff --git a/kernel-shark/trace-dialog.c b/kernel-shark/trace-dialog.c
index c9f8eec..9298078 100644
--- a/kernel-shark/trace-dialog.c
+++ b/kernel-shark/trace-dialog.c
@@ -385,7 +385,7 @@ static void read_raw_events(struct trace_seq *s,
 
 	for (i = 0; fields[i]; i++) {
 		trace_seq_printf(s, "%s: ", fields[i]->name);
-		pevent_print_field(s, record->data, fields[i]);
+		tep_print_field(s, record->data, fields[i]);
 		trace_seq_putc(s, '\n');
 	}
 
@@ -407,7 +407,7 @@ void trace_show_record_dialog(GtkWindow *parent, struct tep_handle *pevent,
 	if (raw)
 		read_raw_events(&s, event, record);
 	else
-		pevent_print_event(pevent, &s, record, FALSE);
+		tep_print_event(pevent, &s, record, FALSE);
 
 	if (s.buffer_size) {
 		trace_seq_terminate(&s);
diff --git a/lib/traceevent/event-parse.c b/lib/traceevent/event-parse.c
index 49689b2..f59dc6e 100644
--- a/lib/traceevent/event-parse.c
+++ b/lib/traceevent/event-parse.c
@@ -575,12 +575,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;
 
@@ -718,12 +718,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;
 
@@ -4786,8 +4786,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;
@@ -4851,15 +4851,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;
 	}
 }
@@ -4885,7 +4885,7 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct event
 
 	if (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;
 	}
 
@@ -5391,7 +5391,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))
@@ -5442,7 +5442,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
@@ -5450,9 +5450,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;
@@ -5469,7 +5469,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
@@ -5478,10 +5478,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;
@@ -5520,7 +5520,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
@@ -5528,9 +5528,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;
@@ -5545,8 +5545,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;
 
@@ -5563,9 +5563,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)
@@ -6374,7 +6374,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
@@ -6384,9 +6384,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;
@@ -6406,7 +6406,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
@@ -6416,9 +6416,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;
diff --git a/plugins/plugin_hrtimer.c b/plugins/plugin_hrtimer.c
index fd067e0..f3a0ceb 100644
--- a/plugins/plugin_hrtimer.c
+++ b/plugins/plugin_hrtimer.c
@@ -14,14 +14,14 @@ static int timer_expire_handler(struct trace_seq *s, struct tep_record *record,
 {
 	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", record, 0);
+	tep_print_func_field(s, " function=%s", event, "function", record, 0);
 
 	return 0;
 }
@@ -31,17 +31,17 @@ static int timer_start_handler(struct trace_seq *s, struct tep_record *record,
 {
 	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",
+	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;
 }
diff --git a/plugins/plugin_kvm.c b/plugins/plugin_kvm.c
index 686ba6a..0244768 100644
--- a/plugins/plugin_kvm.c
+++ b/plugins/plugin_kvm.c
@@ -277,7 +277,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)
@@ -337,10 +337,10 @@ static int kvm_nested_vmexit_inject_handler(struct trace_seq *s, struct tep_reco
 	if (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;
 }
@@ -348,7 +348,7 @@ static int kvm_nested_vmexit_inject_handler(struct trace_seq *s, struct tep_reco
 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 %lx ", event, "rip", record, 1);
+	tep_print_num_field(s, "rip %lx ", event, "rip", record, 1);
 
 	return kvm_nested_vmexit_inject_handler(s, record, event, context);
 }
@@ -400,8 +400,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;
diff --git a/plugins/plugin_mac80211.c b/plugins/plugin_mac80211.c
index ba81e29..0cb9c95 100644
--- a/plugins/plugin_mac80211.c
+++ b/plugins/plugin_mac80211.c
@@ -119,8 +119,8 @@ static void _print_flag(struct trace_seq *s, struct event_format *event,
 	_print_flag(s, ev, name, data, __n, sizeof(__n)/sizeof(__n[0]));	\
 	})
 
-#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, struct tep_record *record,
@@ -131,7 +131,7 @@ static int drv_bss_info_changed(struct trace_seq *s, struct tep_record *record,
 	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();
@@ -164,7 +164,7 @@ static int drv_config(struct trace_seq *s, struct tep_record *record,
 		{ 2, "IDLE" },
 		{ 3, "QOS"},
 	);
-	pevent_print_num_field(s, " chan:%d/", event, "center_freq", record, 1);
+	tep_print_num_field(s, " chan:%d/", event, "center_freq", record, 1);
 	print_enum(s, event, "channel_type", data,
 		{ 0, "noht" },
 		{ 1, "ht20" },
diff --git a/plugins/plugin_tlb.c b/plugins/plugin_tlb.c
index 4a750aa..86f4cba 100644
--- a/plugins/plugin_tlb.c
+++ b/plugins/plugin_tlb.c
@@ -23,7 +23,7 @@ static int tlb_flush_handler(struct trace_seq *s, struct tep_record *record,
 
 	trace_seq_printf(s, "pages=");
 
-	pevent_print_num_field(s, "%ld", event, "pages", record, 1);
+	tep_print_num_field(s, "%ld", event, "pages", record, 1);
 
 	if (pevent_get_field_val(s, event, "reason", record, &val, 1) < 0)
 		return -1;
diff --git a/tracecmd/trace-read.c b/tracecmd/trace-read.c
index 9df3f91..880656f 100644
--- a/tracecmd/trace-read.c
+++ b/tracecmd/trace-read.c
@@ -149,7 +149,7 @@ static void show_test(struct tracecmd_input *handle)
 	record = tracecmd_read_at(handle, test_read_at_offset, &cpu);
 	printf("\nHERE'S THE COPY RECORD\n");
 	trace_seq_init(&s);
-	pevent_print_event(pevent, &s, cpu, record->data, record->size, record->ts);
+	tep_print_event(pevent, &s, cpu, record->data, record->size, record->ts);
 	trace_seq_do_printf(&s);
 	trace_seq_destroy(&s);
 	printf("\n");
@@ -196,7 +196,7 @@ static void show_test(struct tracecmd_input *handle)
 	       (void *)(record->offset & ~(page_size - 1)),
 	       (void *)record->offset);
 	trace_seq_init(&s);
-	pevent_print_event(pevent, &s, cpu, record->data, record->size, record->ts);
+	tep_print_event(pevent, &s, cpu, record->data, record->size, record->ts);
 	trace_seq_do_printf(&s);
 	trace_seq_destroy(&s);
 	printf("\n");
@@ -237,7 +237,7 @@ static void show_test(struct tracecmd_input *handle)
 	printf("\nHERE'S THE FIRST RECORD with offset %p\n",
 	       (void *)record->offset);
 	trace_seq_init(&s);
-	pevent_print_event(pevent, &s, cpu, record->data, record->size, record->ts);
+	tep_print_event(pevent, &s, cpu, record->data, record->size, record->ts);
 	trace_seq_do_printf(&s);
 	trace_seq_destroy(&s);
 	printf("\n");
@@ -253,7 +253,7 @@ static void show_test(struct tracecmd_input *handle)
 	printf("\nHERE'S THE LAST RECORD with offset %p\n",
 	       (void *)record->offset);
 	trace_seq_init(&s);
-	pevent_print_event(pevent, &s, cpu, record->data, record->size, record->ts);
+	tep_print_event(pevent, &s, cpu, record->data, record->size, record->ts);
 	trace_seq_do_printf(&s);
 	trace_seq_destroy(&s);
 	printf("\n");
@@ -794,8 +794,8 @@ void trace_show_data(struct tracecmd_input *handle, struct tep_record *record)
 		unsigned long long rec_ts = record->ts;
 
 		event = pevent_find_event_by_record(pevent, record);
-		pevent_print_event_task(pevent, &s, event, record);
-		pevent_print_event_time(pevent, &s, event, record,
+		tep_print_event_task(pevent, &s, event, record);
+		tep_print_event_time(pevent, &s, event, record,
 					use_trace_clock);
 		buf[0] = 0;
 		if (use_trace_clock && !(pevent->flags & PEVENT_NSEC_OUTPUT))
@@ -807,9 +807,9 @@ void trace_show_data(struct tracecmd_input *handle, struct tep_record *record)
 		}
 		last_ts = rec_ts;
 		trace_seq_printf(&s, " %-8s", buf);
-		pevent_print_event_data(pevent, &s, event, record);
+		tep_print_event_data(pevent, &s, event, record);
 	} else
-		pevent_print_event(pevent, &s, record, use_trace_clock);
+		tep_print_event(pevent, &s, record, use_trace_clock);
 	if (s.len && *(s.buffer + s.len - 1) == '\n')
 		s.len--;
 	if (debug) {
@@ -1727,11 +1727,11 @@ void trace_report (int argc, char **argv)
 		}
 
 		if (show_funcs) {
-			pevent_print_funcs(pevent);
+			tep_print_funcs(pevent);
 			return;
 		}
 		if (show_printk) {
-			pevent_print_printk(pevent);
+			tep_print_printk(pevent);
 			return;
 		}
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH v3 08/24] tools lib traceevent, perf tools: Rename pevent_read_number_* APIs
  2018-08-27  8:17 [PATCH v3 00/24] trace-cmd: rename variables, data structures and functions in lib/traceevent Tzvetomir Stoyanov (VMware)
                   ` (5 preceding siblings ...)
  2018-08-27  8:17 ` [PATCH v3 07/24] tools lib traceevent, perf tools: Rename pevent print APIs Tzvetomir Stoyanov (VMware)
@ 2018-08-27  8:17 ` Tzvetomir Stoyanov (VMware)
  2018-08-27  8:17 ` [PATCH v3 09/24] tools lib traceevent, perf tools: Rename pevent_register_* APIs Tzvetomir Stoyanov (VMware)
                   ` (15 subsequent siblings)
  22 siblings, 0 replies; 30+ messages in thread
From: Tzvetomir Stoyanov (VMware) @ 2018-08-27  8:17 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel

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

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/20180808180700.804271434@goodmis.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 include/traceevent/event-parse.h |  6 +--
 kernel-shark/trace-graph.c       | 12 +++---
 kernel-shark/trace-plot-task.c   |  2 +-
 kernel-shark/trace-view-store.c  |  6 +--
 lib/trace-cmd/trace-ftrace.c     |  2 +-
 lib/traceevent/event-parse.c     | 68 ++++++++++++++++----------------
 lib/traceevent/parse-filter.c    |  2 +-
 plugins/plugin_blk.c             | 14 +++----
 plugins/plugin_kmem.c            |  2 +-
 plugins/plugin_mac80211.c        |  6 +--
 python/ctracecmd.i               |  6 +--
 python/tracecmd.py               |  4 +-
 tracecmd/trace-hist.c            | 40 +++++++++----------
 tracecmd/trace-mem.c             | 12 +++---
 tracecmd/trace-profile.c         | 46 ++++++++++-----------
 tracecmd/trace-read.c            | 12 +++---
 16 files changed, 120 insertions(+), 120 deletions(-)

diff --git a/include/traceevent/event-parse.h b/include/traceevent/event-parse.h
index 11dd41b..97eb42d 100644
--- a/include/traceevent/event-parse.h
+++ b/include/traceevent/event-parse.h
@@ -681,9 +681,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);
 
diff --git a/kernel-shark/trace-graph.c b/kernel-shark/trace-graph.c
index 0bf0dba..04f58f1 100644
--- a/kernel-shark/trace-graph.c
+++ b/kernel-shark/trace-graph.c
@@ -1043,11 +1043,11 @@ int trace_graph_check_sched_wakeup(struct graph_info *ginfo,
 	if (id == ginfo->event_wakeup_id) {
 		/* We only want those that actually woke up the task */
 		if (ginfo->wakeup_success_field) {
-			pevent_read_number_field(ginfo->wakeup_success_field, record->data, &val);
+			tep_read_number_field(ginfo->wakeup_success_field, record->data, &val);
 			if (!val)
 				return 0;
 		}
-		pevent_read_number_field(ginfo->wakeup_pid_field, record->data, &val);
+		tep_read_number_field(ginfo->wakeup_pid_field, record->data, &val);
 		if (pid)
 			*pid = val;
 		return 1;
@@ -1056,11 +1056,11 @@ int trace_graph_check_sched_wakeup(struct graph_info *ginfo,
 	if (id == ginfo->event_wakeup_new_id) {
 		/* We only want those that actually woke up the task */
 		if (ginfo->wakeup_new_success_field) {
-			pevent_read_number_field(ginfo->wakeup_new_success_field, record->data, &val);
+			tep_read_number_field(ginfo->wakeup_new_success_field, record->data, &val);
 			if (!val)
 				return 0;
 		}
-		pevent_read_number_field(ginfo->wakeup_new_pid_field, record->data, &val);
+		tep_read_number_field(ginfo->wakeup_new_pid_field, record->data, &val);
 		if (pid)
 			*pid = val;
 		return 1;
@@ -1107,7 +1107,7 @@ int trace_graph_check_sched_switch(struct graph_info *ginfo,
 
 	id = pevent_data_type(ginfo->pevent, record);
 	if (id == ginfo->event_sched_switch_id) {
-		pevent_read_number_field(ginfo->event_pid_field, record->data, &val);
+		tep_read_number_field(ginfo->event_pid_field, record->data, &val);
 		if (comm)
 			*comm = record->data + ginfo->event_comm_field->offset;
 		if (pid)
@@ -1116,7 +1116,7 @@ int trace_graph_check_sched_switch(struct graph_info *ginfo,
 	}
 
 	if (id == ginfo->ftrace_sched_switch_id) {
-		pevent_read_number_field(ginfo->ftrace_pid_field, record->data, &val);
+		tep_read_number_field(ginfo->ftrace_pid_field, record->data, &val);
 		if (comm && ginfo->ftrace_comm_field)
 			*comm = record->data + ginfo->ftrace_comm_field->offset;
 		else
diff --git a/kernel-shark/trace-plot-task.c b/kernel-shark/trace-plot-task.c
index 11930ed..ca62457 100644
--- a/kernel-shark/trace-plot-task.c
+++ b/kernel-shark/trace-plot-task.c
@@ -58,7 +58,7 @@ static gboolean is_running(struct graph_info *ginfo, struct tep_record *record)
 	if (id != ginfo->event_sched_switch_id)
 		return FALSE;
 
-	pevent_read_number_field(ginfo->event_prev_state, record->data, &val);
+	tep_read_number_field(ginfo->event_prev_state, record->data, &val);
 	return val & ((1 << 11) - 1)? FALSE : TRUE;
 }
 
diff --git a/kernel-shark/trace-view-store.c b/kernel-shark/trace-view-store.c
index c6ddad8..61d0157 100644
--- a/kernel-shark/trace-view-store.c
+++ b/kernel-shark/trace-view-store.c
@@ -1143,7 +1143,7 @@ gint get_next_pid(TraceViewStore *store, struct tep_handle *pevent, struct tep_r
 {
 	unsigned long long val;
 
-	pevent_read_number_field(store->sched_switch_next_field, record->data, &val);
+	tep_read_number_field(store->sched_switch_next_field, record->data, &val);
 
 	return val;
 }
@@ -1152,7 +1152,7 @@ gint get_wakeup_pid(TraceViewStore *store, struct tep_handle *pevent, struct tep
 {
 	unsigned long long val;
 
-	pevent_read_number_field(store->sched_wakeup_pid_field, record->data, &val);
+	tep_read_number_field(store->sched_wakeup_pid_field, record->data, &val);
 
 	return val;
 }
@@ -1161,7 +1161,7 @@ gint get_wakeup_new_pid(TraceViewStore *store, struct tep_handle *pevent, struct
 {
 	unsigned long long val;
 
-	pevent_read_number_field(store->sched_wakeup_new_pid_field, record->data, &val);
+	tep_read_number_field(store->sched_wakeup_new_pid_field, record->data, &val);
 
 	return val;
 }
diff --git a/lib/trace-cmd/trace-ftrace.c b/lib/trace-cmd/trace-ftrace.c
index 76f8f56..90770fc 100644
--- a/lib/trace-cmd/trace-ftrace.c
+++ b/lib/trace-cmd/trace-ftrace.c
@@ -383,7 +383,7 @@ trace_stack_handler(struct trace_seq *s, struct tep_record *record,
 
 	for (data += field->offset; data < record->data + record->size;
 	     data += finfo->long_size) {
-		addr = pevent_read_number(event->pevent, data, finfo->long_size);
+		addr = tep_read_number(event->pevent, data, finfo->long_size);
 
 		if ((finfo->long_size == 8 && addr == (unsigned long long)-1) ||
 		    ((int)addr == -1))
diff --git a/lib/traceevent/event-parse.c b/lib/traceevent/event-parse.c
index f59dc6e..3bcdde8 100644
--- a/lib/traceevent/event-parse.c
+++ b/lib/traceevent/event-parse.c
@@ -3315,7 +3315,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
@@ -3323,8 +3323,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:
@@ -3342,7 +3342,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
@@ -3352,8 +3352,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;
@@ -3362,8 +3362,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;
@@ -3406,7 +3406,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)
@@ -3545,8 +3545,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:
@@ -3589,7 +3589,7 @@ eval_num_arg(void *data, int size, struct event_format *event, struct print_arg
 
 			switch (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)
@@ -3618,8 +3618,8 @@ eval_num_arg(void *data, int size, struct event_format *event, struct print_arg
 			default:
 				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;
@@ -3719,9 +3719,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
@@ -3731,9 +3731,9 @@ eval_num_arg(void *data, int size, struct event_format *event, struct print_arg
 		break;
 	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
@@ -3978,7 +3978,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);
@@ -4009,9 +4009,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;
@@ -4239,7 +4239,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.
@@ -4333,7 +4333,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) {
@@ -4407,7 +4407,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) {
@@ -4797,7 +4797,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;
@@ -4817,8 +4817,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) {
@@ -6239,7 +6239,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;
@@ -6288,7 +6288,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;
@@ -6394,7 +6394,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);
@@ -6429,7 +6429,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);
diff --git a/lib/traceevent/parse-filter.c b/lib/traceevent/parse-filter.c
index 68d8d0e..bfdaec1 100644
--- a/lib/traceevent/parse-filter.c
+++ b/lib/traceevent/parse-filter.c
@@ -1714,7 +1714,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;
diff --git a/plugins/plugin_blk.c b/plugins/plugin_blk.c
index 81cce73..5070af2 100644
--- a/plugins/plugin_blk.c
+++ b/plugins/plugin_blk.c
@@ -291,28 +291,28 @@ static int blktrace_handler(struct trace_seq *s, struct tep_record *record,
 	field = tep_find_field(event, "action");
 	if (!field)
 		return 1;
-	if (pevent_read_number_field(field, data, &val))
+	if (tep_read_number_field(field, data, &val))
 		return 1;
 	blk_data.action = val;
 
 	field = tep_find_field(event, "bytes");
 	if (!field)
 		return 1;
-	if (pevent_read_number_field(field, data, &val))
+	if (tep_read_number_field(field, data, &val))
 		return 1;
 	blk_data.bytes = val;
 
 	field = tep_find_field(event, "device");
 	if (!field)
 		return 1;
-	if (pevent_read_number_field(field, data, &val))
+	if (tep_read_number_field(field, data, &val))
 		return 1;
 	blk_data.device = val;
 
 	field = tep_find_field(event, "pdu_len");
 	if (!field)
 		return 1;
-	if (pevent_read_number_field(field, data, &val))
+	if (tep_read_number_field(field, data, &val))
 		return 1;
 	blk_data.pdu_len = val;
 
@@ -324,20 +324,20 @@ static int blktrace_handler(struct trace_seq *s, struct tep_record *record,
 	field = tep_find_field(event, "sector");
 	if (!field)
 		return 1;
-	if (pevent_read_number_field(field, data, &blk_data.sector))
+	if (tep_read_number_field(field, data, &blk_data.sector))
 		return 1;
 
 	field = tep_find_field(event, "pid");
 	if (!field)
 		return 1;
-	if (pevent_read_number_field(field, data, &val))
+	if (tep_read_number_field(field, data, &val))
 		return 1;
 	blk_data.pid = val;
 
 	field = tep_find_field(event, "error");
 	if (!field)
 		return 1;
-	if (pevent_read_number_field(field, data, &val))
+	if (tep_read_number_field(field, data, &val))
 		return 1;
 	blk_data.error = val;
 
diff --git a/plugins/plugin_kmem.c b/plugins/plugin_kmem.c
index 5691b71..0840d6f 100644
--- a/plugins/plugin_kmem.c
+++ b/plugins/plugin_kmem.c
@@ -20,7 +20,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);
diff --git a/plugins/plugin_mac80211.c b/plugins/plugin_mac80211.c
index 0cb9c95..5fc3170 100644
--- a/plugins/plugin_mac80211.c
+++ b/plugins/plugin_mac80211.c
@@ -27,7 +27,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;
 		}
@@ -56,7 +56,7 @@ static void _print_enum(struct trace_seq *s, struct event_format *event,
 		return;
 	}
 
-	if (pevent_read_number_field(f, data, &val)) {
+	if (tep_read_number_field(f, data, &val)) {
 		trace_seq_puts(s, "field-invalid");
 		return;
 	}
@@ -89,7 +89,7 @@ static void _print_flag(struct trace_seq *s, struct event_format *event,
 		return;
 	}
 
-	if (pevent_read_number_field(f, data, &val)) {
+	if (tep_read_number_field(f, data, &val)) {
 		trace_seq_puts(s, "field-invalid");
 		return;
 	}
diff --git a/python/ctracecmd.i b/python/ctracecmd.i
index df757af..0a3b84a 100644
--- a/python/ctracecmd.i
+++ b/python/ctracecmd.i
@@ -102,7 +102,7 @@ static PyObject *py_field_get_stack(struct tep_handle *pevent,
 
 	for (data += field->offset; data < record->data + record->size;
 	     data += long_size) {
-		addr = pevent_read_number(event->pevent, data, long_size);
+		addr = tep_read_number(event->pevent, data, long_size);
 
 		if ((long_size == 8 && addr == (unsigned long long)-1) ||
 		    ((int)addr == -1))
@@ -123,7 +123,7 @@ static PyObject *py_field_get_data(struct format_field *f, struct tep_record *r)
 		unsigned long long val;
 		int len, offset;
 
-		if (pevent_read_number_field(f, r->data, &val)) {
+		if (tep_read_number_field(f, r->data, &val)) {
 			PyErr_SetString(PyExc_TypeError,
 					"Field is not a valid number");
 			return NULL;
@@ -149,7 +149,7 @@ static PyObject *py_field_get_str(struct format_field *f, struct tep_record *r)
 		unsigned long long val;
 		int offset;
 
-		if (pevent_read_number_field(f, r->data, &val)) {
+		if (tep_read_number_field(f, r->data, &val)) {
 			PyErr_SetString(PyExc_TypeError,
 					"Field is not a valid number");
 			return NULL;
diff --git a/python/tracecmd.py b/python/tracecmd.py
index 7da113e..318887c 100644
--- a/python/tracecmd.py
+++ b/python/tracecmd.py
@@ -106,7 +106,7 @@ class Event(object, DictMixin):
         f = tep_find_any_field(self._format, name)
         if f is None:
             return None
-        ret, val = pevent_read_number_field(f, pevent_record_data_get(self._record))
+        ret, val = tep_read_number_field(f, pevent_record_data_get(self._record))
         if ret:
             return None
         return val
@@ -141,7 +141,7 @@ class Field(object):
         return py_field_get_data(self._field, self._record)
 
     def __long__(self):
-        ret, val =  pevent_read_number_field(self._field,
+        ret, val =  tep_read_number_field(self._field,
                                              pevent_record_data_get(self._record))
         if ret:
             raise FieldError("Not a number field")
diff --git a/tracecmd/trace-hist.c b/tracecmd/trace-hist.c
index d2adda9..87f96d8 100644
--- a/tracecmd/trace-hist.c
+++ b/tracecmd/trace-hist.c
@@ -262,15 +262,15 @@ process_function(struct tep_handle *pevent, struct tep_record *record)
 	int pid;
 	int ret;
 
-	ret = pevent_read_number_field(common_pid_field, record->data, &val);
+	ret = tep_read_number_field(common_pid_field, record->data, &val);
 	if (ret < 0)
 		die("no pid field for function?");
 
-	ret = pevent_read_number_field(function_ip_field, record->data, &ip);
+	ret = tep_read_number_field(function_ip_field, record->data, &ip);
 	if (ret < 0)
 		die("no ip field for function?");
 
-	ret = pevent_read_number_field(function_parent_ip_field, record->data, &parent_ip);
+	ret = tep_read_number_field(function_parent_ip_field, record->data, &parent_ip);
 	if (ret < 0)
 		die("no parent ip field for function?");
 
@@ -318,17 +318,17 @@ process_function_graph_entry(struct tep_handle *pevent, struct tep_record *recor
 	int pid;
 	int ret;
 
-	ret = pevent_read_number_field(common_pid_field, record->data, &val);
+	ret = tep_read_number_field(common_pid_field, record->data, &val);
 	if (ret < 0)
 		die("no pid field for function graph entry?");
 
-	ret = pevent_read_number_field(function_graph_entry_func_field,
-				       record->data, &ip);
+	ret = tep_read_number_field(function_graph_entry_func_field,
+				    record->data, &ip);
 	if (ret < 0)
 		die("no ip field for function graph entry?");
 
-	ret = pevent_read_number_field(function_graph_entry_depth_field,
-				       record->data, &depth);
+	ret = tep_read_number_field(function_graph_entry_depth_field,
+				    record->data, &depth);
 	if (ret < 0)
 		die("no parent ip field for function entry?");
 
@@ -362,12 +362,12 @@ process_function_graph_exit(struct tep_handle *pevent, struct tep_record *record
 	int pid;
 	int ret;
 
-	ret = pevent_read_number_field(common_pid_field, record->data, &val);
+	ret = tep_read_number_field(common_pid_field, record->data, &val);
 	if (ret < 0)
 		die("no pid field for function graph exit?");
 
-	ret = pevent_read_number_field(function_graph_exit_depth_field,
-				       record->data, &depth);
+	ret = tep_read_number_field(function_graph_exit_depth_field,
+				    record->data, &depth);
 	if (ret < 0)
 		die("no parent ip field for function?");
 
@@ -419,7 +419,7 @@ process_kernel_stack(struct tep_handle *pevent, struct tep_record *record)
 	int pid;
 	int ret;
 
-	ret = pevent_read_number_field(common_pid_field, record->data, &val);
+	ret = tep_read_number_field(common_pid_field, record->data, &val);
 	if (ret < 0)
 		die("no pid field for function?");
 	pid = val;
@@ -453,7 +453,7 @@ process_kernel_stack(struct tep_handle *pevent, struct tep_record *record)
 	     data += long_size) {
 		unsigned long long addr;
 
-		addr = pevent_read_number(pevent, data, long_size);
+		addr = tep_read_number(pevent, data, long_size);
 
 		if ((long_size == 8 && addr == (unsigned long long)-1) ||
 		    ((int)addr == -1))
@@ -464,7 +464,7 @@ process_kernel_stack(struct tep_handle *pevent, struct tep_record *record)
 		unsigned long long addr;
 		const char *func;
 
-		addr = pevent_read_number(pevent, data, long_size);
+		addr = tep_read_number(pevent, data, long_size);
 		func = pevent_find_function(pevent, addr);
 		if (func)
 			push_stack_func(func);
@@ -489,12 +489,12 @@ process_sched_wakeup(struct tep_handle *pevent, struct tep_record *record, int t
 
 	if (type == sched_wakeup_type) {
 		comm = (char *)(record->data + sched_wakeup_comm_field->offset);
-		ret = pevent_read_number_field(sched_wakeup_pid_field, record->data, &val);
+		ret = tep_read_number_field(sched_wakeup_pid_field, record->data, &val);
 		if (ret < 0)
 			die("no pid field in sched_wakeup?");
 	} else {
 		comm = (char *)(record->data + sched_wakeup_new_comm_field->offset);
-		ret = pevent_read_number_field(sched_wakeup_new_pid_field, record->data, &val);
+		ret = tep_read_number_field(sched_wakeup_new_pid_field, record->data, &val);
 		if (ret < 0)
 			die("no pid field in sched_wakeup_new?");
 	}
@@ -513,14 +513,14 @@ process_sched_switch(struct tep_handle *pevent, struct tep_record *record)
 	int ret;
 
 	comm = (char *)(record->data + sched_switch_prev_field->offset);
-	ret = pevent_read_number_field(sched_switch_prev_pid_field, record->data, &val);
+	ret = tep_read_number_field(sched_switch_prev_pid_field, record->data, &val);
 	if (ret < 0)
 		die("no prev_pid field in sched_switch?");
 	pid = val;
 	pevent_register_comm(pevent, comm, pid);
 
 	comm = (char *)(record->data + sched_switch_next_field->offset);
-	ret = pevent_read_number_field(sched_switch_next_pid_field, record->data, &val);
+	ret = tep_read_number_field(sched_switch_next_pid_field, record->data, &val);
 	if (ret < 0)
 		die("no next_pid field in sched_switch?");
 	pid = val;
@@ -544,7 +544,7 @@ process_event(struct tep_handle *pevent, struct tep_record *record, int type)
 	event = pevent_data_event_from_type(pevent, type);
 	event_name = event->name;
 
-	ret = pevent_read_number_field(common_pid_field, record->data, &val);
+	ret = tep_read_number_field(common_pid_field, record->data, &val);
 	if (ret < 0)
 		die("no pid field for function?");
 
@@ -568,7 +568,7 @@ process_record(struct tep_handle *pevent, struct tep_record *record)
 	unsigned long long val;
 	int type;
 
-	pevent_read_number_field(common_type_field, record->data, &val);
+	tep_read_number_field(common_type_field, record->data, &val);
 	type = val;
 
 	if (type == function_type)
diff --git a/tracecmd/trace-mem.c b/tracecmd/trace-mem.c
index d5a4df2..1833d88 100644
--- a/tracecmd/trace-mem.c
+++ b/tracecmd/trace-mem.c
@@ -340,12 +340,12 @@ process_kmalloc(struct tep_handle *pevent, struct tep_record *record,
 	int alloc;
 	const char *func;
 
-	pevent_read_number_field(callsite_field, record->data, &callsite);
-	pevent_read_number_field(bytes_req_field, record->data, &val);
+	tep_read_number_field(callsite_field, record->data, &callsite);
+	tep_read_number_field(bytes_req_field, record->data, &val);
 	req = val;
-	pevent_read_number_field(bytes_alloc_field, record->data, &val);
+	tep_read_number_field(bytes_alloc_field, record->data, &val);
 	alloc = val;
-	pevent_read_number_field(ptr_field, record->data, &ptr);
+	tep_read_number_field(ptr_field, record->data, &ptr);
 
 	func = pevent_find_function(pevent, callsite);
 
@@ -358,7 +358,7 @@ process_kfree(struct tep_handle *pevent, struct tep_record *record,
 {
 	unsigned long long ptr;
 
-	pevent_read_number_field(ptr_field, record->data, &ptr);
+	tep_read_number_field(ptr_field, record->data, &ptr);
 
 	remove_kmalloc(ptr);
 }
@@ -369,7 +369,7 @@ process_record(struct tep_handle *pevent, struct tep_record *record)
 	unsigned long long val;
 	int type;
 
-	pevent_read_number_field(common_type_field, record->data, &val);
+	tep_read_number_field(common_type_field, record->data, &val);
 	type = val;
 
 	if (type == kmalloc_type)
diff --git a/tracecmd/trace-profile.c b/tracecmd/trace-profile.c
index 2df208c..e3e49eb 100644
--- a/tracecmd/trace-profile.c
+++ b/tracecmd/trace-profile.c
@@ -563,8 +563,8 @@ static void account_task(struct task_data *task, struct event_data *event_data,
 	 * stack traces on this event.
 	 */
 	if (event_data->pid_field) {
-		pevent_read_number_field(event_data->pid_field,
-					 record->data, &pid);
+		tep_read_number_field(event_data->pid_field,
+				      record->data, &pid);
 		proxy = task;
 		task = find_task(task->handle, pid);
 		if (!task)
@@ -577,12 +577,12 @@ static void account_task(struct task_data *task, struct event_data *event_data,
 	 * if the start_field is defined, use that for search_val.
 	 */
 	if (event_data->data_field) {
-		pevent_read_number_field(event_data->data_field,
-					 record->data, &val);
+		tep_read_number_field(event_data->data_field,
+				      record->data, &val);
 	}
 	if (event_data->start_match_field) {
-		pevent_read_number_field(event_data->start_match_field,
-					 record->data, &search_val);
+		tep_read_number_field(event_data->start_match_field,
+				      record->data, &search_val);
 	}
 
 	edata.event_data = event_data;
@@ -612,8 +612,8 @@ find_event_task(struct handle_data *h, struct event_data *event_data,
 
 	/* If pid_field is defined, use that to find the task */
 	if (event_data->pid_field)
-		pevent_read_number_field(event_data->pid_field,
-					 record->data, &pid);
+		tep_read_number_field(event_data->pid_field,
+				      record->data, &pid);
 	return find_task(h, pid);
 }
 
@@ -629,8 +629,8 @@ handle_end_event(struct handle_data *h, struct event_data *event_data,
 	if (!task)
 		return NULL;
 
-	pevent_read_number_field(event_data->start_match_field, record->data,
-				 &val);
+	tep_read_number_field(event_data->start_match_field, record->data,
+			      &val);
 	event_hash = find_and_update_start(task, event_data->start, record->ts, val);
 	task->last_start = NULL;
 	task->last_event = event_hash;
@@ -650,7 +650,7 @@ handle_start_event(struct handle_data *h, struct event_data *event_data,
 	if (!task)
 		return NULL;
 
-	pevent_read_number_field(event_data->end_match_field, record->data,
+	tep_read_number_field(event_data->end_match_field, record->data,
 				 &val);
 	start = add_start(task, event_data, record, val, val);
 	if (!start) {
@@ -772,7 +772,7 @@ static void trace_profile_record(struct tracecmd_input *handle,
 
 
 	/* Get this current PID */
-	pevent_read_number_field(h->common_pid, record->data, &pid);
+	tep_read_number_field(h->common_pid, record->data, &pid);
 
 	task = find_task(h, pid);
 	if (!task)
@@ -998,18 +998,18 @@ static int handle_sched_switch_event(struct handle_data *h,
 	struct start_data *start;
 
 	/* pid_field holds prev_pid, data_field holds prev_state */
-	pevent_read_number_field(event_data->pid_field,
-				 record->data, &prev_pid);
+	tep_read_number_field(event_data->pid_field,
+			      record->data, &prev_pid);
 
-	pevent_read_number_field(event_data->data_field,
+	tep_read_number_field(event_data->data_field,
 				 record->data, &prev_state);
 
 	/* only care about real states */
 	prev_state &= TASK_STATE_MAX - 1;
 
 	/* end_match_field holds next_pid */
-	pevent_read_number_field(event_data->end_match_field,
-				 record->data, &next_pid);
+	tep_read_number_field(event_data->end_match_field,
+			      record->data, &next_pid);
 
 	task = find_task(h, prev_pid);
 	if (!task)
@@ -1186,8 +1186,8 @@ static int handle_process_exec(struct handle_data *h,
 
 	/* Task has execed, remove the comm for it */
 	if (event_data->data_field) {
-		pevent_read_number_field(event_data->data_field,
-					 record->data, &val);
+		tep_read_number_field(event_data->data_field,
+				      record->data, &val);
 		pid = val;
 	}
 
@@ -1217,16 +1217,16 @@ static int handle_sched_wakeup_event(struct handle_data *h,
 
 	/* If present, data_field holds "success" */
 	if (event_data->data_field) {
-		pevent_read_number_field(event_data->data_field,
-					 record->data, &success);
+		tep_read_number_field(event_data->data_field,
+				      record->data, &success);
 
 		/* If not a successful wakeup, ignore this */
 		if (!success)
 			return 0;
 	}
 
-	pevent_read_number_field(event_data->pid_field,
-				 record->data, &pid);
+	tep_read_number_field(event_data->pid_field,
+			      record->data, &pid);
 
 	task = find_task(h, pid);
 	if (!task)
diff --git a/tracecmd/trace-read.c b/tracecmd/trace-read.c
index 880656f..a61f6aa 100644
--- a/tracecmd/trace-read.c
+++ b/tracecmd/trace-read.c
@@ -671,28 +671,28 @@ static void process_wakeup(struct tep_handle *pevent, struct tep_record *record)
 
 	id = pevent_data_type(pevent, record);
 	if (id == wakeup_id) {
-		if (pevent_read_number_field(wakeup_success, record->data, &val) == 0) {
+		if (tep_read_number_field(wakeup_success, record->data, &val) == 0) {
 			if (!val)
 				return;
 		}
-		if (pevent_read_number_field(wakeup_task, record->data, &val))
+		if (tep_read_number_field(wakeup_task, record->data, &val))
 			return;
 		add_wakeup(val, record->ts);
 	} else if (id == wakeup_new_id) {
-		if (pevent_read_number_field(wakeup_new_success, record->data, &val) == 0) {
+		if (tep_read_number_field(wakeup_new_success, record->data, &val) == 0) {
 			if (!val)
 				return;
 		}
-		if (pevent_read_number_field(wakeup_new_task, record->data, &val))
+		if (tep_read_number_field(wakeup_new_task, record->data, &val))
 			return;
 		add_wakeup(val, record->ts);
 	} else if (id == sched_id) {
 		int rt = 1;
-		if (pevent_read_number_field(sched_prio, record->data, &val))
+		if (tep_read_number_field(sched_prio, record->data, &val))
 			return;
 		if (val > 99)
 			rt = 0;
-		if (pevent_read_number_field(sched_task, record->data, &val))
+		if (tep_read_number_field(sched_task, record->data, &val))
 			return;
 		add_sched(val, record->ts, rt);
 	}
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH v3 09/24] tools lib traceevent, perf tools: Rename pevent_register_* APIs
  2018-08-27  8:17 [PATCH v3 00/24] trace-cmd: rename variables, data structures and functions in lib/traceevent Tzvetomir Stoyanov (VMware)
                   ` (6 preceding siblings ...)
  2018-08-27  8:17 ` [PATCH v3 08/24] tools lib traceevent, perf tools: Rename pevent_read_number_* APIs Tzvetomir Stoyanov (VMware)
@ 2018-08-27  8:17 ` Tzvetomir Stoyanov (VMware)
  2018-08-27  8:17 ` [PATCH v3 10/24] tools lib traceevent, perf tools: Rename pevent_set_* APIs Tzvetomir Stoyanov (VMware)
                   ` (14 subsequent siblings)
  22 siblings, 0 replies; 30+ messages in thread
From: Tzvetomir Stoyanov (VMware) @ 2018-08-27  8:17 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel

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

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/20180808180700.948980691@goodmis.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 include/traceevent/event-parse.h |  6 +++---
 kernel-shark/trace-graph.c       |  4 ++--
 lib/trace-cmd/trace-util.c       |  4 ++--
 lib/traceevent/event-parse.c     | 10 +++++-----
 plugins/plugin_sched_switch.c    |  2 +-
 tracecmd/trace-hist.c            |  6 +++---
 6 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/include/traceevent/event-parse.h b/include/traceevent/event-parse.h
index 97eb42d..c368a55 100644
--- a/include/traceevent/event-parse.h
+++ b/include/traceevent/event-parse.h
@@ -606,12 +606,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,
diff --git a/kernel-shark/trace-graph.c b/kernel-shark/trace-graph.c
index 04f58f1..3fe0f83 100644
--- a/kernel-shark/trace-graph.c
+++ b/kernel-shark/trace-graph.c
@@ -1134,8 +1134,8 @@ int trace_graph_check_sched_switch(struct graph_info *ginfo,
 		 *  comm / pid mappings.
 		 */
 		if (!pevent_pid_is_registered(ginfo->pevent, *pid))
-			pevent_register_comm(ginfo->pevent,
-					     *comm, *pid);
+			tep_register_comm(ginfo->pevent,
+					  *comm, *pid);
 	}
 
 	return ret;
diff --git a/lib/trace-cmd/trace-util.c b/lib/trace-cmd/trace-util.c
index 7d4a2a4..877907d 100644
--- a/lib/trace-cmd/trace-util.c
+++ b/lib/trace-cmd/trace-util.c
@@ -374,7 +374,7 @@ void tracecmd_parse_cmdlines(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);
 	}
@@ -473,7 +473,7 @@ void tracecmd_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);
 		free(printk);
 	}
 }
diff --git a/lib/traceevent/event-parse.c b/lib/traceevent/event-parse.c
index 3bcdde8..fcde4d1 100644
--- a/lib/traceevent/event-parse.c
+++ b/lib/traceevent/event-parse.c
@@ -274,7 +274,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
@@ -282,7 +282,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;
 
@@ -671,7 +671,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
@@ -679,8 +679,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;
diff --git a/plugins/plugin_sched_switch.c b/plugins/plugin_sched_switch.c
index fa3add1..534e99c 100644
--- a/plugins/plugin_sched_switch.c
+++ b/plugins/plugin_sched_switch.c
@@ -46,7 +46,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, struct tep_record *record,
diff --git a/tracecmd/trace-hist.c b/tracecmd/trace-hist.c
index 87f96d8..e8bf434 100644
--- a/tracecmd/trace-hist.c
+++ b/tracecmd/trace-hist.c
@@ -501,7 +501,7 @@ process_sched_wakeup(struct tep_handle *pevent, struct tep_record *record, int t
 
 	pid = val;
 
-	pevent_register_comm(pevent, comm, pid);
+	tep_register_comm(pevent, comm, pid);
 }
 
 static void
@@ -517,14 +517,14 @@ process_sched_switch(struct tep_handle *pevent, struct tep_record *record)
 	if (ret < 0)
 		die("no prev_pid field in sched_switch?");
 	pid = val;
-	pevent_register_comm(pevent, comm, pid);
+	tep_register_comm(pevent, comm, pid);
 
 	comm = (char *)(record->data + sched_switch_next_field->offset);
 	ret = tep_read_number_field(sched_switch_next_pid_field, record->data, &val);
 	if (ret < 0)
 		die("no next_pid field in sched_switch?");
 	pid = val;
-	pevent_register_comm(pevent, comm, pid);
+	tep_register_comm(pevent, comm, pid);
 }
 
 static void
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH v3 10/24] tools lib traceevent, perf tools: Rename pevent_set_* APIs
  2018-08-27  8:17 [PATCH v3 00/24] trace-cmd: rename variables, data structures and functions in lib/traceevent Tzvetomir Stoyanov (VMware)
                   ` (7 preceding siblings ...)
  2018-08-27  8:17 ` [PATCH v3 09/24] tools lib traceevent, perf tools: Rename pevent_register_* APIs Tzvetomir Stoyanov (VMware)
@ 2018-08-27  8:17 ` Tzvetomir Stoyanov (VMware)
  2018-08-27  8:17 ` [PATCH v3 11/24] tools lib traceevent, perf tools: Rename traceevent_* APIs Tzvetomir Stoyanov (VMware)
                   ` (13 subsequent siblings)
  22 siblings, 0 replies; 30+ messages in thread
From: Tzvetomir Stoyanov (VMware) @ 2018-08-27  8:17 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel

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

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/20180808180701.256265951@goodmis.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 include/traceevent/event-parse.h | 16 ++++++++--------
 lib/trace-cmd/trace-input.c      |  2 +-
 lib/traceevent/event-parse.c     |  6 +++---
 tracecmd/trace-profile.c         |  4 ++--
 4 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/include/traceevent/event-parse.h b/include/traceevent/event-parse.h
index c368a55..ea5b9f5 100644
--- a/include/traceevent/event-parse.h
+++ b/include/traceevent/event-parse.h
@@ -520,7 +520,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;
 }
@@ -603,8 +603,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);
@@ -729,12 +729,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;
 }
@@ -744,7 +744,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;
 }
@@ -754,7 +754,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;
 }
@@ -764,7 +764,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;
 }
diff --git a/lib/trace-cmd/trace-input.c b/lib/trace-cmd/trace-input.c
index ef55177..20203ad 100644
--- a/lib/trace-cmd/trace-input.c
+++ b/lib/trace-cmd/trace-input.c
@@ -748,7 +748,7 @@ int tracecmd_read_headers(struct tracecmd_input *handle)
 	if (read_and_parse_cmdlines(handle) < 0)
 		return -1;
 
-	pevent_set_long_size(handle->pevent, handle->long_size);
+	tep_set_long_size(handle->pevent, handle->long_size);
 
 	return 0;
 }
diff --git a/lib/traceevent/event-parse.c b/lib/traceevent/event-parse.c
index fcde4d1..0dc3dc5 100644
--- a/lib/traceevent/event-parse.c
+++ b/lib/traceevent/event-parse.c
@@ -430,7 +430,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.
@@ -439,8 +439,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));
 
diff --git a/tracecmd/trace-profile.c b/tracecmd/trace-profile.c
index e3e49eb..2b50d33 100644
--- a/tracecmd/trace-profile.c
+++ b/tracecmd/trace-profile.c
@@ -1520,7 +1520,7 @@ void trace_init_profile(struct tracecmd_input *handle, struct hook_list *hook,
 
 static void output_event_stack(struct tep_handle *pevent, struct stack_data *stack)
 {
-	int longsize = pevent_get_long_size(pevent);
+	int longsize = tep_get_long_size(pevent);
 	unsigned long long val;
 	const char *func;
 	unsigned long long stop = -1ULL;
@@ -1886,7 +1886,7 @@ static void output_stacks(struct tep_handle *pevent, struct trace_hash *stack_ha
 	struct stack_chain *chain;
 	unsigned long long mask = 0;
 	int nr_chains;
-	int longsize = pevent_get_long_size(pevent);
+	int longsize = tep_get_long_size(pevent);
 	int nr_stacks;
 	int i;
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH v3 11/24] tools lib traceevent, perf tools: Rename traceevent_* APIs
  2018-08-27  8:17 [PATCH v3 00/24] trace-cmd: rename variables, data structures and functions in lib/traceevent Tzvetomir Stoyanov (VMware)
                   ` (8 preceding siblings ...)
  2018-08-27  8:17 ` [PATCH v3 10/24] tools lib traceevent, perf tools: Rename pevent_set_* APIs Tzvetomir Stoyanov (VMware)
@ 2018-08-27  8:17 ` Tzvetomir Stoyanov (VMware)
  2018-08-27  8:17 ` [PATCH v3 12/24] tools lib traceevent, perf tools: Rename 'enum pevent_flag' to 'enum tep_flag' Tzvetomir Stoyanov (VMware)
                   ` (12 subsequent siblings)
  22 siblings, 0 replies; 30+ messages in thread
From: Tzvetomir Stoyanov (VMware) @ 2018-08-27  8:17 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel

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

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/20180808180701.484691639@goodmis.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 include/traceevent/event-parse.h | 8 ++++----
 lib/traceevent/event-plugin.c    | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/include/traceevent/event-parse.h b/include/traceevent/event-parse.h
index ea5b9f5..979ac97 100644
--- a/include/traceevent/event-parse.h
+++ b/include/traceevent/event-parse.h
@@ -421,9 +421,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,
@@ -585,7 +585,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;
diff --git a/lib/traceevent/event-plugin.c b/lib/traceevent/event-plugin.c
index ccda700..35b35dc 100644
--- a/lib/traceevent/event-plugin.c
+++ b/lib/traceevent/event-plugin.c
@@ -250,10 +250,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,
@@ -417,7 +417,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;
 
@@ -426,7 +426,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;
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH v3 12/24] tools lib traceevent, perf tools: Rename 'enum pevent_flag' to 'enum tep_flag'
  2018-08-27  8:17 [PATCH v3 00/24] trace-cmd: rename variables, data structures and functions in lib/traceevent Tzvetomir Stoyanov (VMware)
                   ` (9 preceding siblings ...)
  2018-08-27  8:17 ` [PATCH v3 11/24] tools lib traceevent, perf tools: Rename traceevent_* APIs Tzvetomir Stoyanov (VMware)
@ 2018-08-27  8:17 ` Tzvetomir Stoyanov (VMware)
  2018-08-27  8:17 ` [PATCH v3 13/24] tools lib traceevent, tools lib lockdep: Rename 'enum pevent_errno' to 'enum tep_errno' Tzvetomir Stoyanov (VMware)
                   ` (11 subsequent siblings)
  22 siblings, 0 replies; 30+ messages in thread
From: Tzvetomir Stoyanov (VMware) @ 2018-08-27  8:17 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel

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

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/20180808180701.623942406@goodmis.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 include/traceevent/event-parse.h | 10 +++++-----
 lib/traceevent/event-parse.c     |  2 +-
 lib/traceevent/event-plugin.c    |  4 ++--
 tracecmd/trace-read.c            |  4 ++--
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/include/traceevent/event-parse.h b/include/traceevent/event-parse.h
index 979ac97..3df714f 100644
--- a/include/traceevent/event-parse.h
+++ b/include/traceevent/event-parse.h
@@ -359,10 +359,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 							      \
@@ -739,7 +739,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;
 }
diff --git a/lib/traceevent/event-parse.c b/lib/traceevent/event-parse.c
index 0dc3dc5..004ac88 100644
--- a/lib/traceevent/event-parse.c
+++ b/lib/traceevent/event-parse.c
@@ -5501,7 +5501,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 {
diff --git a/lib/traceevent/event-plugin.c b/lib/traceevent/event-plugin.c
index 35b35dc..aeab162 100644
--- a/lib/traceevent/event-plugin.c
+++ b/lib/traceevent/event-plugin.c
@@ -376,7 +376,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;
 
 	/*
@@ -384,7 +384,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
diff --git a/tracecmd/trace-read.c b/tracecmd/trace-read.c
index a61f6aa..74059a0 100644
--- a/tracecmd/trace-read.c
+++ b/tracecmd/trace-read.c
@@ -798,7 +798,7 @@ void trace_show_data(struct tracecmd_input *handle, struct tep_record *record)
 		tep_print_event_time(pevent, &s, event, record,
 					use_trace_clock);
 		buf[0] = 0;
-		if (use_trace_clock && !(pevent->flags & PEVENT_NSEC_OUTPUT))
+		if (use_trace_clock && !(pevent->flags & TEP_NSEC_OUTPUT))
 			rec_ts = (rec_ts + 500) / 1000;
 		if (last_ts) {
 			diff_ts = rec_ts - last_ts;
@@ -1687,7 +1687,7 @@ void trace_report (int argc, char **argv)
 		pevent = tracecmd_get_pevent(handle);
 
 		if (nanosec)
-			pevent->flags |= PEVENT_NSEC_OUTPUT;
+			pevent->flags |= TEP_NSEC_OUTPUT;
 
 		if (raw)
 			pevent->print_raw = 1;
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH v3 13/24] tools lib traceevent, tools lib lockdep: Rename 'enum pevent_errno' to 'enum tep_errno'
  2018-08-27  8:17 [PATCH v3 00/24] trace-cmd: rename variables, data structures and functions in lib/traceevent Tzvetomir Stoyanov (VMware)
                   ` (10 preceding siblings ...)
  2018-08-27  8:17 ` [PATCH v3 12/24] tools lib traceevent, perf tools: Rename 'enum pevent_flag' to 'enum tep_flag' Tzvetomir Stoyanov (VMware)
@ 2018-08-27  8:17 ` Tzvetomir Stoyanov (VMware)
  2018-08-27  8:17 ` [PATCH v3 14/24] tools lib traceevent: Rename pevent_function* APIs Tzvetomir Stoyanov (VMware)
                   ` (10 subsequent siblings)
  22 siblings, 0 replies; 30+ messages in thread
From: Tzvetomir Stoyanov (VMware) @ 2018-08-27  8:17 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel

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'.

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/20180808180701.770475059@goodmis.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 include/traceevent/event-parse.h |  48 +++++-----
 lib/traceevent/event-parse.c     |  60 ++++++-------
 lib/traceevent/parse-filter.c    | 150 +++++++++++++++----------------
 3 files changed, 129 insertions(+), 129 deletions(-)

diff --git a/include/traceevent/event-parse.h b/include/traceevent/event-parse.h
index 3df714f..4d4637d 100644
--- a/include/traceevent/event-parse.h
+++ b/include/traceevent/event-parse.h
@@ -365,7 +365,7 @@ enum tep_flag {
 	TEP_DISABLE_PLUGINS	= 1 << 2,
 };
 
-#define PEVENT_ERRORS 							      \
+#define TEP_ERRORS 							      \
 	_PE(MEM_ALLOC_FAILED,	"failed to allocate memory"),		      \
 	_PE(PARSE_EVENT_FAILED,	"failed to parse event"),		      \
 	_PE(READ_ID_FAILED,	"failed to read event id"),		      \
@@ -397,10 +397,10 @@ enum tep_flag {
 	_PE(FILTER_MISS,	"record does not match to filter")
 
 #undef _PE
-#define _PE(__code, __str) PEVENT_ERRNO__ ## __code
-enum pevent_errno {
-	PEVENT_ERRNO__SUCCESS			= 0,
-	PEVENT_ERRNO__FILTER_MATCH		= PEVENT_ERRNO__SUCCESS,
+#define _PE(__code, __str) TEP_ERRNO__ ## __code
+enum tep_errno {
+	TEP_ERRNO__SUCCESS			= 0,
+	TEP_ERRNO__FILTER_MATCH			= TEP_ERRNO__SUCCESS,
 
 	/*
 	 * Choose an arbitrary negative big number not to clash with standard
@@ -409,11 +409,11 @@ enum pevent_errno {
 	 *
 	 * http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/errno.h.html
 	 */
-	__PEVENT_ERRNO__START			= -100000,
+	__TEP_ERRNO__START			= -100000,
 
-	PEVENT_ERRORS,
+	TEP_ERRORS,
 
-	__PEVENT_ERRNO__END,
+	__TEP_ERRNO__END,
 };
 #undef _PE
 
@@ -630,12 +630,12 @@ void tep_print_event(struct tep_handle *pevent, struct trace_seq *s,
 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);
+enum tep_errno tep_parse_event(struct tep_handle *pevent, const char *buf,
+			       unsigned long size, const char *sys);
+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);
 
@@ -712,7 +712,7 @@ 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 pevent_errno errnum,
+int pevent_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);
@@ -930,10 +930,10 @@ struct event_filter {
 struct event_filter *pevent_filter_alloc(struct tep_handle *pevent);
 
 /* for backward compatibility */
-#define FILTER_NONE		PEVENT_ERRNO__NO_FILTER
-#define FILTER_NOEXIST		PEVENT_ERRNO__FILTER_NOT_FOUND
-#define FILTER_MISS		PEVENT_ERRNO__FILTER_MISS
-#define FILTER_MATCH		PEVENT_ERRNO__FILTER_MATCH
+#define FILTER_NONE		TEP_ERRNO__NO_FILTER
+#define FILTER_NOEXIST		TEP_ERRNO__FILTER_NOT_FOUND
+#define FILTER_MISS		TEP_ERRNO__FILTER_MISS
+#define FILTER_MATCH		TEP_ERRNO__FILTER_MATCH
 
 enum filter_trivial_type {
 	FILTER_TRIVIAL_FALSE,
@@ -941,13 +941,13 @@ enum filter_trivial_type {
 	FILTER_TRIVIAL_BOTH,
 };
 
-enum pevent_errno pevent_filter_add_filter_str(struct event_filter *filter,
-					       const char *filter_str);
+enum tep_errno pevent_filter_add_filter_str(struct event_filter *filter,
+					    const char *filter_str);
 
-enum pevent_errno pevent_filter_match(struct event_filter *filter,
-				      struct tep_record *record);
+enum tep_errno pevent_filter_match(struct event_filter *filter,
+				   struct tep_record *record);
 
-int pevent_filter_strerror(struct event_filter *filter, enum pevent_errno err,
+int pevent_filter_strerror(struct event_filter *filter, enum tep_errno err,
 			   char *buf, size_t buflen);
 
 int pevent_event_filtered(struct event_filter *filter,
diff --git a/lib/traceevent/event-parse.c b/lib/traceevent/event-parse.c
index 004ac88..b717eb8 100644
--- a/lib/traceevent/event-parse.c
+++ b/lib/traceevent/event-parse.c
@@ -6021,9 +6021,9 @@ static int find_event_handle(struct tep_handle *pevent, struct event_format *eve
  *
  * /sys/kernel/debug/tracing/events/.../.../format
  */
-enum pevent_errno __pevent_parse_format(struct event_format **eventp,
-					struct tep_handle *pevent, const char *buf,
-					unsigned long size, const char *sys)
+enum tep_errno __pevent_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;
@@ -6032,12 +6032,12 @@ enum pevent_errno __pevent_parse_format(struct event_format **eventp,
 
 	*eventp = event = alloc_event();
 	if (!event)
-		return PEVENT_ERRNO__MEM_ALLOC_FAILED;
+		return TEP_ERRNO__MEM_ALLOC_FAILED;
 
 	event->name = event_read_name();
 	if (!event->name) {
 		/* Bad event? */
-		ret = PEVENT_ERRNO__MEM_ALLOC_FAILED;
+		ret = TEP_ERRNO__MEM_ALLOC_FAILED;
 		goto event_alloc_failed;
 	}
 
@@ -6050,7 +6050,7 @@ enum pevent_errno __pevent_parse_format(struct event_format **eventp,
 		
 	event->id = event_read_id();
 	if (event->id < 0) {
-		ret = PEVENT_ERRNO__READ_ID_FAILED;
+		ret = TEP_ERRNO__READ_ID_FAILED;
 		/*
 		 * This isn't an allocation error actually.
 		 * But as the ID is critical, just bail out.
@@ -6060,7 +6060,7 @@ enum pevent_errno __pevent_parse_format(struct event_format **eventp,
 
 	event->system = strdup(sys);
 	if (!event->system) {
-		ret = PEVENT_ERRNO__MEM_ALLOC_FAILED;
+		ret = TEP_ERRNO__MEM_ALLOC_FAILED;
 		goto event_alloc_failed;
 	}
 
@@ -6069,7 +6069,7 @@ enum pevent_errno __pevent_parse_format(struct event_format **eventp,
 
 	ret = event_read_format(event);
 	if (ret < 0) {
-		ret = PEVENT_ERRNO__READ_FORMAT_FAILED;
+		ret = TEP_ERRNO__READ_FORMAT_FAILED;
 		goto event_parse_failed;
 	}
 
@@ -6084,7 +6084,7 @@ enum pevent_errno __pevent_parse_format(struct event_format **eventp,
 	show_warning = 1;
 
 	if (ret < 0) {
-		ret = PEVENT_ERRNO__READ_PRINT_FAILED;
+		ret = TEP_ERRNO__READ_PRINT_FAILED;
 		goto event_parse_failed;
 	}
 
@@ -6098,14 +6098,14 @@ enum pevent_errno __pevent_parse_format(struct event_format **eventp,
 			arg = alloc_arg();
 			if (!arg) {
 				event->flags |= EVENT_FL_FAILED;
-				return PEVENT_ERRNO__OLD_FTRACE_ARG_FAILED;
+				return TEP_ERRNO__OLD_FTRACE_ARG_FAILED;
 			}
 			arg->type = PRINT_FIELD;
 			arg->field.name = strdup(field->name);
 			if (!arg->field.name) {
 				event->flags |= EVENT_FL_FAILED;
 				free_arg(arg);
-				return PEVENT_ERRNO__OLD_FTRACE_ARG_FAILED;
+				return TEP_ERRNO__OLD_FTRACE_ARG_FAILED;
 			}
 			arg->field.field = field;
 			*list = arg;
@@ -6128,7 +6128,7 @@ enum pevent_errno __pevent_parse_format(struct event_format **eventp,
 	return ret;
 }
 
-static enum pevent_errno
+static enum tep_errno
 __pevent_parse_event(struct tep_handle *pevent,
 		     struct event_format **eventp,
 		     const char *buf, unsigned long size,
@@ -6141,7 +6141,7 @@ __pevent_parse_event(struct tep_handle *pevent,
 		return ret;
 
 	if (pevent && add_event(pevent, event)) {
-		ret = PEVENT_ERRNO__MEM_ALLOC_FAILED;
+		ret = TEP_ERRNO__MEM_ALLOC_FAILED;
 		goto event_add_failed;
 	}
 
@@ -6171,10 +6171,10 @@ event_add_failed:
  *
  * /sys/kernel/debug/tracing/events/.../.../format
  */
-enum pevent_errno tep_parse_format(struct tep_handle *pevent,
-				   struct event_format **eventp,
-				   const char *buf,
-				   unsigned long size, const char *sys)
+enum tep_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);
 }
@@ -6193,8 +6193,8 @@ enum pevent_errno tep_parse_format(struct tep_handle *pevent,
  *
  * /sys/kernel/debug/tracing/events/.../.../format
  */
-enum pevent_errno tep_parse_event(struct tep_handle *pevent, const char *buf,
-				  unsigned long size, const char *sys)
+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);
@@ -6203,12 +6203,12 @@ enum pevent_errno tep_parse_event(struct tep_handle *pevent, const char *buf,
 #undef _PE
 #define _PE(code, str) str
 static const char * const pevent_error_str[] = {
-	PEVENT_ERRORS
+	TEP_ERRORS
 };
 #undef _PE
 
 int pevent_strerror(struct tep_handle *pevent __maybe_unused,
-		    enum pevent_errno errnum, char *buf, size_t buflen)
+		    enum tep_errno errnum, char *buf, size_t buflen)
 {
 	int idx;
 	const char *msg;
@@ -6218,11 +6218,11 @@ int pevent_strerror(struct tep_handle *pevent __maybe_unused,
 		return 0;
 	}
 
-	if (errnum <= __PEVENT_ERRNO__START ||
-	    errnum >= __PEVENT_ERRNO__END)
+	if (errnum <= __TEP_ERRNO__START ||
+	    errnum >= __TEP_ERRNO__END)
 		return -1;
 
-	idx = errnum - __PEVENT_ERRNO__START - 1;
+	idx = errnum - __TEP_ERRNO__START - 1;
 	msg = pevent_error_str[idx];
 	snprintf(buf, buflen, "%s", msg);
 
@@ -6503,7 +6503,7 @@ int pevent_register_print_function(struct tep_handle *pevent,
 	func_handle = calloc(1, sizeof(*func_handle));
 	if (!func_handle) {
 		do_warning("Failed to allocate function handler");
-		return PEVENT_ERRNO__MEM_ALLOC_FAILED;
+		return TEP_ERRNO__MEM_ALLOC_FAILED;
 	}
 
 	func_handle->ret_type = ret_type;
@@ -6512,7 +6512,7 @@ int pevent_register_print_function(struct tep_handle *pevent,
 	if (!func_handle->name) {
 		do_warning("Failed to allocate function name");
 		free(func_handle);
-		return PEVENT_ERRNO__MEM_ALLOC_FAILED;
+		return TEP_ERRNO__MEM_ALLOC_FAILED;
 	}
 
 	next_param = &(func_handle->params);
@@ -6524,14 +6524,14 @@ int pevent_register_print_function(struct tep_handle *pevent,
 
 		if (type >= PEVENT_FUNC_ARG_MAX_TYPES) {
 			do_warning("Invalid argument type %d", type);
-			ret = PEVENT_ERRNO__INVALID_ARG_TYPE;
+			ret = TEP_ERRNO__INVALID_ARG_TYPE;
 			goto out_free;
 		}
 
 		param = malloc(sizeof(*param));
 		if (!param) {
 			do_warning("Failed to allocate function param");
-			ret = PEVENT_ERRNO__MEM_ALLOC_FAILED;
+			ret = TEP_ERRNO__MEM_ALLOC_FAILED;
 			goto out_free;
 		}
 		param->type = type;
@@ -6640,7 +6640,7 @@ int pevent_register_event_handler(struct tep_handle *pevent, int id,
 	handle = calloc(1, sizeof(*handle));
 	if (!handle) {
 		do_warning("Failed to allocate event handler");
-		return PEVENT_ERRNO__MEM_ALLOC_FAILED;
+		return TEP_ERRNO__MEM_ALLOC_FAILED;
 	}
 
 	handle->id = id;
@@ -6655,7 +6655,7 @@ int pevent_register_event_handler(struct tep_handle *pevent, int id,
 		free((void *)handle->event_name);
 		free((void *)handle->sys_name);
 		free(handle);
-		return PEVENT_ERRNO__MEM_ALLOC_FAILED;
+		return TEP_ERRNO__MEM_ALLOC_FAILED;
 	}
 
 	handle->func = func;
diff --git a/lib/traceevent/parse-filter.c b/lib/traceevent/parse-filter.c
index bfdaec1..2241523 100644
--- a/lib/traceevent/parse-filter.c
+++ b/lib/traceevent/parse-filter.c
@@ -254,7 +254,7 @@ static int event_match(struct event_format *event,
 		!regexec(ereg, event->name, 0, NULL, 0);
 }
 
-static enum pevent_errno
+static enum tep_errno
 find_event(struct tep_handle *pevent, struct event_list **events,
 	   char *sys_name, char *event_name)
 {
@@ -275,26 +275,26 @@ find_event(struct tep_handle *pevent, struct event_list **events,
 
 	ret = asprintf(&reg, "^%s$", event_name);
 	if (ret < 0)
-		return PEVENT_ERRNO__MEM_ALLOC_FAILED;
+		return TEP_ERRNO__MEM_ALLOC_FAILED;
 
 	ret = regcomp(&ereg, reg, REG_ICASE|REG_NOSUB);
 	free(reg);
 
 	if (ret)
-		return PEVENT_ERRNO__INVALID_EVENT_NAME;
+		return TEP_ERRNO__INVALID_EVENT_NAME;
 
 	if (sys_name) {
 		ret = asprintf(&reg, "^%s$", sys_name);
 		if (ret < 0) {
 			regfree(&ereg);
-			return PEVENT_ERRNO__MEM_ALLOC_FAILED;
+			return TEP_ERRNO__MEM_ALLOC_FAILED;
 		}
 
 		ret = regcomp(&sreg, reg, REG_ICASE|REG_NOSUB);
 		free(reg);
 		if (ret) {
 			regfree(&ereg);
-			return PEVENT_ERRNO__INVALID_EVENT_NAME;
+			return TEP_ERRNO__INVALID_EVENT_NAME;
 		}
 	}
 
@@ -314,9 +314,9 @@ find_event(struct tep_handle *pevent, struct event_list **events,
 		regfree(&sreg);
 
 	if (!match)
-		return PEVENT_ERRNO__EVENT_NOT_FOUND;
+		return TEP_ERRNO__EVENT_NOT_FOUND;
 	if (fail)
-		return PEVENT_ERRNO__MEM_ALLOC_FAILED;
+		return TEP_ERRNO__MEM_ALLOC_FAILED;
 
 	return 0;
 }
@@ -332,7 +332,7 @@ static void free_events(struct event_list *events)
 	}
 }
 
-static enum pevent_errno
+static enum tep_errno
 create_arg_item(struct event_format *event, const char *token,
 		enum event_type type, struct filter_arg **parg, char *error_str)
 {
@@ -342,7 +342,7 @@ create_arg_item(struct event_format *event, const char *token,
 	arg = allocate_arg();
 	if (arg == NULL) {
 		show_error(error_str, "failed to allocate filter arg");
-		return PEVENT_ERRNO__MEM_ALLOC_FAILED;
+		return TEP_ERRNO__MEM_ALLOC_FAILED;
 	}
 
 	switch (type) {
@@ -356,7 +356,7 @@ create_arg_item(struct event_format *event, const char *token,
 		if (!arg->value.str) {
 			free_arg(arg);
 			show_error(error_str, "failed to allocate string filter arg");
-			return PEVENT_ERRNO__MEM_ALLOC_FAILED;
+			return TEP_ERRNO__MEM_ALLOC_FAILED;
 		}
 		break;
 	case EVENT_ITEM:
@@ -388,7 +388,7 @@ create_arg_item(struct event_format *event, const char *token,
 	default:
 		free_arg(arg);
 		show_error(error_str, "expected a value but found %s", token);
-		return PEVENT_ERRNO__UNEXPECTED_TYPE;
+		return TEP_ERRNO__UNEXPECTED_TYPE;
 	}
 	*parg = arg;
 	return 0;
@@ -440,7 +440,7 @@ create_arg_cmp(enum filter_cmp_type ctype)
 	return arg;
 }
 
-static enum pevent_errno
+static enum tep_errno
 add_right(struct filter_arg *op, struct filter_arg *arg, char *error_str)
 {
 	struct filter_arg *left;
@@ -473,7 +473,7 @@ add_right(struct filter_arg *op, struct filter_arg *arg, char *error_str)
 			break;
 		default:
 			show_error(error_str, "Illegal rvalue");
-			return PEVENT_ERRNO__ILLEGAL_RVALUE;
+			return TEP_ERRNO__ILLEGAL_RVALUE;
 		}
 
 		/*
@@ -520,7 +520,7 @@ add_right(struct filter_arg *op, struct filter_arg *arg, char *error_str)
 			if (left->type != FILTER_ARG_FIELD) {
 				show_error(error_str,
 					   "Illegal lvalue for string comparison");
-				return PEVENT_ERRNO__ILLEGAL_LVALUE;
+				return TEP_ERRNO__ILLEGAL_LVALUE;
 			}
 
 			/* Make sure this is a valid string compare */
@@ -539,13 +539,13 @@ add_right(struct filter_arg *op, struct filter_arg *arg, char *error_str)
 					show_error(error_str,
 						   "RegEx '%s' did not compute",
 						   str);
-					return PEVENT_ERRNO__INVALID_REGEX;
+					return TEP_ERRNO__INVALID_REGEX;
 				}
 				break;
 			default:
 				show_error(error_str,
 					   "Illegal comparison for string");
-				return PEVENT_ERRNO__ILLEGAL_STRING_CMP;
+				return TEP_ERRNO__ILLEGAL_STRING_CMP;
 			}
 
 			op->type = FILTER_ARG_STR;
@@ -554,7 +554,7 @@ add_right(struct filter_arg *op, struct filter_arg *arg, char *error_str)
 			op->str.val = strdup(str);
 			if (!op->str.val) {
 				show_error(error_str, "Failed to allocate string filter");
-				return PEVENT_ERRNO__MEM_ALLOC_FAILED;
+				return TEP_ERRNO__MEM_ALLOC_FAILED;
 			}
 			/*
 			 * Need a buffer to copy data for tests
@@ -562,7 +562,7 @@ add_right(struct filter_arg *op, struct filter_arg *arg, char *error_str)
 			op->str.buffer = malloc(op->str.field->size + 1);
 			if (!op->str.buffer) {
 				show_error(error_str, "Failed to allocate string filter");
-				return PEVENT_ERRNO__MEM_ALLOC_FAILED;
+				return TEP_ERRNO__MEM_ALLOC_FAILED;
 			}
 			/* Null terminate this buffer */
 			op->str.buffer[op->str.field->size] = 0;
@@ -581,7 +581,7 @@ add_right(struct filter_arg *op, struct filter_arg *arg, char *error_str)
 			case FILTER_CMP_NOT_REGEX:
 				show_error(error_str,
 					   "Op not allowed with integers");
-				return PEVENT_ERRNO__ILLEGAL_INTEGER_CMP;
+				return TEP_ERRNO__ILLEGAL_INTEGER_CMP;
 
 			default:
 				break;
@@ -602,7 +602,7 @@ add_right(struct filter_arg *op, struct filter_arg *arg, char *error_str)
 
  out_fail:
 	show_error(error_str, "Syntax error");
-	return PEVENT_ERRNO__SYNTAX_ERROR;
+	return TEP_ERRNO__SYNTAX_ERROR;
 }
 
 static struct filter_arg *
@@ -615,7 +615,7 @@ rotate_op_right(struct filter_arg *a, struct filter_arg *b)
 	return arg;
 }
 
-static enum pevent_errno add_left(struct filter_arg *op, struct filter_arg *arg)
+static enum tep_errno add_left(struct filter_arg *op, struct filter_arg *arg)
 {
 	switch (op->type) {
 	case FILTER_ARG_EXP:
@@ -634,11 +634,11 @@ static enum pevent_errno add_left(struct filter_arg *op, struct filter_arg *arg)
 		/* left arg of compares must be a field */
 		if (arg->type != FILTER_ARG_FIELD &&
 		    arg->type != FILTER_ARG_BOOLEAN)
-			return PEVENT_ERRNO__INVALID_ARG_TYPE;
+			return TEP_ERRNO__INVALID_ARG_TYPE;
 		op->num.left = arg;
 		break;
 	default:
-		return PEVENT_ERRNO__INVALID_ARG_TYPE;
+		return TEP_ERRNO__INVALID_ARG_TYPE;
 	}
 	return 0;
 }
@@ -751,7 +751,7 @@ enum filter_vals {
 	FILTER_VAL_TRUE,
 };
 
-static enum pevent_errno
+static enum tep_errno
 reparent_op_arg(struct filter_arg *parent, struct filter_arg *old_child,
 		struct filter_arg *arg, char *error_str)
 {
@@ -761,7 +761,7 @@ reparent_op_arg(struct filter_arg *parent, struct filter_arg *old_child,
 	if (parent->type != FILTER_ARG_OP &&
 	    arg->type != FILTER_ARG_OP) {
 		show_error(error_str, "can not reparent other than OP");
-		return PEVENT_ERRNO__REPARENT_NOT_OP;
+		return TEP_ERRNO__REPARENT_NOT_OP;
 	}
 
 	/* Get the sibling */
@@ -773,7 +773,7 @@ reparent_op_arg(struct filter_arg *parent, struct filter_arg *old_child,
 		other_child = old_child->op.right;
 	} else {
 		show_error(error_str, "Error in reparent op, find other child");
-		return PEVENT_ERRNO__REPARENT_FAILED;
+		return TEP_ERRNO__REPARENT_FAILED;
 	}
 
 	/* Detach arg from old_child */
@@ -794,7 +794,7 @@ reparent_op_arg(struct filter_arg *parent, struct filter_arg *old_child,
 		ptr = &parent->op.left;
 	else {
 		show_error(error_str, "Error in reparent op");
-		return PEVENT_ERRNO__REPARENT_FAILED;
+		return TEP_ERRNO__REPARENT_FAILED;
 	}
 
 	*ptr = arg;
@@ -803,7 +803,7 @@ reparent_op_arg(struct filter_arg *parent, struct filter_arg *old_child,
 	return 0;
 }
 
-/* Returns either filter_vals (success) or pevent_errno (failfure) */
+/* Returns either filter_vals (success) or tep_errno (failfure) */
 static int test_arg(struct filter_arg *parent, struct filter_arg *arg,
 		    char *error_str)
 {
@@ -898,7 +898,7 @@ static int test_arg(struct filter_arg *parent, struct filter_arg *arg,
 		return rval;
 	default:
 		show_error(error_str, "bad arg in filter tree");
-		return PEVENT_ERRNO__BAD_FILTER_ARG;
+		return TEP_ERRNO__BAD_FILTER_ARG;
 	}
 	return FILTER_VAL_NORM;
 }
@@ -923,7 +923,7 @@ static int collapse_tree(struct filter_arg *arg,
 			arg->boolean.value = ret == FILTER_VAL_TRUE;
 		} else {
 			show_error(error_str, "Failed to allocate filter arg");
-			ret = PEVENT_ERRNO__MEM_ALLOC_FAILED;
+			ret = TEP_ERRNO__MEM_ALLOC_FAILED;
 		}
 		break;
 
@@ -938,7 +938,7 @@ static int collapse_tree(struct filter_arg *arg,
 	return ret;
 }
 
-static enum pevent_errno
+static enum tep_errno
 process_filter(struct event_format *event, struct filter_arg **parg,
 	       char *error_str, int not)
 {
@@ -952,7 +952,7 @@ process_filter(struct event_format *event, struct filter_arg **parg,
 	enum filter_op_type btype;
 	enum filter_exp_type etype;
 	enum filter_cmp_type ctype;
-	enum pevent_errno ret;
+	enum tep_errno ret;
 
 	*parg = NULL;
 
@@ -990,7 +990,7 @@ process_filter(struct event_format *event, struct filter_arg **parg,
 		case EVENT_DELIM:
 			if (*token == ',') {
 				show_error(error_str, "Illegal token ','");
-				ret = PEVENT_ERRNO__ILLEGAL_TOKEN;
+				ret = TEP_ERRNO__ILLEGAL_TOKEN;
 				goto fail;
 			}
 
@@ -998,22 +998,22 @@ process_filter(struct event_format *event, struct filter_arg **parg,
 				if (left_item) {
 					show_error(error_str,
 						   "Open paren can not come after item");
-					ret = PEVENT_ERRNO__INVALID_PAREN;
+					ret = TEP_ERRNO__INVALID_PAREN;
 					goto fail;
 				}
 				if (current_exp) {
 					show_error(error_str,
 						   "Open paren can not come after expression");
-					ret = PEVENT_ERRNO__INVALID_PAREN;
+					ret = TEP_ERRNO__INVALID_PAREN;
 					goto fail;
 				}
 
 				ret = process_filter(event, &arg, error_str, 0);
-				if (ret != PEVENT_ERRNO__UNBALANCED_PAREN) {
+				if (ret != TEP_ERRNO__UNBALANCED_PAREN) {
 					if (ret == 0) {
 						show_error(error_str,
 							   "Unbalanced number of '('");
-						ret = PEVENT_ERRNO__UNBALANCED_PAREN;
+						ret = TEP_ERRNO__UNBALANCED_PAREN;
 					}
 					goto fail;
 				}
@@ -1050,7 +1050,7 @@ process_filter(struct event_format *event, struct filter_arg **parg,
 				else
 					*parg = current_exp;
 				free(token);
-				return PEVENT_ERRNO__UNBALANCED_PAREN;
+				return TEP_ERRNO__UNBALANCED_PAREN;
 			}
 			break;
 
@@ -1077,7 +1077,7 @@ process_filter(struct event_format *event, struct filter_arg **parg,
 			case OP_NONE:
 				show_error(error_str,
 					   "Unknown op token %s", token);
-				ret = PEVENT_ERRNO__UNKNOWN_TOKEN;
+				ret = TEP_ERRNO__UNKNOWN_TOKEN;
 				goto fail;
 			}
 
@@ -1165,11 +1165,11 @@ process_filter(struct event_format *event, struct filter_arg **parg,
 
  fail_alloc:
 	show_error(error_str, "failed to allocate filter arg");
-	ret = PEVENT_ERRNO__MEM_ALLOC_FAILED;
+	ret = TEP_ERRNO__MEM_ALLOC_FAILED;
 	goto fail;
  fail_syntax:
 	show_error(error_str, "Syntax error");
-	ret = PEVENT_ERRNO__SYNTAX_ERROR;
+	ret = TEP_ERRNO__SYNTAX_ERROR;
  fail:
 	free_arg(current_op);
 	free_arg(current_exp);
@@ -1178,7 +1178,7 @@ process_filter(struct event_format *event, struct filter_arg **parg,
 	return ret;
 }
 
-static enum pevent_errno
+static enum tep_errno
 process_event(struct event_format *event, const char *filter_str,
 	      struct filter_arg **parg, char *error_str)
 {
@@ -1194,7 +1194,7 @@ process_event(struct event_format *event, const char *filter_str,
 	if (!*parg) {
 		*parg = allocate_arg();
 		if (*parg == NULL)
-			return PEVENT_ERRNO__MEM_ALLOC_FAILED;
+			return TEP_ERRNO__MEM_ALLOC_FAILED;
 
 		(*parg)->type = FILTER_ARG_BOOLEAN;
 		(*parg)->boolean.value = FILTER_FALSE;
@@ -1203,13 +1203,13 @@ process_event(struct event_format *event, const char *filter_str,
 	return 0;
 }
 
-static enum pevent_errno
+static enum tep_errno
 filter_event(struct event_filter *filter, struct event_format *event,
 	     const char *filter_str, char *error_str)
 {
 	struct filter_type *filter_type;
 	struct filter_arg *arg;
-	enum pevent_errno ret;
+	enum tep_errno ret;
 
 	if (filter_str) {
 		ret = process_event(event, filter_str, &arg, error_str);
@@ -1220,7 +1220,7 @@ filter_event(struct event_filter *filter, struct event_format *event,
 		/* just add a TRUE arg */
 		arg = allocate_arg();
 		if (arg == NULL)
-			return PEVENT_ERRNO__MEM_ALLOC_FAILED;
+			return TEP_ERRNO__MEM_ALLOC_FAILED;
 
 		arg->type = FILTER_ARG_BOOLEAN;
 		arg->boolean.value = FILTER_TRUE;
@@ -1228,7 +1228,7 @@ filter_event(struct event_filter *filter, struct event_format *event,
 
 	filter_type = add_filter_type(filter, event->id);
 	if (filter_type == NULL)
-		return PEVENT_ERRNO__MEM_ALLOC_FAILED;
+		return TEP_ERRNO__MEM_ALLOC_FAILED;
 
 	if (filter_type->filter)
 		free_arg(filter_type->filter);
@@ -1253,7 +1253,7 @@ static void filter_init_error_buf(struct event_filter *filter)
  * negative error code.  Use pevent_filter_strerror() to see
  * actual error message in case of error.
  */
-enum pevent_errno pevent_filter_add_filter_str(struct event_filter *filter,
+enum tep_errno pevent_filter_add_filter_str(struct event_filter *filter,
 					       const char *filter_str)
 {
 	struct tep_handle *pevent = filter->pevent;
@@ -1265,7 +1265,7 @@ enum pevent_errno pevent_filter_add_filter_str(struct event_filter *filter,
 	char *event_name = NULL;
 	char *sys_name = NULL;
 	char *sp;
-	enum pevent_errno rtn = 0; /* PEVENT_ERRNO__SUCCESS */
+	enum tep_errno rtn = 0; /* TEP_ERRNO__SUCCESS */
 	int len;
 	int ret;
 
@@ -1291,7 +1291,7 @@ enum pevent_errno pevent_filter_add_filter_str(struct event_filter *filter,
 		if (this_event == NULL) {
 			/* This can only happen when events is NULL, but still */
 			free_events(events);
-			return PEVENT_ERRNO__MEM_ALLOC_FAILED;
+			return TEP_ERRNO__MEM_ALLOC_FAILED;
 		}
 		memcpy(this_event, filter_str, len);
 		this_event[len] = 0;
@@ -1308,7 +1308,7 @@ enum pevent_errno pevent_filter_add_filter_str(struct event_filter *filter,
 			/* This can only happen when events is NULL, but still */
 			free_events(events);
 			free(this_event);
-			return PEVENT_ERRNO__FILTER_NOT_FOUND;
+			return TEP_ERRNO__FILTER_NOT_FOUND;
 		}
 
 		/* Find this event */
@@ -1365,10 +1365,10 @@ static void free_filter_type(struct filter_type *filter_type)
  *
  * Returns 0 if message was filled successfully, -1 if error
  */
-int pevent_filter_strerror(struct event_filter *filter, enum pevent_errno err,
+int pevent_filter_strerror(struct event_filter *filter, enum tep_errno err,
 			   char *buf, size_t buflen)
 {
-	if (err <= __PEVENT_ERRNO__START || err >= __PEVENT_ERRNO__END)
+	if (err <= __TEP_ERRNO__START || err >= __TEP_ERRNO__END)
 		return -1;
 
 	if (strlen(filter->error_buffer) > 0) {
@@ -1683,7 +1683,7 @@ int pevent_filter_event_has_trivial(struct event_filter *filter,
 }
 
 static int test_filter(struct event_format *event, struct filter_arg *arg,
-		       struct tep_record *record, enum pevent_errno *err);
+		       struct tep_record *record, enum tep_errno *err);
 
 static const char *
 get_comm(struct event_format *event, struct tep_record *record)
@@ -1734,11 +1734,11 @@ get_value(struct event_format *event,
 
 static unsigned long long
 get_arg_value(struct event_format *event, struct filter_arg *arg,
-	      struct tep_record *record, enum pevent_errno *err);
+	      struct tep_record *record, enum tep_errno *err);
 
 static unsigned long long
 get_exp_value(struct event_format *event, struct filter_arg *arg,
-	      struct tep_record *record, enum pevent_errno *err)
+	      struct tep_record *record, enum tep_errno *err)
 {
 	unsigned long long lval, rval;
 
@@ -1786,14 +1786,14 @@ get_exp_value(struct event_format *event, struct filter_arg *arg,
 	case FILTER_EXP_NOT:
 	default:
 		if (!*err)
-			*err = PEVENT_ERRNO__INVALID_EXP_TYPE;
+			*err = TEP_ERRNO__INVALID_EXP_TYPE;
 	}
 	return 0;
 }
 
 static unsigned long long
 get_arg_value(struct event_format *event, struct filter_arg *arg,
-	      struct tep_record *record, enum pevent_errno *err)
+	      struct tep_record *record, enum tep_errno *err)
 {
 	switch (arg->type) {
 	case FILTER_ARG_FIELD:
@@ -1802,7 +1802,7 @@ get_arg_value(struct event_format *event, struct filter_arg *arg,
 	case FILTER_ARG_VALUE:
 		if (arg->value.type != FILTER_NUMBER) {
 			if (!*err)
-				*err = PEVENT_ERRNO__NOT_A_NUMBER;
+				*err = TEP_ERRNO__NOT_A_NUMBER;
 		}
 		return arg->value.val;
 
@@ -1811,13 +1811,13 @@ get_arg_value(struct event_format *event, struct filter_arg *arg,
 
 	default:
 		if (!*err)
-			*err = PEVENT_ERRNO__INVALID_ARG_TYPE;
+			*err = TEP_ERRNO__INVALID_ARG_TYPE;
 	}
 	return 0;
 }
 
 static int test_num(struct event_format *event, struct filter_arg *arg,
-		    struct tep_record *record, enum pevent_errno *err)
+		    struct tep_record *record, enum tep_errno *err)
 {
 	unsigned long long lval, rval;
 
@@ -1852,7 +1852,7 @@ static int test_num(struct event_format *event, struct filter_arg *arg,
 
 	default:
 		if (!*err)
-			*err = PEVENT_ERRNO__ILLEGAL_INTEGER_CMP;
+			*err = TEP_ERRNO__ILLEGAL_INTEGER_CMP;
 		return 0;
 	}
 }
@@ -1908,7 +1908,7 @@ static const char *get_field_str(struct filter_arg *arg, struct tep_record *reco
 }
 
 static int test_str(struct event_format *event, struct filter_arg *arg,
-		    struct tep_record *record, enum pevent_errno *err)
+		    struct tep_record *record, enum tep_errno *err)
 {
 	const char *val;
 
@@ -1933,13 +1933,13 @@ static int test_str(struct event_format *event, struct filter_arg *arg,
 
 	default:
 		if (!*err)
-			*err = PEVENT_ERRNO__ILLEGAL_STRING_CMP;
+			*err = TEP_ERRNO__ILLEGAL_STRING_CMP;
 		return 0;
 	}
 }
 
 static int test_op(struct event_format *event, struct filter_arg *arg,
-		   struct tep_record *record, enum pevent_errno *err)
+		   struct tep_record *record, enum tep_errno *err)
 {
 	switch (arg->op.type) {
 	case FILTER_OP_AND:
@@ -1955,13 +1955,13 @@ static int test_op(struct event_format *event, struct filter_arg *arg,
 
 	default:
 		if (!*err)
-			*err = PEVENT_ERRNO__INVALID_OP_TYPE;
+			*err = TEP_ERRNO__INVALID_OP_TYPE;
 		return 0;
 	}
 }
 
 static int test_filter(struct event_format *event, struct filter_arg *arg,
-		       struct tep_record *record, enum pevent_errno *err)
+		       struct tep_record *record, enum tep_errno *err)
 {
 	if (*err) {
 		/*
@@ -1995,7 +1995,7 @@ static int test_filter(struct event_format *event, struct filter_arg *arg,
 
 	default:
 		if (!*err)
-			*err = PEVENT_ERRNO__INVALID_ARG_TYPE;
+			*err = TEP_ERRNO__INVALID_ARG_TYPE;
 		return 0;
 	}
 }
@@ -2025,38 +2025,38 @@ int pevent_event_filtered(struct event_filter *filter, int event_id)
  * @filter: filter struct with filter information
  * @record: the record to test against the filter
  *
- * Returns: match result or error code (prefixed with PEVENT_ERRNO__)
+ * Returns: match result or error code (prefixed with TEP_ERRNO__)
  * FILTER_MATCH - filter found for event and @record matches
  * FILTER_MISS  - filter found for event and @record does not match
  * FILTER_NOT_FOUND - no filter found for @record's event
  * NO_FILTER - if no filters exist
  * otherwise - error occurred during test
  */
-enum pevent_errno pevent_filter_match(struct event_filter *filter,
-				      struct tep_record *record)
+enum tep_errno pevent_filter_match(struct event_filter *filter,
+				   struct tep_record *record)
 {
 	struct tep_handle *pevent = filter->pevent;
 	struct filter_type *filter_type;
 	int event_id;
 	int ret;
-	enum pevent_errno err = 0;
+	enum tep_errno err = 0;
 
 	filter_init_error_buf(filter);
 
 	if (!filter->filters)
-		return PEVENT_ERRNO__NO_FILTER;
+		return TEP_ERRNO__NO_FILTER;
 
 	event_id = pevent_data_type(pevent, record);
 
 	filter_type = find_filter_type(filter, event_id);
 	if (!filter_type)
-		return PEVENT_ERRNO__FILTER_NOT_FOUND;
+		return TEP_ERRNO__FILTER_NOT_FOUND;
 
 	ret = test_filter(filter_type->event, filter_type->filter, record, &err);
 	if (err)
 		return err;
 
-	return ret ? PEVENT_ERRNO__FILTER_MATCH : PEVENT_ERRNO__FILTER_MISS;
+	return ret ? TEP_ERRNO__FILTER_MATCH : TEP_ERRNO__FILTER_MISS;
 }
 
 static char *op_to_str(struct event_filter *filter, struct filter_arg *arg)
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH v3 14/24] tools lib traceevent: Rename pevent_function* APIs
  2018-08-27  8:17 [PATCH v3 00/24] trace-cmd: rename variables, data structures and functions in lib/traceevent Tzvetomir Stoyanov (VMware)
                   ` (11 preceding siblings ...)
  2018-08-27  8:17 ` [PATCH v3 13/24] tools lib traceevent, tools lib lockdep: Rename 'enum pevent_errno' to 'enum tep_errno' Tzvetomir Stoyanov (VMware)
@ 2018-08-27  8:17 ` Tzvetomir Stoyanov (VMware)
  2018-08-27  8:17 ` [PATCH v3 15/24] tools lib traceevent, perf tools: Rename traceevent_plugin_* APIs Tzvetomir Stoyanov (VMware)
                   ` (9 subsequent siblings)
  22 siblings, 0 replies; 30+ messages in thread
From: Tzvetomir Stoyanov (VMware) @ 2018-08-27  8:17 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel

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

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/20180808180701.935881193@goodmis.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 include/traceevent/event-parse.h | 30 ++++++++--------
 lib/traceevent/event-parse.c     | 62 ++++++++++++++++----------------
 plugins/plugin_cfg80211.c        |  6 ++--
 plugins/plugin_jbd2.c            | 12 +++----
 plugins/plugin_kvm.c             |  6 ++--
 plugins/plugin_scsi.c            | 10 +++---
 plugins/plugin_xen.c             |  6 ++--
 7 files changed, 66 insertions(+), 66 deletions(-)

diff --git a/include/traceevent/event-parse.h b/include/traceevent/event-parse.h
index 4d4637d..89f4c64 100644
--- a/include/traceevent/event-parse.h
+++ b/include/traceevent/event-parse.h
@@ -255,10 +255,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;
 };
 
@@ -347,16 +347,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 {
@@ -510,7 +510,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;
 
 	int parsing_failures;
 
@@ -668,11 +668,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);
diff --git a/lib/traceevent/event-parse.c b/lib/traceevent/event-parse.c
index b717eb8..5e4f493 100644
--- a/lib/traceevent/event-parse.c
+++ b/lib/traceevent/event-parse.c
@@ -80,14 +80,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;
 };
@@ -96,7 +96,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
@@ -2900,10 +2900,10 @@ process_bitmask(struct event_format *event __maybe_unused, struct print_arg *arg
 	return 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;
@@ -2918,8 +2918,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)) {
@@ -2933,7 +2933,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;
@@ -2994,7 +2994,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);
@@ -4118,7 +4118,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;
@@ -4145,12 +4145,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);
@@ -6447,7 +6447,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;
 
@@ -6468,24 +6468,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;
 
@@ -6518,11 +6518,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;
@@ -6565,9 +6565,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) {
@@ -6805,7 +6805,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;
 
diff --git a/plugins/plugin_cfg80211.c b/plugins/plugin_cfg80211.c
index c189bbc..e0421e3 100644
--- a/plugins/plugin_cfg80211.c
+++ b/plugins/plugin_cfg80211.c
@@ -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;
 }
 
diff --git a/plugins/plugin_jbd2.c b/plugins/plugin_jbd2.c
index c942229..0dd1633 100644
--- a/plugins/plugin_jbd2.c
+++ b/plugins/plugin_jbd2.c
@@ -38,17 +38,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;
 }
 
diff --git a/plugins/plugin_kvm.c b/plugins/plugin_kvm.c
index 0244768..a7626ac 100644
--- a/plugins/plugin_kvm.c
+++ b/plugins/plugin_kvm.c
@@ -472,10 +472,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;
 }
 
diff --git a/plugins/plugin_scsi.c b/plugins/plugin_scsi.c
index bb9aea6..ce38df7 100644
--- a/plugins/plugin_scsi.c
+++ b/plugins/plugin_scsi.c
@@ -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;
 }
 
diff --git a/plugins/plugin_xen.c b/plugins/plugin_xen.c
index 1973dd8..2ffbd91 100644
--- a/plugins/plugin_xen.c
+++ b/plugins/plugin_xen.c
@@ -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;
 }
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH v3 15/24] tools lib traceevent, perf tools: Rename traceevent_plugin_* APIs
  2018-08-27  8:17 [PATCH v3 00/24] trace-cmd: rename variables, data structures and functions in lib/traceevent Tzvetomir Stoyanov (VMware)
                   ` (12 preceding siblings ...)
  2018-08-27  8:17 ` [PATCH v3 14/24] tools lib traceevent: Rename pevent_function* APIs Tzvetomir Stoyanov (VMware)
@ 2018-08-27  8:17 ` Tzvetomir Stoyanov (VMware)
  2018-08-27  8:17 ` [PATCH v3 16/24] tools lib traceevent: Rename pevent_filter* APIs Tzvetomir Stoyanov (VMware)
                   ` (8 subsequent siblings)
  22 siblings, 0 replies; 30+ messages in thread
From: Tzvetomir Stoyanov (VMware) @ 2018-08-27  8:17 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel

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

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/20180808180702.089951638@goodmis.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 include/traceevent/event-parse.h | 16 ++++++++--------
 lib/traceevent/event-plugin.c    | 28 ++++++++++++++--------------
 2 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/include/traceevent/event-parse.h b/include/traceevent/event-parse.h
index 89f4c64..5a630cc 100644
--- a/include/traceevent/event-parse.h
+++ b/include/traceevent/event-parse.h
@@ -424,14 +424,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;
diff --git a/lib/traceevent/event-plugin.c b/lib/traceevent/event-plugin.c
index aeab162..f17e250 100644
--- a/lib/traceevent/event-plugin.c
+++ b/lib/traceevent/event-plugin.c
@@ -83,7 +83,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
@@ -92,9 +92,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;
@@ -132,7 +132,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;
 
@@ -201,14 +201,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;
 
@@ -227,10 +227,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;
@@ -246,7 +246,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
@@ -256,9 +256,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);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH v3 16/24] tools lib traceevent: Rename pevent_filter* APIs
  2018-08-27  8:17 [PATCH v3 00/24] trace-cmd: rename variables, data structures and functions in lib/traceevent Tzvetomir Stoyanov (VMware)
                   ` (13 preceding siblings ...)
  2018-08-27  8:17 ` [PATCH v3 15/24] tools lib traceevent, perf tools: Rename traceevent_plugin_* APIs Tzvetomir Stoyanov (VMware)
@ 2018-08-27  8:17 ` Tzvetomir Stoyanov (VMware)
  2018-08-27  8:17 ` [PATCH v3 17/24] tools lib traceevent: Rename pevent_register / unregister APIs Tzvetomir Stoyanov (VMware)
                   ` (7 subsequent siblings)
  22 siblings, 0 replies; 30+ messages in thread
From: Tzvetomir Stoyanov (VMware) @ 2018-08-27  8:17 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel

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

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/20180808180702.370659353@goodmis.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 include/traceevent/event-parse.h         | 50 +++++++-------
 kernel-shark-qt/examples/datafilter.c    |  4 +-
 kernel-shark-qt/src/libkshark-configio.c |  4 +-
 kernel-shark-qt/src/libkshark.c          |  8 +--
 kernel-shark/kernel-shark.c              |  4 +-
 kernel-shark/trace-filter.c              | 38 +++++------
 kernel-shark/trace-graph.c               | 22 +++----
 kernel-shark/trace-view-store.c          | 12 ++--
 kernel-shark/trace-view.c                |  6 +-
 lib/traceevent/parse-filter.c            | 84 ++++++++++++------------
 tracecmd/trace-read.c                    |  8 +--
 11 files changed, 120 insertions(+), 120 deletions(-)

diff --git a/include/traceevent/event-parse.h b/include/traceevent/event-parse.h
index 5a630cc..812ef18 100644
--- a/include/traceevent/event-parse.h
+++ b/include/traceevent/event-parse.h
@@ -918,16 +918,16 @@ struct filter_type {
 	struct filter_arg	*filter;
 };
 
-#define PEVENT_FILTER_ERROR_BUFSZ  1024
+#define TEP_FILTER_ERROR_BUFSZ  1024
 
 struct 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
@@ -941,39 +941,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 */
diff --git a/kernel-shark-qt/examples/datafilter.c b/kernel-shark-qt/examples/datafilter.c
index 1c04ce5..4b1e1e9 100644
--- a/kernel-shark-qt/examples/datafilter.c
+++ b/kernel-shark-qt/examples/datafilter.c
@@ -117,8 +117,8 @@ int main(int argc, char **argv)
 
 	/* Use the Advanced filter to do event content based filtering. */
 	adv_filter = kshark_ctx->advanced_event_filter;
-	pevent_filter_add_filter_str(adv_filter,
-				     "sched/sched_wakeup:target_cpu==1");
+	tep_filter_add_filter_str(adv_filter,
+				  "sched/sched_wakeup:target_cpu==1");
 
 	/* The Advanced filter requires reloading the data. */
 	for (i = 0; i < n_rows; ++i)
diff --git a/kernel-shark-qt/src/libkshark-configio.c b/kernel-shark-qt/src/libkshark-configio.c
index 026ad50..d7c1a06 100644
--- a/kernel-shark-qt/src/libkshark-configio.c
+++ b/kernel-shark-qt/src/libkshark-configio.c
@@ -1033,7 +1033,7 @@ static bool kshark_adv_filters_to_json(struct kshark_context *kshark_ctx,
 		return false;
 
 	for (i = 0; events[i]; i++) {
-		str = pevent_filter_make_string(adv_filter,
+		str = tep_filter_make_string(adv_filter,
 						events[i]->id);
 		if (!str)
 			continue;
@@ -1136,7 +1136,7 @@ static bool kshark_adv_filters_from_json(struct kshark_context *kshark_ctx,
 			 json_object_get_string(jname),
 			 json_object_get_string(jcond));
 
-		ret = pevent_filter_add_filter_str(adv_filter,
+		ret = tep_filter_add_filter_str(adv_filter,
 						   filter_str);
 		if (ret < 0)
 			goto fail;
diff --git a/kernel-shark-qt/src/libkshark.c b/kernel-shark-qt/src/libkshark.c
index bb23afe..4f8da8a 100644
--- a/kernel-shark-qt/src/libkshark.c
+++ b/kernel-shark-qt/src/libkshark.c
@@ -148,7 +148,7 @@ bool kshark_open(struct kshark_context *kshark_ctx, const char *file)
 	kshark_ctx->pevent = tracecmd_get_pevent(handle);
 
 	kshark_ctx->advanced_event_filter =
-		pevent_filter_alloc(kshark_ctx->pevent);
+		tep_filter_alloc(kshark_ctx->pevent);
 
 	/*
 	 * Turn off function trace indent and turn on show parent
@@ -180,8 +180,8 @@ void kshark_close(struct kshark_context *kshark_ctx)
 	tracecmd_filter_id_clear(kshark_ctx->hide_event_filter);
 
 	if (kshark_ctx->advanced_event_filter) {
-		pevent_filter_reset(kshark_ctx->advanced_event_filter);
-		pevent_filter_free(kshark_ctx->advanced_event_filter);
+		tep_filter_reset(kshark_ctx->advanced_event_filter);
+		tep_filter_free(kshark_ctx->advanced_event_filter);
 		kshark_ctx->advanced_event_filter = NULL;
 	}
 
@@ -612,7 +612,7 @@ static size_t get_records(struct kshark_context *kshark_ctx,
 				/* Apply event filtering. */
 				ret = FILTER_MATCH;
 				if (adv_filter->filters)
-					ret = pevent_filter_match(adv_filter, rec);
+					ret = tep_filter_match(adv_filter, rec);
 
 				if (!kshark_show_event(kshark_ctx, entry->event_id) ||
 				    ret != FILTER_MATCH) {
diff --git a/kernel-shark/kernel-shark.c b/kernel-shark/kernel-shark.c
index 6b43296..8a512fc 100644
--- a/kernel-shark/kernel-shark.c
+++ b/kernel-shark/kernel-shark.c
@@ -460,7 +460,7 @@ static void load_filter(struct shark_info *info, const char *filename)
 	store = TRACE_VIEW_STORE(model);
 	event_filter = trace_view_store_get_event_filter(store);
 
-	if (pevent_filter_compare(event_filter, ginfo->event_filter))
+	if (tep_filter_compare(event_filter, ginfo->event_filter))
 		sync_event_filters(info);
 }
 
@@ -843,7 +843,7 @@ sync_events_filter_clicked (GtkWidget *subitem, gpointer data)
 	event_filter = trace_view_store_get_event_filter(store);
 
 	/* If they are already equal, then just perminently sync them */
-	if (pevent_filter_compare(event_filter, ginfo->event_filter))
+	if (tep_filter_compare(event_filter, ginfo->event_filter))
 		result = 2;
 	else
 		/* Ask user which way to sync */
diff --git a/kernel-shark/trace-filter.c b/kernel-shark/trace-filter.c
index 7216702..3145f99 100644
--- a/kernel-shark/trace-filter.c
+++ b/kernel-shark/trace-filter.c
@@ -470,7 +470,7 @@ create_tree_filter_model(struct tep_handle *pevent,
 		return GTK_TREE_MODEL(treestore);
 
 	for (i = 0; events[i]; i++) {
-		str = pevent_filter_make_string(event_filter, events[i]->id);
+		str = tep_filter_make_string(event_filter, events[i]->id);
 		if (!str)
 			continue;
 
@@ -1125,12 +1125,12 @@ create_tree_event_model(struct tep_handle *pevent,
 
 		normal = TRUE;
 		if (active && filter) {
-			if (pevent_event_filtered(filter, event->id) &&
-			    !pevent_filter_event_has_trivial(filter, event->id,
+			if (tep_event_filtered(filter, event->id) &&
+			    !tep_filter_event_has_trivial(filter, event->id,
 							     FILTER_TRIVIAL_BOTH))
 				normal = FALSE;
 			/* Make trivial false not selected */
-			else if (pevent_filter_event_has_trivial(filter, event->id,
+			else if (tep_filter_event_has_trivial(filter, event->id,
 								 FILTER_TRIVIAL_FALSE))
 				active = FALSE;
 		}
@@ -1950,7 +1950,7 @@ void trace_filter_convert_filter_to_names(struct event_filter *filter,
 			all_selected = 1;
 		}
 
-		if (pevent_filter_event_has_trivial(filter, event->id,
+		if (tep_filter_event_has_trivial(filter, event->id,
 						    FILTER_TRIVIAL_TRUE)) {
 			if (!all_selected || !systems)
 				*event_ids = tracecmd_add_id(*event_ids, event->id, event_count++);
@@ -1964,7 +1964,7 @@ void trace_filter_convert_filter_to_names(struct event_filter *filter,
 			all_selected = 0;
 
 			/* If this event is filtered, still add it */
-			if (pevent_event_filtered(filter, event->id))
+			if (tep_event_filtered(filter, event->id))
 				*event_ids = tracecmd_add_id(*event_ids, event->id, event_count++);
 		}
 		last_system = event->system;
@@ -1992,28 +1992,28 @@ void trace_filter_convert_char_to_filter(struct event_filter *filter,
 	pevent = filter->pevent;
 
 	/* Make a copy to use later */
-	copy = pevent_filter_alloc(pevent);
-	pevent_filter_copy(copy, filter);
-	pevent_filter_reset(filter);
+	copy = tep_filter_alloc(pevent);
+	tep_filter_copy(copy, filter);
+	tep_filter_reset(filter);
 
 	if (systems) {
 		for (i = 0; systems[i]; i++)
-			pevent_filter_add_filter_str(filter,
-						     systems[i]);
+			tep_filter_add_filter_str(filter,
+						  systems[i]);
 	}
 
 	if (events) {
 		for (i = 0; events[i] >= 0; i++) {
 			event = tep_find_event(filter->pevent, events[i]);
 			if (event)
-				pevent_filter_add_filter_str(filter,
-							     event->name);
+				tep_filter_add_filter_str(filter,
+							  event->name);
 		}
 	}
 
-	pevent_update_trivial(filter, copy, FILTER_TRIVIAL_BOTH);
+	tep_update_trivial(filter, copy, FILTER_TRIVIAL_BOTH);
 
-	pevent_filter_free(copy);
+	tep_filter_free(copy);
 }
 
 int trace_filter_save_events(struct tracecmd_xml_handle *handle,
@@ -2032,7 +2032,7 @@ int trace_filter_save_events(struct tracecmd_xml_handle *handle,
 		tracecmd_xml_write_element(handle, "System", "%s", systems[i]);
 
 	for (i = 0; event_ids && event_ids[i] > 0; i++) {
-		str = pevent_filter_make_string(filter, event_ids[i]);
+		str = tep_filter_make_string(filter, event_ids[i]);
 		if (!str)
 			continue;
 
@@ -2098,7 +2098,7 @@ int trace_filter_load_events(struct event_filter *event_filter,
 
 		if (strcmp(name, "System") == 0) {
 			system = tracecmd_xml_node_value(handle, node);
-			pevent_filter_add_filter_str(event_filter,
+			tep_filter_add_filter_str(event_filter,
 						     system);
 		} else if (strcmp(name, "Event") == 0) {
 			system = NULL;
@@ -2145,8 +2145,8 @@ int trace_filter_load_events(struct event_filter *event_filter,
 						sprintf(buffer, "%s", event);
 					}
 				}
-				pevent_filter_add_filter_str(event_filter,
-							     buffer);
+				tep_filter_add_filter_str(event_filter,
+							  buffer);
 				free(buffer);
 			}
 		}
diff --git a/kernel-shark/trace-graph.c b/kernel-shark/trace-graph.c
index 3fe0f83..53f5e39 100644
--- a/kernel-shark/trace-graph.c
+++ b/kernel-shark/trace-graph.c
@@ -279,7 +279,7 @@ gboolean trace_graph_filter_on_event(struct graph_info *ginfo, struct tep_record
 	if (ginfo->all_events)
 		return FALSE;
 
-	ret = pevent_filter_match(ginfo->event_filter, record);
+	ret = tep_filter_match(ginfo->event_filter, record);
 	return ret == FILTER_MATCH ? FALSE : TRUE;
 }
 
@@ -2235,14 +2235,14 @@ void trace_graph_event_filter_callback(gboolean accept,
 	if (all_events) {
 		ginfo->all_events = TRUE;
 		/* filter is no longer used */
-		pevent_filter_reset(ginfo->event_filter);
+		tep_filter_reset(ginfo->event_filter);
 		redraw_graph(ginfo);
 		return;
 	}
 
 	ginfo->all_events = FALSE;
 
-	pevent_filter_clear_trivial(ginfo->event_filter, FILTER_TRIVIAL_BOTH);
+	tep_filter_clear_trivial(ginfo->event_filter, FILTER_TRIVIAL_BOTH);
 
 	trace_filter_convert_char_to_filter(ginfo->event_filter,
 					    systems, events);
@@ -2271,17 +2271,17 @@ void trace_graph_adv_filter_callback(gboolean accept,
 
 	if (event_ids) {
 		for (i = 0; event_ids[i] >= 0; i++)
-			pevent_filter_remove_event(event_filter, event_ids[i]);
+			tep_filter_remove_event(event_filter, event_ids[i]);
 	}
 
 	if (has_text(text)) {
 
 		ginfo->all_events = FALSE;
 
-		pevent_filter_clear_trivial(event_filter,
+		tep_filter_clear_trivial(event_filter,
 					    FILTER_TRIVIAL_BOTH);
 
-		ret = pevent_filter_add_filter_str(event_filter, text);
+		ret = tep_filter_add_filter_str(event_filter, text);
 		if (ret < 0) {
 			pevent_strerror(event_filter->pevent, ret,
 					error_str, sizeof(error_str));
@@ -2300,14 +2300,14 @@ void trace_graph_copy_filter(struct graph_info *ginfo,
 	if (all_events) {
 		ginfo->all_events = TRUE;
 		/* filter is no longer used */
-		pevent_filter_reset(ginfo->event_filter);
+		tep_filter_reset(ginfo->event_filter);
 		redraw_graph(ginfo);
 		return;
 	}
 
 	ginfo->all_events = FALSE;
 
-	pevent_filter_copy(ginfo->event_filter, event_filter);
+	tep_filter_copy(ginfo->event_filter, event_filter);
 
 	redraw_graph(ginfo);
 }
@@ -2515,7 +2515,7 @@ static void free_int_array(int **array)
 void trace_graph_free_info(struct graph_info *ginfo)
 {
 	if (ginfo->handle) {
-		pevent_filter_free(ginfo->event_filter);
+		tep_filter_free(ginfo->event_filter);
 		trace_graph_plot_free(ginfo);
 		tracecmd_close(ginfo->handle);
 		free_task_hash(ginfo);
@@ -2552,7 +2552,7 @@ static int load_handle(struct graph_info *ginfo,
 	ginfo->cpus = tracecmd_cpus(handle);
 	ginfo->all_events = TRUE;
 
-	ginfo->event_filter = pevent_filter_alloc(ginfo->pevent);
+	ginfo->event_filter = tep_filter_alloc(ginfo->pevent);
 
 	ginfo->start_time = -1ULL;
 	ginfo->end_time = 0;
@@ -2645,7 +2645,7 @@ static int load_event_filter(struct graph_info *ginfo,
 	if (!node)
 		return -1;
 
-	pevent_filter_clear_trivial(event_filter, FILTER_TRIVIAL_BOTH);
+	tep_filter_clear_trivial(event_filter, FILTER_TRIVIAL_BOTH);
 	ginfo->all_events = FALSE;
 
 	trace_filter_load_events(event_filter, handle, node);
diff --git a/kernel-shark/trace-view-store.c b/kernel-shark/trace-view-store.c
index 61d0157..8d4e05f 100644
--- a/kernel-shark/trace-view-store.c
+++ b/kernel-shark/trace-view-store.c
@@ -224,7 +224,7 @@ trace_view_store_finalize (GObject *object)
 		store->spin = NULL;
 	}
 
-	pevent_filter_free(store->event_filter);
+	tep_filter_free(store->event_filter);
 	tracecmd_close(store->handle);
 
 	/* must chain up - finalize parent */
@@ -512,7 +512,7 @@ void trace_view_store_clear_all_events_enabled(TraceViewStore *store)
 {
 	g_return_if_fail (TRACE_VIEW_IS_LIST (store));
 
-	pevent_filter_clear_trivial(store->event_filter, FILTER_TRIVIAL_BOTH);
+	tep_filter_clear_trivial(store->event_filter, FILTER_TRIVIAL_BOTH);
 	store->all_events = 0;
 }
 
@@ -527,7 +527,7 @@ void trace_view_store_set_all_events_enabled(TraceViewStore *store)
 	 * All enabled means that we don't need to look at 
 	 * the system events, so free those arrays.
 	 */
-	pevent_filter_reset(store->event_filter);
+	tep_filter_reset(store->event_filter);
 
 	store->all_events = 1;
 }
@@ -855,7 +855,7 @@ trace_view_store_new (struct tracecmd_input *handle)
 	newstore->handle = handle;
 	newstore->cpus = tracecmd_cpus(handle);
 	tracecmd_ref(handle);
-	newstore->event_filter = pevent_filter_alloc(tracecmd_get_pevent(handle));
+	newstore->event_filter = tep_filter_alloc(tracecmd_get_pevent(handle));
 
 	newstore->cpu_list = g_new(TraceViewRecord *, newstore->cpus);
 	g_assert(newstore->cpu_list != NULL);
@@ -1257,8 +1257,8 @@ static void update_filter_tasks(TraceViewStore *store)
 			/* The record may be filtered by the events */
 			if (!store->all_events) {
 				int ret;
-				ret = pevent_filter_match(store->event_filter,
-							  record);
+				ret = tep_filter_match(store->event_filter,
+						       record);
 				if (ret != FILTER_MATCH) {
 					store->cpu_list[cpu][i].visible = 0;
 					goto skip;
diff --git a/kernel-shark/trace-view.c b/kernel-shark/trace-view.c
index a1e0b47..fdf8290 100644
--- a/kernel-shark/trace-view.c
+++ b/kernel-shark/trace-view.c
@@ -463,14 +463,14 @@ void trace_view_adv_filter_callback(gboolean accept,
 
 	if (event_ids) {
 		for (i = 0; event_ids[i] >= 0; i++)
-			pevent_filter_remove_event(event_filter, event_ids[i]);
+			tep_filter_remove_event(event_filter, event_ids[i]);
 	}
 
 	if (has_text(text)) {
 
 		trace_view_store_clear_all_events_enabled(store);
 
-		ret = pevent_filter_add_filter_str(event_filter, text);
+		ret = tep_filter_add_filter_str(event_filter, text);
 		if (ret < 0) {
 			pevent_strerror(event_filter->pevent, ret,
 					error_str, sizeof(error_str));
@@ -509,7 +509,7 @@ void trace_view_copy_filter(GtkWidget *treeview,
 
 		event_filter = trace_view_store_get_event_filter(store);
 
-		pevent_filter_copy(event_filter, src_event_filter);
+		tep_filter_copy(event_filter, src_event_filter);
 	}
 
 	update_rows(trace_tree, store);
diff --git a/lib/traceevent/parse-filter.c b/lib/traceevent/parse-filter.c
index 2241523..df42e04 100644
--- a/lib/traceevent/parse-filter.c
+++ b/lib/traceevent/parse-filter.c
@@ -52,7 +52,7 @@ static void show_error(char *error_buf, const char *fmt, ...)
 	}
 
 	va_start(ap, fmt);
-	vsnprintf(error_buf + len, PEVENT_FILTER_ERROR_BUFSZ - len, fmt, ap);
+	vsnprintf(error_buf + len, TEP_FILTER_ERROR_BUFSZ - len, fmt, ap);
 	va_end(ap);
 }
 
@@ -162,10 +162,10 @@ add_filter_type(struct event_filter *filter, int id)
 }
 
 /**
- * pevent_filter_alloc - create a new event filter
+ * tep_filter_alloc - create a new event filter
  * @pevent: The pevent that this filter is associated with
  */
-struct event_filter *pevent_filter_alloc(struct tep_handle *pevent)
+struct event_filter *tep_filter_alloc(struct tep_handle *pevent)
 {
 	struct event_filter *filter;
 
@@ -1245,16 +1245,16 @@ static void filter_init_error_buf(struct event_filter *filter)
 }
 
 /**
- * pevent_filter_add_filter_str - add a new filter
+ * tep_filter_add_filter_str - add a new filter
  * @filter: the event filter to add to
  * @filter_str: the filter string that contains the filter
  *
  * Returns 0 if the filter was successfully added or a
- * negative error code.  Use pevent_filter_strerror() to see
+ * negative error code.  Use tep_filter_strerror() to see
  * actual error message in case of error.
  */
-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)
 {
 	struct tep_handle *pevent = filter->pevent;
 	struct event_list *event;
@@ -1335,7 +1335,7 @@ enum tep_errno pevent_filter_add_filter_str(struct event_filter *filter,
 
 		if (ret >= 0 && pevent->test_filters) {
 			char *test;
-			test = pevent_filter_make_string(filter, event->event->id);
+			test = tep_filter_make_string(filter, event->event->id);
 			if (test) {
 				printf(" '%s: %s'\n", event->event->name, test);
 				free(test);
@@ -1357,7 +1357,7 @@ static void free_filter_type(struct filter_type *filter_type)
 }
 
 /**
- * pevent_filter_strerror - fill error message in a buffer
+ * tep_filter_strerror - fill error message in a buffer
  * @filter: the event filter contains error
  * @err: the error code
  * @buf: the buffer to be filled in
@@ -1365,8 +1365,8 @@ static void free_filter_type(struct filter_type *filter_type)
  *
  * Returns 0 if message was filled successfully, -1 if error
  */
-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)
 {
 	if (err <= __TEP_ERRNO__START || err >= __TEP_ERRNO__END)
 		return -1;
@@ -1383,7 +1383,7 @@ int pevent_filter_strerror(struct event_filter *filter, enum tep_errno err,
 }
 
 /**
- * pevent_filter_remove_event - remove a filter for an event
+ * tep_filter_remove_event - remove a filter for an event
  * @filter: the event filter to remove from
  * @event_id: the event to remove a filter for
  *
@@ -1393,8 +1393,8 @@ int pevent_filter_strerror(struct event_filter *filter, enum tep_errno err,
  * Returns 1: if an event was removed
  *   0: if the event was not found
  */
-int pevent_filter_remove_event(struct event_filter *filter,
-			       int event_id)
+int tep_filter_remove_event(struct event_filter *filter,
+			    int event_id)
 {
 	struct filter_type *filter_type;
 	unsigned long len;
@@ -1423,12 +1423,12 @@ int pevent_filter_remove_event(struct event_filter *filter,
 }
 
 /**
- * pevent_filter_reset - clear all filters in a filter
+ * tep_filter_reset - clear all filters in a filter
  * @filter: the event filter to reset
  *
  * Removes all filters from a filter and resets it.
  */
-void pevent_filter_reset(struct event_filter *filter)
+void tep_filter_reset(struct event_filter *filter)
 {
 	int i;
 
@@ -1440,11 +1440,11 @@ void pevent_filter_reset(struct event_filter *filter)
 	filter->event_filters = NULL;
 }
 
-void pevent_filter_free(struct event_filter *filter)
+void tep_filter_free(struct event_filter *filter)
 {
 	pevent_unref(filter->pevent);
 
-	pevent_filter_reset(filter);
+	tep_filter_reset(filter);
 
 	free(filter);
 }
@@ -1501,18 +1501,18 @@ static int copy_filter_type(struct event_filter *filter,
 }
 
 /**
- * pevent_filter_copy - copy a filter using another filter
+ * tep_filter_copy - copy a filter using another filter
  * @dest - the filter to copy to
  * @source - the filter to copy from
  *
  * Returns 0 on success and -1 if not all filters were copied
  */
-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 ret = 0;
 	int i;
 
-	pevent_filter_reset(dest);
+	tep_filter_reset(dest);
 
 	for (i = 0; i < source->filters; i++) {
 		if (copy_filter_type(dest, source, &source->event_filters[i]))
@@ -1523,7 +1523,7 @@ int pevent_filter_copy(struct event_filter *dest, struct event_filter *source)
 
 
 /**
- * pevent_update_trivial - update the trivial filters with the given filter
+ * tep_update_trivial - update the trivial filters with the given filter
  * @dest - the filter to update
  * @source - the filter as the source of the update
  * @type - the type of trivial filter to update.
@@ -1533,8 +1533,8 @@ int pevent_filter_copy(struct event_filter *dest, struct event_filter *source)
  * Returns 0 on success and -1 if there was a problem updating, but
  *   events may have still been updated on error.
  */
-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)
 {
 	struct tep_handle *src_pevent;
 	struct tep_handle *dest_pevent;
@@ -1571,7 +1571,7 @@ int pevent_update_trivial(struct event_filter *dest, struct event_filter *source
 				return -1;
 		}
 
-		str = pevent_filter_make_string(source, event->id);
+		str = tep_filter_make_string(source, event->id);
 		if (!str)
 			continue;
 
@@ -1584,7 +1584,7 @@ int pevent_update_trivial(struct event_filter *dest, struct event_filter *source
 }
 
 /**
- * pevent_filter_clear_trivial - clear TRUE and FALSE filters
+ * tep_filter_clear_trivial - clear TRUE and FALSE filters
  * @filter: the filter to remove trivial filters from
  * @type: remove only true, false, or both
  *
@@ -1592,8 +1592,8 @@ int pevent_update_trivial(struct event_filter *dest, struct event_filter *source
  *
  * Returns 0 on success and -1 if there was a problem.
  */
-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)
 {
 	struct filter_type *filter_type;
 	int count = 0;
@@ -1639,14 +1639,14 @@ int pevent_filter_clear_trivial(struct event_filter *filter,
 		return 0;
 
 	for (i = 0; i < count; i++)
-		pevent_filter_remove_event(filter, ids[i]);
+		tep_filter_remove_event(filter, ids[i]);
 
 	free(ids);
 	return 0;
 }
 
 /**
- * pevent_filter_event_has_trivial - return true event contains trivial filter
+ * tep_filter_event_has_trivial - return true event contains trivial filter
  * @filter: the filter with the information
  * @event_id: the id of the event to test
  * @type: trivial type to test for (TRUE, FALSE, EITHER)
@@ -1654,9 +1654,9 @@ int pevent_filter_clear_trivial(struct event_filter *filter,
  * Returns 1 if the event contains a matching trivial type
  *  otherwise 0.
  */
-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)
 {
 	struct filter_type *filter_type;
 
@@ -2001,14 +2001,14 @@ static int test_filter(struct event_format *event, struct filter_arg *arg,
 }
 
 /**
- * pevent_event_filtered - return true if event has filter
+ * tep_event_filtered - return true if event has filter
  * @filter: filter struct with filter information
  * @event_id: event id to test if filter exists
  *
  * Returns 1 if filter found for @event_id
  *   otherwise 0;
  */
-int pevent_event_filtered(struct event_filter *filter, int event_id)
+int tep_event_filtered(struct event_filter *filter, int event_id)
 {
 	struct filter_type *filter_type;
 
@@ -2021,7 +2021,7 @@ int pevent_event_filtered(struct event_filter *filter, int event_id)
 }
 
 /**
- * pevent_filter_match - test if a record matches a filter
+ * tep_filter_match - test if a record matches a filter
  * @filter: filter struct with filter information
  * @record: the record to test against the filter
  *
@@ -2032,8 +2032,8 @@ int pevent_event_filtered(struct event_filter *filter, int event_id)
  * NO_FILTER - if no filters exist
  * otherwise - error occurred during test
  */
-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)
 {
 	struct tep_handle *pevent = filter->pevent;
 	struct filter_type *filter_type;
@@ -2350,7 +2350,7 @@ static char *arg_to_str(struct event_filter *filter, struct filter_arg *arg)
 }
 
 /**
- * pevent_filter_make_string - return a string showing the filter
+ * tep_filter_make_string - return a string showing the filter
  * @filter: filter struct with filter information
  * @event_id: the event id to return the filter string with
  *
@@ -2359,7 +2359,7 @@ static char *arg_to_str(struct event_filter *filter, struct filter_arg *arg)
  *  NULL is returned if no filter is found or allocation failed.
  */
 char *
-pevent_filter_make_string(struct event_filter *filter, int event_id)
+tep_filter_make_string(struct event_filter *filter, int event_id)
 {
 	struct filter_type *filter_type;
 
@@ -2375,7 +2375,7 @@ pevent_filter_make_string(struct event_filter *filter, int event_id)
 }
 
 /**
- * pevent_filter_compare - compare two filters and return if they are the same
+ * tep_filter_compare - compare two filters and return if they are the same
  * @filter1: Filter to compare with @filter2
  * @filter2: Filter to compare with @filter1
  *
@@ -2383,7 +2383,7 @@ pevent_filter_make_string(struct event_filter *filter, int event_id)
  *  1 if the two filters hold the same content.
  *  0 if they do not.
  */
-int pevent_filter_compare(struct event_filter *filter1, struct event_filter *filter2)
+int tep_filter_compare(struct event_filter *filter1, struct event_filter *filter2)
 {
 	struct filter_type *filter_type1;
 	struct filter_type *filter_type2;
diff --git a/tracecmd/trace-read.c b/tracecmd/trace-read.c
index 74059a0..352ff11 100644
--- a/tracecmd/trace-read.c
+++ b/tracecmd/trace-read.c
@@ -503,11 +503,11 @@ static void process_filters(struct handle_list *handles)
 		if (!event_filter)
 			die("Failed to allocate for event filter");
 		event_filter->next = NULL;
-		event_filter->filter = pevent_filter_alloc(pevent);
+		event_filter->filter = tep_filter_alloc(pevent);
 		if (!event_filter->filter)
 			die("malloc");
 
-		ret = pevent_filter_add_filter_str(event_filter->filter,
+		ret = tep_filter_add_filter_str(event_filter->filter,
 						   filter->filter);
 		if (ret < 0) {
 			pevent_strerror(pevent, ret, errstr, sizeof(errstr));
@@ -891,7 +891,7 @@ test_filters(struct tep_handle *pevent, struct filter *event_filters,
 	}
 
 	while (event_filters) {
-		ret = pevent_filter_match(event_filters->filter, record);
+		ret = tep_filter_match(event_filters->filter, record);
 		switch (ret) {
 			case FILTER_NONE:
 			case FILTER_MATCH: 
@@ -1099,7 +1099,7 @@ static void free_filters(struct filter *event_filter)
 		filter = event_filter;
 		event_filter = filter->next;
 
-		pevent_filter_free(filter->filter);
+		tep_filter_free(filter->filter);
 		free(filter);
 	}
 }
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH v3 17/24] tools lib traceevent: Rename pevent_register / unregister APIs
  2018-08-27  8:17 [PATCH v3 00/24] trace-cmd: rename variables, data structures and functions in lib/traceevent Tzvetomir Stoyanov (VMware)
                   ` (14 preceding siblings ...)
  2018-08-27  8:17 ` [PATCH v3 16/24] tools lib traceevent: Rename pevent_filter* APIs Tzvetomir Stoyanov (VMware)
@ 2018-08-27  8:17 ` Tzvetomir Stoyanov (VMware)
  2018-08-27  8:17 ` [PATCH v3 18/24] tools lib traceevent: Rename pevent_data_ APIs Tzvetomir Stoyanov (VMware)
                   ` (6 subsequent siblings)
  22 siblings, 0 replies; 30+ messages in thread
From: Tzvetomir Stoyanov (VMware) @ 2018-08-27  8:17 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel

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

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/20180808180702.524813185@goodmis.org
Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 include/traceevent/event-parse.h | 30 +++++------
 lib/trace-cmd/trace-ftrace.c     |  8 +--
 lib/trace-cmd/trace-util.c       |  4 +-
 lib/traceevent/event-parse.c     | 40 +++++++--------
 plugins/plugin_blk.c             |  4 +-
 plugins/plugin_cfg80211.c        | 16 +++---
 plugins/plugin_function.c        |  8 +--
 plugins/plugin_futex.c           |  8 +--
 plugins/plugin_hrtimer.c         | 18 +++----
 plugins/plugin_jbd2.c            | 34 ++++++-------
 plugins/plugin_kmem.c            | 50 +++++++++----------
 plugins/plugin_kvm.c             | 86 ++++++++++++++++----------------
 plugins/plugin_mac80211.c        |  8 +--
 plugins/plugin_sched_switch.c    | 24 ++++-----
 plugins/plugin_scsi.c            | 20 ++++----
 plugins/plugin_tlb.c             | 10 ++--
 plugins/plugin_xen.c             | 16 +++---
 python/ctracecmd.i               |  4 +-
 18 files changed, 194 insertions(+), 194 deletions(-)

diff --git a/include/traceevent/event-parse.h b/include/traceevent/event-parse.h
index 812ef18..9523143 100644
--- a/include/traceevent/event-parse.h
+++ b/include/traceevent/event-parse.h
@@ -607,9 +607,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);
@@ -661,18 +661,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);
diff --git a/lib/trace-cmd/trace-ftrace.c b/lib/trace-cmd/trace-ftrace.c
index 90770fc..01a2a7c 100644
--- a/lib/trace-cmd/trace-ftrace.c
+++ b/lib/trace-cmd/trace-ftrace.c
@@ -421,16 +421,16 @@ int tracecmd_ftrace_overrides(struct tracecmd_input *handle,
 
 	pevent = tracecmd_get_pevent(handle);
 
-	pevent_register_event_handler(pevent, -1, "ftrace", "function",
+	tep_register_event_handler(pevent, -1, "ftrace", "function",
 				      function_handler, NULL);
 
-	pevent_register_event_handler(pevent, -1, "ftrace", "funcgraph_entry",
+	tep_register_event_handler(pevent, -1, "ftrace", "funcgraph_entry",
 				      fgraph_ent_handler, finfo);
 
-	pevent_register_event_handler(pevent, -1, "ftrace", "funcgraph_exit",
+	tep_register_event_handler(pevent, -1, "ftrace", "funcgraph_exit",
 				      fgraph_ret_handler, finfo);
 
-	pevent_register_event_handler(pevent, -1, "ftrace", "kernel_stack",
+	tep_register_event_handler(pevent, -1, "ftrace", "kernel_stack",
 				      trace_stack_handler, finfo);
 
 	trace_util_add_options("ftrace", trace_ftrace_options);
diff --git a/lib/trace-cmd/trace-util.c b/lib/trace-cmd/trace-util.c
index 877907d..0760815 100644
--- a/lib/trace-cmd/trace-util.c
+++ b/lib/trace-cmd/trace-util.c
@@ -388,7 +388,7 @@ static void extract_trace_clock(struct tep_handle *pevent, char *line)
 
 	data = strtok_r(line, "[]", &next);
 	sscanf(data, "%ms", &clock);
-	pevent_register_trace_clock(pevent, clock);
+	tep_register_trace_clock(pevent, clock);
 	free(clock);
 }
 
@@ -444,7 +444,7 @@ void tracecmd_parse_proc_kallsyms(struct tep_handle *pevent,
 		 *  - x86-64 that reports per-cpu variable offsets as absolute
 		 */
 		if (func[0] != '$' && ch != 'A' && ch != 'a')
-			pevent_register_function(pevent, func, addr, mod);
+			tep_register_function(pevent, func, addr, mod);
 		free(func);
 		free(mod);
 
diff --git a/lib/traceevent/event-parse.c b/lib/traceevent/event-parse.c
index 5e4f493..7f9c0b3 100644
--- a/lib/traceevent/event-parse.c
+++ b/lib/traceevent/event-parse.c
@@ -310,7 +310,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) {
@@ -530,7 +530,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
@@ -539,8 +539,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));
 
@@ -6463,7 +6463,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
@@ -6477,10 +6477,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;
@@ -6555,7 +6555,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
@@ -6564,8 +6564,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;
 
@@ -6601,7 +6601,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
@@ -6617,9 +6617,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;
@@ -6686,7 +6686,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
@@ -6701,9 +6701,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;
diff --git a/plugins/plugin_blk.c b/plugins/plugin_blk.c
index 5070af2..0e92546 100644
--- a/plugins/plugin_blk.c
+++ b/plugins/plugin_blk.c
@@ -365,7 +365,7 @@ static int blktrace_handler(struct trace_seq *s, struct tep_record *record,
 
 int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent)
 {
-	pevent_register_event_handler(pevent, -1, "ftrace", "blktrace",
-				      blktrace_handler, NULL);
+	tep_register_event_handler(pevent, -1, "ftrace", "blktrace",
+				   blktrace_handler, NULL);
 	return 0;
 }
diff --git a/plugins/plugin_cfg80211.c b/plugins/plugin_cfg80211.c
index e0421e3..a51b366 100644
--- a/plugins/plugin_cfg80211.c
+++ b/plugins/plugin_cfg80211.c
@@ -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");
 }
diff --git a/plugins/plugin_function.c b/plugins/plugin_function.c
index 5434a5f..f88da43 100644
--- a/plugins/plugin_function.c
+++ b/plugins/plugin_function.c
@@ -170,8 +170,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);
 
 	trace_util_add_options("ftrace", plugin_options);
 
@@ -182,8 +182,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++)
diff --git a/plugins/plugin_futex.c b/plugins/plugin_futex.c
index 60babce..d060bd0 100644
--- a/plugins/plugin_futex.c
+++ b/plugins/plugin_futex.c
@@ -109,13 +109,13 @@ static int futex_handler(struct trace_seq *s, struct tep_record *record,
 
 int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent)
 {
-	pevent_register_event_handler(pevent, -1, "syscalls", "sys_enter_futex",
-				      futex_handler, NULL);
+	tep_register_event_handler(pevent, -1, "syscalls", "sys_enter_futex",
+				   futex_handler, NULL);
 	return 0;
 }
 
 void PEVENT_PLUGIN_UNLOADER(struct tep_handle *pevent)
 {
-	pevent_unregister_event_handler(pevent, -1, "syscalls", "sys_enter_futex",
-					futex_handler, NULL);
+	tep_unregister_event_handler(pevent, -1, "syscalls", "sys_enter_futex",
+				     futex_handler, NULL);
 }
diff --git a/plugins/plugin_hrtimer.c b/plugins/plugin_hrtimer.c
index f3a0ceb..a2edb69 100644
--- a/plugins/plugin_hrtimer.c
+++ b/plugins/plugin_hrtimer.c
@@ -48,21 +48,21 @@ static int timer_start_handler(struct trace_seq *s, struct tep_record *record,
 
 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);
 }
diff --git a/plugins/plugin_jbd2.c b/plugins/plugin_jbd2.c
index 0dd1633..fe95f3e 100644
--- a/plugins/plugin_jbd2.c
+++ b/plugins/plugin_jbd2.c
@@ -36,27 +36,27 @@ process_jiffies_to_msecs(struct trace_seq *s,
 
 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);
-
-	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_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_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");
 }
diff --git a/plugins/plugin_kmem.c b/plugins/plugin_kmem.c
index 0840d6f..3088d3a 100644
--- a/plugins/plugin_kmem.c
+++ b/plugins/plugin_kmem.c
@@ -35,45 +35,45 @@ static int call_site_handler(struct trace_seq *s, struct tep_record *record,
 
 int TEP_PLUGIN_LOADER(struct tep_handle *pevent)
 {
-	pevent_register_event_handler(pevent, -1, "kmem", "kfree",
-				      call_site_handler, NULL);
+	tep_register_event_handler(pevent, -1, "kmem", "kfree",
+				   call_site_handler, NULL);
 
-	pevent_register_event_handler(pevent, -1, "kmem", "kmalloc",
-				      call_site_handler, NULL);
+	tep_register_event_handler(pevent, -1, "kmem", "kmalloc",
+				   call_site_handler, NULL);
 
-	pevent_register_event_handler(pevent, -1, "kmem", "kmalloc_node",
-				      call_site_handler, NULL);
+	tep_register_event_handler(pevent, -1, "kmem", "kmalloc_node",
+				   call_site_handler, NULL);
 
-	pevent_register_event_handler(pevent, -1, "kmem", "kmem_cache_alloc",
-				      call_site_handler, NULL);
+	tep_register_event_handler(pevent, -1, "kmem", "kmem_cache_alloc",
+				   call_site_handler, NULL);
 
-	pevent_register_event_handler(pevent, -1, "kmem", "kmem_cache_alloc_node",
-				      call_site_handler, NULL);
+	tep_register_event_handler(pevent, -1, "kmem", "kmem_cache_alloc_node",
+				   call_site_handler, NULL);
 
-	pevent_register_event_handler(pevent, -1, "kmem", "kmem_cache_free",
-				      call_site_handler, NULL);
+	tep_register_event_handler(pevent, -1, "kmem", "kmem_cache_free",
+				   call_site_handler, NULL);
 
 	return 0;
 }
 
 void TEP_PLUGIN_UNLOADER(struct tep_handle *pevent)
 {
-	pevent_unregister_event_handler(pevent, -1, "kmem", "kfree",
-					call_site_handler, NULL);
+	tep_unregister_event_handler(pevent, -1, "kmem", "kfree",
+				     call_site_handler, NULL);
 
-	pevent_unregister_event_handler(pevent, -1, "kmem", "kmalloc",
-					call_site_handler, NULL);
+	tep_unregister_event_handler(pevent, -1, "kmem", "kmalloc",
+				     call_site_handler, NULL);
 
-	pevent_unregister_event_handler(pevent, -1, "kmem", "kmalloc_node",
-					call_site_handler, NULL);
+	tep_unregister_event_handler(pevent, -1, "kmem", "kmalloc_node",
+				     call_site_handler, NULL);
 
-	pevent_unregister_event_handler(pevent, -1, "kmem", "kmem_cache_alloc",
-					call_site_handler, NULL);
+	tep_unregister_event_handler(pevent, -1, "kmem", "kmem_cache_alloc",
+				     call_site_handler, NULL);
 
-	pevent_unregister_event_handler(pevent, -1, "kmem",
-					"kmem_cache_alloc_node",
-					call_site_handler, NULL);
+	tep_unregister_event_handler(pevent, -1, "kmem",
+				     "kmem_cache_alloc_node",
+				     call_site_handler, NULL);
 
-	pevent_unregister_event_handler(pevent, -1, "kmem", "kmem_cache_free",
-					call_site_handler, NULL);
+	tep_unregister_event_handler(pevent, -1, "kmem", "kmem_cache_free",
+				     call_site_handler, NULL);
 }
diff --git a/plugins/plugin_kvm.c b/plugins/plugin_kvm.c
index a7626ac..2c1a8a7 100644
--- a/plugins/plugin_kvm.c
+++ b/plugins/plugin_kvm.c
@@ -442,74 +442,74 @@ int TEP_PLUGIN_LOADER(struct tep_handle *pevent)
 {
 	init_disassembler();
 
-	pevent_register_event_handler(pevent, -1, "kvm", "kvm_exit",
-				      kvm_exit_handler, NULL);
+	tep_register_event_handler(pevent, -1, "kvm", "kvm_exit",
+				   kvm_exit_handler, NULL);
 
-	pevent_register_event_handler(pevent, -1, "kvm", "kvm_emulate_insn",
-				      kvm_emulate_insn_handler, NULL);
+	tep_register_event_handler(pevent, -1, "kvm", "kvm_emulate_insn",
+				   kvm_emulate_insn_handler, NULL);
 
-	pevent_register_event_handler(pevent, -1, "kvm", "kvm_nested_vmexit",
-				      kvm_nested_vmexit_handler, NULL);
+	tep_register_event_handler(pevent, -1, "kvm", "kvm_nested_vmexit",
+				   kvm_nested_vmexit_handler, NULL);
 
-	pevent_register_event_handler(pevent, -1, "kvm", "kvm_nested_vmexit_inject",
-				      kvm_nested_vmexit_inject_handler, NULL);
+	tep_register_event_handler(pevent, -1, "kvm", "kvm_nested_vmexit_inject",
+				   kvm_nested_vmexit_inject_handler, NULL);
 
-	pevent_register_event_handler(pevent, -1, "kvmmmu", "kvm_mmu_get_page",
-				      kvm_mmu_get_page_handler, NULL);
+	tep_register_event_handler(pevent, -1, "kvmmmu", "kvm_mmu_get_page",
+				   kvm_mmu_get_page_handler, NULL);
 
-	pevent_register_event_handler(pevent, -1, "kvmmmu", "kvm_mmu_sync_page",
-				      kvm_mmu_print_role, NULL);
+	tep_register_event_handler(pevent, -1, "kvmmmu", "kvm_mmu_sync_page",
+				   kvm_mmu_print_role, NULL);
 
-	pevent_register_event_handler(pevent, -1, "kvmmmu", "kvm_mmu_unsync_page",
-				      kvm_mmu_print_role, NULL);
+	tep_register_event_handler(pevent, -1, "kvmmmu", "kvm_mmu_unsync_page",
+				   kvm_mmu_print_role, NULL);
 
-	pevent_register_event_handler(pevent, -1, "kvmmmu", "kvm_mmu_zap_page",
-				      kvm_mmu_print_role, NULL);
+	tep_register_event_handler(pevent, -1, "kvmmmu", "kvm_mmu_zap_page",
+				   kvm_mmu_print_role, NULL);
 
-	pevent_register_event_handler(pevent, -1, "kvmmmu",
+	tep_register_event_handler(pevent, -1, "kvmmmu",
 			"kvm_mmu_prepare_zap_page", kvm_mmu_print_role,
 			NULL);
 
-	pevent_register_print_function(pevent,
-				       process_is_writable_pte,
-				       TEP_FUNC_ARG_INT,
-				       "is_writable_pte",
-				       TEP_FUNC_ARG_LONG,
-				       TEP_FUNC_ARG_VOID);
+	tep_register_print_function(pevent,
+				    process_is_writable_pte,
+				    TEP_FUNC_ARG_INT,
+				    "is_writable_pte",
+				    TEP_FUNC_ARG_LONG,
+				    TEP_FUNC_ARG_VOID);
 	return 0;
 }
 
 void TEP_PLUGIN_UNLOADER(struct tep_handle *pevent)
 {
-	pevent_unregister_event_handler(pevent, -1, "kvm", "kvm_exit",
-					kvm_exit_handler, NULL);
+	tep_unregister_event_handler(pevent, -1, "kvm", "kvm_exit",
+				     kvm_exit_handler, NULL);
 
-	pevent_unregister_event_handler(pevent, -1, "kvm", "kvm_emulate_insn",
-					kvm_emulate_insn_handler, NULL);
+	tep_unregister_event_handler(pevent, -1, "kvm", "kvm_emulate_insn",
+				     kvm_emulate_insn_handler, NULL);
 
-	pevent_unregister_event_handler(pevent, -1, "kvm", "kvm_nested_vmexit",
-					kvm_nested_vmexit_handler, NULL);
+	tep_unregister_event_handler(pevent, -1, "kvm", "kvm_nested_vmexit",
+				     kvm_nested_vmexit_handler, NULL);
 
-	pevent_unregister_event_handler(pevent, -1, "kvm", "kvm_nested_vmexit_inject",
-					kvm_nested_vmexit_inject_handler, NULL);
+	tep_unregister_event_handler(pevent, -1, "kvm", "kvm_nested_vmexit_inject",
+				     kvm_nested_vmexit_inject_handler, NULL);
 
-	pevent_unregister_event_handler(pevent, -1, "kvmmmu", "kvm_mmu_get_page",
-					kvm_mmu_get_page_handler, NULL);
+	tep_unregister_event_handler(pevent, -1, "kvmmmu", "kvm_mmu_get_page",
+				     kvm_mmu_get_page_handler, NULL);
 
-	pevent_unregister_event_handler(pevent, -1, "kvmmmu", "kvm_mmu_sync_page",
-					kvm_mmu_print_role, NULL);
+	tep_unregister_event_handler(pevent, -1, "kvmmmu", "kvm_mmu_sync_page",
+				     kvm_mmu_print_role, NULL);
 
-	pevent_unregister_event_handler(pevent, -1,
-					"kvmmmu", "kvm_mmu_unsync_page",
-					kvm_mmu_print_role, NULL);
+	tep_unregister_event_handler(pevent, -1,
+				     "kvmmmu", "kvm_mmu_unsync_page",
+				     kvm_mmu_print_role, NULL);
 
-	pevent_unregister_event_handler(pevent, -1, "kvmmmu", "kvm_mmu_zap_page",
-					kvm_mmu_print_role, NULL);
+	tep_unregister_event_handler(pevent, -1, "kvmmmu", "kvm_mmu_zap_page",
+				     kvm_mmu_print_role, NULL);
 
-	pevent_unregister_event_handler(pevent, -1, "kvmmmu",
+	tep_unregister_event_handler(pevent, -1, "kvmmmu",
 			"kvm_mmu_prepare_zap_page", kvm_mmu_print_role,
 			NULL);
 
-	pevent_unregister_print_function(pevent, process_is_writable_pte,
-					 "is_writable_pte");
+	tep_unregister_print_function(pevent, process_is_writable_pte,
+				      "is_writable_pte");
 }
diff --git a/plugins/plugin_mac80211.c b/plugins/plugin_mac80211.c
index 5fc3170..72f7d7c 100644
--- a/plugins/plugin_mac80211.c
+++ b/plugins/plugin_mac80211.c
@@ -178,10 +178,10 @@ static int drv_config(struct trace_seq *s, struct tep_record *record,
 
 int TEP_PLUGIN_LOADER(struct tep_handle *pevent)
 {
-	pevent_register_event_handler(pevent, -1, "mac80211", "drv_bss_info_changed",
-				      drv_bss_info_changed, NULL);
-	pevent_register_event_handler(pevent, -1, "mac80211", "drv_config",
-				      drv_config, NULL);
+	tep_register_event_handler(pevent, -1, "mac80211", "drv_bss_info_changed",
+				   drv_bss_info_changed, NULL);
+	tep_register_event_handler(pevent, -1, "mac80211", "drv_config",
+				   drv_config, NULL);
 
 	return 0;
 }
diff --git a/plugins/plugin_sched_switch.c b/plugins/plugin_sched_switch.c
index 534e99c..f1229b8 100644
--- a/plugins/plugin_sched_switch.c
+++ b/plugins/plugin_sched_switch.c
@@ -119,26 +119,26 @@ static int sched_switch_handler(struct trace_seq *s, struct tep_record *record,
 
 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);
 }
diff --git a/plugins/plugin_scsi.c b/plugins/plugin_scsi.c
index ce38df7..5ec346f 100644
--- a/plugins/plugin_scsi.c
+++ b/plugins/plugin_scsi.c
@@ -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");
 }
diff --git a/plugins/plugin_tlb.c b/plugins/plugin_tlb.c
index 86f4cba..9f1a70a 100644
--- a/plugins/plugin_tlb.c
+++ b/plugins/plugin_tlb.c
@@ -52,15 +52,15 @@ static int tlb_flush_handler(struct trace_seq *s, struct tep_record *record,
 
 int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent)
 {
-	pevent_register_event_handler(pevent, -1, "tlb", "tlb_flush",
-				      tlb_flush_handler, NULL);
+	tep_register_event_handler(pevent, -1, "tlb", "tlb_flush",
+				   tlb_flush_handler, NULL);
 
 	return 0;
 }
 
 void PEVENT_PLUGIN_UNLOADER(struct tep_handle *pevent)
 {
-	pevent_unregister_event_handler(pevent, -1,
-					"tlb", "tlb_flush",
-					tlb_flush_handler, NULL);
+	tep_unregister_event_handler(pevent, -1,
+				     "tlb", "tlb_flush",
+				     tlb_flush_handler, NULL);
 }
diff --git a/plugins/plugin_xen.c b/plugins/plugin_xen.c
index 2ffbd91..b2acbd6 100644
--- a/plugins/plugin_xen.c
+++ b/plugins/plugin_xen.c
@@ -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");
 }
diff --git a/python/ctracecmd.i b/python/ctracecmd.i
index 0a3b84a..e29581e 100644
--- a/python/ctracecmd.i
+++ b/python/ctracecmd.i
@@ -76,8 +76,8 @@ void py_pevent_register_event_handler(struct tep_handle *pevent, int id,
 				      PyObject *pyfunc)
 {
 	Py_INCREF(pyfunc);
-	pevent_register_event_handler(pevent, id, subsys, evname,
-				      python_callback, pyfunc);
+	tep_register_event_handler(pevent, id, subsys, evname,
+				   python_callback, pyfunc);
 }
 
 static PyObject *py_field_get_stack(struct tep_handle *pevent,
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH v3 18/24] tools lib traceevent: Rename pevent_data_ APIs
  2018-08-27  8:17 [PATCH v3 00/24] trace-cmd: rename variables, data structures and functions in lib/traceevent Tzvetomir Stoyanov (VMware)
                   ` (15 preceding siblings ...)
  2018-08-27  8:17 ` [PATCH v3 17/24] tools lib traceevent: Rename pevent_register / unregister APIs Tzvetomir Stoyanov (VMware)
@ 2018-08-27  8:17 ` Tzvetomir Stoyanov (VMware)
  2018-08-27  8:17 ` [PATCH v3 19/24] tools lib traceevent: Rename pevent field APIs Tzvetomir Stoyanov (VMware)
                   ` (5 subsequent siblings)
  22 siblings, 0 replies; 30+ messages in thread
From: Tzvetomir Stoyanov (VMware) @ 2018-08-27  8:17 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel

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

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/20180808180702.678020020@goodmis.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 include/traceevent/event-parse.h      | 22 +++++++-------
 kernel-shark-qt/examples/datafilter.c |  4 +--
 kernel-shark-qt/examples/dataload.c   |  4 +--
 kernel-shark-qt/src/libkshark.c       | 14 ++++-----
 kernel-shark/kernel-shark.c           |  4 +--
 kernel-shark/trace-dialog.c           |  4 +--
 kernel-shark/trace-filter.c           |  2 +-
 kernel-shark/trace-graph.c            | 14 ++++-----
 kernel-shark/trace-plot-cpu.c         | 22 +++++++-------
 kernel-shark/trace-plot-task.c        | 26 ++++++++--------
 kernel-shark/trace-view-main.c        |  4 +--
 kernel-shark/trace-view-store.c       | 14 ++++-----
 lib/traceevent/event-parse.c          | 44 +++++++++++++--------------
 lib/traceevent/parse-filter.c         |  6 ++--
 plugins/plugin_blk.c                  |  8 ++---
 python/tracecmd.py                    | 22 +++++++-------
 tracecmd/trace-hist.c                 |  8 ++---
 tracecmd/trace-mem.c                  |  4 +--
 tracecmd/trace-profile.c              |  4 +--
 tracecmd/trace-read.c                 | 12 ++++----
 tracecmd/trace-record.c               |  4 +--
 21 files changed, 123 insertions(+), 123 deletions(-)

diff --git a/include/traceevent/event-parse.h b/include/traceevent/event-parse.h
index 9523143..9ad3208 100644
--- a/include/traceevent/event-parse.h
+++ b/include/traceevent/event-parse.h
@@ -693,18 +693,18 @@ pevent_find_event_by_name(struct tep_handle *pevent, const char *sys, const char
 struct 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);
diff --git a/kernel-shark-qt/examples/datafilter.c b/kernel-shark-qt/examples/datafilter.c
index 4b1e1e9..7129f37 100644
--- a/kernel-shark-qt/examples/datafilter.c
+++ b/kernel-shark-qt/examples/datafilter.c
@@ -47,8 +47,8 @@ int main(int argc, char **argv)
 	n_tasks = kshark_get_task_pids(kshark_ctx, &pids);
 	for (i = 0; i < n_tasks; ++i) {
 		const char *task_str =
-			pevent_data_comm_from_pid(kshark_ctx->pevent,
-						  pids[i]);
+			tep_data_comm_from_pid(kshark_ctx->pevent,
+					       pids[i]);
 
 		if (strcmp(task_str, "trace-cmd") == 0)
 			kshark_filter_add_id(kshark_ctx, KS_HIDE_TASK_FILTER,
diff --git a/kernel-shark-qt/examples/dataload.c b/kernel-shark-qt/examples/dataload.c
index 963bc08..0cbc0f6 100644
--- a/kernel-shark-qt/examples/dataload.c
+++ b/kernel-shark-qt/examples/dataload.c
@@ -45,8 +45,8 @@ int main(int argc, char **argv)
 	n_tasks = kshark_get_task_pids(kshark_ctx, &pids);
 	for (r = 0; r < n_tasks; ++r) {
 		const char *task_str =
-			pevent_data_comm_from_pid(kshark_ctx->pevent,
-						  pids[r]);
+			tep_data_comm_from_pid(kshark_ctx->pevent,
+					       pids[r]);
 
 		printf("task: %s-%i\n", task_str, pids[r]);
 	}
diff --git a/kernel-shark-qt/src/libkshark.c b/kernel-shark-qt/src/libkshark.c
index 4f8da8a..d07bdd8 100644
--- a/kernel-shark-qt/src/libkshark.c
+++ b/kernel-shark-qt/src/libkshark.c
@@ -504,7 +504,7 @@ static void kshark_set_entry_values(struct kshark_context *kshark_ctx,
 	entry->ts = record->ts;
 
 	/* Event Id of the record */
-	entry->event_id = pevent_data_type(kshark_ctx->pevent, record);
+	entry->event_id = tep_data_type(kshark_ctx->pevent, record);
 
 	/*
 	 * Is visible mask. This default value means that the entry
@@ -513,7 +513,7 @@ static void kshark_set_entry_values(struct kshark_context *kshark_ctx,
 	entry->visible = 0xFF;
 
 	/* Process Id of the record */
-	entry->pid = pevent_data_pid(kshark_ctx->pevent, record);
+	entry->pid = tep_data_pid(kshark_ctx->pevent, record);
 }
 
 /**
@@ -600,7 +600,7 @@ static size_t get_records(struct kshark_context *kshark_ctx,
 			switch (type) {
 			case REC_RECORD:
 				temp_rec->rec = rec;
-				pid = pevent_data_pid(kshark_ctx->pevent, rec);
+				pid = tep_data_pid(kshark_ctx->pevent, rec);
 				break;
 			case REC_ENTRY: {
 				struct kshark_entry *entry;
@@ -841,7 +841,7 @@ static const char *kshark_get_latency(struct tep_handle *pe,
 		return NULL;
 
 	trace_seq_reset(&seq);
-	pevent_data_lat_fmt(pe, &seq, record);
+	tep_data_lat_fmt(pe, &seq, record);
 	return seq.buffer;
 }
 
@@ -892,11 +892,11 @@ char* kshark_dump_entry(const struct kshark_entry *entry)
 
 	data = kshark_read_at(kshark_ctx, entry->offset);
 
-	event_id = pevent_data_type(kshark_ctx->pevent, data);
-	event = pevent_data_event_from_type(kshark_ctx->pevent, event_id);
+	event_id = tep_data_type(kshark_ctx->pevent, data);
+	event = tep_data_event_from_type(kshark_ctx->pevent, event_id);
 
 	event_name = event? event->name : "[UNKNOWN EVENT]";
-	task = pevent_data_comm_from_pid(kshark_ctx->pevent, entry->pid);
+	task = tep_data_comm_from_pid(kshark_ctx->pevent, entry->pid);
 	lat = kshark_get_latency(kshark_ctx->pevent, data);
 
 	size = asprintf(&temp_str, "%li %s-%i; CPU %i; %s;",
diff --git a/kernel-shark/kernel-shark.c b/kernel-shark/kernel-shark.c
index 8a512fc..0da78be 100644
--- a/kernel-shark/kernel-shark.c
+++ b/kernel-shark/kernel-shark.c
@@ -1650,8 +1650,8 @@ do_tree_popup(GtkWidget *widget, GdkEventButton *event, gpointer data)
 		record = tracecmd_read_at(info->handle, offset, &cpu);
 
 		if (record) {
-			pid = pevent_data_pid(ginfo->pevent, record);
-			comm = pevent_data_comm_from_pid(ginfo->pevent, pid);
+			pid = tep_data_pid(ginfo->pevent, record);
+			comm = tep_data_comm_from_pid(ginfo->pevent, pid);
 
 			if (info->sync_task_filters) {
 				if (trace_graph_filter_task_find_pid(ginfo, pid))
diff --git a/kernel-shark/trace-dialog.c b/kernel-shark/trace-dialog.c
index 9298078..50b4daf 100644
--- a/kernel-shark/trace-dialog.c
+++ b/kernel-shark/trace-dialog.c
@@ -401,8 +401,8 @@ void trace_show_record_dialog(GtkWindow *parent, struct tep_handle *pevent,
 
 	trace_seq_init(&s);
 
-	type = pevent_data_type(pevent, record);
-	event = pevent_data_event_from_type(pevent, type);
+	type = tep_data_type(pevent, record);
+	event = tep_data_event_from_type(pevent, type);
 
 	if (raw)
 		read_raw_events(&s, event, record);
diff --git a/kernel-shark/trace-filter.c b/kernel-shark/trace-filter.c
index 3145f99..b762d97 100644
--- a/kernel-shark/trace-filter.c
+++ b/kernel-shark/trace-filter.c
@@ -809,7 +809,7 @@ create_task_model(struct tep_handle *pevent,
 
 	for (i = 0; tasks[i] >= 0; i++) {
 
-		comm = pevent_data_comm_from_pid(pevent, tasks[i]);
+		comm = tep_data_comm_from_pid(pevent, tasks[i]);
 
 		gtk_tree_store_append(treestore, &iter, NULL);
 
diff --git a/kernel-shark/trace-graph.c b/kernel-shark/trace-graph.c
index 53f5e39..b6890e9 100644
--- a/kernel-shark/trace-graph.c
+++ b/kernel-shark/trace-graph.c
@@ -748,8 +748,8 @@ do_pop_up(GtkWidget *widget, GdkEventButton *event, gpointer data)
 	if (record) {
 
 		if (!trace_graph_check_sched_switch(ginfo, record, &pid, &comm)) {
-			pid = pevent_data_pid(ginfo->pevent, record);
-			comm = pevent_data_comm_from_pid(ginfo->pevent, pid);
+			pid = tep_data_pid(ginfo->pevent, record);
+			comm = tep_data_comm_from_pid(ginfo->pevent, pid);
 		}
 
 		len = strlen(comm) + 50;
@@ -1038,7 +1038,7 @@ int trace_graph_check_sched_wakeup(struct graph_info *ginfo,
 			return 0;
 	}
 
-	id = pevent_data_type(ginfo->pevent, record);
+	id = tep_data_type(ginfo->pevent, record);
 
 	if (id == ginfo->event_wakeup_id) {
 		/* We only want those that actually woke up the task */
@@ -1081,7 +1081,7 @@ int trace_graph_check_sched_switch(struct graph_info *ginfo,
 
 	if (ginfo->read_comms) {
 		/* record all pids, for task plots */
-		this_pid = pevent_data_pid(ginfo->pevent, record);
+		this_pid = tep_data_pid(ginfo->pevent, record);
 		add_task_hash(ginfo, this_pid);
 	}
 
@@ -1105,7 +1105,7 @@ int trace_graph_check_sched_switch(struct graph_info *ginfo,
 		}
 	}
 
-	id = pevent_data_type(ginfo->pevent, record);
+	id = tep_data_type(ginfo->pevent, record);
 	if (id == ginfo->event_sched_switch_id) {
 		tep_read_number_field(ginfo->event_pid_field, record->data, &val);
 		if (comm)
@@ -1221,7 +1221,7 @@ trace_graph_check_irq(struct graph_info *ginfo,
 		}
 	}
 
-	id = pevent_data_type(ginfo->pevent, record);
+	id = tep_data_type(ginfo->pevent, record);
 
 	for (i = 0; ginfo->hard_irq_exit_ids[i] != -1; i++)
 		if (id == ginfo->hard_irq_exit_ids[i])
@@ -1997,7 +1997,7 @@ static void draw_plots(struct graph_info *ginfo, gint new_width)
 			for (list = hash->plots; list; list = list->next)
 				draw_plot(ginfo, list->plot, record);
 		}
-		pid = pevent_data_pid(ginfo->pevent, record);
+		pid = tep_data_pid(ginfo->pevent, record);
 		hash = trace_graph_plot_find_task(ginfo, pid);
 		if (hash) {
 			for (list = hash->plots; list; list = list->next)
diff --git a/kernel-shark/trace-plot-cpu.c b/kernel-shark/trace-plot-cpu.c
index 39b96f7..b2ec987 100644
--- a/kernel-shark/trace-plot-cpu.c
+++ b/kernel-shark/trace-plot-cpu.c
@@ -84,7 +84,7 @@ static int filter_record(struct graph_info *ginfo,
 	int wake_pid;
 	int filter;
 
-	*orig_pid = pevent_data_pid(ginfo->pevent, record);
+	*orig_pid = tep_data_pid(ginfo->pevent, record);
 
 	filter = trace_graph_filter_on_task(ginfo, *orig_pid);
 
@@ -154,8 +154,8 @@ again:
 		return 0;
 
 	/* Must have the record we want */
-	type = pevent_data_type(ginfo->pevent, record);
-	event = pevent_data_event_from_type(ginfo->pevent, type);
+	type = tep_data_type(ginfo->pevent, record);
+	event = tep_data_event_from_type(ginfo->pevent, type);
 	/* Unlikely that the event was not saved */
 	if (!event)
 		goto again;
@@ -163,7 +163,7 @@ again:
 	if (is_sched_switch)
 		pid = sched_pid;
 	trace_seq_printf(s, "%s-%d\n%s\n",
-			 pevent_data_comm_from_pid(ginfo->pevent, pid),
+			 tep_data_comm_from_pid(ginfo->pevent, pid),
 			 pid, event->name);
 	free_record(record);
 
@@ -373,8 +373,8 @@ int cpu_plot_display_info(struct graph_info *ginfo,
 		record = tracecmd_read_cpu_last(ginfo->handle, cpu);
 		if (record && record->ts < time) {
 			if (!trace_graph_check_sched_switch(ginfo, record, &pid, &comm)) {
-				pid = pevent_data_pid(ginfo->pevent, record);
-				comm = pevent_data_comm_from_pid(ginfo->pevent, pid);
+				pid = tep_data_pid(ginfo->pevent, record);
+				comm = tep_data_comm_from_pid(ginfo->pevent, pid);
 			}
 
 			convert_nano(record->ts, &sec, &usec);
@@ -393,18 +393,18 @@ int cpu_plot_display_info(struct graph_info *ginfo,
 
 	pevent = ginfo->pevent;
 
-	pid = pevent_data_pid(ginfo->pevent, record);
-	comm = pevent_data_comm_from_pid(ginfo->pevent, pid);
+	pid = tep_data_pid(ginfo->pevent, record);
+	comm = tep_data_comm_from_pid(ginfo->pevent, pid);
 
 	if (record->ts > time - 2/ginfo->resolution &&
 	    record->ts < time + 2/ginfo->resolution) {
 
-		type = pevent_data_type(pevent, record);
-		event = pevent_data_event_from_type(pevent, type);
+		type = tep_data_type(pevent, record);
+		event = tep_data_event_from_type(pevent, type);
 		if (event) {
 			trace_seq_puts(s, event->name);
 			trace_seq_putc(s, '\n');
-			pevent_data_lat_fmt(pevent, s, record);
+			tep_data_lat_fmt(pevent, s, record);
 			trace_seq_putc(s, '\n');
 			tep_event_info(s, event, record);
 			trace_seq_putc(s, '\n');
diff --git a/kernel-shark/trace-plot-task.c b/kernel-shark/trace-plot-task.c
index ca62457..81ac157 100644
--- a/kernel-shark/trace-plot-task.c
+++ b/kernel-shark/trace-plot-task.c
@@ -54,7 +54,7 @@ static gboolean is_running(struct graph_info *ginfo, struct tep_record *record)
 	unsigned long long val;
 	int id;
 
-	id = pevent_data_type(ginfo->pevent, record);
+	id = tep_data_type(ginfo->pevent, record);
 	if (id != ginfo->event_sched_switch_id)
 		return FALSE;
 
@@ -73,7 +73,7 @@ static gboolean record_matches_pid(struct graph_info *ginfo,
 	*is_sched = FALSE;
 	*wakeup = FALSE;
 
-	*pid = pevent_data_pid(ginfo->pevent, record);
+	*pid = tep_data_pid(ginfo->pevent, record);
 	*sched_pid = *pid;
 
 	if (trace_graph_check_sched_switch(ginfo, record, sched_pid, &comm)) {
@@ -286,20 +286,20 @@ static int task_plot_display_last_event(struct graph_info *ginfo,
 			trace_seq_printf(s, "sched_switch\n"
 					 "CPU %d %s-%d\n",
 					 record->cpu,
-					 pevent_data_comm_from_pid(ginfo->pevent, pid),
+					 tep_data_comm_from_pid(ginfo->pevent, pid),
 					 pid);
 		}
 	} else {
 			
 		/* Must have the record we want */
-		type = pevent_data_type(ginfo->pevent, record);
-		event = pevent_data_event_from_type(ginfo->pevent, type);
+		type = tep_data_type(ginfo->pevent, record);
+		event = tep_data_event_from_type(ginfo->pevent, type);
 		if (pid == rec_pid)
 			trace_seq_printf(s, "CPU %d\n%s\n",
 					 record->cpu, event->name);
 		else
 			trace_seq_printf(s, "%s-%d\n%s\n",
-					 pevent_data_comm_from_pid(ginfo->pevent, rec_pid),
+					 tep_data_comm_from_pid(ginfo->pevent, rec_pid),
 					 rec_pid, event->name);
 	}
 	free_record(record);
@@ -330,7 +330,7 @@ static gboolean record_is_interrupt(struct graph_info *ginfo,
 	if (ginfo->no_irqs)
 		return FALSE;
 
-	in_irq = !!(pevent_data_flags(ginfo->pevent, record) &
+	in_irq = !!(tep_data_flags(ginfo->pevent, record) &
 		    (TRACE_FLAG_HARDIRQ | TRACE_FLAG_SOFTIRQ));
 
 	/*
@@ -751,7 +751,7 @@ int task_plot_display_info(struct graph_info *ginfo,
 
 	pevent = ginfo->pevent;
 
-	pid = pevent_data_pid(ginfo->pevent, record);
+	pid = tep_data_pid(ginfo->pevent, record);
 	cpu = record->cpu;
 
 	convert_nano(record->ts, &sec, &usec);
@@ -759,12 +759,12 @@ int task_plot_display_info(struct graph_info *ginfo,
 	if (record->ts > time - 2/ginfo->resolution &&
 	    record->ts < time + 2/ginfo->resolution) {
 
-		type = pevent_data_type(pevent, record);
-		event = pevent_data_event_from_type(pevent, type);
+		type = tep_data_type(pevent, record);
+		event = tep_data_event_from_type(pevent, type);
 		if (event) {
 			trace_seq_puts(s, event->name);
 			trace_seq_putc(s, '\n');
-			pevent_data_lat_fmt(pevent, s, record);
+			tep_data_lat_fmt(pevent, s, record);
 			trace_seq_putc(s, '\n');
 			tep_event_info(s, event, record);
 			trace_seq_putc(s, '\n');
@@ -907,7 +907,7 @@ void graph_plot_init_tasks(struct graph_info *ginfo)
 	/* Just for testing */
 	record = tracecmd_read_cpu_first(ginfo->handle, 0);
 	while (record) {
-		pid = pevent_data_pid(ginfo->pevent, record);
+		pid = tep_data_pid(ginfo->pevent, record);
 		free_record(record);
 		if (pid)
 			break;
@@ -936,7 +936,7 @@ void graph_plot_task(struct graph_info *ginfo, int pid, int pos)
 	task_info->last_records =
 		malloc_or_die(sizeof(struct tep_record *) * ginfo->cpus);
 	task_info->pid = pid;
-	comm = pevent_data_comm_from_pid(ginfo->pevent, pid);
+	comm = tep_data_comm_from_pid(ginfo->pevent, pid);
 
 	len = strlen(comm) + 100;
 	label = malloc_or_die(len);
diff --git a/kernel-shark/trace-view-main.c b/kernel-shark/trace-view-main.c
index 00f53e0..faaef99 100644
--- a/kernel-shark/trace-view-main.c
+++ b/kernel-shark/trace-view-main.c
@@ -377,8 +377,8 @@ do_tree_popup(GtkWidget *widget, GdkEventButton *event, gpointer data)
 
 		if (record) {
 			pevent = tracecmd_get_pevent(info->handle);
-			pid = pevent_data_pid(pevent, record);
-			comm = pevent_data_comm_from_pid(pevent, pid);
+			pid = tep_data_pid(pevent, record);
+			comm = tep_data_comm_from_pid(pevent, pid);
 
 			len = strlen(comm) + 50;
 
diff --git a/kernel-shark/trace-view-store.c b/kernel-shark/trace-view-store.c
index 8d4e05f..92ddf7e 100644
--- a/kernel-shark/trace-view-store.c
+++ b/kernel-shark/trace-view-store.c
@@ -467,26 +467,26 @@ trace_view_store_get_value (GtkTreeModel *tree_model,
 		switch (column) {
 		case TRACE_VIEW_STORE_COL_COMM:
 		case TRACE_VIEW_STORE_COL_PID:
-			val = pevent_data_pid(pevent, data);
+			val = tep_data_pid(pevent, data);
 			if (column == TRACE_VIEW_STORE_COL_PID)
 				g_value_set_uint(value, val);
 			else {
-				comm = pevent_data_comm_from_pid(pevent, val);
+				comm = tep_data_comm_from_pid(pevent, val);
 				g_value_set_string(value, comm);
 			}
 			break;
 
 		case TRACE_VIEW_STORE_COL_LAT:
 			trace_seq_init(&s);
-			pevent_data_lat_fmt(pevent, &s, data);
+			tep_data_lat_fmt(pevent, &s, data);
 			g_value_set_string(value, s.buffer);
 			trace_seq_destroy(&s);
 			break;
 
 		case TRACE_VIEW_STORE_COL_EVENT:
 		case TRACE_VIEW_STORE_COL_INFO:
-			val = pevent_data_type(pevent, data);
-			event = pevent_data_event_from_type(pevent, val);
+			val = tep_data_type(pevent, data);
+			event = tep_data_event_from_type(pevent, val);
 			if (!event) {
 				if (column == TRACE_VIEW_STORE_COL_EVENT)
 					g_value_set_string(value, "[UNKNOWN EVENT]");
@@ -1184,7 +1184,7 @@ static gboolean show_task(TraceViewStore *store, struct tep_handle *pevent,
 	if (view_task(store, pid))
 		return TRUE;
 
-	event_id = pevent_data_type(pevent, record);
+	event_id = tep_data_type(pevent, record);
 
 	if (store->sched_switch_next_field &&
 	    event_id == store->sched_switch_event->id) {
@@ -1265,7 +1265,7 @@ static void update_filter_tasks(TraceViewStore *store)
 				}
 			}
 
-			pid = pevent_data_pid(pevent, record);
+			pid = tep_data_pid(pevent, record);
 			if (show_task(store, pevent, record, pid))
 				store->cpu_list[cpu][i].visible = 1;
 			else
diff --git a/lib/traceevent/event-parse.c b/lib/traceevent/event-parse.c
index 7f9c0b3..a140fbc 100644
--- a/lib/traceevent/event-parse.c
+++ b/lib/traceevent/event-parse.c
@@ -5126,7 +5126,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
@@ -5135,8 +5135,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;
@@ -5209,55 +5209,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
  *
@@ -5265,20 +5265,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;
 
@@ -5303,7 +5303,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
@@ -5315,8 +5315,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;
 
@@ -5351,13 +5351,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;
 
@@ -5377,7 +5377,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
@@ -5497,7 +5497,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) {
diff --git a/lib/traceevent/parse-filter.c b/lib/traceevent/parse-filter.c
index df42e04..4cc539c 100644
--- a/lib/traceevent/parse-filter.c
+++ b/lib/traceevent/parse-filter.c
@@ -1691,8 +1691,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;
 }
 
@@ -2046,7 +2046,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)
diff --git a/plugins/plugin_blk.c b/plugins/plugin_blk.c
index 0e92546..f9bd743 100644
--- a/plugins/plugin_blk.c
+++ b/plugins/plugin_blk.c
@@ -191,7 +191,7 @@ static int blk_log_split(struct trace_seq *s, struct blk_data *data)
 {
 	const char *cmd;
 
-	cmd = pevent_data_comm_from_pid(data->event->pevent, data->pid);
+	cmd = tep_data_comm_from_pid(data->event->pevent, data->pid);
 
 	return trace_seq_printf(s, "%llu / %llu [%s]\n", data->sector,
 				get_pdu_int(data->pdu_data), cmd);
@@ -201,7 +201,7 @@ static int blk_log_plug(struct trace_seq *s, struct blk_data *data)
 {
 	const char *cmd;
 
-	cmd = pevent_data_comm_from_pid(data->event->pevent, data->pid);
+	cmd = tep_data_comm_from_pid(data->event->pevent, data->pid);
 
 	return trace_seq_printf(s, "[%s]\n", cmd);
 }
@@ -210,7 +210,7 @@ static int blk_log_unplug(struct trace_seq *s, struct blk_data *data)
 {
 	const char *cmd;
 
-	cmd = pevent_data_comm_from_pid(data->event->pevent, data->pid);
+	cmd = tep_data_comm_from_pid(data->event->pevent, data->pid);
 
 	return trace_seq_printf(s, "[%s] %llu\n", cmd, get_pdu_int(data->pdu_data));
 }
@@ -236,7 +236,7 @@ static int blk_log_generic(struct trace_seq *s, struct blk_data *data)
 {
 	const char *cmd;
 
-	cmd = pevent_data_comm_from_pid(data->event->pevent, data->pid);
+	cmd = tep_data_comm_from_pid(data->event->pevent, data->pid);
 
 	if (data->action & BLK_TC_ACT(BLK_TC_PC)) {
 		int ret;
diff --git a/python/tracecmd.py b/python/tracecmd.py
index 318887c..bc926c6 100644
--- a/python/tracecmd.py
+++ b/python/tracecmd.py
@@ -80,7 +80,7 @@ class Event(object, DictMixin):
 
     @cached_property
     def comm(self):
-        return pevent_data_comm_from_pid(self._pevent, self.pid)
+        return tep_data_comm_from_pid(self._pevent, self.pid)
 
     @cached_property
     def cpu(self):
@@ -92,7 +92,7 @@ class Event(object, DictMixin):
 
     @cached_property
     def pid(self):
-        return pevent_data_pid(self._pevent, self._record)
+        return tep_data_pid(self._pevent, self._record)
 
     @cached_property
     def ts(self):
@@ -100,7 +100,7 @@ class Event(object, DictMixin):
 
     @cached_property
     def type(self):
-        return pevent_data_type(self._pevent, self._record)
+        return tep_data_type(self._pevent, self._record)
 
     def num_field(self, name):
         f = tep_find_any_field(self._format, name)
@@ -203,8 +203,8 @@ class Trace(object):
     def read_event(self, cpu):
         rec = tracecmd_read_data(self._handle, cpu)
         if rec:
-            type = pevent_data_type(self._pevent, rec)
-            format = pevent_data_event_from_type(self._pevent, type)
+            type = tep_data_type(self._pevent, rec)
+            format = tep_data_event_from_type(self._pevent, type)
             # rec ownership goes over to Event instance
             return Event(self._pevent, rec, format)
         return None
@@ -215,8 +215,8 @@ class Trace(object):
         if isinstance(res, int):
             return None
         rec, cpu = res
-        type = pevent_data_type(self._pevent, rec)
-        format = pevent_data_event_from_type(self._pevent, type)
+        type = tep_data_type(self._pevent, rec)
+        format = tep_data_event_from_type(self._pevent, type)
         # rec ownership goes over to Event instance
         return Event(self._pevent, rec, format)
 
@@ -225,16 +225,16 @@ class Trace(object):
         if isinstance(res, int):
             return None
         rec, cpu = res
-        type = pevent_data_type(self._pevent, rec)
-        format = pevent_data_event_from_type(self._pevent, type)
+        type = tep_data_type(self._pevent, rec)
+        format = tep_data_event_from_type(self._pevent, type)
         return Event(self._pevent, rec, format)
 
     def peek_event(self, cpu):
         rec = tracecmd_peek_data_ref(self._handle, cpu)
         if rec is None:
             return None
-        type = pevent_data_type(self._pevent, rec)
-        format = pevent_data_event_from_type(self._pevent, type)
+        type = tep_data_type(self._pevent, rec)
+        format = tep_data_event_from_type(self._pevent, type)
         # rec ownership goes over to Event instance
         return Event(self._pevent, rec, format)
 
diff --git a/tracecmd/trace-hist.c b/tracecmd/trace-hist.c
index e8bf434..08e0449 100644
--- a/tracecmd/trace-hist.c
+++ b/tracecmd/trace-hist.c
@@ -541,7 +541,7 @@ process_event(struct tep_handle *pevent, struct tep_record *record, int type)
 		reset_pending_stack();
 	}
 		
-	event = pevent_data_event_from_type(pevent, type);
+	event = tep_data_event_from_type(pevent, type);
 	event_name = event->name;
 
 	ret = tep_read_number_field(common_pid_field, record->data, &val);
@@ -919,7 +919,7 @@ static void print_chains(struct tep_handle *pevent)
 			printf("  %%%3.2f  (%d) %s %30s #%d\n",
 			       get_percent(total_counts, chain->count),
 			       pid,
-			       pevent_data_comm_from_pid(pevent, pid),
+			       tep_data_comm_from_pid(pevent, pid),
 			       chain->func,
 			       chain->count);
 		printf(START);
@@ -951,8 +951,8 @@ static void do_trace_hist(struct tracecmd_input *handle)
 	if (!record)
 		die("No records found in file");
 
-	ret = pevent_data_type(pevent, record);
-	event = pevent_data_event_from_type(pevent, ret);
+	ret = tep_data_type(pevent, record);
+	event = tep_data_event_from_type(pevent, ret);
 
 	long_size = tracecmd_long_size(handle);
 
diff --git a/tracecmd/trace-mem.c b/tracecmd/trace-mem.c
index 1833d88..c4edc06 100644
--- a/tracecmd/trace-mem.c
+++ b/tracecmd/trace-mem.c
@@ -487,8 +487,8 @@ static void do_trace_mem(struct tracecmd_input *handle)
 	if (!record)
 		die("No records found in file");
 
-	ret = pevent_data_type(pevent, record);
-	event = pevent_data_event_from_type(pevent, ret);
+	ret = tep_data_type(pevent, record);
+	event = tep_data_event_from_type(pevent, ret);
 
 	common_type_field = tep_find_common_field(event, "common_type");
 	if (!common_type_field)
diff --git a/tracecmd/trace-profile.c b/tracecmd/trace-profile.c
index 2b50d33..cf0eace 100644
--- a/tracecmd/trace-profile.c
+++ b/tracecmd/trace-profile.c
@@ -763,7 +763,7 @@ static void trace_profile_record(struct tracecmd_input *handle,
 
 	pevent = h->pevent;
 
-	id = pevent_data_type(pevent, record);
+	id = tep_data_type(pevent, record);
 
 	event_data = find_event_data(h, id);
 
@@ -2017,7 +2017,7 @@ static void output_task(struct handle_data *h, struct task_data *task)
 	if (task->comm)
 		comm = task->comm;
 	else
-		comm = pevent_data_comm_from_pid(h->pevent, task->pid);
+		comm = tep_data_comm_from_pid(h->pevent, task->pid);
 
 	if (task->pid < 0)
 		printf("%s\n", task->comm);
diff --git a/tracecmd/trace-read.c b/tracecmd/trace-read.c
index 352ff11..fd5567e 100644
--- a/tracecmd/trace-read.c
+++ b/tracecmd/trace-read.c
@@ -432,15 +432,15 @@ static void convert_comm_filter(struct tracecmd_input *handle)
 
 	/* Seach for comm names and get their pids */
 	for (list = comm_list; list; list = list->next) {
-		cmdline = pevent_data_pid_from_comm(pevent, list->pid, NULL);
+		cmdline = tep_data_pid_from_comm(pevent, list->pid, NULL);
 		if (!cmdline) {
 			warning("comm: %s not in cmdline list", list->pid);
 			continue;
 		}
 		do {
-			sprintf(pidstr, "%d", pevent_cmdline_pid(pevent, cmdline));
+			sprintf(pidstr, "%d", tep_cmdline_pid(pevent, cmdline));
 			add_pid_filter(pidstr);
-			cmdline = pevent_data_pid_from_comm(pevent, list->pid,
+			cmdline = tep_data_pid_from_comm(pevent, list->pid,
 							    cmdline);
 		} while (cmdline);
 	}
@@ -669,7 +669,7 @@ static void process_wakeup(struct tep_handle *pevent, struct tep_record *record)
 	if (!show_wakeup)
 		return;
 
-	id = pevent_data_type(pevent, record);
+	id = tep_data_type(pevent, record);
 	if (id == wakeup_id) {
 		if (tep_read_number_field(wakeup_success, record->data, &val) == 0) {
 			if (!val)
@@ -883,7 +883,7 @@ test_filters(struct tep_handle *pevent, struct filter *event_filters,
 	int flags;
 
 	if (no_irqs || no_softirqs) {
-		flags = pevent_data_flags(pevent, record);
+		flags = tep_data_flags(pevent, record);
 		if (no_irqs && (flags & TRACE_FLAG_HARDIRQ))
 			return FILTER_MISS;
 		if (no_softirqs && (flags & TRACE_FLAG_SOFTIRQ))
@@ -976,7 +976,7 @@ test_stacktrace(struct handle_list *handles, struct tep_record *record,
 
 	cpu_info = &info->cpus[record->cpu];
 
-	id = pevent_data_type(pevent, record);
+	id = tep_data_type(pevent, record);
 
 	/*
 	 * Print the stack trace if the previous event was printed.
diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c
index 6952492..5a1d2a0 100644
--- a/tracecmd/trace-record.c
+++ b/tracecmd/trace-record.c
@@ -3362,8 +3362,8 @@ find_ts_in_page(struct tep_handle *pevent, void *page, int size)
 		if (!record)
 			break;
 		free_record(last_record);
-		id = pevent_data_type(pevent, record);
-		event = pevent_data_event_from_type(pevent, id);
+		id = tep_data_type(pevent, record);
+		event = tep_data_event_from_type(pevent, id);
 		if (event) {
 			/* Make sure this is our event */
 			field = tep_find_field(event, "buf");
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH v3 19/24] tools lib traceevent: Rename pevent field APIs
  2018-08-27  8:17 [PATCH v3 00/24] trace-cmd: rename variables, data structures and functions in lib/traceevent Tzvetomir Stoyanov (VMware)
                   ` (16 preceding siblings ...)
  2018-08-27  8:17 ` [PATCH v3 18/24] tools lib traceevent: Rename pevent_data_ APIs Tzvetomir Stoyanov (VMware)
@ 2018-08-27  8:17 ` Tzvetomir Stoyanov (VMware)
  2018-08-27  8:17 ` [PATCH v3 20/24] tools lib traceevent: Rename pevent_find_* APIs Tzvetomir Stoyanov (VMware)
                   ` (4 subsequent siblings)
  22 siblings, 0 replies; 30+ messages in thread
From: Tzvetomir Stoyanov (VMware) @ 2018-08-27  8:17 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel

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

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/20180808180702.821244942@goodmis.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 include/traceevent/event-parse.h | 28 ++++++++++-----------
 lib/trace-cmd/trace-ftrace.c     | 34 +++++++++++++-------------
 lib/traceevent/event-parse.c     | 42 ++++++++++++++++----------------
 plugins/plugin_function.c        |  4 +--
 plugins/plugin_futex.c           | 12 ++++-----
 plugins/plugin_kvm.c             | 28 ++++++++++-----------
 plugins/plugin_sched_switch.c    | 18 +++++++-------
 plugins/plugin_tlb.c             |  2 +-
 8 files changed, 84 insertions(+), 84 deletions(-)

diff --git a/include/traceevent/event-parse.h b/include/traceevent/event-parse.h
index 9ad3208..e1628f5 100644
--- a/include/traceevent/event-parse.h
+++ b/include/traceevent/event-parse.h
@@ -636,22 +636,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,
diff --git a/lib/trace-cmd/trace-ftrace.c b/lib/trace-cmd/trace-ftrace.c
index 01a2a7c..05e1200 100644
--- a/lib/trace-cmd/trace-ftrace.c
+++ b/lib/trace-cmd/trace-ftrace.c
@@ -69,7 +69,7 @@ static int function_handler(struct trace_seq *s, struct tep_record *record,
 	unsigned long long function;
 	const char *func;
 
-	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);
@@ -78,7 +78,7 @@ static int function_handler(struct trace_seq *s, struct tep_record *record,
 	else
 		trace_seq_printf(s, "0x%llx", function);
 
-	if (pevent_get_field_val(s, event, "parent_ip", record, &function, 1))
+	if (tep_get_field_val(s, event, "parent_ip", record, &function, 1))
 		return trace_seq_putc(s, '!');
 
 	func = pevent_find_function(pevent, function);
@@ -102,20 +102,20 @@ get_return_for_leaf(struct trace_seq *s, int cpu, int cur_pid,
 	unsigned long long pid;
 
 	/* Searching a common field, can use any event */
-	if (pevent_get_common_field_val(s, finfo->fgraph_ret_event, "common_type", next, &type, 1))
+	if (tep_get_common_field_val(s, finfo->fgraph_ret_event, "common_type", next, &type, 1))
 		return NULL;
 
 	if (type != finfo->fgraph_ret_id)
 		return NULL;
 
-	if (pevent_get_common_field_val(s, finfo->fgraph_ret_event, "common_pid", next, &pid, 1))
+	if (tep_get_common_field_val(s, finfo->fgraph_ret_event, "common_pid", next, &pid, 1))
 		return NULL;
 
 	if (cur_pid != pid)
 		return NULL;
 
 	/* We aleady know this is a funcgraph_ret_event */
-	if (pevent_get_field_val(s, finfo->fgraph_ret_event, "func", next, &val, 1))
+	if (tep_get_field_val(s, finfo->fgraph_ret_event, "func", next, &val, 1))
 		return NULL;
 
 	if (cur_func != val)
@@ -200,10 +200,10 @@ print_graph_entry_leaf(struct trace_seq *s,
 	int ret;
 	int i;
 
-	if (pevent_get_field_val(s, finfo->fgraph_ret_event, "rettime", ret_rec, &rettime, 1))
+	if (tep_get_field_val(s, finfo->fgraph_ret_event, "rettime", ret_rec, &rettime, 1))
 		return trace_seq_putc(s, '!');
 
-	if (pevent_get_field_val(s, finfo->fgraph_ret_event, "calltime", ret_rec, &calltime, 1))
+	if (tep_get_field_val(s, finfo->fgraph_ret_event, "calltime", ret_rec, &calltime, 1))
 		return trace_seq_putc(s, '!');
 
 	duration = rettime - calltime;
@@ -214,14 +214,14 @@ print_graph_entry_leaf(struct trace_seq *s,
 	/* Duration */
 	print_graph_duration(s, duration);
 
-	if (pevent_get_field_val(s, event, "depth", record, &depth, 1))
+	if (tep_get_field_val(s, event, "depth", record, &depth, 1))
 		return trace_seq_putc(s, '!');
 
 	/* Function */
 	for (i = 0; i < (int)(depth * TRACE_GRAPH_INDENT); i++)
 		trace_seq_putc(s, ' ');
 
-	if (pevent_get_field_val(s, event, "func", record, &val, 1))
+	if (tep_get_field_val(s, event, "func", record, &val, 1))
 		return trace_seq_putc(s, '!');
 	func = pevent_find_function(pevent, val);
 
@@ -253,14 +253,14 @@ static int print_graph_nested(struct trace_seq *s,
 	/* No time */
 	trace_seq_puts(s, "           |  ");
 
-	if (pevent_get_field_val(s, event, "depth", record, &depth, 1))
+	if (tep_get_field_val(s, event, "depth", record, &depth, 1))
 		return trace_seq_putc(s, '!');
 
 	/* Function */
 	for (i = 0; i < (int)(depth * TRACE_GRAPH_INDENT); i++)
 		trace_seq_putc(s, ' ');
 
-	if (pevent_get_field_val(s, event, "func", record, &val, 1))
+	if (tep_get_field_val(s, event, "func", record, &val, 1))
 		return trace_seq_putc(s, '!');
 
 	func = pevent_find_function(pevent, val);
@@ -287,10 +287,10 @@ fgraph_ent_handler(struct trace_seq *s, struct tep_record *record,
 
 	ret_event_check(finfo, event->pevent);
 
-	if (pevent_get_common_field_val(s, event, "common_pid", record, &pid, 1))
+	if (tep_get_common_field_val(s, event, "common_pid", record, &pid, 1))
 		return trace_seq_putc(s, '!');
 
-	if (pevent_get_field_val(s, event, "func", record, &val, 1))
+	if (tep_get_field_val(s, event, "func", record, &val, 1))
 		return trace_seq_putc(s, '!');
 
 	rec = tracecmd_peek_next_data(tracecmd_curr_thread_handle, &cpu);
@@ -323,10 +323,10 @@ fgraph_ret_handler(struct trace_seq *s, struct tep_record *record,
 
 	ret_event_check(finfo, event->pevent);
 
-	if (pevent_get_field_val(s, event, "rettime", record, &rettime, 1))
+	if (tep_get_field_val(s, event, "rettime", record, &rettime, 1))
 		return trace_seq_putc(s, '!');
 
-	if (pevent_get_field_val(s, event, "calltime", record, &calltime, 1))
+	if (tep_get_field_val(s, event, "calltime", record, &calltime, 1))
 		return trace_seq_putc(s, '!');
 
 	duration = rettime - calltime;
@@ -337,7 +337,7 @@ fgraph_ret_handler(struct trace_seq *s, struct tep_record *record,
 	/* Duration */
 	print_graph_duration(s, duration);
 
-	if (pevent_get_field_val(s, event, "depth", record, &depth, 1))
+	if (tep_get_field_val(s, event, "depth", record, &depth, 1))
 		return trace_seq_putc(s, '!');
 
 	/* Function */
@@ -347,7 +347,7 @@ fgraph_ret_handler(struct trace_seq *s, struct tep_record *record,
 	trace_seq_putc(s, '}');
 
 	if (fgraph_tail->set) {
-		if (pevent_get_field_val(s, event, "func", record, &val, 0))
+		if (tep_get_field_val(s, event, "func", record, &val, 0))
 			return 0;
 		func = pevent_find_function(event->pevent, val);
 		if (!func)
diff --git a/lib/traceevent/event-parse.c b/lib/traceevent/event-parse.c
index a140fbc..63c3e76 100644
--- a/lib/traceevent/event-parse.c
+++ b/lib/traceevent/event-parse.c
@@ -6152,7 +6152,7 @@ __pevent_parse_event(struct tep_handle *pevent,
 	return 0;
 
 event_add_failed:
-	pevent_free_format(event);
+	tep_free_format(event);
 	return ret;
 }
 
@@ -6249,7 +6249,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
@@ -6262,9 +6262,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;
@@ -6299,7 +6299,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
@@ -6309,9 +6309,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;
 
@@ -6324,7 +6324,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
@@ -6334,9 +6334,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;
 
@@ -6349,7 +6349,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
@@ -6359,9 +6359,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;
 
@@ -6757,7 +6757,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)
@@ -6772,7 +6772,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;
 	}
 }
@@ -6783,7 +6783,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);
@@ -6869,7 +6869,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;
diff --git a/plugins/plugin_function.c b/plugins/plugin_function.c
index f88da43..0e1f13a 100644
--- a/plugins/plugin_function.c
+++ b/plugins/plugin_function.c
@@ -137,12 +137,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);
diff --git a/plugins/plugin_futex.c b/plugins/plugin_futex.c
index d060bd0..988b093 100644
--- a/plugins/plugin_futex.c
+++ b/plugins/plugin_futex.c
@@ -71,22 +71,22 @@ static int futex_handler(struct trace_seq *s, struct tep_record *record,
 	struct futex_args args;
 	unsigned long long cmd;
 
-	if (pevent_get_field_val(s, event, "uaddr", record, &args.uaddr, 1))
+	if (tep_get_field_val(s, event, "uaddr", record, &args.uaddr, 1))
 		return 1;
 
-	if (pevent_get_field_val(s, event, "op", record, &args.op, 1))
+	if (tep_get_field_val(s, event, "op", record, &args.op, 1))
 		return 1;
 
-	if (pevent_get_field_val(s, event, "val", record, &args.val, 1))
+	if (tep_get_field_val(s, event, "val", record, &args.val, 1))
 		return 1;
 
-	if (pevent_get_field_val(s, event, "utime", record, &args.utime, 1))
+	if (tep_get_field_val(s, event, "utime", record, &args.utime, 1))
 		return 1;
 
-	if (pevent_get_field_val(s, event, "uaddr2", record, &args.uaddr2, 1))
+	if (tep_get_field_val(s, event, "uaddr2", record, &args.uaddr2, 1))
 		return 1;
 
-	if (pevent_get_field_val(s, event, "val3", record, &args.val3, 1))
+	if (tep_get_field_val(s, event, "val3", record, &args.val3, 1))
 		return 1;
 
 	cmd = args.op & FUTEX_CMD_MASK;
diff --git a/plugins/plugin_kvm.c b/plugins/plugin_kvm.c
index 2c1a8a7..b19311d 100644
--- a/plugins/plugin_kvm.c
+++ b/plugins/plugin_kvm.c
@@ -255,10 +255,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);
@@ -279,8 +279,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\n", info1, info2);
 
 	return 0;
@@ -299,22 +299,22 @@ static int kvm_emulate_insn_handler(struct trace_seq *s, struct tep_record *reco
 	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;
 
@@ -376,7 +376,7 @@ static int kvm_mmu_print_role(struct trace_seq *s, struct tep_record *record,
 		{ "---", "--x", "w--", "w-x", "-u-", "-ux", "wu-", "wux" };
 	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;
@@ -403,7 +403,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);
@@ -415,12 +415,12 @@ static int kvm_mmu_get_page_handler(struct trace_seq *s, struct tep_record *reco
 {
 	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);
diff --git a/plugins/plugin_sched_switch.c b/plugins/plugin_sched_switch.c
index f1229b8..715587a 100644
--- a/plugins/plugin_sched_switch.c
+++ b/plugins/plugin_sched_switch.c
@@ -55,7 +55,7 @@ static int sched_wakeup_handler(struct trace_seq *s, struct tep_record *record,
 	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");
@@ -65,13 +65,13 @@ static int sched_wakeup_handler(struct trace_seq *s, struct tep_record *record,
 	}
 	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;
@@ -83,7 +83,7 @@ static int sched_switch_handler(struct trace_seq *s, struct tep_record *record,
 	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");
@@ -93,15 +93,15 @@ static int sched_switch_handler(struct trace_seq *s, struct tep_record *record,
 	}
 	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, "[%lld] ", 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");
@@ -111,7 +111,7 @@ static int sched_switch_handler(struct trace_seq *s, struct tep_record *record,
 	}
 	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, " [%lld]", val);
 
 	return 0;
diff --git a/plugins/plugin_tlb.c b/plugins/plugin_tlb.c
index 9f1a70a..14afa18 100644
--- a/plugins/plugin_tlb.c
+++ b/plugins/plugin_tlb.c
@@ -25,7 +25,7 @@ static int tlb_flush_handler(struct trace_seq *s, struct tep_record *record,
 
 	tep_print_num_field(s, "%ld", event, "pages", record, 1);
 
-	if (pevent_get_field_val(s, event, "reason", record, &val, 1) < 0)
+	if (tep_get_field_val(s, event, "reason", record, &val, 1) < 0)
 		return -1;
 
 	trace_seq_puts(s, " reason=");
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH v3 20/24] tools lib traceevent: Rename pevent_find_* APIs
  2018-08-27  8:17 [PATCH v3 00/24] trace-cmd: rename variables, data structures and functions in lib/traceevent Tzvetomir Stoyanov (VMware)
                   ` (17 preceding siblings ...)
  2018-08-27  8:17 ` [PATCH v3 19/24] tools lib traceevent: Rename pevent field APIs Tzvetomir Stoyanov (VMware)
@ 2018-08-27  8:17 ` Tzvetomir Stoyanov (VMware)
  2018-08-27  8:17 ` [PATCH v3 21/24] tools lib traceevent: Rename various pevent get/set/is APIs Tzvetomir Stoyanov (VMware)
                   ` (3 subsequent siblings)
  22 siblings, 0 replies; 30+ messages in thread
From: Tzvetomir Stoyanov (VMware) @ 2018-08-27  8:17 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel

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

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/20180808180702.966965051@goodmis.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 include/traceevent/event-parse.h         |  8 +++---
 kernel-shark-qt/src/libkshark-configio.c |  2 +-
 kernel-shark/trace-capture.c             |  2 +-
 kernel-shark/trace-filter.c              |  2 +-
 kernel-shark/trace-graph.c               | 32 ++++++++++++------------
 kernel-shark/trace-view-store.c          |  6 ++---
 lib/trace-cmd/trace-blk-hack.c           |  6 ++---
 lib/trace-cmd/trace-ftrace.c             | 16 ++++++------
 lib/traceevent/event-parse.c             | 24 +++++++++---------
 lib/traceevent/parse-filter.c            | 10 ++++----
 plugins/plugin_function.c                |  6 ++---
 plugins/plugin_kmem.c                    |  4 +--
 python/ctracecmd.i                       |  2 +-
 tracecmd/trace-hist.c                    | 10 ++++----
 tracecmd/trace-mem.c                     |  4 +--
 tracecmd/trace-profile.c                 | 10 ++++----
 tracecmd/trace-read.c                    | 14 +++++------
 17 files changed, 79 insertions(+), 79 deletions(-)

diff --git a/include/traceevent/event-parse.h b/include/traceevent/event-parse.h
index e1628f5..87777c2 100644
--- a/include/traceevent/event-parse.h
+++ b/include/traceevent/event-parse.h
@@ -678,9 +678,9 @@ struct format_field *tep_find_common_field(struct event_format *event, const cha
 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);
+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);
@@ -688,10 +688,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);
diff --git a/kernel-shark-qt/src/libkshark-configio.c b/kernel-shark-qt/src/libkshark-configio.c
index d7c1a06..9bdd2c0 100644
--- a/kernel-shark-qt/src/libkshark-configio.c
+++ b/kernel-shark-qt/src/libkshark-configio.c
@@ -819,7 +819,7 @@ static bool kshark_event_filter_from_json(struct tep_handle *pevent,
 		system_str = json_object_get_string(jsystem);
 		name_str = json_object_get_string(jname);
 
-		event = pevent_find_event_by_name(pevent, system_str, name_str);
+		event = tep_find_event_by_name(pevent, system_str, name_str);
 		if (!event)
 			goto fail;
 
diff --git a/kernel-shark/trace-capture.c b/kernel-shark/trace-capture.c
index 27cea40..4bfec6a 100644
--- a/kernel-shark/trace-capture.c
+++ b/kernel-shark/trace-capture.c
@@ -841,7 +841,7 @@ static int load_events(struct trace_capture *cap,
 			continue;
 		event_name = tracecmd_xml_node_value(handle, event_node);
 
-		event = pevent_find_event_by_name(pevent, system, event_name);
+		event = tep_find_event_by_name(pevent, system, event_name);
 
 		if (!event)
 			continue;
diff --git a/kernel-shark/trace-filter.c b/kernel-shark/trace-filter.c
index b762d97..d9b1563 100644
--- a/kernel-shark/trace-filter.c
+++ b/kernel-shark/trace-filter.c
@@ -194,7 +194,7 @@ static void update_field_combo(struct tep_handle *pevent,
 		return;
 
 	if (event_name) {
-		event = pevent_find_event_by_name(pevent, system, event_name);
+		event = tep_find_event_by_name(pevent, system, event_name);
 		if (!event)
 			return;
 	} else {
diff --git a/kernel-shark/trace-graph.c b/kernel-shark/trace-graph.c
index b6890e9..808b2f3 100644
--- a/kernel-shark/trace-graph.c
+++ b/kernel-shark/trace-graph.c
@@ -1016,8 +1016,8 @@ int trace_graph_check_sched_wakeup(struct graph_info *ginfo,
 
 		found = FALSE;
 
-		event = pevent_find_event_by_name(ginfo->pevent,
-						  NULL, "sched_wakeup");
+		event = tep_find_event_by_name(ginfo->pevent,
+					       NULL, "sched_wakeup");
 		if (event) {
 			found = TRUE;
 			ginfo->event_wakeup_id = event->id;
@@ -1026,8 +1026,8 @@ int trace_graph_check_sched_wakeup(struct graph_info *ginfo,
 		}
 
 
-		event = pevent_find_event_by_name(ginfo->pevent,
-						  NULL, "sched_wakeup_new");
+		event = tep_find_event_by_name(ginfo->pevent,
+					       NULL, "sched_wakeup_new");
 		if (event) {
 			found = TRUE;
 			ginfo->event_wakeup_new_id = event->id;
@@ -1086,8 +1086,8 @@ int trace_graph_check_sched_switch(struct graph_info *ginfo,
 	}
 
 	if (ginfo->event_sched_switch_id < 0) {
-		event = pevent_find_event_by_name(ginfo->pevent,
-						  NULL, "sched_switch");
+		event = tep_find_event_by_name(ginfo->pevent,
+					       NULL, "sched_switch");
 		if (!event)
 			return 0;
 
@@ -1096,8 +1096,8 @@ int trace_graph_check_sched_switch(struct graph_info *ginfo,
 		ginfo->event_pid_field = tep_find_field(event, "next_pid");
 		ginfo->event_comm_field = tep_find_field(event, "next_comm");
 
-		event = pevent_find_event_by_name(ginfo->pevent,
-						  "ftrace", "context_switch");
+		event = tep_find_event_by_name(ginfo->pevent,
+					       "ftrace", "context_switch");
 		if (event) {
 			ginfo->ftrace_sched_switch_id = event->id;
 			ginfo->ftrace_pid_field = tep_find_field(event, "next_pid");
@@ -1164,32 +1164,32 @@ trace_graph_check_irq(struct graph_info *ginfo,
 		gint soft_irq_entry_len = 0;
 		gint soft_irq_exit_len = 0;
 
-		event = pevent_find_event_by_name(ginfo->pevent,
-						  NULL, "irq_handler_exit");
+		event = tep_find_event_by_name(ginfo->pevent,
+					       NULL, "irq_handler_exit");
 		if (event)
 			enter_id(&ginfo->hard_irq_exit_ids, event->id,
 				 &hard_irq_exit_len);
 		else
 			ginfo->hard_irq_exit_ids = null_int_array;
 
-		event = pevent_find_event_by_name(ginfo->pevent,
-						  NULL, "irq_handler_entry");
+		event = tep_find_event_by_name(ginfo->pevent,
+					       NULL, "irq_handler_entry");
 		if (event)
 			enter_id(&ginfo->hard_irq_entry_ids, event->id,
 				 &hard_irq_entry_len);
 		else
 			ginfo->hard_irq_entry_ids = null_int_array;
 
-		event = pevent_find_event_by_name(ginfo->pevent,
-						  NULL, "softirq_exit");
+		event = tep_find_event_by_name(ginfo->pevent,
+					       NULL, "softirq_exit");
 		if (event)
 			enter_id(&ginfo->soft_irq_exit_ids, event->id,
 				 &soft_irq_exit_len);
 		else
 			ginfo->soft_irq_exit_ids = null_int_array;
 
-		event = pevent_find_event_by_name(ginfo->pevent,
-						  NULL, "softirq_entry");
+		event = tep_find_event_by_name(ginfo->pevent,
+					       NULL, "softirq_entry");
 		if (event)
 			enter_id(&ginfo->soft_irq_entry_ids, event->id,
 				 &soft_irq_entry_len);
diff --git a/kernel-shark/trace-view-store.c b/kernel-shark/trace-view-store.c
index 92ddf7e..a798804 100644
--- a/kernel-shark/trace-view-store.c
+++ b/kernel-shark/trace-view-store.c
@@ -1227,20 +1227,20 @@ static void update_filter_tasks(TraceViewStore *store)
 
 	if (!store->sched_switch_event) {
 		store->sched_switch_event =
-			pevent_find_event_by_name(pevent, "sched", "sched_switch");
+			tep_find_event_by_name(pevent, "sched", "sched_switch");
 		if (store->sched_switch_event)
 			store->sched_switch_next_field =
 				tep_find_any_field(store->sched_switch_event,
 						      "next_pid");
 		store->sched_wakeup_event =
-			pevent_find_event_by_name(pevent, "sched", "sched_wakeup");
+			tep_find_event_by_name(pevent, "sched", "sched_wakeup");
 		if (store->sched_wakeup_event)
 			store->sched_wakeup_pid_field =
 				tep_find_any_field(store->sched_wakeup_event,
 						      "pid");
 
 		store->sched_wakeup_new_event =
-			pevent_find_event_by_name(pevent, "sched", "sched_wakeup_new");
+			tep_find_event_by_name(pevent, "sched", "sched_wakeup_new");
 		if (store->sched_wakeup_new_event)
 			store->sched_wakeup_new_pid_field =
 				tep_find_any_field(store->sched_wakeup_new_event,
diff --git a/lib/trace-cmd/trace-blk-hack.c b/lib/trace-cmd/trace-blk-hack.c
index 2883c68..dbeedab 100644
--- a/lib/trace-cmd/trace-blk-hack.c
+++ b/lib/trace-cmd/trace-blk-hack.c
@@ -48,7 +48,7 @@ int tracecmd_blk_hack(struct tracecmd_input *handle)
 	 */
 
 	/* It was originally behind the "power" event */
-	event = pevent_find_event_by_name(pevent, "ftrace", "power");
+	event = tep_find_event_by_name(pevent, "ftrace", "power");
 	if (event) {
 		id = event->id + 1;
 		goto found;
@@ -58,7 +58,7 @@ int tracecmd_blk_hack(struct tracecmd_input *handle)
 	 * But the power tracer is now in perf.
 	 * Then it was after kmem_free
 	 */
-	event = pevent_find_event_by_name(pevent, "ftrace", "kmem_free");
+	event = tep_find_event_by_name(pevent, "ftrace", "kmem_free");
 	if (event) {
 		id = event->id + 1;
 		goto found;
@@ -68,7 +68,7 @@ int tracecmd_blk_hack(struct tracecmd_input *handle)
 	 * But that then went away.
 	 * Currently it should be behind the user stack.
 	 */
-	event = pevent_find_event_by_name(pevent, "ftrace", "user_stack");
+	event = tep_find_event_by_name(pevent, "ftrace", "user_stack");
 	if (event) {
 		id = event->id + 1;
 		goto found;
diff --git a/lib/trace-cmd/trace-ftrace.c b/lib/trace-cmd/trace-ftrace.c
index 05e1200..09fd40f 100644
--- a/lib/trace-cmd/trace-ftrace.c
+++ b/lib/trace-cmd/trace-ftrace.c
@@ -47,7 +47,7 @@ static int find_ret_event(struct tracecmd_ftrace *finfo, struct tep_handle *peve
 	struct event_format *event;
 
 	/* Store the func ret id and event for later use */
-	event = pevent_find_event_by_name(pevent, "ftrace", "funcgraph_exit");
+	event = tep_find_event_by_name(pevent, "ftrace", "funcgraph_exit");
 	if (!event)
 		return -1;
 
@@ -72,7 +72,7 @@ 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 (func)
 		trace_seq_printf(s, "%s <-- ", func);
 	else
@@ -81,7 +81,7 @@ static int function_handler(struct trace_seq *s, struct tep_record *record,
 	if (tep_get_field_val(s, event, "parent_ip", record, &function, 1))
 		return trace_seq_putc(s, '!');
 
-	func = pevent_find_function(pevent, function);
+	func = tep_find_function(pevent, function);
 	if (func)
 		trace_seq_printf(s, "%s", func);
 	else
@@ -223,7 +223,7 @@ print_graph_entry_leaf(struct trace_seq *s,
 
 	if (tep_get_field_val(s, event, "func", record, &val, 1))
 		return trace_seq_putc(s, '!');
-	func = pevent_find_function(pevent, val);
+	func = tep_find_function(pevent, val);
 
 	if (func)
 		ret = trace_seq_printf(s, "%s();", func);
@@ -263,7 +263,7 @@ static int print_graph_nested(struct trace_seq *s,
 	if (tep_get_field_val(s, event, "func", record, &val, 1))
 		return trace_seq_putc(s, '!');
 
-	func = pevent_find_function(pevent, val);
+	func = tep_find_function(pevent, val);
 
 	if (func)
 		ret = trace_seq_printf(s, "%s() {", func);
@@ -349,7 +349,7 @@ fgraph_ret_handler(struct trace_seq *s, struct tep_record *record,
 	if (fgraph_tail->set) {
 		if (tep_get_field_val(s, event, "func", record, &val, 0))
 			return 0;
-		func = pevent_find_function(event->pevent, val);
+		func = tep_find_function(event->pevent, val);
 		if (!func)
 			return 0;
 		trace_seq_printf(s, " /* %s */", func);
@@ -389,7 +389,7 @@ trace_stack_handler(struct trace_seq *s, struct tep_record *record,
 		    ((int)addr == -1))
 			break;
 
-		func = pevent_find_function(event->pevent, addr);
+		func = tep_find_function(event->pevent, addr);
 		if (func)
 			trace_seq_printf(s, "=> %s (%llx)\n", func, addr);
 		else
@@ -436,7 +436,7 @@ int tracecmd_ftrace_overrides(struct tracecmd_input *handle,
 	trace_util_add_options("ftrace", trace_ftrace_options);
 
 	/* Store the func ret id and event for later use */
-	event = pevent_find_event_by_name(pevent, "ftrace", "funcgraph_exit");
+	event = tep_find_event_by_name(pevent, "ftrace", "funcgraph_exit");
 	if (!event)
 		return 0;
 
diff --git a/lib/traceevent/event-parse.c b/lib/traceevent/event-parse.c
index 63c3e76..5d2f738 100644
--- a/lib/traceevent/event-parse.c
+++ b/lib/traceevent/event-parse.c
@@ -489,7 +489,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
  *
@@ -497,7 +497,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;
 
@@ -509,16 +509,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;
 
@@ -3484,7 +3484,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
@@ -3493,8 +3493,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;
@@ -5419,7 +5419,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
  *
@@ -5427,7 +5427,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;
 
@@ -5550,7 +5550,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);
@@ -6593,7 +6593,7 @@ static struct event_format *pevent_search_event(struct tep_handle *pevent, int i
 		if (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;
 	}
diff --git a/lib/traceevent/parse-filter.c b/lib/traceevent/parse-filter.c
index 4cc539c..a1d0e3a 100644
--- a/lib/traceevent/parse-filter.c
+++ b/lib/traceevent/parse-filter.c
@@ -1464,7 +1464,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;
 
@@ -1564,9 +1564,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;
 		}
@@ -1895,7 +1895,7 @@ static const char *get_field_str(struct filter_arg *arg, struct tep_record *reco
 
 		if (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 */
diff --git a/plugins/plugin_function.c b/plugins/plugin_function.c
index 0e1f13a..9efa01c 100644
--- a/plugins/plugin_function.c
+++ b/plugins/plugin_function.c
@@ -122,7 +122,7 @@ static void show_function(struct trace_seq *s, struct tep_handle *pevent,
 
 	trace_seq_printf(s, "%s", func);
 	if (ftrace_offset->set) {
-		offset = pevent_find_function_address(pevent, function);
+		offset = tep_find_function_address(pevent, function);
 		trace_seq_printf(s, "+0x%x ", (int)(function - offset));
 	}
 }
@@ -140,12 +140,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);
diff --git a/plugins/plugin_kmem.c b/plugins/plugin_kmem.c
index 3088d3a..79e3d3b 100644
--- a/plugins/plugin_kmem.c
+++ b/plugins/plugin_kmem.c
@@ -23,10 +23,10 @@ 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));
 
diff --git a/python/ctracecmd.i b/python/ctracecmd.i
index e29581e..e826679 100644
--- a/python/ctracecmd.i
+++ b/python/ctracecmd.i
@@ -107,7 +107,7 @@ static PyObject *py_field_get_stack(struct tep_handle *pevent,
 		if ((long_size == 8 && addr == (unsigned long long)-1) ||
 		    ((int)addr == -1))
 			break;
-		func = pevent_find_function(event->pevent, addr);
+		func = tep_find_function(event->pevent, addr);
 		if (PyList_Append(list, PyString_FromString(func))) {
 			Py_DECREF(list);
 			return NULL;
diff --git a/tracecmd/trace-hist.c b/tracecmd/trace-hist.c
index 08e0449..324b20d 100644
--- a/tracecmd/trace-hist.c
+++ b/tracecmd/trace-hist.c
@@ -276,8 +276,8 @@ process_function(struct tep_handle *pevent, struct tep_record *record)
 
 	pid = val;
 
-	func = pevent_find_function(pevent, ip);
-	parent = pevent_find_function(pevent, parent_ip);
+	func = tep_find_function(pevent, ip);
+	parent = tep_find_function(pevent, parent_ip);
 
 	if (current_pid >= 0 && pid != current_pid) {
 		save_stack();
@@ -334,7 +334,7 @@ process_function_graph_entry(struct tep_handle *pevent, struct tep_record *recor
 
 	pid = val;
 
-	func = pevent_find_function(pevent, ip);
+	func = tep_find_function(pevent, ip);
 
 	if (current_pid >= 0 && pid != current_pid) {
 		save_stack();
@@ -465,7 +465,7 @@ process_kernel_stack(struct tep_handle *pevent, struct tep_record *record)
 		const char *func;
 
 		addr = tep_read_number(pevent, data, long_size);
-		func = pevent_find_function(pevent, addr);
+		func = tep_find_function(pevent, addr);
 		if (func)
 			push_stack_func(func);
 	}
@@ -598,7 +598,7 @@ update_event(struct tep_handle *pevent,
 {
 	struct event_format *event;
 
-	event = pevent_find_event_by_name(pevent, sys, name);
+	event = tep_find_event_by_name(pevent, sys, name);
 	if (!event)
 		return NULL;
 
diff --git a/tracecmd/trace-mem.c b/tracecmd/trace-mem.c
index c4edc06..8dfa285 100644
--- a/tracecmd/trace-mem.c
+++ b/tracecmd/trace-mem.c
@@ -67,7 +67,7 @@ update_event(struct tep_handle *pevent,
 {
 	struct event_format *event;
 
-	event = pevent_find_event_by_name(pevent, sys, name);
+	event = tep_find_event_by_name(pevent, sys, name);
 	if (!event)
 		return NULL;
 
@@ -347,7 +347,7 @@ process_kmalloc(struct tep_handle *pevent, struct tep_record *record,
 	alloc = val;
 	tep_read_number_field(ptr_field, record->data, &ptr);
 
-	func = pevent_find_function(pevent, callsite);
+	func = tep_find_function(pevent, callsite);
 
 	add_kmalloc(func, ptr, req, alloc);
 }
diff --git a/tracecmd/trace-profile.c b/tracecmd/trace-profile.c
index cf0eace..6d56093 100644
--- a/tracecmd/trace-profile.c
+++ b/tracecmd/trace-profile.c
@@ -798,7 +798,7 @@ add_event(struct handle_data *h, const char *system, const char *event_name,
 	struct event_format *event;
 	struct event_data *event_data;
 
-	event = pevent_find_event_by_name(h->pevent, system, event_name);
+	event = tep_find_event_by_name(h->pevent, system, event_name);
 	if (!event)
 		return NULL;
 
@@ -904,8 +904,8 @@ static void func_print(struct trace_seq *s, struct event_hash *event_hash)
 {
 	const char *func;
 
-	func = pevent_find_function(event_hash->event_data->event->pevent,
-				    event_hash->val);
+	func = tep_find_function(event_hash->event_data->event->pevent,
+				 event_hash->val);
 	if (func)
 		trace_seq_printf(s, "func: %s()", func);
 	else
@@ -1555,7 +1555,7 @@ static void output_event_stack(struct tep_handle *pevent, struct stack_data *sta
 		}
 		if (val == stop)
 			break;
-		func = pevent_find_function(pevent, val);
+		func = tep_find_function(pevent, val);
 		if (func)
 			printf("       => %s (0x%llx)\n", func, val);
 		else
@@ -1777,7 +1777,7 @@ static void print_chain_func(struct tep_handle *pevent, struct stack_chain *chai
 	unsigned long long val = chain->val;
 	const char *func;
 
-	func = pevent_find_function(pevent, val);
+	func = tep_find_function(pevent, val);
 	if (func)
 		printf("%s (0x%llx)\n", func, val);
 	else
diff --git a/tracecmd/trace-read.c b/tracecmd/trace-read.c
index fd5567e..b6c4c90 100644
--- a/tracecmd/trace-read.c
+++ b/tracecmd/trace-read.c
@@ -540,7 +540,7 @@ static void init_wakeup(struct tracecmd_input *handle)
 
 	trace_hash_init(&wakeup_hash, WAKEUP_HASH_SIZE);
 
-	event = pevent_find_event_by_name(pevent, "sched", "sched_wakeup");
+	event = tep_find_event_by_name(pevent, "sched", "sched_wakeup");
 	if (!event)
 		goto fail;
 	wakeup_id = event->id;
@@ -549,7 +549,7 @@ static void init_wakeup(struct tracecmd_input *handle)
 		goto fail;
 	wakeup_success = tep_find_field(event, "success");
 
-	event = pevent_find_event_by_name(pevent, "sched", "sched_switch");
+	event = tep_find_event_by_name(pevent, "sched", "sched_switch");
 	if (!event)
 		goto fail;
 	sched_id = event->id;
@@ -564,7 +564,7 @@ static void init_wakeup(struct tracecmd_input *handle)
 
 	wakeup_new_id = -1;
 
-	event = pevent_find_event_by_name(pevent, "sched", "sched_wakeup_new");
+	event = tep_find_event_by_name(pevent, "sched", "sched_wakeup_new");
 	if (!event)
 		goto skip;
 	wakeup_new_id = event->id;
@@ -793,7 +793,7 @@ void trace_show_data(struct tracecmd_input *handle, struct tep_record *record)
 		struct event_format *event;
 		unsigned long long rec_ts = record->ts;
 
-		event = pevent_find_event_by_record(pevent, record);
+		event = tep_find_event_by_record(pevent, record);
 		tep_print_event_task(pevent, &s, event, record);
 		tep_print_event_time(pevent, &s, event, record,
 					use_trace_clock);
@@ -950,8 +950,8 @@ test_stacktrace(struct handle_list *handles, struct tep_record *record,
 			memset(info->cpus, 0, sizeof(*info->cpus));
 
 			pevent = tracecmd_get_pevent(h->handle);
-			event = pevent_find_event_by_name(pevent, "ftrace",
-							  "kernel_stack");
+			event = tep_find_event_by_name(pevent, "ftrace",
+						       "kernel_stack");
 			if (event)
 				info->stacktrace_id = event->id;
 			else
@@ -1161,7 +1161,7 @@ static void read_data_info(struct list_head *handle_list, enum output_type otype
 
 		/* Find the kernel_stacktrace if available */
 		pevent = tracecmd_get_pevent(handles->handle);
-		event = pevent_find_event_by_name(pevent, "ftrace", "kernel_stack");
+		event = tep_find_event_by_name(pevent, "ftrace", "kernel_stack");
 		if (event)
 			stacktrace_id = event->id;
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH v3 21/24] tools lib traceevent: Rename various pevent get/set/is APIs
  2018-08-27  8:17 [PATCH v3 00/24] trace-cmd: rename variables, data structures and functions in lib/traceevent Tzvetomir Stoyanov (VMware)
                   ` (18 preceding siblings ...)
  2018-08-27  8:17 ` [PATCH v3 20/24] tools lib traceevent: Rename pevent_find_* APIs Tzvetomir Stoyanov (VMware)
@ 2018-08-27  8:17 ` Tzvetomir Stoyanov (VMware)
  2018-08-27 13:17   ` Steven Rostedt
  2018-08-28  9:09   ` [PATCH v3.5 " Tzvetomir Stoyanov (VMware)
  2018-08-27  8:17 ` [PATCH v3 22/24] tools lib traceevent: Rename internal parser related APIs Tzvetomir Stoyanov (VMware)
                   ` (2 subsequent siblings)
  22 siblings, 2 replies; 30+ messages in thread
From: Tzvetomir Stoyanov (VMware) @ 2018-08-27  8:17 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel

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

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.114110715@goodmis.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 include/traceevent/event-parse.h | 14 +++++++-------
 kernel-shark/trace-graph.c       |  2 +-
 lib/trace-cmd/trace-input.c      |  2 +-
 lib/traceevent/event-parse.c     |  4 ++--
 plugins/plugin_kvm.c             |  4 ++--
 python/tracecmd.py               |  2 +-
 tracecmd/trace-read.c            |  6 +++---
 7 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/include/traceevent/event-parse.h b/include/traceevent/event-parse.h
index 87777c2..328d0d3 100644
--- a/include/traceevent/event-parse.h
+++ b/include/traceevent/event-parse.h
@@ -612,7 +612,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,
@@ -719,12 +719,12 @@ struct event_format **pevent_list_events(struct tep_handle *pevent, enum event_s
 struct 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;
 }
@@ -749,7 +749,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;
 }
@@ -759,7 +759,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;
 }
@@ -769,12 +769,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;
 }
diff --git a/kernel-shark/trace-graph.c b/kernel-shark/trace-graph.c
index 808b2f3..88870c1 100644
--- a/kernel-shark/trace-graph.c
+++ b/kernel-shark/trace-graph.c
@@ -1133,7 +1133,7 @@ int trace_graph_check_sched_switch(struct graph_info *ginfo,
 		 * First time through, register any missing
 		 *  comm / pid mappings.
 		 */
-		if (!pevent_pid_is_registered(ginfo->pevent, *pid))
+		if (!tep_find_event_by_record(ginfo->pevent, *pid))
 			tep_register_comm(ginfo->pevent,
 					  *comm, *pid);
 	}
diff --git a/lib/trace-cmd/trace-input.c b/lib/trace-cmd/trace-input.c
index 20203ad..af812c1 100644
--- a/lib/trace-cmd/trace-input.c
+++ b/lib/trace-cmd/trace-input.c
@@ -2406,7 +2406,7 @@ int tracecmd_init_data(struct tracecmd_input *handle)
 		return -1;
 	handle->cpus = cpus;
 
-	pevent_set_cpus(pevent, handle->cpus);
+	tep_set_cpus(pevent, handle->cpus);
 
 	ret = read_cpu_data(handle);
 	if (ret < 0)
diff --git a/lib/traceevent/event-parse.c b/lib/traceevent/event-parse.c
index 5d2f738..8264309 100644
--- a/lib/traceevent/event-parse.c
+++ b/lib/traceevent/event-parse.c
@@ -197,14 +197,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;
diff --git a/plugins/plugin_kvm.c b/plugins/plugin_kvm.c
index b19311d..3f4a8c0 100644
--- a/plugins/plugin_kvm.c
+++ b/plugins/plugin_kvm.c
@@ -385,8 +385,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/%u q%u%s %s%s %spge %snxe",
 				 role.level,
diff --git a/python/tracecmd.py b/python/tracecmd.py
index bc926c6..1267941 100644
--- a/python/tracecmd.py
+++ b/python/tracecmd.py
@@ -166,7 +166,7 @@ class PEvent(object):
 
     @cached_property
     def file_endian(self):
-        if pevent_is_file_bigendian(self._pevent):
+        if tep_is_file_bigendian(self._pevent):
             return '>'
         return '<'
 
diff --git a/tracecmd/trace-read.c b/tracecmd/trace-read.c
index b6c4c90..5832a8e 100644
--- a/tracecmd/trace-read.c
+++ b/tracecmd/trace-read.c
@@ -1700,8 +1700,8 @@ void trace_report (int argc, char **argv)
 
 		if (show_endian) {
 			printf("file is %s endian and host is %s endian\n",
-			       pevent_is_file_bigendian(pevent) ? "big" : "little",
-			       pevent_is_host_bigendian(pevent) ? "big" : "little");
+			       tep_is_file_bigendian(pevent) ? "big" : "little",
+			       tep_is_host_bigendian(pevent) ? "big" : "little");
 			return;
 		}
 
@@ -1755,7 +1755,7 @@ void trace_report (int argc, char **argv)
 	}
 
 	if (latency_format)
-		pevent_set_latency_format(pevent, latency_format);
+		tep_set_latency_format(pevent, latency_format);
 
 	otype = OUTPUT_NORMAL;
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH v3 22/24] tools lib traceevent: Rename internal parser related APIs
  2018-08-27  8:17 [PATCH v3 00/24] trace-cmd: rename variables, data structures and functions in lib/traceevent Tzvetomir Stoyanov (VMware)
                   ` (19 preceding siblings ...)
  2018-08-27  8:17 ` [PATCH v3 21/24] tools lib traceevent: Rename various pevent get/set/is APIs Tzvetomir Stoyanov (VMware)
@ 2018-08-27  8:17 ` Tzvetomir Stoyanov (VMware)
  2018-08-27  8:17 ` [PATCH v3 23/24] tools lib traceevent: Rename various pevent APIs Tzvetomir Stoyanov (VMware)
  2018-08-27  8:17 ` [PATCH v3 24/24] tools lib traceevent: Rename static variables and functions in event-parse.c Tzvetomir Stoyanov (VMware)
  22 siblings, 0 replies; 30+ messages in thread
From: Tzvetomir Stoyanov (VMware) @ 2018-08-27  8:17 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel

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

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.275281085@goodmis.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 include/traceevent/event-parse.h | 12 ++++++------
 lib/traceevent/event-parse.c     | 24 ++++++++++++------------
 lib/traceevent/parse-filter.c    | 16 ++++++++--------
 3 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/include/traceevent/event-parse.h b/include/traceevent/event-parse.h
index 328d0d3..1da291e 100644
--- a/include/traceevent/event-parse.h
+++ b/include/traceevent/event-parse.h
@@ -785,12 +785,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);
diff --git a/lib/traceevent/event-parse.c b/lib/traceevent/event-parse.c
index 8264309..b41608e 100644
--- a/lib/traceevent/event-parse.c
+++ b/lib/traceevent/event-parse.c
@@ -59,12 +59,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;
 }
@@ -99,14 +99,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);
 }
@@ -899,11 +899,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();
 }
@@ -1143,7 +1143,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
@@ -1151,16 +1151,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);
 }
diff --git a/lib/traceevent/parse-filter.c b/lib/traceevent/parse-filter.c
index a1d0e3a..1ff488d 100644
--- a/lib/traceevent/parse-filter.c
+++ b/lib/traceevent/parse-filter.c
@@ -37,8 +37,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) {
@@ -58,7 +58,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)
@@ -68,13 +68,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) {
@@ -84,7 +84,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;
@@ -1184,7 +1184,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)
@@ -1240,7 +1240,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';
 }
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH v3 23/24] tools lib traceevent: Rename various pevent APIs
  2018-08-27  8:17 [PATCH v3 00/24] trace-cmd: rename variables, data structures and functions in lib/traceevent Tzvetomir Stoyanov (VMware)
                   ` (20 preceding siblings ...)
  2018-08-27  8:17 ` [PATCH v3 22/24] tools lib traceevent: Rename internal parser related APIs Tzvetomir Stoyanov (VMware)
@ 2018-08-27  8:17 ` Tzvetomir Stoyanov (VMware)
  2018-08-27  8:17 ` [PATCH v3 24/24] tools lib traceevent: Rename static variables and functions in event-parse.c Tzvetomir Stoyanov (VMware)
  22 siblings, 0 replies; 30+ messages in thread
From: Tzvetomir Stoyanov (VMware) @ 2018-08-27  8:17 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel

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: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 include/traceevent/event-parse.h         | 14 +++++++-------
 kernel-shark-qt/src/libkshark-configio.c |  4 ++--
 kernel-shark/trace-dialog.c              |  2 +-
 kernel-shark/trace-filter.c              | 18 +++++++++---------
 kernel-shark/trace-graph.c               |  6 +++---
 kernel-shark/trace-view.c                |  4 ++--
 lib/traceevent/event-parse.c             | 22 +++++++++++-----------
 lib/traceevent/parse-filter.c            |  6 +++---
 tracecmd/trace-output.c                  |  6 +++---
 tracecmd/trace-profile.c                 |  4 ++--
 tracecmd/trace-read.c                    |  6 +++---
 11 files changed, 46 insertions(+), 46 deletions(-)

diff --git a/include/traceevent/event-parse.h b/include/traceevent/event-parse.h
index 1da291e..713a4e4 100644
--- a/include/traceevent/event-parse.h
+++ b/include/traceevent/event-parse.h
@@ -605,7 +605,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,
@@ -712,12 +712,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)
 {
@@ -781,8 +781,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);
diff --git a/kernel-shark-qt/src/libkshark-configio.c b/kernel-shark-qt/src/libkshark-configio.c
index 9bdd2c0..484da93 100644
--- a/kernel-shark-qt/src/libkshark-configio.c
+++ b/kernel-shark-qt/src/libkshark-configio.c
@@ -1028,7 +1028,7 @@ static bool kshark_adv_filters_to_json(struct kshark_context *kshark_ctx,
 	if (!jfilter_data)
 		goto fail;
 
-	events = pevent_list_events(kshark_ctx->pevent, EVENT_SORT_SYSTEM);
+	events = tep_list_events(kshark_ctx->pevent, EVENT_SORT_SYSTEM);
 	if (!events)
 		return false;
 
@@ -1148,7 +1148,7 @@ static bool kshark_adv_filters_from_json(struct kshark_context *kshark_ctx,
 	fprintf(stderr, "Failed to laod Advanced filters.\n");
 	char error_str[200];
 	int error_status =
-		pevent_strerror(kshark_ctx->pevent, ret, error_str,
+		tep_strerror(kshark_ctx->pevent, ret, error_str,
 							 sizeof(error_str));
 
 	if (error_status == 0)
diff --git a/kernel-shark/trace-dialog.c b/kernel-shark/trace-dialog.c
index 50b4daf..3eba62e 100644
--- a/kernel-shark/trace-dialog.c
+++ b/kernel-shark/trace-dialog.c
@@ -379,7 +379,7 @@ static void read_raw_events(struct trace_seq *s,
 	struct format_field **fields;
 	int i;
 
-	fields = pevent_event_fields(event);
+	fields = tep_event_fields(event);
 	if (!fields)
 		return;
 
diff --git a/kernel-shark/trace-filter.c b/kernel-shark/trace-filter.c
index d9b1563..8d78b31 100644
--- a/kernel-shark/trace-filter.c
+++ b/kernel-shark/trace-filter.c
@@ -92,7 +92,7 @@ static GtkTreeModel *create_event_combo_model(gpointer data)
 	const char *last_sys = NULL;
 	int i;
 
-	events = pevent_list_events(pevent, EVENT_SORT_SYSTEM);
+	events = tep_list_events(pevent, EVENT_SORT_SYSTEM);
 	if (!events)
 		return NULL;
 
@@ -150,14 +150,14 @@ static GtkTreeModel *create_field_combo_model(gpointer data)
 	struct format_field *field;
 	int i;
 
-	events = pevent_list_events(pevent, EVENT_SORT_SYSTEM);
+	events = tep_list_events(pevent, EVENT_SORT_SYSTEM);
 	if (!events)
 		return NULL;
 
 	list = gtk_list_store_new(1, G_TYPE_STRING);
 
 	/* use any event for common fields */
-	fields = pevent_event_common_fields(events[0]);
+	fields = tep_event_common_fields(events[0]);
 
 	for (i = 0; fields[i]; i++) {
 		field = fields[i];
@@ -199,7 +199,7 @@ static void update_field_combo(struct tep_handle *pevent,
 			return;
 	} else {
 		/* use any event */
-		events = pevent_list_events(pevent, EVENT_SORT_SYSTEM);
+		events = tep_list_events(pevent, EVENT_SORT_SYSTEM);
 		if (!events)
 			return;
 		event = events[0];
@@ -215,7 +215,7 @@ static void update_field_combo(struct tep_handle *pevent,
 		;
 
 	/* always load the common fields first */
-	fields = pevent_event_common_fields(event);
+	fields = tep_event_common_fields(event);
 	for (i = 0; fields[i]; i++) {
 		field = fields[i];
 		gtk_list_store_append(list, &iter);
@@ -227,7 +227,7 @@ static void update_field_combo(struct tep_handle *pevent,
 
 	/* Now add event specific events */
 	if (event_name) {
-		fields = pevent_event_fields(event);
+		fields = tep_event_fields(event);
 		for (i = 0; fields[i]; i++) {
 			field = fields[i];
 			gtk_list_store_append(list, &iter);
@@ -465,7 +465,7 @@ create_tree_filter_model(struct tep_handle *pevent,
 				       G_TYPE_STRING, G_TYPE_STRING,
 				       G_TYPE_INT);
 
-	events = pevent_list_events(pevent, EVENT_SORT_SYSTEM);
+	events = tep_list_events(pevent, EVENT_SORT_SYSTEM);
 	if (!events)
 		return GTK_TREE_MODEL(treestore);
 
@@ -1086,7 +1086,7 @@ create_tree_event_model(struct tep_handle *pevent,
 			   COL_ACTIVE_START, FALSE,
 			   -1);
 
-	events = pevent_list_events(pevent, EVENT_SORT_SYSTEM);
+	events = tep_list_events(pevent, EVENT_SORT_SYSTEM);
 	if (!events)
 		return GTK_TREE_MODEL(treestore);
 
@@ -1937,7 +1937,7 @@ void trace_filter_convert_filter_to_names(struct event_filter *filter,
 	if (event_ids)
 		*event_ids = NULL;
 
-	events = pevent_list_events(pevent, EVENT_SORT_SYSTEM);
+	events = tep_list_events(pevent, EVENT_SORT_SYSTEM);
 
 	for (i = 0; events[i]; i++) {
 		event = events[i];
diff --git a/kernel-shark/trace-graph.c b/kernel-shark/trace-graph.c
index 88870c1..183f7bd 100644
--- a/kernel-shark/trace-graph.c
+++ b/kernel-shark/trace-graph.c
@@ -1196,7 +1196,7 @@ trace_graph_check_irq(struct graph_info *ginfo,
 		else
 			ginfo->soft_irq_entry_ids = null_int_array;
 
-		events = pevent_list_events(ginfo->pevent, EVENT_SORT_SYSTEM);
+		events = tep_list_events(ginfo->pevent, EVENT_SORT_SYSTEM);
 
 		for (i = 0; events[i]; i++) {
 			event = events[i];
@@ -2283,8 +2283,8 @@ void trace_graph_adv_filter_callback(gboolean accept,
 
 		ret = tep_filter_add_filter_str(event_filter, text);
 		if (ret < 0) {
-			pevent_strerror(event_filter->pevent, ret,
-					error_str, sizeof(error_str));
+			tep_strerror(event_filter->pevent, ret,
+				     error_str, sizeof(error_str));
 			warning("filter failed due to: %s", error_str);
 			return;
 		}
diff --git a/kernel-shark/trace-view.c b/kernel-shark/trace-view.c
index fdf8290..2f50361 100644
--- a/kernel-shark/trace-view.c
+++ b/kernel-shark/trace-view.c
@@ -472,8 +472,8 @@ void trace_view_adv_filter_callback(gboolean accept,
 
 		ret = tep_filter_add_filter_str(event_filter, text);
 		if (ret < 0) {
-			pevent_strerror(event_filter->pevent, ret,
-					error_str, sizeof(error_str));
+			tep_strerror(event_filter->pevent, ret,
+				     error_str, sizeof(error_str));
 			warning("filter failed due to: %s", error_str);
 			return;
 		}
diff --git a/lib/traceevent/event-parse.c b/lib/traceevent/event-parse.c
index b41608e..51932b8 100644
--- a/lib/traceevent/event-parse.c
+++ b/lib/traceevent/event-parse.c
@@ -457,13 +457,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;
@@ -5616,7 +5616,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);
@@ -5695,13 +5695,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,
@@ -5709,13 +5709,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,
@@ -6207,8 +6207,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;
@@ -6752,7 +6752,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++;
 }
@@ -6885,7 +6885,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);
 }
diff --git a/lib/traceevent/parse-filter.c b/lib/traceevent/parse-filter.c
index 1ff488d..e76154c 100644
--- a/lib/traceevent/parse-filter.c
+++ b/lib/traceevent/parse-filter.c
@@ -175,7 +175,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;
 }
@@ -1379,7 +1379,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);
 }
 
 /**
@@ -1442,7 +1442,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);
 
diff --git a/tracecmd/trace-output.c b/tracecmd/trace-output.c
index a0f2898..ff7b198 100644
--- a/tracecmd/trace-output.c
+++ b/tracecmd/trace-output.c
@@ -116,7 +116,7 @@ void tracecmd_output_free(struct tracecmd_output *handle)
 		free(handle->tracing_dir);
 
 	if (handle->pevent)
-		pevent_unref(handle->pevent);
+		tep_unref(handle->pevent);
 
 	while (!list_empty(&handle->options)) {
 		option = container_of(handle->options.next,
@@ -808,7 +808,7 @@ create_file_fd(int fd, struct tracecmd_input *ihandle,
 		pevent = tracecmd_get_pevent(ihandle);
 		/* Use the pevent of the ihandle for later writes */
 		handle->pevent = tracecmd_get_pevent(ihandle);
-		pevent_ref(pevent);
+		tep_ref(pevent);
 		if (pevent->file_bigendian)
 			buf[0] = 1;
 		else
@@ -1261,7 +1261,7 @@ int tracecmd_attach_cpu_data_fd(int fd, int cpus, char * const *cpu_data_files)
 	pevent = tracecmd_get_pevent(ihandle);
 	/* Use the pevent of the ihandle for later writes */
 	handle->pevent = tracecmd_get_pevent(ihandle);
-	pevent_ref(pevent);
+	tep_ref(pevent);
 	handle->page_size = tracecmd_page_size(ihandle);
 	list_head_init(&handle->options);
 
diff --git a/tracecmd/trace-profile.c b/tracecmd/trace-profile.c
index 6d56093..5cf0ccd 100644
--- a/tracecmd/trace-profile.c
+++ b/tracecmd/trace-profile.c
@@ -1458,7 +1458,7 @@ void trace_init_profile(struct tracecmd_input *handle, struct hook_list *hook,
 		syscall_exit->print_func = syscall_print;
 	}
 
-	events = pevent_list_events(pevent, EVENT_SORT_ID);
+	events = tep_list_events(pevent, EVENT_SORT_ID);
 	if (!events)
 		die("malloc");
 
@@ -1497,7 +1497,7 @@ void trace_init_profile(struct tracecmd_input *handle, struct hook_list *hook,
 		event_data = add_event(h, events[i]->system, events[i]->name,
 				       EVENT_TYPE_UNDEFINED);
 
-		fields = pevent_event_fields(events[i]);
+		fields = tep_event_fields(events[i]);
 		if (!fields)
 			die("malloc");
 
diff --git a/tracecmd/trace-read.c b/tracecmd/trace-read.c
index 5832a8e..02f0ce8 100644
--- a/tracecmd/trace-read.c
+++ b/tracecmd/trace-read.c
@@ -510,7 +510,7 @@ static void process_filters(struct handle_list *handles)
 		ret = tep_filter_add_filter_str(event_filter->filter,
 						   filter->filter);
 		if (ret < 0) {
-			pevent_strerror(pevent, ret, errstr, sizeof(errstr));
+			tep_strerror(pevent, ret, errstr, sizeof(errstr));
 			die("Error filtering: %s\n%s",
 			    filter->filter, errstr);
 		}
@@ -1346,7 +1346,7 @@ static void set_event_flags(struct tep_handle *pevent, struct event_str *list,
 	if (!list)
 		return;
 
-	events = pevent_list_events(pevent, 0);
+	events = tep_list_events(pevent, 0);
 
 	for (str = list; str; str = str->next) {
 		char *match;
@@ -1740,7 +1740,7 @@ void trace_report (int argc, char **argv)
 			struct event_format *event;
 			int i;
 
-			events = pevent_list_events(pevent, EVENT_SORT_SYSTEM);
+			events = tep_list_events(pevent, EVENT_SORT_SYSTEM);
 			for (i = 0; events[i]; i++) {
 				event = events[i];
 				if (event->system)
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH v3 24/24] tools lib traceevent: Rename static variables and functions in event-parse.c
  2018-08-27  8:17 [PATCH v3 00/24] trace-cmd: rename variables, data structures and functions in lib/traceevent Tzvetomir Stoyanov (VMware)
                   ` (21 preceding siblings ...)
  2018-08-27  8:17 ` [PATCH v3 23/24] tools lib traceevent: Rename various pevent APIs Tzvetomir Stoyanov (VMware)
@ 2018-08-27  8:17 ` Tzvetomir Stoyanov (VMware)
  22 siblings, 0 replies; 30+ messages in thread
From: Tzvetomir Stoyanov (VMware) @ 2018-08-27  8:17 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel

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

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.575392642@goodmis.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 lib/traceevent/event-parse.c | 54 ++++++++++++++++++------------------
 1 file changed, 27 insertions(+), 27 deletions(-)

diff --git a/lib/traceevent/event-parse.c b/lib/traceevent/event-parse.c
index 51932b8..ce1e202 100644
--- a/lib/traceevent/event-parse.c
+++ b/lib/traceevent/event-parse.c
@@ -78,9 +78,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 {
@@ -88,7 +88,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;
 };
 
@@ -1147,7 +1147,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.
  */
@@ -4119,7 +4119,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;
@@ -6009,7 +6009,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
@@ -6021,9 +6021,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;
@@ -6129,12 +6129,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)
@@ -6176,7 +6176,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);
 }
 
 /**
@@ -6197,12 +6197,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
@@ -6223,7 +6223,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;
@@ -6449,7 +6449,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);
 
@@ -6483,8 +6483,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;
@@ -6577,9 +6577,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;
 
@@ -6624,7 +6624,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;
 
@@ -6709,7 +6709,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;
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* Re: [PATCH v3 21/24] tools lib traceevent: Rename various pevent get/set/is APIs
  2018-08-27  8:17 ` [PATCH v3 21/24] tools lib traceevent: Rename various pevent get/set/is APIs Tzvetomir Stoyanov (VMware)
@ 2018-08-27 13:17   ` Steven Rostedt
  2018-08-27 13:31     ` Ceco
  2018-08-28  9:09   ` [PATCH v3.5 " Tzvetomir Stoyanov (VMware)
  1 sibling, 1 reply; 30+ messages in thread
From: Steven Rostedt @ 2018-08-27 13:17 UTC (permalink / raw)
  To: Tzvetomir Stoyanov (VMware); +Cc: linux-trace-devel

On Mon, 27 Aug 2018 11:17:56 +0300
"Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com> wrote:


> diff --git a/kernel-shark/trace-graph.c b/kernel-shark/trace-graph.c
> index 808b2f3..88870c1 100644
> --- a/kernel-shark/trace-graph.c
> +++ b/kernel-shark/trace-graph.c
> @@ -1133,7 +1133,7 @@ int trace_graph_check_sched_switch(struct graph_info *ginfo,
>  		 * First time through, register any missing
>  		 *  comm / pid mappings.
>  		 */
> -		if (!pevent_pid_is_registered(ginfo->pevent, *pid))
> +		if (!tep_find_event_by_record(ginfo->pevent, *pid))

Hmm, this isn't just a name change, but a change in function. Did you
mean this?

-- Steve

>  			tep_register_comm(ginfo->pevent,
>  					  *comm, *pid);
>  	}

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v3 21/24] tools lib traceevent: Rename various pevent get/set/is APIs
  2018-08-27 13:17   ` Steven Rostedt
@ 2018-08-27 13:31     ` Ceco
  2018-08-27 13:36       ` Steven Rostedt
  0 siblings, 1 reply; 30+ messages in thread
From: Ceco @ 2018-08-27 13:31 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel

На пн, 27.08.2018 г. в 16:17 ч. Steven Rostedt <rostedt@goodmis.org> написа:
>
> On Mon, 27 Aug 2018 11:17:56 +0300
> "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com> wrote:
>
>
> > diff --git a/kernel-shark/trace-graph.c b/kernel-shark/trace-graph.c
> > index 808b2f3..88870c1 100644
> > --- a/kernel-shark/trace-graph.c
> > +++ b/kernel-shark/trace-graph.c
> > @@ -1133,7 +1133,7 @@ int trace_graph_check_sched_switch(struct graph_info *ginfo,
> >                * First time through, register any missing
> >                *  comm / pid mappings.
> >                */
> > -             if (!pevent_pid_is_registered(ginfo->pevent, *pid))
> > +             if (!tep_find_event_by_record(ginfo->pevent, *pid))
>
> Hmm, this isn't just a name change, but a change in function. Did you
> mean this?

This is very strange, I'm going to check all patches from the series again.

> -- Steve
>
> >                       tep_register_comm(ginfo->pevent,
> >                                         *comm, *pid);
> >       }

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH v3 21/24] tools lib traceevent: Rename various pevent get/set/is APIs
  2018-08-27 13:31     ` Ceco
@ 2018-08-27 13:36       ` Steven Rostedt
  0 siblings, 0 replies; 30+ messages in thread
From: Steven Rostedt @ 2018-08-27 13:36 UTC (permalink / raw)
  To: Ceco; +Cc: linux-trace-devel

On Mon, 27 Aug 2018 16:31:06 +0300
Ceco <tz.stoyanov@gmail.com> wrote:

> На пн, 27.08.2018 г. в 16:17 ч. Steven Rostedt <rostedt@goodmis.org> написа:
> >
> > On Mon, 27 Aug 2018 11:17:56 +0300
> > "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com> wrote:
> >
> >  
> > > diff --git a/kernel-shark/trace-graph.c b/kernel-shark/trace-graph.c
> > > index 808b2f3..88870c1 100644
> > > --- a/kernel-shark/trace-graph.c
> > > +++ b/kernel-shark/trace-graph.c
> > > @@ -1133,7 +1133,7 @@ int trace_graph_check_sched_switch(struct graph_info *ginfo,
> > >                * First time through, register any missing
> > >                *  comm / pid mappings.
> > >                */
> > > -             if (!pevent_pid_is_registered(ginfo->pevent, *pid))
> > > +             if (!tep_find_event_by_record(ginfo->pevent, *pid))  
> >
> > Hmm, this isn't just a name change, but a change in function. Did you
> > mean this?  
> 
> This is very strange, I'm going to check all patches from the series again.
> 

Thanks. One thing you can do (and I'm doing this too), is after
applying all the patches, do a "git diff" against a branch with all the
patches applied and the root branch without the patches. This makes it
quicker than having to check each individual patch.

If this is the only patch affected, just reply back to this patch with
an updated patch with a "v3.5" version.


-- Steve

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH v3.5 21/24] tools lib traceevent: Rename various pevent get/set/is APIs
  2018-08-27  8:17 ` [PATCH v3 21/24] tools lib traceevent: Rename various pevent get/set/is APIs Tzvetomir Stoyanov (VMware)
  2018-08-27 13:17   ` Steven Rostedt
@ 2018-08-28  9:09   ` Tzvetomir Stoyanov (VMware)
  2018-08-28 22:18     ` Steven Rostedt
  1 sibling, 1 reply; 30+ messages in thread
From: Tzvetomir Stoyanov (VMware) @ 2018-08-28  9:09 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel

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

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.114110715@goodmis.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 include/traceevent/event-parse.h | 14 +++++++-------
 kernel-shark/trace-graph.c       |  2 +-
 lib/trace-cmd/trace-input.c      |  2 +-
 lib/traceevent/event-parse.c     |  4 ++--
 plugins/plugin_kvm.c             |  4 ++--
 python/tracecmd.py               |  2 +-
 tracecmd/trace-read.c            |  6 +++---
 7 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/include/traceevent/event-parse.h b/include/traceevent/event-parse.h
index 87777c2..328d0d3 100644
--- a/include/traceevent/event-parse.h
+++ b/include/traceevent/event-parse.h
@@ -612,7 +612,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,
@@ -719,12 +719,12 @@ struct event_format **pevent_list_events(struct tep_handle *pevent, enum event_s
 struct 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;
 }
@@ -749,7 +749,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;
 }
@@ -759,7 +759,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;
 }
@@ -769,12 +769,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;
 }
diff --git a/kernel-shark/trace-graph.c b/kernel-shark/trace-graph.c
index 808b2f3..b13f756 100644
--- a/kernel-shark/trace-graph.c
+++ b/kernel-shark/trace-graph.c
@@ -1133,7 +1133,7 @@ int trace_graph_check_sched_switch(struct graph_info *ginfo,
 		 * First time through, register any missing
 		 *  comm / pid mappings.
 		 */
-		if (!pevent_pid_is_registered(ginfo->pevent, *pid))
+		if (!tep_pid_is_registered(ginfo->pevent, *pid))
 			tep_register_comm(ginfo->pevent,
 					  *comm, *pid);
 	}
diff --git a/lib/trace-cmd/trace-input.c b/lib/trace-cmd/trace-input.c
index 20203ad..af812c1 100644
--- a/lib/trace-cmd/trace-input.c
+++ b/lib/trace-cmd/trace-input.c
@@ -2406,7 +2406,7 @@ int tracecmd_init_data(struct tracecmd_input *handle)
 		return -1;
 	handle->cpus = cpus;
 
-	pevent_set_cpus(pevent, handle->cpus);
+	tep_set_cpus(pevent, handle->cpus);
 
 	ret = read_cpu_data(handle);
 	if (ret < 0)
diff --git a/lib/traceevent/event-parse.c b/lib/traceevent/event-parse.c
index 5d2f738..8264309 100644
--- a/lib/traceevent/event-parse.c
+++ b/lib/traceevent/event-parse.c
@@ -197,14 +197,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;
diff --git a/plugins/plugin_kvm.c b/plugins/plugin_kvm.c
index b19311d..3f4a8c0 100644
--- a/plugins/plugin_kvm.c
+++ b/plugins/plugin_kvm.c
@@ -385,8 +385,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/%u q%u%s %s%s %spge %snxe",
 				 role.level,
diff --git a/python/tracecmd.py b/python/tracecmd.py
index bc926c6..1267941 100644
--- a/python/tracecmd.py
+++ b/python/tracecmd.py
@@ -166,7 +166,7 @@ class PEvent(object):
 
     @cached_property
     def file_endian(self):
-        if pevent_is_file_bigendian(self._pevent):
+        if tep_is_file_bigendian(self._pevent):
             return '>'
         return '<'
 
diff --git a/tracecmd/trace-read.c b/tracecmd/trace-read.c
index b6c4c90..5832a8e 100644
--- a/tracecmd/trace-read.c
+++ b/tracecmd/trace-read.c
@@ -1700,8 +1700,8 @@ void trace_report (int argc, char **argv)
 
 		if (show_endian) {
 			printf("file is %s endian and host is %s endian\n",
-			       pevent_is_file_bigendian(pevent) ? "big" : "little",
-			       pevent_is_host_bigendian(pevent) ? "big" : "little");
+			       tep_is_file_bigendian(pevent) ? "big" : "little",
+			       tep_is_host_bigendian(pevent) ? "big" : "little");
 			return;
 		}
 
@@ -1755,7 +1755,7 @@ void trace_report (int argc, char **argv)
 	}
 
 	if (latency_format)
-		pevent_set_latency_format(pevent, latency_format);
+		tep_set_latency_format(pevent, latency_format);
 
 	otype = OUTPUT_NORMAL;
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH v3.5 03/24] tools lib traceevent, perf tools: Rename pevent plugin related APIs
  2018-08-27  8:17 ` [PATCH v3 03/24] tools lib traceevent, perf tools: Rename pevent plugin related APIs Tzvetomir Stoyanov (VMware)
@ 2018-08-28  9:10   ` Tzvetomir Stoyanov (VMware)
  0 siblings, 0 replies; 30+ messages in thread
From: Tzvetomir Stoyanov (VMware) @ 2018-08-28  9:10 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel

In order to make libtraceevent into a proper library, variables, data
structures and functions require a unique prefix to prevent name space
conflicts. That prefix will be "tep_" and not "pevent_". This changes
the pevent plugin related API.

Signed-off-by: Tzvetomir Stoyanov (VMware) <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/20180808180700.005287044@goodmis.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 include/trace-cmd/trace-cmd.h    | 10 +++---
 include/traceevent/event-parse.h | 56 ++++++++++++++---------------
 lib/trace-cmd/trace-ftrace.c     |  6 ++--
 lib/trace-cmd/trace-util.c       | 62 ++++++++++++++++----------------
 lib/traceevent/event-parse.c     |  8 ++---
 lib/traceevent/event-plugin.c    | 24 ++++++-------
 plugins/plugin_blk.c             |  2 +-
 plugins/plugin_cfg80211.c        |  4 +--
 plugins/plugin_function.c        | 12 +++----
 plugins/plugin_futex.c           |  4 +--
 plugins/plugin_hrtimer.c         |  4 +--
 plugins/plugin_jbd2.c            |  4 +--
 plugins/plugin_kmem.c            |  4 +--
 plugins/plugin_kvm.c             |  4 +--
 plugins/plugin_mac80211.c        |  2 +-
 plugins/plugin_python.c          |  4 +--
 plugins/plugin_sched_switch.c    |  4 +--
 plugins/plugin_scsi.c            |  4 +--
 plugins/plugin_tlb.c             |  4 +--
 plugins/plugin_xen.c             |  4 +--
 20 files changed, 113 insertions(+), 113 deletions(-)

diff --git a/include/trace-cmd/trace-cmd.h b/include/trace-cmd/trace-cmd.h
index ade21b1..1f5ef81 100644
--- a/include/trace-cmd/trace-cmd.h
+++ b/include/trace-cmd/trace-cmd.h
@@ -330,10 +330,10 @@ bool tracecmd_msg_done(struct tracecmd_msg_handle *msg_handle);
 void tracecmd_msg_set_done(struct tracecmd_msg_handle *msg_handle);
 
 /* --- Plugin handling --- */
-extern struct pevent_plugin_option trace_ftrace_options[];
+extern struct tep_plugin_option trace_ftrace_options[];
 
-int trace_util_add_options(const char *name, struct pevent_plugin_option *options);
-void trace_util_remove_options(struct pevent_plugin_option *options);
+int trace_util_add_options(const char *name, struct tep_plugin_option *options);
+void trace_util_remove_options(struct tep_plugin_option *options);
 int trace_util_add_option(const char *name, const char *val);
 int trace_util_load_plugins(struct tep_handle *pevent, const char *suffix,
 			    int (*load_plugin)(struct tep_handle *pevent,
@@ -341,8 +341,8 @@ int trace_util_load_plugins(struct tep_handle *pevent, const char *suffix,
 					       const char *name,
 					       void *data),
 			    void *data);
-struct pevent_plugin_option *trace_util_read_plugin_options(void);
-void trace_util_free_options(struct pevent_plugin_option *options);
+struct tep_plugin_option *trace_util_read_plugin_options(void);
+void trace_util_free_options(struct tep_plugin_option *options);
 char **trace_util_find_plugin_files(const char *suffix);
 void trace_util_free_plugin_files(char **files);
 void trace_util_print_plugins(struct trace_seq *s, const char *prefix, const char *suffix,
diff --git a/include/traceevent/event-parse.h b/include/traceevent/event-parse.h
index 3b99120..ada1efa 100644
--- a/include/traceevent/event-parse.h
+++ b/include/traceevent/event-parse.h
@@ -87,16 +87,16 @@ extern int trace_seq_do_printf(struct trace_seq *s);
 struct tep_handle;
 struct event_format;
 
-typedef int (*pevent_event_handler_func)(struct trace_seq *s,
-					 struct tep_record *record,
-					 struct event_format *event,
-					 void *context);
+typedef int (*tep_event_handler_func)(struct trace_seq *s,
+				      struct tep_record *record,
+				      struct event_format *event,
+				      void *context);
 
-typedef int (*pevent_plugin_load_func)(struct tep_handle *pevent);
-typedef int (*pevent_plugin_unload_func)(struct tep_handle *pevent);
+typedef int (*tep_plugin_load_func)(struct tep_handle *pevent);
+typedef int (*tep_plugin_unload_func)(struct tep_handle *pevent);
 
-struct pevent_plugin_option {
-	struct pevent_plugin_option	*next;
+struct tep_plugin_option {
+	struct tep_plugin_option	*next;
 	void				*handle;
 	char				*file;
 	char				*name;
@@ -110,20 +110,20 @@ struct pevent_plugin_option {
 /*
  * Plugin hooks that can be called:
  *
- * PEVENT_PLUGIN_LOADER:  (required)
+ * TEP_PLUGIN_LOADER:  (required)
  *   The function name to initialized the plugin.
  *
- *   int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent)
+ *   int TEP_PLUGIN_LOADER(struct tep_handle *pevent)
  *
- * PEVENT_PLUGIN_UNLOADER:  (optional)
+ * TEP_PLUGIN_UNLOADER:  (optional)
  *   The function called just before unloading
  *
- *   int PEVENT_PLUGIN_UNLOADER(struct tep_handle *pevent)
+ *   int TEP_PLUGIN_UNLOADER(struct tep_handle *pevent)
  *
- * PEVENT_PLUGIN_OPTIONS:  (optional)
+ * TEP_PLUGIN_OPTIONS:  (optional)
  *   Plugin options that can be set before loading
  *
- *   struct pevent_plugin_option PEVENT_PLUGIN_OPTIONS[] = {
+ *   struct tep_plugin_option TEP_PLUGIN_OPTIONS[] = {
  *	{
  *		.name = "option-name",
  *		.plugin_alias = "override-file-name", (optional)
@@ -144,19 +144,19 @@ struct pevent_plugin_option {
  *   .set will be processed. If .value is defined, then it is considered
  *   a string option and .set will be ignored.
  *
- * PEVENT_PLUGIN_ALIAS: (optional)
+ * TEP_PLUGIN_ALIAS: (optional)
  *   The name to use for finding options (uses filename if not defined)
  */
-#define PEVENT_PLUGIN_LOADER pevent_plugin_loader
-#define PEVENT_PLUGIN_UNLOADER pevent_plugin_unloader
-#define PEVENT_PLUGIN_OPTIONS pevent_plugin_options
-#define PEVENT_PLUGIN_ALIAS pevent_plugin_alias
+#define TEP_PLUGIN_LOADER tep_plugin_loader
+#define TEP_PLUGIN_UNLOADER tep_plugin_unloader
+#define TEP_PLUGIN_OPTIONS tep_plugin_options
+#define TEP_PLUGIN_ALIAS tep_plugin_alias
 #define _MAKE_STR(x)	#x
 #define MAKE_STR(x)	_MAKE_STR(x)
-#define PEVENT_PLUGIN_LOADER_NAME MAKE_STR(PEVENT_PLUGIN_LOADER)
-#define PEVENT_PLUGIN_UNLOADER_NAME MAKE_STR(PEVENT_PLUGIN_UNLOADER)
-#define PEVENT_PLUGIN_OPTIONS_NAME MAKE_STR(PEVENT_PLUGIN_OPTIONS)
-#define PEVENT_PLUGIN_ALIAS_NAME MAKE_STR(PEVENT_PLUGIN_ALIAS)
+#define TEP_PLUGIN_LOADER_NAME MAKE_STR(TEP_PLUGIN_LOADER)
+#define TEP_PLUGIN_UNLOADER_NAME MAKE_STR(TEP_PLUGIN_UNLOADER)
+#define TEP_PLUGIN_OPTIONS_NAME MAKE_STR(TEP_PLUGIN_OPTIONS)
+#define TEP_PLUGIN_ALIAS_NAME MAKE_STR(TEP_PLUGIN_ALIAS)
 
 enum format_flags {
 	FIELD_IS_ARRAY		= 1,
@@ -313,7 +313,7 @@ struct event_format {
 	struct format		format;
 	struct print_fmt	print_fmt;
 	char			*system;
-	pevent_event_handler_func handler;
+	tep_event_handler_func	handler;
 	void			*context;
 };
 
@@ -427,8 +427,8 @@ void traceevent_unload_plugins(struct plugin_list *plugin_list,
 char **traceevent_plugin_list_options(void);
 void traceevent_plugin_free_options_list(char **list);
 int traceevent_plugin_add_options(const char *name,
-				  struct pevent_plugin_option *options);
-void traceevent_plugin_remove_options(struct pevent_plugin_option *options);
+				  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);
@@ -663,10 +663,10 @@ int pevent_print_func_field(struct trace_seq *s, const char *fmt,
 
 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);
 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);
 int pevent_register_print_function(struct tep_handle *pevent,
 				   pevent_func_handler func,
 				   enum pevent_func_arg_type ret_type,
diff --git a/lib/trace-cmd/trace-ftrace.c b/lib/trace-cmd/trace-ftrace.c
index 3b87071..8c706f3 100644
--- a/lib/trace-cmd/trace-ftrace.c
+++ b/lib/trace-cmd/trace-ftrace.c
@@ -10,7 +10,7 @@
 
 #include "trace-cmd.h"
 
-struct pevent_plugin_option trace_ftrace_options[] = {
+struct tep_plugin_option trace_ftrace_options[] = {
 	{
 		.name = "tailprint",
 		.plugin_alias = "fgraph",
@@ -28,8 +28,8 @@ struct pevent_plugin_option trace_ftrace_options[] = {
 	}
 };
 
-static struct pevent_plugin_option *fgraph_tail = &trace_ftrace_options[0];
-static struct pevent_plugin_option *fgraph_depth = &trace_ftrace_options[1];
+static struct tep_plugin_option *fgraph_tail = &trace_ftrace_options[0];
+static struct tep_plugin_option *fgraph_depth = &trace_ftrace_options[1];
 
 static void find_long_size(struct tracecmd_ftrace *finfo)
 {
diff --git a/lib/trace-cmd/trace-util.c b/lib/trace-cmd/trace-util.c
index ed1c008..4a66457 100644
--- a/lib/trace-cmd/trace-util.c
+++ b/lib/trace-cmd/trace-util.c
@@ -30,7 +30,7 @@ int tracecmd_disable_plugins;
 
 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 {
@@ -63,7 +63,7 @@ struct plugin_list {
 char **trace_util_list_plugin_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;
@@ -101,7 +101,7 @@ void trace_util_free_plugin_options_list(char **list)
 }
 
 static int process_option(const char *plugin, const char *option, const char *val);
-static int update_option(const char *file, struct pevent_plugin_option *option);
+static int update_option(const char *file, struct tep_plugin_option *option);
 
 /**
  * trace_util_add_options - Add a set of options by a plugin
@@ -110,7 +110,7 @@ static int update_option(const char *file, struct pevent_plugin_option *option);
  *
  * Sets the options with the values that have been added by user.
  */
-int trace_util_add_options(const char *name, struct pevent_plugin_option *options)
+int trace_util_add_options(const char *name, struct tep_plugin_option *options)
 {
 	struct registered_plugin_options *reg;
 	int ret;
@@ -135,7 +135,7 @@ int trace_util_add_options(const char *name, struct pevent_plugin_option *option
  * trace_util_remove_options - remove plugin options that were registered
  * @options: Options to removed that were registered with trace_util_add_options
  */
-void trace_util_remove_options(struct pevent_plugin_option *options)
+void trace_util_remove_options(struct tep_plugin_option *options)
 {
 	struct registered_plugin_options **last;
 	struct registered_plugin_options *reg;
@@ -187,11 +187,11 @@ static void parse_option_name(char **option, char **plugin)
 	}
 }
 
-static struct pevent_plugin_option *
+static struct tep_plugin_option *
 find_registered_option(const char *plugin, const char *option)
 {
 	struct registered_plugin_options *reg;
-	struct pevent_plugin_option *op;
+	struct tep_plugin_option *op;
 	const char *op_plugin;
 
 	for (reg = registered_options; reg; reg = reg->next) {
@@ -213,10 +213,10 @@ find_registered_option(const char *plugin, const char *option)
 	return NULL;
 }
 
-static struct pevent_plugin_option *
+static struct tep_plugin_option *
 find_registered_option_parse(const char *name)
 {
-	struct pevent_plugin_option *option;
+	struct tep_plugin_option *option;
 	char *option_str;
 	char *plugin;
 
@@ -243,7 +243,7 @@ find_registered_option_parse(const char *name)
  */
 const char *trace_util_plugin_option_value(const char *name)
 {
-	struct pevent_plugin_option *option;
+	struct tep_plugin_option *option;
 
 	option = find_registered_option_parse(name);
 	if (!option)
@@ -345,7 +345,7 @@ static void print_op_data(struct trace_seq *s, const char *name,
 void trace_util_print_plugin_options(struct trace_seq *s)
 {
 	struct registered_plugin_options *reg;
-	struct pevent_plugin_option *op;
+	struct tep_plugin_option *op;
 
 	for (reg = registered_options; reg; reg = reg->next) {
 		if (reg != registered_options)
@@ -486,7 +486,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;
 	int ret = 1;
@@ -530,7 +530,7 @@ static int update_option_value(struct pevent_plugin_option *op, const char *val)
 
 static int process_option(const char *plugin, const char *option, const char *val)
 {
-	struct pevent_plugin_option *op;
+	struct tep_plugin_option *op;
 
 	op = find_registered_option(plugin, option);
 	if (!op)
@@ -539,7 +539,7 @@ static int process_option(const char *plugin, const char *option, const char *va
 	return update_option_value(op, val);
 }
 
-static int update_option(const char *file, struct pevent_plugin_option *option)
+static int update_option(const char *file, struct tep_plugin_option *option)
 {
 	struct trace_plugin_options *op;
 	char *plugin;
@@ -593,9 +593,9 @@ static int 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;
-	struct pevent_plugin_option *options;
+	struct tep_plugin_option *options;
 	const char *alias;
 	char *plugin;
 	void *handle;
@@ -612,11 +612,11 @@ static int 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;
 
-	options = dlsym(handle, PEVENT_PLUGIN_OPTIONS_NAME);
+	options = dlsym(handle, TEP_PLUGIN_OPTIONS_NAME);
 	if (options) {
 		while (options->name) {
 			ret = update_option(alias, options);
@@ -626,10 +626,10 @@ static int load_plugin(struct tep_handle *pevent, const char *path,
 		}
 	}
 
-	func = dlsym(handle, PEVENT_PLUGIN_LOADER_NAME);
+	func = dlsym(handle, TEP_PLUGIN_LOADER_NAME);
 	if (!func) {
 		warning("cound 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;
 	}
 
@@ -1453,14 +1453,14 @@ void trace_util_free_plugin_files(char **files)
 }
 
 struct plugin_option_read {
-	struct pevent_plugin_option	*options;
+	struct tep_plugin_option	*options;
 };
 
 static int append_option(struct plugin_option_read *options,
-			 struct pevent_plugin_option *option,
+			 struct tep_plugin_option *option,
 			 const char *alias, void *handle)
 {
-	struct pevent_plugin_option *op;
+	struct tep_plugin_option *op;
 
 	while (option->name) {
 		op = malloc(sizeof(*op));
@@ -1480,7 +1480,7 @@ static int read_options(struct tep_handle *pevent, const char *path,
 			 const char *file, void *data)
 {
 	struct plugin_option_read *options = data;
-	struct pevent_plugin_option *option;
+	struct tep_plugin_option *option;
 	const char *alias;
 	int unload = 0;
 	char *plugin;
@@ -1498,11 +1498,11 @@ static int read_options(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;
 
-	option = dlsym(handle, PEVENT_PLUGIN_OPTIONS_NAME);
+	option = dlsym(handle, TEP_PLUGIN_OPTIONS_NAME);
 	if (!option) {
 		unload = 1;
 		goto out_unload;
@@ -1518,7 +1518,7 @@ static int read_options(struct tep_handle *pevent, const char *path,
 	return 0;
 }
 
-struct pevent_plugin_option *trace_util_read_plugin_options(void)
+struct tep_plugin_option *trace_util_read_plugin_options(void)
 {
 	struct plugin_option_read option = {
 		.options = NULL,
@@ -1531,9 +1531,9 @@ struct pevent_plugin_option *trace_util_read_plugin_options(void)
 	return option.options;
 }
 
-void trace_util_free_options(struct pevent_plugin_option *options)
+void trace_util_free_options(struct tep_plugin_option *options)
 {
-	struct pevent_plugin_option *op;
+	struct tep_plugin_option *op;
 	void *last_handle = NULL;
 
 	while (options) {
@@ -1560,13 +1560,13 @@ struct plugin_list *tracecmd_load_plugins(struct tep_handle *pevent)
 void
 tracecmd_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);
diff --git a/lib/traceevent/event-parse.c b/lib/traceevent/event-parse.c
index 9088b99..f00a02b 100644
--- a/lib/traceevent/event-parse.c
+++ b/lib/traceevent/event-parse.c
@@ -74,7 +74,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;
 };
 
@@ -6619,7 +6619,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;
@@ -6668,7 +6668,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;
@@ -6703,7 +6703,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;
diff --git a/lib/traceevent/event-plugin.c b/lib/traceevent/event-plugin.c
index b2ef017..ccda700 100644
--- a/lib/traceevent/event-plugin.c
+++ b/lib/traceevent/event-plugin.c
@@ -20,7 +20,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 {
@@ -44,7 +44,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;
 
@@ -97,7 +97,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;
@@ -149,7 +149,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;
@@ -208,7 +208,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;
 
@@ -230,7 +230,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;
@@ -271,7 +271,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;
@@ -291,14 +291,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;
 	}
 
@@ -428,13 +428,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);
diff --git a/plugins/plugin_blk.c b/plugins/plugin_blk.c
index 6cb6151..7eba547 100644
--- a/plugins/plugin_blk.c
+++ b/plugins/plugin_blk.c
@@ -363,7 +363,7 @@ static int blktrace_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", "blktrace",
 				      blktrace_handler, NULL);
diff --git a/plugins/plugin_cfg80211.c b/plugins/plugin_cfg80211.c
index 959d94f..c189bbc 100644
--- a/plugins/plugin_cfg80211.c
+++ b/plugins/plugin_cfg80211.c
@@ -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");
diff --git a/plugins/plugin_function.c b/plugins/plugin_function.c
index 058144e..5434a5f 100644
--- a/plugins/plugin_function.c
+++ b/plugins/plugin_function.c
@@ -18,7 +18,7 @@ static int cpus = -1;
 
 #define STK_BLK 10
 
-struct pevent_plugin_option plugin_options[] =
+struct tep_plugin_option plugin_options[] =
 {
 	{
 		.name = "parent",
@@ -45,9 +45,9 @@ 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 pevent_plugin_option *ftrace_offset = &plugin_options[2];
+static struct tep_plugin_option *ftrace_parent = &plugin_options[0];
+static struct tep_plugin_option *ftrace_indent = &plugin_options[1];
+static struct tep_plugin_option *ftrace_offset = &plugin_options[2];
 
 static void add_child(struct func_stack *stack, const char *child, int pos)
 {
@@ -168,7 +168,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);
@@ -178,7 +178,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;
 
diff --git a/plugins/plugin_futex.c b/plugins/plugin_futex.c
index 60babce..8aad7f8 100644
--- a/plugins/plugin_futex.c
+++ b/plugins/plugin_futex.c
@@ -107,14 +107,14 @@ static int futex_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, "syscalls", "sys_enter_futex",
 				      futex_handler, NULL);
 	return 0;
 }
 
-void PEVENT_PLUGIN_UNLOADER(struct tep_handle *pevent)
+void TEP_PLUGIN_UNLOADER(struct tep_handle *pevent)
 {
 	pevent_unregister_event_handler(pevent, -1, "syscalls", "sys_enter_futex",
 					futex_handler, NULL);
diff --git a/plugins/plugin_hrtimer.c b/plugins/plugin_hrtimer.c
index 176788c..fd067e0 100644
--- a/plugins/plugin_hrtimer.c
+++ b/plugins/plugin_hrtimer.c
@@ -46,7 +46,7 @@ static int timer_start_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, "timer", "hrtimer_expire_entry",
 				      timer_expire_handler, NULL);
@@ -57,7 +57,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",
diff --git a/plugins/plugin_jbd2.c b/plugins/plugin_jbd2.c
index a29a0af..c942229 100644
--- a/plugins/plugin_jbd2.c
+++ b/plugins/plugin_jbd2.c
@@ -34,7 +34,7 @@ process_jiffies_to_msecs(struct trace_seq *s,
 	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,
@@ -52,7 +52,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");
diff --git a/plugins/plugin_kmem.c b/plugins/plugin_kmem.c
index c913cc7..d4478f5 100644
--- a/plugins/plugin_kmem.c
+++ b/plugins/plugin_kmem.c
@@ -33,7 +33,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);
@@ -56,7 +56,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);
diff --git a/plugins/plugin_kvm.c b/plugins/plugin_kvm.c
index f5024db..686ba6a 100644
--- a/plugins/plugin_kvm.c
+++ b/plugins/plugin_kvm.c
@@ -438,7 +438,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();
 
@@ -479,7 +479,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);
diff --git a/plugins/plugin_mac80211.c b/plugins/plugin_mac80211.c
index b98803b..a830b25 100644
--- a/plugins/plugin_mac80211.c
+++ b/plugins/plugin_mac80211.c
@@ -176,7 +176,7 @@ static int drv_config(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, "mac80211", "drv_bss_info_changed",
 				      drv_bss_info_changed, NULL);
diff --git a/plugins/plugin_python.c b/plugins/plugin_python.c
index d5f3bc5..ec802d3 100644
--- a/plugins/plugin_python.c
+++ b/plugins/plugin_python.c
@@ -58,7 +58,7 @@ static int load_plugin(struct tep_handle *pevent, const char *path,
 	return 0;
 }
 
-int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent)
+int TEP_PLUGIN_LOADER(struct tep_handle *pevent)
 {
 	PyObject *globals, *m, *py_pevent, *str, *res;
 	char **plugin_list;
@@ -100,7 +100,7 @@ int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent)
 	return 0;
 }
 
-int PEVENT_PLUGIN_UNLOADER(struct tep_handle *pevent)
+int TEP_PLUGIN_UNLOADER(struct tep_handle *pevent)
 {
 	Py_Finalize();
 	return 0;
diff --git a/plugins/plugin_sched_switch.c b/plugins/plugin_sched_switch.c
index 6c6e9f5..26fa5c8 100644
--- a/plugins/plugin_sched_switch.c
+++ b/plugins/plugin_sched_switch.c
@@ -117,7 +117,7 @@ static int sched_switch_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, "sched", "sched_switch",
 				      sched_switch_handler, NULL);
@@ -131,7 +131,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);
diff --git a/plugins/plugin_scsi.c b/plugins/plugin_scsi.c
index e430a49..bb9aea6 100644
--- a/plugins/plugin_scsi.c
+++ b/plugins/plugin_scsi.c
@@ -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");
diff --git a/plugins/plugin_tlb.c b/plugins/plugin_tlb.c
index 4a750aa..2ddd84b 100644
--- a/plugins/plugin_tlb.c
+++ b/plugins/plugin_tlb.c
@@ -50,7 +50,7 @@ static int tlb_flush_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, "tlb", "tlb_flush",
 				      tlb_flush_handler, NULL);
@@ -58,7 +58,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,
 					"tlb", "tlb_flush",
diff --git a/plugins/plugin_xen.c b/plugins/plugin_xen.c
index 11dbddd..1973dd8 100644
--- a/plugins/plugin_xen.c
+++ b/plugins/plugin_xen.c
@@ -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");
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* Re: [PATCH v3.5 21/24] tools lib traceevent: Rename various pevent get/set/is APIs
  2018-08-28  9:09   ` [PATCH v3.5 " Tzvetomir Stoyanov (VMware)
@ 2018-08-28 22:18     ` Steven Rostedt
  0 siblings, 0 replies; 30+ messages in thread
From: Steven Rostedt @ 2018-08-28 22:18 UTC (permalink / raw)
  To: Tzvetomir Stoyanov (VMware); +Cc: linux-trace-devel

On Tue, 28 Aug 2018 12:09:10 +0300
"Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com> wrote:

> 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
> 
> 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.114110715@goodmis.org
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
> ---
>

Thanks, I pulled the entire series with the two updated patches.

-- Steve

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2018-08-29  2:12 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-27  8:17 [PATCH v3 00/24] trace-cmd: rename variables, data structures and functions in lib/traceevent Tzvetomir Stoyanov (VMware)
2018-08-27  8:17 ` [PATCH v3 02/24] tools lib traceevent, perf tools: Rename 'struct pevent_record' to 'struct tep_record' Tzvetomir Stoyanov (VMware)
2018-08-27  8:17 ` [PATCH v3 03/24] tools lib traceevent, perf tools: Rename pevent plugin related APIs Tzvetomir Stoyanov (VMware)
2018-08-28  9:10   ` [PATCH v3.5 " Tzvetomir Stoyanov (VMware)
2018-08-27  8:17 ` [PATCH v3 04/24] tools lib traceevent, perf tools: Rename pevent alloc / free APIs Tzvetomir Stoyanov (VMware)
2018-08-27  8:17 ` [PATCH v3 05/24] tools lib traceevent, perf tools: Rename pevent find APIs Tzvetomir Stoyanov (VMware)
2018-08-27  8:17 ` [PATCH v3 06/24] tools lib traceevent, perf tools: Rename pevent parse APIs Tzvetomir Stoyanov (VMware)
2018-08-27  8:17 ` [PATCH v3 07/24] tools lib traceevent, perf tools: Rename pevent print APIs Tzvetomir Stoyanov (VMware)
2018-08-27  8:17 ` [PATCH v3 08/24] tools lib traceevent, perf tools: Rename pevent_read_number_* APIs Tzvetomir Stoyanov (VMware)
2018-08-27  8:17 ` [PATCH v3 09/24] tools lib traceevent, perf tools: Rename pevent_register_* APIs Tzvetomir Stoyanov (VMware)
2018-08-27  8:17 ` [PATCH v3 10/24] tools lib traceevent, perf tools: Rename pevent_set_* APIs Tzvetomir Stoyanov (VMware)
2018-08-27  8:17 ` [PATCH v3 11/24] tools lib traceevent, perf tools: Rename traceevent_* APIs Tzvetomir Stoyanov (VMware)
2018-08-27  8:17 ` [PATCH v3 12/24] tools lib traceevent, perf tools: Rename 'enum pevent_flag' to 'enum tep_flag' Tzvetomir Stoyanov (VMware)
2018-08-27  8:17 ` [PATCH v3 13/24] tools lib traceevent, tools lib lockdep: Rename 'enum pevent_errno' to 'enum tep_errno' Tzvetomir Stoyanov (VMware)
2018-08-27  8:17 ` [PATCH v3 14/24] tools lib traceevent: Rename pevent_function* APIs Tzvetomir Stoyanov (VMware)
2018-08-27  8:17 ` [PATCH v3 15/24] tools lib traceevent, perf tools: Rename traceevent_plugin_* APIs Tzvetomir Stoyanov (VMware)
2018-08-27  8:17 ` [PATCH v3 16/24] tools lib traceevent: Rename pevent_filter* APIs Tzvetomir Stoyanov (VMware)
2018-08-27  8:17 ` [PATCH v3 17/24] tools lib traceevent: Rename pevent_register / unregister APIs Tzvetomir Stoyanov (VMware)
2018-08-27  8:17 ` [PATCH v3 18/24] tools lib traceevent: Rename pevent_data_ APIs Tzvetomir Stoyanov (VMware)
2018-08-27  8:17 ` [PATCH v3 19/24] tools lib traceevent: Rename pevent field APIs Tzvetomir Stoyanov (VMware)
2018-08-27  8:17 ` [PATCH v3 20/24] tools lib traceevent: Rename pevent_find_* APIs Tzvetomir Stoyanov (VMware)
2018-08-27  8:17 ` [PATCH v3 21/24] tools lib traceevent: Rename various pevent get/set/is APIs Tzvetomir Stoyanov (VMware)
2018-08-27 13:17   ` Steven Rostedt
2018-08-27 13:31     ` Ceco
2018-08-27 13:36       ` Steven Rostedt
2018-08-28  9:09   ` [PATCH v3.5 " Tzvetomir Stoyanov (VMware)
2018-08-28 22:18     ` Steven Rostedt
2018-08-27  8:17 ` [PATCH v3 22/24] tools lib traceevent: Rename internal parser related APIs Tzvetomir Stoyanov (VMware)
2018-08-27  8:17 ` [PATCH v3 23/24] tools lib traceevent: Rename various pevent APIs Tzvetomir Stoyanov (VMware)
2018-08-27  8:17 ` [PATCH v3 24/24] tools lib traceevent: Rename static variables and functions in event-parse.c Tzvetomir Stoyanov (VMware)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.