trace-cmd: rename variables, data structures and functions in lib/traceevent
v3 cover trace-cmd: rename variables, data structures and functions in lib/traceevent
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(-)
Signature · 1 line
2.17.1
PATCH v3 2/24 tools lib traceevent, perf tools: Rename 'struct pevent_record' to 'struct tep_record'
In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_" and not "pevent_". This changes the 'struct pevent_record' to 'struct tep_record'.
--- 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(-)
include/trace-cmd/trace-cmd.h +24 -24
@@ -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 */
include/traceevent/event-parse.h +22 -22
115 lines not on this page · raw message
kernel-shark-qt/src/libkshark.c +14 -14
@@ -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;
kernel-shark-qt/src/libkshark.h +2 -2
@@ -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,
kernel-shark/include/trace-graph.h +9 -9
@@ -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);
kernel-shark/include/trace-gui.h +2 -2
@@ -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 */
kernel-shark/kernel-shark.c +2 -2
@@ -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;
kernel-shark/trace-dialog.c +2 -2
@@ -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;
kernel-shark/trace-graph.c +8 -8
@@ -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 5int 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;
kernel-shark/trace-plot-cpu.c +15 -15
@@ -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;
kernel-shark/trace-plot-task.c +30 -30
197 lines not on this page · raw message
kernel-shark/trace-plot.c +2 -2
@@ -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)
kernel-shark/trace-view-main.c +1 -1
@@ -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;
kernel-shark/trace-view-store.c +7 -7
@@ -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 pevenreturn 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 pevreturn 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;
lib/trace-cmd/trace-ftrace.c +10 -10
@@ -62,7 +62,7 @@ static int find_ret_event(struct tracecmd_ftrace *finfo, struct tep_handle *pevereturn -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 duratiostatic 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;
lib/trace-cmd/trace-input.c +44 -44
301 lines not on this page · raw message
lib/traceevent/event-parse.c +18 -18
@@ -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;
lib/traceevent/parse-filter.c +12 -12
@@ -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;
plugins/plugin_blk.c +1 -1
@@ -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;
plugins/plugin_function.c +1 -1
@@ -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;
plugins/plugin_futex.c +1 -1
@@ -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;
plugins/plugin_hrtimer.c +2 -2
@@ -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 *recorreturn 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=" );
plugins/plugin_kmem.c +1 -1
@@ -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;
plugins/plugin_kvm.c +7 -7
@@ -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_rreturn 0 ; } -static int kvm_nested_vmexit_handler (struct trace_seq *s,struct pevent_record *record, +static int kvm_nested_vmexit_handler (struct trace_seq *s,struct tep_record *record,struct event_format *event,void *context) {pevent_print_num_field (s,"rip %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;
plugins/plugin_mac80211.c +2 -2
@@ -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 *recorreturn 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;
plugins/plugin_sched_switch.c +3 -3
@@ -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 *recorreturn 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;
plugins/plugin_tlb.c +1 -1
@@ -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;
python/ctracecmd.i +6 -6
@@ -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));
tracecmd/include/trace-local.h +2 -2
@@ -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 --- */
tracecmd/trace-hist.c +10 -10
@@ -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)
tracecmd/trace-mem.c +4 -4
@@ -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;
tracecmd/trace-profile.c +18 -18
@@ -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_hasstatic 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 ;
tracecmd/trace-read.c +17 -17
@@ -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;
tracecmd/trace-record.c +2 -2
@@ -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;
tracecmd/trace-split.c +6 -6
@@ -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;
tracecmd/trace-stream.c +1 -1
@@ -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;
Signature · 1 line
2.17.1
PATCH v3 3/24 tools lib traceevent, perf tools: Rename pevent plugin related APIs
In reply to Tzvetomir Stoyanov (VMware)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.
--- 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(-)
include/trace-cmd/trace-cmd.h +5 -5
@@ -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,
include/traceevent/event-parse.h +28 -28
108 lines not on this page · raw message
lib/trace-cmd/trace-ftrace.c +3 -3
@@ -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) {
lib/trace-cmd/trace-util.c +31 -31
213 lines not on this page · raw message
lib/traceevent/event-parse.c +4 -4
@@ -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;
lib/traceevent/event-plugin.c +12 -12
@@ -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);
plugins/plugin_cfg80211.c +2 -2
@@ -25,7 +25,7 @@ process___le16_to_cpup(struct trace_seq *s, unsigned long long *args)return val ? (long long )le16toh (*val) :0 ; } -int PEVENT_PLUGIN_LOADER (struct tep_handle *pevent) +int TEP_PLUGIN_LOADER (struct tep_handle *pevent) { pevent_register_print_function(pevent, process___le16_to_cpup,
@@ -36,7 +36,7 @@ int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent)return 0 ; } -void PEVENT_PLUGIN_UNLOADER (struct tep_handle *pevent) +void TEP_PLUGIN_UNLOADER (struct tep_handle *pevent) {pevent_unregister_print_function (pevent, process___le16_to_cpup,"__le16_to_cpup" );
plugins/plugin_function.c +6 -6
@@ -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;
plugins/plugin_hrtimer.c +2 -2
@@ -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",
plugins/plugin_jbd2.c +2 -2
@@ -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" );
plugins/plugin_kmem.c +2 -2
@@ -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 );
plugins/plugin_kvm.c +2 -2
@@ -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 );
plugins/plugin_mac80211.c +1 -1
@@ -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 );
plugins/plugin_sched_switch.c +2 -2
@@ -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 );
plugins/plugin_scsi.c +2 -2
@@ -413,7 +413,7 @@ unsigned long long process_scsi_trace_parse_cdb(struct trace_seq *s,return 0 ; } -int PEVENT_PLUGIN_LOADER (struct tep_handle *pevent) +int TEP_PLUGIN_LOADER (struct tep_handle *pevent) { pevent_register_print_function(pevent, process_scsi_trace_parse_cdb,
@@ -426,7 +426,7 @@ int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent)return 0 ; } -void PEVENT_PLUGIN_UNLOADER (struct tep_handle *pevent) +void TEP_PLUGIN_UNLOADER (struct tep_handle *pevent) {pevent_unregister_print_function (pevent, process_scsi_trace_parse_cdb,"scsi_trace_parse_cdb" );
plugins/plugin_xen.c +2 -2
@@ -119,7 +119,7 @@ unsigned long long process_xen_hypercall_name(struct trace_seq *s,return 0 ; } -int PEVENT_PLUGIN_LOADER (struct tep_handle *pevent) +int TEP_PLUGIN_LOADER (struct tep_handle *pevent) { pevent_register_print_function(pevent, process_xen_hypercall_name,
@@ -130,7 +130,7 @@ int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent)return 0 ; } -void PEVENT_PLUGIN_UNLOADER (struct tep_handle *pevent) +void TEP_PLUGIN_UNLOADER (struct tep_handle *pevent) {pevent_unregister_print_function (pevent, process_xen_hypercall_name,"xen_hypercall_name" );
Signature · 1 line
2.17.1
PATCH v3 3/24 tools lib traceevent, perf tools: Rename pevent plugin related APIs
In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_" and not "pevent_". This changes the pevent plugin related API.
--- 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(-)
include/trace-cmd/trace-cmd.h +5 -5
@@ -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,
include/traceevent/event-parse.h +28 -28
108 lines not on this page · raw message
lib/trace-cmd/trace-ftrace.c +3 -3
@@ -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) {
lib/trace-cmd/trace-util.c +31 -31
213 lines not on this page · raw message
lib/traceevent/event-parse.c +4 -4
@@ -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;
lib/traceevent/event-plugin.c +12 -12
@@ -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);
plugins/plugin_blk.c +1 -1
@@ -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 );
plugins/plugin_cfg80211.c +2 -2
@@ -25,7 +25,7 @@ process___le16_to_cpup(struct trace_seq *s, unsigned long long *args)return val ? (long long )le16toh (*val) :0 ; } -int PEVENT_PLUGIN_LOADER (struct tep_handle *pevent) +int TEP_PLUGIN_LOADER (struct tep_handle *pevent) { pevent_register_print_function(pevent, process___le16_to_cpup,
@@ -36,7 +36,7 @@ int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent)return 0 ; } -void PEVENT_PLUGIN_UNLOADER (struct tep_handle *pevent) +void TEP_PLUGIN_UNLOADER (struct tep_handle *pevent) {pevent_unregister_print_function (pevent, process___le16_to_cpup,"__le16_to_cpup" );
plugins/plugin_function.c +6 -6
@@ -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;
plugins/plugin_futex.c +2 -2
@@ -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 );
plugins/plugin_hrtimer.c +2 -2
@@ -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",
plugins/plugin_jbd2.c +2 -2
@@ -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" );
plugins/plugin_kmem.c +2 -2
@@ -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 );
plugins/plugin_kvm.c +2 -2
@@ -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 );
plugins/plugin_mac80211.c +1 -1
@@ -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 );
plugins/plugin_python.c +2 -2
@@ -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 ;
plugins/plugin_sched_switch.c +2 -2
@@ -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 );
plugins/plugin_scsi.c +2 -2
@@ -413,7 +413,7 @@ unsigned long long process_scsi_trace_parse_cdb(struct trace_seq *s,return 0 ; } -int PEVENT_PLUGIN_LOADER (struct tep_handle *pevent) +int TEP_PLUGIN_LOADER (struct tep_handle *pevent) { pevent_register_print_function(pevent, process_scsi_trace_parse_cdb,
@@ -426,7 +426,7 @@ int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent)return 0 ; } -void PEVENT_PLUGIN_UNLOADER (struct tep_handle *pevent) +void TEP_PLUGIN_UNLOADER (struct tep_handle *pevent) {pevent_unregister_print_function (pevent, process_scsi_trace_parse_cdb,"scsi_trace_parse_cdb" );
plugins/plugin_tlb.c +2 -2
@@ -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",
plugins/plugin_xen.c +2 -2
@@ -119,7 +119,7 @@ unsigned long long process_xen_hypercall_name(struct trace_seq *s,return 0 ; } -int PEVENT_PLUGIN_LOADER (struct tep_handle *pevent) +int TEP_PLUGIN_LOADER (struct tep_handle *pevent) { pevent_register_print_function(pevent, process_xen_hypercall_name,
@@ -130,7 +130,7 @@ int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent)return 0 ; } -void PEVENT_PLUGIN_UNLOADER (struct tep_handle *pevent) +void TEP_PLUGIN_UNLOADER (struct tep_handle *pevent) {pevent_unregister_print_function (pevent, process_xen_hypercall_name,"xen_hypercall_name" );
Signature · 1 line
2.17.1
PATCH v3 4/24 tools lib traceevent, perf tools: Rename pevent alloc / free APIs
In reply to Tzvetomir Stoyanov (VMware)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
--- 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(-)
include/traceevent/event-parse.h +6 -6
@@ -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);
kernel-shark-qt/src/libkshark.c +1 -1
@@ -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.
kernel-shark/trace-capture.c +1 -1
@@ -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);
kernel-shark/trace-plot-cpu.c +1 -1
@@ -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);
kernel-shark/trace-plot-task.c +1 -1
@@ -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);
kernel-shark/trace-view-store.c +1 -1
@@ -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 ;
lib/trace-cmd/trace-input.c +2 -2
@@ -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); }
lib/trace-cmd/trace-util.c +2 -2
@@ -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 ; }
lib/traceevent/event-parse.c +12 -12
@@ -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); }
tracecmd/trace-check-events.c +2 -2
@@ -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 ; }
tracecmd/trace-list.c +4 -4
@@ -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); }
tracecmd/trace-record.c +2 -2
@@ -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; }
Signature · 1 line
2.17.1
PATCH v3 5/24 tools lib traceevent, perf tools: Rename pevent find APIs
In reply to Tzvetomir Stoyanov (VMware)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
--- 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(-)
include/traceevent/event-parse.h +4 -4
@@ -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 *ptrint pevent_read_number_field (struct format_field *field,const void *data,unsigned long long *value); -struct event_format *pevent_find_event (struct tep_handle *pevent,int id); +struct event_format *tep_find_event (struct tep_handle *pevent,int id);struct event_format *pevent_find_event_by_name (struct tep_handle *pevent,const char *sys,const char *name);
kernel-shark/trace-capture.c +2 -2
@@ -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);
kernel-shark/trace-filter.c +2 -2
@@ -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 */
kernel-shark/trace-graph.c +9 -9
@@ -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" ); } }
kernel-shark/trace-view-store.c +3 -3
@@ -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" ); }
lib/trace-cmd/trace-blk-hack.c +5 -5
@@ -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 ;
lib/trace-cmd/trace-ftrace.c +1 -1
@@ -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 ;
lib/traceevent/event-parse.c +38 -38
291 lines not on this page · raw message
lib/traceevent/parse-filter.c +2 -2
@@ -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 ) {
plugins/plugin_blk.c +8 -8
@@ -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))
plugins/plugin_kmem.c +1 -1
@@ -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 ;
plugins/plugin_mac80211.c +3 -3
@@ -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 ;
plugins/plugin_sched_switch.c +3 -3
@@ -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,':' );
python/ctracecmd.i +1 -1
@@ -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");
python/tracecmd.py +3 -3
@@ -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)
tracecmd/trace-hist.c +20 -20
@@ -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?" );
tracecmd/trace-mem.c +19 -19
@@ -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?" );
tracecmd/trace-profile.c +12 -12
@@ -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 */
tracecmd/trace-read.c +6 -6
@@ -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 ;
tracecmd/trace-record.c +1 -1
@@ -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;
Signature · 1 line
2.17.1
PATCH v3 6/24 tools lib traceevent, perf tools: Rename pevent parse APIs
In reply to Tzvetomir Stoyanov (VMware)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
--- 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(-)
include/traceevent/event-parse.h +9 -9
@@ -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);
lib/trace-cmd/trace-blk-hack.c +1 -1
@@ -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 ;
lib/trace-cmd/trace-input.c +3 -3
@@ -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);
lib/trace-cmd/trace-util.c +2 -2
@@ -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);
lib/traceevent/event-parse.c +11 -11
@@ -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);
tracecmd/trace-record.c +2 -2
@@ -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" );
Signature · 1 line
2.17.1
PATCH v3 7/24 tools lib traceevent, perf tools: Rename pevent print APIs
In reply to Tzvetomir Stoyanov (VMware)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
--- 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(-)
include/traceevent/event-parse.h +22 -22
@@ -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 ----------------------- */
kernel-shark/trace-dialog.c +2 -2
@@ -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);
lib/traceevent/event-parse.c +37 -37
196 lines not on this page · raw message
plugins/plugin_hrtimer.c +9 -9
@@ -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 ; }
plugins/plugin_kvm.c +8 -8
@@ -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_recoif (print_exit_reason (s, record, event,"exit_code" ) <0 )return -1 ; -pevent_print_num_field (s," info1 %llx" , event,"exit_info1" , record,1 ); -pevent_print_num_field (s," info2 %llx" , event,"exit_info2" , record,1 ); -pevent_print_num_field (s," int_info %llx" , event,"exit_int_info" , record,1 ); -pevent_print_num_field (s," int_info_err %llx" , event,"exit_int_info_err" , record,1 ); +tep_print_num_field (s," info1 %llx" , event,"exit_info1" , record,1 ); +tep_print_num_field (s," info2 %llx" , event,"exit_info2" , record,1 ); +tep_print_num_field (s," int_info %llx" , event,"exit_int_info" , record,1 ); +tep_print_num_field (s," int_info_err %llx" , event,"exit_int_info_err" , record,1 );return 0 ; }
@@ -348,7 +348,7 @@ static int kvm_nested_vmexit_inject_handler(struct trace_seq *s, struct tep_recostatic int kvm_nested_vmexit_handler (struct trace_seq *s,struct tep_record *record,struct event_format *event,void *context) { -pevent_print_num_field (s,"rip %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 ;
plugins/plugin_mac80211.c +4 -4
@@ -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" },
plugins/plugin_tlb.c +1 -1
@@ -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 ;
tracecmd/trace-read.c +10 -10
@@ -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 ; }
Signature · 1 line
2.17.1
PATCH v3 8/24 tools lib traceevent, perf tools: Rename pevent_read_number_* APIs
In reply to Tzvetomir Stoyanov (VMware)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
--- 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(-)
include/traceevent/event-parse.h +3 -3
@@ -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);
kernel-shark/trace-graph.c +6 -6
@@ -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
kernel-shark/trace-plot-task.c +1 -1
@@ -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; }
kernel-shark/trace-view-store.c +3 -3
@@ -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; }
lib/trace-cmd/trace-ftrace.c +1 -1
@@ -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 ))
lib/traceevent/event-parse.c +34 -34
200 lines not on this page · raw message
lib/traceevent/parse-filter.c +1 -1
@@ -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;
plugins/plugin_blk.c +7 -7
@@ -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;
plugins/plugin_kmem.c +1 -1
@@ -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);
plugins/plugin_mac80211.c +3 -3
@@ -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 ; }
python/ctracecmd.i +3 -3
@@ -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;
python/tracecmd.py +2 -2
@@ -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")
tracecmd/trace-hist.c +20 -20
@@ -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 *recorint 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 *recordint 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 tif (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)
tracecmd/trace-mem.c +6 -6
@@ -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)
tracecmd/trace-profile.c +23 -23
115 lines not on this page · raw message
tracecmd/trace-read.c +6 -6
@@ -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); }
Signature · 1 line
2.17.1
PATCH v3 9/24 tools lib traceevent, perf tools: Rename pevent_register_* APIs
In reply to Tzvetomir Stoyanov (VMware)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
--- 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(-)
include/traceevent/event-parse.h +3 -3
@@ -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,
kernel-shark/trace-graph.c +2 -2
@@ -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;
lib/trace-cmd/trace-util.c +2 -2
@@ -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); } }
lib/traceevent/event-parse.c +5 -5
@@ -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;
plugins/plugin_sched_switch.c +1 -1
@@ -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,
tracecmd/trace-hist.c +3 -3
@@ -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
Signature · 1 line
2.17.1
PATCH v3 10/24 tools lib traceevent, perf tools: Rename pevent_set_* APIs
In reply to Tzvetomir Stoyanov (VMware)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
--- 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(-)
include/traceevent/event-parse.h +8 -8
@@ -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; }
lib/trace-cmd/trace-input.c +1 -1
@@ -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 ; }
lib/traceevent/event-parse.c +3 -3
@@ -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));
tracecmd/trace-profile.c +2 -2
@@ -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_hastruct 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;
Signature · 1 line
2.17.1
PATCH v3 11/24 tools lib traceevent, perf tools: Rename traceevent_* APIs
In reply to Tzvetomir Stoyanov (VMware)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
--- include/traceevent/event-parse.h | 8 ++++---- lib/traceevent/event-plugin.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-)
include/traceevent/event-parse.h +4 -4
@@ -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;
lib/traceevent/event-plugin.c +4 -4
@@ -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;
Signature · 1 line
2.17.1
PATCH v3 12/24 tools lib traceevent, perf tools: Rename 'enum pevent_flag' to 'enum tep_flag'
In reply to Tzvetomir Stoyanov (VMware)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
--- 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(-)
include/traceevent/event-parse.h +5 -5
@@ -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; }
lib/traceevent/event-parse.c +1 -1
@@ -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 {
lib/traceevent/event-plugin.c +2 -2
@@ -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
tracecmd/trace-read.c +2 -2
@@ -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 ;
Signature · 1 line
2.17.1
PATCH v3 13/24 tools lib traceevent, tools lib lockdep: Rename 'enum pevent_errno' to 'enum tep_errno'
In reply to Tzvetomir Stoyanov (VMware)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'.
--- 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(-)
include/traceevent/event-parse.h +24 -24
@@ -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_MATCHenum 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,
lib/traceevent/event-parse.c +30 -30
190 lines not on this page · raw message
lib/traceevent/parse-filter.c +75 -75
558 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v3 14/24 tools lib traceevent: Rename pevent_function* APIs
In reply to Tzvetomir Stoyanov (VMware)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
--- 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(-)
include/traceevent/event-parse.h +15 -15
@@ -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);
lib/traceevent/event-parse.c +31 -31
161 lines not on this page · raw message
plugins/plugin_cfg80211.c +3 -3
@@ -29,10 +29,10 @@ int TEP_PLUGIN_LOADER(struct tep_handle *pevent) {pevent_register_print_function (pevent, process___le16_to_cpup, -PEVENT_FUNC_ARG_INT , +TEP_FUNC_ARG_INT ,"__le16_to_cpup" , -PEVENT_FUNC_ARG_PTR , -PEVENT_FUNC_ARG_VOID ); +TEP_FUNC_ARG_PTR , +TEP_FUNC_ARG_VOID );return 0 ; }
plugins/plugin_jbd2.c +6 -6
@@ -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 ; }
plugins/plugin_kvm.c +3 -3
@@ -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 ; }
plugins/plugin_scsi.c +5 -5
@@ -417,12 +417,12 @@ int TEP_PLUGIN_LOADER(struct tep_handle *pevent) {pevent_register_print_function (pevent, process_scsi_trace_parse_cdb, -PEVENT_FUNC_ARG_STRING , +TEP_FUNC_ARG_STRING ,"scsi_trace_parse_cdb" , -PEVENT_FUNC_ARG_PTR , -PEVENT_FUNC_ARG_PTR , -PEVENT_FUNC_ARG_INT , -PEVENT_FUNC_ARG_VOID ); +TEP_FUNC_ARG_PTR , +TEP_FUNC_ARG_PTR , +TEP_FUNC_ARG_INT , +TEP_FUNC_ARG_VOID );return 0 ; }
plugins/plugin_xen.c +3 -3
@@ -123,10 +123,10 @@ int TEP_PLUGIN_LOADER(struct tep_handle *pevent) {pevent_register_print_function (pevent, process_xen_hypercall_name, -PEVENT_FUNC_ARG_STRING , +TEP_FUNC_ARG_STRING ,"xen_hypercall_name" , -PEVENT_FUNC_ARG_INT , -PEVENT_FUNC_ARG_VOID ); +TEP_FUNC_ARG_INT , +TEP_FUNC_ARG_VOID );return 0 ; }
Signature · 1 line
2.17.1
PATCH v3 15/24 tools lib traceevent, perf tools: Rename traceevent_plugin_* APIs
In reply to Tzvetomir Stoyanov (VMware)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
--- include/traceevent/event-parse.h | 16 ++++++++-------- lib/traceevent/event-plugin.c | 28 ++++++++++++++-------------- 2 files changed, 22 insertions(+), 22 deletions(-)
include/traceevent/event-parse.h +8 -8
@@ -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 ;
lib/traceevent/event-plugin.c +14 -14
@@ -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);
Signature · 1 line
2.17.1
PATCH v3 16/24 tools lib traceevent: Rename pevent_filter* APIs
In reply to Tzvetomir Stoyanov (VMware)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
--- 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(-)
include/traceevent/event-parse.h +25 -25
@@ -918,16 +918,16 @@ struct filter_type {struct filter_arg *filter; }; -#define PEVENT_FILTER_ERROR_BUFSZ 1024 +#define TEP_FILTER_ERROR_BUFSZ 1024struct event_filter {struct tep_handle *pevent;int filters;struct filter_type *event_filters; -char error_buffer[PEVENT_FILTER_ERROR_BUFSZ ]; +char error_buffer[TEP_FILTER_ERROR_BUFSZ ]; }; -struct event_filter *pevent_filter_alloc (struct tep_handle *pevent); +struct event_filter *tep_filter_alloc (struct tep_handle *pevent);/* for backward compatibility */ #define FILTER_NONE TEP_ERRNO__NO_FILTER
@@ -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 */
kernel-shark-qt/examples/datafilter.c +2 -2
@@ -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)
kernel-shark-qt/src/libkshark-configio.c +2 -2
@@ -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;
kernel-shark-qt/src/libkshark.c +4 -4
@@ -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 ) {
kernel-shark/kernel-shark.c +2 -2
@@ -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 */
kernel-shark/trace-filter.c +19 -19
@@ -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); } }
kernel-shark/trace-graph.c +11 -11
@@ -279,7 +279,7 @@ gboolean trace_graph_filter_on_event(struct graph_info *ginfo, struct tep_recordif (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);
kernel-shark/trace-view-store.c +6 -6
@@ -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;
kernel-shark/trace-view.c +3 -3
@@ -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);
lib/traceevent/parse-filter.c +42 -42
270 lines not on this page · raw message
tracecmd/trace-read.c +4 -4
@@ -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); } }
Signature · 1 line
2.17.1
PATCH v3 17/24 tools lib traceevent: Rename pevent_register / unregister APIs
In reply to Tzvetomir Stoyanov (VMware)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
--- 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(-)
include/traceevent/event-parse.h +15 -15
@@ -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);
lib/trace-cmd/trace-ftrace.c +4 -4
@@ -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);
lib/trace-cmd/trace-util.c +2 -2
@@ -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);
lib/traceevent/event-parse.c +20 -20
@@ -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;
plugins/plugin_blk.c +2 -2
@@ -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 ; }
plugins/plugin_cfg80211.c +8 -8
@@ -27,17 +27,17 @@ process___le16_to_cpup(struct trace_seq *s, unsigned long long *args)int TEP_PLUGIN_LOADER (struct tep_handle *pevent) { -pevent_register_print_function (pevent, - process___le16_to_cpup, -TEP_FUNC_ARG_INT , -"__le16_to_cpup" , -TEP_FUNC_ARG_PTR , -TEP_FUNC_ARG_VOID ); +tep_register_print_function (pevent, + process___le16_to_cpup, +TEP_FUNC_ARG_INT , +"__le16_to_cpup" , +TEP_FUNC_ARG_PTR , +TEP_FUNC_ARG_VOID );return 0 ; }void TEP_PLUGIN_UNLOADER (struct tep_handle *pevent) { -pevent_unregister_print_function (pevent, process___le16_to_cpup, -"__le16_to_cpup" ); +tep_unregister_print_function (pevent, process___le16_to_cpup, +"__le16_to_cpup" ); }
plugins/plugin_function.c +4 -4
@@ -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++)
plugins/plugin_futex.c +4 -4
@@ -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 ); }
plugins/plugin_hrtimer.c +9 -9
@@ -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 ); }
plugins/plugin_jbd2.c +17 -17
@@ -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" ); }
plugins/plugin_kmem.c +25 -25
70 lines not on this page · raw message
plugins/plugin_kvm.c +43 -43
117 lines not on this page · raw message
plugins/plugin_mac80211.c +4 -4
@@ -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 ; }
plugins/plugin_sched_switch.c +12 -12
@@ -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 ); }
plugins/plugin_scsi.c +10 -10
@@ -415,19 +415,19 @@ unsigned long long process_scsi_trace_parse_cdb(struct trace_seq *s,int TEP_PLUGIN_LOADER (struct tep_handle *pevent) { -pevent_register_print_function (pevent, - process_scsi_trace_parse_cdb, -TEP_FUNC_ARG_STRING , -"scsi_trace_parse_cdb" , -TEP_FUNC_ARG_PTR , -TEP_FUNC_ARG_PTR , -TEP_FUNC_ARG_INT , -TEP_FUNC_ARG_VOID ); +tep_register_print_function (pevent, + process_scsi_trace_parse_cdb, +TEP_FUNC_ARG_STRING , +"scsi_trace_parse_cdb" , +TEP_FUNC_ARG_PTR , +TEP_FUNC_ARG_PTR , +TEP_FUNC_ARG_INT , +TEP_FUNC_ARG_VOID );return 0 ; }void TEP_PLUGIN_UNLOADER (struct tep_handle *pevent) { -pevent_unregister_print_function (pevent, process_scsi_trace_parse_cdb, -"scsi_trace_parse_cdb" ); +tep_unregister_print_function (pevent, process_scsi_trace_parse_cdb, +"scsi_trace_parse_cdb" ); }
plugins/plugin_tlb.c +5 -5
@@ -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 ); }
plugins/plugin_xen.c +8 -8
@@ -121,17 +121,17 @@ unsigned long long process_xen_hypercall_name(struct trace_seq *s,int TEP_PLUGIN_LOADER (struct tep_handle *pevent) { -pevent_register_print_function (pevent, - process_xen_hypercall_name, -TEP_FUNC_ARG_STRING , -"xen_hypercall_name" , -TEP_FUNC_ARG_INT , -TEP_FUNC_ARG_VOID ); +tep_register_print_function (pevent, + process_xen_hypercall_name, +TEP_FUNC_ARG_STRING , +"xen_hypercall_name" , +TEP_FUNC_ARG_INT , +TEP_FUNC_ARG_VOID );return 0 ; }void TEP_PLUGIN_UNLOADER (struct tep_handle *pevent) { -pevent_unregister_print_function (pevent, process_xen_hypercall_name, -"xen_hypercall_name" ); +tep_unregister_print_function (pevent, process_xen_hypercall_name, +"xen_hypercall_name" ); }
python/ctracecmd.i +2 -2
@@ -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,
Signature · 1 line
2.17.1
PATCH v3 18/24 tools lib traceevent: Rename pevent_data_ APIs
In reply to Tzvetomir Stoyanov (VMware)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
--- 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(-)
include/traceevent/event-parse.h +11 -11
@@ -693,18 +693,18 @@ pevent_find_event_by_name(struct tep_handle *pevent, const char *sys, const charstruct event_format *pevent_find_event_by_record (struct tep_handle *pevent,struct tep_record *record); -void pevent_data_lat_fmt (struct tep_handle *pevent, -struct trace_seq *s,struct tep_record *record); -int pevent_data_type (struct tep_handle *pevent,struct tep_record *rec); -struct event_format *pevent_data_event_from_type (struct tep_handle *pevent,int type); -int pevent_data_pid (struct tep_handle *pevent,struct tep_record *rec); -int pevent_data_preempt_count (struct tep_handle *pevent,struct tep_record *rec); -int pevent_data_flags (struct tep_handle *pevent,struct tep_record *rec); -const char *pevent_data_comm_from_pid (struct tep_handle *pevent,int pid); +void tep_data_lat_fmt (struct tep_handle *pevent, +struct trace_seq *s,struct tep_record *record); +int tep_data_type (struct tep_handle *pevent,struct tep_record *rec); +struct event_format *tep_data_event_from_type (struct tep_handle *pevent,int type); +int tep_data_pid (struct tep_handle *pevent,struct tep_record *rec); +int tep_data_preempt_count (struct tep_handle *pevent,struct tep_record *rec); +int tep_data_flags (struct tep_handle *pevent,struct tep_record *rec); +const char *tep_data_comm_from_pid (struct tep_handle *pevent,int pid);struct cmdline ; -struct cmdline *pevent_data_pid_from_comm (struct tep_handle *pevent,const char *comm, -struct cmdline *next); -int pevent_cmdline_pid (struct tep_handle *pevent,struct cmdline *cmdline); +struct cmdline *tep_data_pid_from_comm (struct tep_handle *pevent,const char *comm, +struct cmdline *next); +int tep_cmdline_pid (struct tep_handle *pevent,struct cmdline *cmdline);void tep_print_field (struct trace_seq *s,void *data,struct format_field *field);
kernel-shark-qt/examples/datafilter.c +2 -2
@@ -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,
kernel-shark-qt/examples/dataload.c +2 -2
@@ -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]); }
kernel-shark-qt/src/libkshark.c +7 -7
@@ -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;",
kernel-shark/kernel-shark.c +2 -2
@@ -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))
kernel-shark/trace-dialog.c +2 -2
@@ -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);
kernel-shark/trace-filter.c +1 -1
@@ -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 );
kernel-shark/trace-graph.c +7 -7
@@ -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)
kernel-shark/trace-plot-cpu.c +11 -11
@@ -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' );
kernel-shark/trace-plot-task.c +13 -13
@@ -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);
kernel-shark/trace-view-main.c +2 -2
@@ -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 ;
kernel-shark/trace-view-store.c +7 -7
@@ -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
lib/traceevent/event-parse.c +22 -22
154 lines not on this page · raw message
lib/traceevent/parse-filter.c +3 -3
@@ -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)
plugins/plugin_blk.c +4 -4
@@ -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;
python/tracecmd.py +11 -11
@@ -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)
tracecmd/trace-hist.c +4 -4
@@ -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);
tracecmd/trace-mem.c +2 -2
@@ -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)
tracecmd/trace-profile.c +2 -2
@@ -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);
tracecmd/trace-read.c +6 -6
@@ -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.
tracecmd/trace-record.c +2 -2
@@ -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" );
Signature · 1 line
2.17.1
PATCH v3 19/24 tools lib traceevent: Rename pevent field APIs
In reply to Tzvetomir Stoyanov (VMware)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
--- 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(-)
include/traceevent/event-parse.h +14 -14
@@ -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,
lib/trace-cmd/trace-ftrace.c +17 -17
@@ -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)
lib/traceevent/event-parse.c +21 -21
120 lines not on this page · raw message
plugins/plugin_function.c +2 -2
@@ -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);
plugins/plugin_futex.c +6 -6
@@ -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 ;
plugins/plugin_kvm.c +14 -14
@@ -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 *recouint8_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);
plugins/plugin_sched_switch.c +9 -9
@@ -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 ;
plugins/plugin_tlb.c +1 -1
@@ -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=" );
Signature · 1 line
2.17.1
PATCH v3 20/24 tools lib traceevent: Rename pevent_find_* APIs
In reply to Tzvetomir Stoyanov (VMware)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
--- 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(-)
include/traceevent/event-parse.h +4 -4
@@ -678,9 +678,9 @@ struct format_field *tep_find_common_field(struct event_format *event, const chastruct format_field *tep_find_field (struct event_format *event,const char *name);struct format_field *tep_find_any_field (struct event_format *event,const char *name); -const char *pevent_find_function (struct tep_handle *pevent,unsigned long long addr); +const char *tep_find_function (struct tep_handle *pevent,unsigned long long addr);unsigned long long -pevent_find_function_address (struct tep_handle *pevent,unsigned long long addr); +tep_find_function_address (struct tep_handle *pevent,unsigned long long addr);unsigned long long tep_read_number (struct tep_handle *pevent,const void *ptr,int size);int tep_read_number_field (struct format_field *field,const void *data,unsigned long long *value);
@@ -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);
kernel-shark-qt/src/libkshark-configio.c +1 -1
@@ -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;
kernel-shark/trace-capture.c +1 -1
@@ -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 ;
kernel-shark/trace-filter.c +1 -1
@@ -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 {
kernel-shark/trace-graph.c +16 -16
@@ -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);
kernel-shark/trace-view-store.c +3 -3
@@ -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,
lib/trace-cmd/trace-blk-hack.c +3 -3
@@ -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;
lib/trace-cmd/trace-ftrace.c +8 -8
@@ -47,7 +47,7 @@ static int find_ret_event(struct tracecmd_ftrace *finfo, struct tep_handle *pevestruct 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 ;
lib/traceevent/event-parse.c +12 -12
@@ -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 iif (sys_name && (strcmp (sys_name, event->system) !=0 ))return NULL ; }else { - event =pevent_find_event_by_name (pevent, sys_name, event_name); + event =tep_find_event_by_name (pevent, sys_name, event_name);if (!event)return NULL ; }
lib/traceevent/parse-filter.c +5 -5
@@ -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 *recoif (arg->str.field->flags & (FIELD_IS_POINTER |FIELD_IS_LONG ))/* convert to a kernel symbol */ - val =pevent_find_function (pevent, addr); + val =tep_find_function (pevent, addr);if (val ==NULL ) {/* just use the hex of the string name */
plugins/plugin_function.c +3 -3
@@ -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);
plugins/plugin_kmem.c +2 -2
@@ -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));
python/ctracecmd.i +1 -1
@@ -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;
tracecmd/trace-hist.c +5 -5
@@ -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 ;
tracecmd/trace-mem.c +2 -2
@@ -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); }
tracecmd/trace-profile.c +5 -5
@@ -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 *chaiunsigned 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
tracecmd/trace-read.c +7 -7
@@ -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;
Signature · 1 line
2.17.1
PATCH v3 21/24 tools lib traceevent: Rename various pevent get/set/is APIs
In reply to Tzvetomir Stoyanov (VMware)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
--- 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(-)
include/traceevent/event-parse.h +7 -7
@@ -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_sstruct format_field **pevent_event_common_fields (struct event_format *event);struct format_field **pevent_event_fields (struct event_format *event); -static inline int pevent_get_cpus (struct tep_handle *pevent) +static inline int tep_get_cpus (struct tep_handle *pevent) {return pevent->cpus; } -static inline void pevent_set_cpus (struct tep_handle *pevent,int cpus) +static inline void tep_set_cpus (struct tep_handle *pevent,int cpus) { pevent->cpus = cpus; }
@@ -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; }
kernel-shark/trace-graph.c +1 -1
@@ -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); }
lib/trace-cmd/trace-input.c +1 -1
@@ -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 )
lib/traceevent/event-parse.c +2 -2
@@ -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;
plugins/plugin_kvm.c +2 -2
@@ -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,
python/tracecmd.py +1 -1
@@ -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 '<'
tracecmd/trace-read.c +3 -3
@@ -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 ;
Signature · 1 line
2.17.1
Re: [PATCH v3 21/24] tools lib traceevent: Rename various pevent get/set/is APIs
kernel-shark/trace-graph.c int trace_graph_check_sched_switch(struct graph_info *ginfo, · line 1136
Quoted 10 lines · On Mon, 27 Aug 2018 11:17:56 +0300 "Tzvetomir Stoyanov (VMware)"…
kernel-shark/trace-graph.c +1
-1@@ -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
Quoted 3 lines
kernel-shark/trace-graph.c +0
-0tep_register_comm (ginfo->pevent, *comm, *pid); }
Re: [PATCH v3 21/24] tools lib traceevent: Rename various pevent get/set/is APIs
На пн, 27.08.2018 г. в 16:17 ч. Steven Rostedt <[email protected]> написа:
Quoted 5 lines
On Mon, 27 Aug 2018 11:17:56 +0300
"Tzvetomir Stoyanov (VMware)" <[email protected]> wrote:
Quoted 13 lines
kernel-shark/trace-graph.c int trace_graph_check_sched_switch(struct graph_info *ginfo, · line 1136
Quoted 10 lines
kernel-shark/trace-graph.c +1
-1@@ -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.
Quoted 5 lines
-- Steve
Quoted 3 lines
kernel-shark/trace-graph.c +0
-0tep_register_comm (ginfo->pevent, *comm, *pid); }
Re: [PATCH v3 21/24] tools lib traceevent: Rename various pevent get/set/is APIs
Quoted 20 lines · On Mon, 27 Aug 2018 16:31:06 +0300 Ceco <[email protected]> wrote:
На пн, 27.08.2018 г. в 16:17 ч. Steven Rostedt <[email protected]> написа:
Quoted 5 lines
On Mon, 27 Aug 2018 11:17:56 +0300
"Tzvetomir Stoyanov (VMware)" <[email protected]> wrote:Quoted 13 lines
kernel-shark/trace-graph.c int trace_graph_check_sched_switch(struct graph_info *ginfo, · line 1136
Quoted 10 lines
kernel-shark/trace-graph.c +1
-1@@ -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?
Quoted 2 lines
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
PATCH v3 21/24 tools lib traceevent: Rename various pevent get/set/is APIs
In reply to Tzvetomir Stoyanov (VMware)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
--- 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(-)
include/traceevent/event-parse.h +7 -7
@@ -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_sstruct format_field **pevent_event_common_fields (struct event_format *event);struct format_field **pevent_event_fields (struct event_format *event); -static inline int pevent_get_cpus (struct tep_handle *pevent) +static inline int tep_get_cpus (struct tep_handle *pevent) {return pevent->cpus; } -static inline void pevent_set_cpus (struct tep_handle *pevent,int cpus) +static inline void tep_set_cpus (struct tep_handle *pevent,int cpus) { pevent->cpus = cpus; }
@@ -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; }
kernel-shark/trace-graph.c +1 -1
@@ -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); }
lib/trace-cmd/trace-input.c +1 -1
@@ -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 )
lib/traceevent/event-parse.c +2 -2
@@ -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;
plugins/plugin_kvm.c +2 -2
@@ -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,
python/tracecmd.py +1 -1
@@ -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 '<'
tracecmd/trace-read.c +3 -3
@@ -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 ;
Signature · 1 line
2.17.1
Re: [PATCH v3.5 21/24] tools lib traceevent: Rename various pevent get/set/is APIs
Quoted 15 lines · On Tue, 28 Aug 2018 12:09:10 +0300 "Tzvetomir Stoyanov (VMware)"…
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_formatSigned-off-by Tzvetomir Stoyanov (VMware) <[email protected]>Cc Andrew Morton <[email protected]>Cc Peter Zijlstra <[email protected]>Cc Yordan Karadzhov (VMware) <[email protected]>Signed-off-by Arnaldo Carvalho de Melo <[email protected]>Signed-off-by Steven Rostedt (VMware) <[email protected]>
Quoted 2 lines
---
Thanks, I pulled the entire series with the two updated patches.
-- Steve
PATCH v3 22/24 tools lib traceevent: Rename internal parser related APIs
In reply to Tzvetomir Stoyanov (VMware)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
--- 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(-)
include/traceevent/event-parse.h +6 -6
@@ -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);
lib/traceevent/event-parse.c +12 -12
@@ -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); }
lib/traceevent/parse-filter.c +8 -8
@@ -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' ; }
Signature · 1 line
2.17.1
PATCH v3 23/24 tools lib traceevent: Rename various pevent APIs
In reply to Tzvetomir Stoyanov (VMware)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
--- 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(-)
include/traceevent/event-parse.h +7 -7
@@ -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);
kernel-shark-qt/src/libkshark-configio.c +2 -2
@@ -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 )
kernel-shark/trace-dialog.c +1 -1
@@ -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 ;
kernel-shark/trace-filter.c +9 -9
@@ -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];
kernel-shark/trace-graph.c +3 -3
@@ -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 ; }
kernel-shark/trace-view.c +2 -2
@@ -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 ; }
lib/traceevent/event-parse.c +11 -11
@@ -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); }
lib/traceevent/parse-filter.c +3 -3
@@ -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);
tracecmd/trace-output.c +3 -3
@@ -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);
tracecmd/trace-profile.c +2 -2
@@ -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" );
tracecmd/trace-read.c +3 -3
@@ -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)
Signature · 1 line
2.17.1
PATCH v3 24/24 tools lib traceevent: Rename static variables and functions in event-parse.c
In reply to Tzvetomir Stoyanov (VMware)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
--- lib/traceevent/event-parse.c | 54 ++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 27 deletions(-)
lib/traceevent/event-parse.c +27 -27
@@ -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;
Signature · 1 line
2.17.1