trace-cmd: rename variables, data structures and functions in lib/traceevent
cover trace-cmd: rename variables, data structures and functions in lib/traceevent
From: "Tzvetomir Stoyanov (VMware)" <[email protected]>
Backport series of patches from kernel tree to trace-cmd. Patches are related to renaming variables, data structures and functions in lib/traceevent, in order to make libtraceevent into a proper library.
Tzvetomir Stoyanov (VMware) (16):
tools lib traceevent, perf tools: Split trace-seq related APIs in a
separate header file
tools lib traceevent, perf tools: Rename struct event_format to struct
tep_event_format
tools lib traceevent, perf tools: Rename struct format{_field} to
struct tep_format{_field}
tools lib traceevent, perf tools: Rename enum format_flags to enum
tep_format_flags
tools lib traceevent: Rename enum event_{sort_}type to enum
tep_event_{sort_}type
tools lib traceevent: Add prefix TEP_ to all EVENT_FL_* flags
tools lib traceevent, perf tools: Add prefix tep_ to all print_*
structures
tools lib traceevent, perf tools: Rename enum print_arg_type to enum
tep_print_arg_type
tools lib traceevent: Add prefix tep_ to enums
filter_{boolean,op,cmp}_type
tools lib traceevent: Add prefix tep_ to enums filter_{exp,arg}_type
tools lib traceevent: Add prefix tep_ to struct
filter_{arg,value_type} tools lib traceevent: Add prefix tep_ to various structs filter_arg_*. tools lib traceevent: Add prefix tep_ to structs filter_type and
event_filter
tools lib traceevent: Rename struct plugin_list to struct
tep_plugin_list
tools lib traceevent: Rename data2host*() APIs
tools lib traceevent: Add prefix tep_ to enum filter_trivial_type
include/trace-cmd/trace-cmd.h | 10 +- include/traceevent/event-parse.h | 576 +++++----- include/traceevent/trace-seq.h | 55 + kernel-shark-qt/examples/datafilter.c | 4 +- kernel-shark-qt/src/libkshark-configio.c | 10 +- kernel-shark-qt/src/libkshark.c | 6 +- kernel-shark-qt/src/libkshark.h | 2 +- kernel-shark-qt/src/plugins/sched_events.c | 2 +- kernel-shark-qt/src/plugins/sched_events.h | 18 +- kernel-shark/include/trace-filter.h | 16 +- kernel-shark/include/trace-graph.h | 22 +- kernel-shark/include/trace-view-store.h | 16 +- kernel-shark/include/trace-view.h | 2 +- kernel-shark/kernel-shark.c | 8 +- kernel-shark/trace-capture.c | 6 +- kernel-shark/trace-dialog.c | 6 +- kernel-shark/trace-filter.c | 78 +- kernel-shark/trace-graph.c | 24 +- kernel-shark/trace-plot-cpu.c | 4 +- kernel-shark/trace-plot-task.c | 4 +- kernel-shark/trace-view-main.c | 4 +- kernel-shark/trace-view-store.c | 4 +- kernel-shark/trace-view.c | 12 +- lib/trace-cmd/trace-blk-hack.c | 4 +- lib/trace-cmd/trace-ftrace.c | 18 +- lib/trace-cmd/trace-input.c | 18 +- lib/trace-cmd/trace-util.c | 18 +- lib/traceevent/event-parse.c | 1185 ++++++++++---------- lib/traceevent/event-plugin.c | 19 +- lib/traceevent/parse-filter.c | 646 +++++------ lib/traceevent/trace-seq.c | 2 + plugins/plugin_blk.c | 6 +- plugins/plugin_function.c | 3 +- plugins/plugin_futex.c | 2 +- plugins/plugin_hrtimer.c | 5 +- plugins/plugin_jbd2.c | 1 + plugins/plugin_kmem.c | 5 +- plugins/plugin_kvm.c | 15 +- plugins/plugin_mac80211.c | 17 +- plugins/plugin_sched_switch.c | 11 +- plugins/plugin_scsi.c | 1 + plugins/plugin_tlb.c | 2 +- plugins/plugin_xen.c | 1 + python/ctracecmd.i | 20 +- tracecmd/trace-check-events.c | 2 +- tracecmd/trace-hist.c | 64 +- tracecmd/trace-list.c | 4 +- tracecmd/trace-mem.c | 66 +- tracecmd/trace-output.c | 6 +- tracecmd/trace-profile.c | 34 +- tracecmd/trace-read.c | 36 +- tracecmd/trace-record.c | 4 +- tracecmd/trace-split.c | 12 +- 53 files changed, 1571 insertions(+), 1545 deletions(-) create mode 100644 include/traceevent/trace-seq.h
Signature · 1 line
2.17.1
PATCH 1/16 tools lib traceevent, perf tools: Split trace-seq related APIs in a separate header file
From: "Tzvetomir Stoyanov (VMware)" <[email protected]>
In order to make libtraceevent into a proper library, all its APIs should be defined in corresponding header files. This patch splits trace-seq related APIs in a separate header file: trace-seq.h
--- include/traceevent/event-parse.h | 46 ++------------------------ include/traceevent/trace-seq.h | 55 ++++++++++++++++++++++++++++++++ lib/traceevent/event-parse.c | 1 + lib/traceevent/event-plugin.c | 1 + lib/traceevent/trace-seq.c | 2 ++ plugins/plugin_function.c | 1 + plugins/plugin_hrtimer.c | 1 + plugins/plugin_jbd2.c | 1 + plugins/plugin_kmem.c | 1 + plugins/plugin_kvm.c | 1 + plugins/plugin_mac80211.c | 1 + plugins/plugin_sched_switch.c | 1 + plugins/plugin_scsi.c | 1 + plugins/plugin_xen.c | 1 + 14 files changed, 70 insertions(+), 44 deletions(-) create mode 100644 include/traceevent/trace-seq.h
include/traceevent/event-parse.h +2 -44
@@ -12,17 +12,12 @@#include <regex.h> #include <string.h> +#include "trace-seq.h" +#ifndef __maybe_unused#define __maybe_unused __attribute__((unused))#endif -/* ----------------------- trace_seq ----------------------- */ - - -#ifndef TRACE_SEQ_BUF_SIZE -#define TRACE_SEQ_BUF_SIZE 4096 -#endif -#ifndef DEBUG_RECORD #define DEBUG_RECORD 0#endif
@@ -45,43 +40,6 @@ struct tep_record {#endif }; -enum trace_seq_fail { -TRACE_SEQ__GOOD , -TRACE_SEQ__BUFFER_POISONED , -TRACE_SEQ__MEM_ALLOC_FAILED , -}; - -/* -* Trace sequences are used to allow a function to call several other functions -* to create a string of data to use (up to a max of PAGE_SIZE). -*/ - -struct trace_seq { -char *buffer; -unsigned int buffer_size; -unsigned int len; -unsigned int readpos; -enum trace_seq_fail state; -}; - -void trace_seq_init (struct trace_seq *s); -void trace_seq_reset (struct trace_seq *s); -void trace_seq_destroy (struct trace_seq *s); - -extern int trace_seq_printf (struct trace_seq *s,const char *fmt, ...) - __attribute__ ((format (printf,2 ,3 ))); -extern int trace_seq_vprintf (struct trace_seq *s,const char *fmt,va_list args) - __attribute__ ((format (printf,2 ,0 ))); - -extern int trace_seq_puts (struct trace_seq *s,const char *str); -extern int trace_seq_putc (struct trace_seq *s,unsigned char c); - -extern void trace_seq_terminate (struct trace_seq *s); - -extern int trace_seq_do_fprintf (struct trace_seq *s,FILE *fp); -extern int trace_seq_do_printf (struct trace_seq *s); - -/* ----------------------- pevent ----------------------- */ struct tep_handle ;
include/traceevent/trace-seq.h new file +55 -0
55 lines not on this page · raw message
lib/traceevent/event-parse.c +1 -0
@@ -24,6 +24,7 @@#include <netinet/in.h> #include "event-parse.h" #include "event-utils.h" +#include "trace-seq.h" static const char *input_buf;static unsigned long long input_buf_ptr;
lib/traceevent/event-plugin.c +1 -0
@@ -15,6 +15,7 @@#include <dirent.h> #include "event-parse.h" #include "event-utils.h" +#include "trace-seq.h" #define LOCAL_PLUGIN_DIR ".traceevent/plugins"
lib/traceevent/trace-seq.c +2 -0
@@ -3,6 +3,8 @@* Copyright (C) 2009 Red Hat Inc, Steven Rostedt <[email protected]> * */ +#include "trace-seq.h" +#include <stdio.h> #include <stdlib.h> #include <string.h>
plugins/plugin_function.c +1 -0
@@ -8,6 +8,7 @@#include "trace-cmd.h" #include "event-utils.h" +#include "trace-seq.h" static struct func_stack { int size;
plugins/plugin_hrtimer.c +1 -0
@@ -8,6 +8,7 @@#include <string.h> #include "event-parse.h" +#include "trace-seq.h" static int timer_expire_handler (struct trace_seq *s,struct tep_record *record,struct event_format *event,void *context)
plugins/plugin_jbd2.c +1 -0
@@ -7,6 +7,7 @@#include <string.h> #include "event-parse.h" +#include "trace-seq.h" #define MINORBITS 20#define MINORMASK ((1U << MINORBITS) - 1)
plugins/plugin_kmem.c +1 -0
@@ -7,6 +7,7 @@#include <string.h> #include "trace-cmd.h" +#include "trace-seq.h" static int call_site_handler (struct trace_seq *s,struct tep_record *record,struct event_format *event,void *context)
plugins/plugin_kvm.c +1 -0
@@ -8,6 +8,7 @@#include <stdint.h> #include "event-parse.h" +#include "trace-seq.h" #ifdef HAVE_UDIS86
plugins/plugin_mac80211.c +1 -0
@@ -7,6 +7,7 @@#include <string.h> #include "event-parse.h" +#include "trace-seq.h" #define INDENT 65
plugins/plugin_sched_switch.c +1 -0
@@ -7,6 +7,7 @@#include <string.h> #include "trace-cmd.h" +#include "trace-seq.h" static void write_state (struct trace_seq *s,int val) {
plugins/plugin_scsi.c +1 -0
@@ -3,6 +3,7 @@#include <string.h> #include <inttypes.h> #include "event-parse.h" +#include "trace-seq.h" typedef unsigned long sector_t ;typedef uint64_t u64 ;
plugins/plugin_xen.c +1 -0
@@ -3,6 +3,7 @@#include <stdlib.h> #include <string.h> #include "event-parse.h" +#include "trace-seq.h" #define __HYPERVISOR_set_trap_table 0#define __HYPERVISOR_mmu_update 1
Signature · 1 line
2.17.1
PATCH 2/16 tools lib traceevent, perf tools: Rename struct event_format to struct tep_event_format
In reply to Tzvetomir StoyanovFrom: "Tzvetomir Stoyanov (VMware)" <[email protected]>
In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_". This renames struct event_format to struct tep_event_format
--- include/trace-cmd/trace-cmd.h | 2 +- include/traceevent/event-parse.h | 64 +++---- kernel-shark-qt/examples/datafilter.c | 2 +- kernel-shark-qt/src/libkshark-configio.c | 4 +- kernel-shark-qt/src/libkshark.c | 4 +- kernel-shark-qt/src/plugins/sched_events.c | 2 +- kernel-shark-qt/src/plugins/sched_events.h | 6 +- kernel-shark/include/trace-view-store.h | 6 +- kernel-shark/trace-capture.c | 6 +- kernel-shark/trace-dialog.c | 4 +- kernel-shark/trace-filter.c | 24 +-- kernel-shark/trace-graph.c | 8 +- kernel-shark/trace-plot-cpu.c | 4 +- kernel-shark/trace-plot-task.c | 4 +- kernel-shark/trace-view-store.c | 2 +- lib/trace-cmd/trace-blk-hack.c | 2 +- lib/trace-cmd/trace-ftrace.c | 16 +- lib/traceevent/event-parse.c | 186 ++++++++++----------- lib/traceevent/parse-filter.c | 42 ++--- plugins/plugin_blk.c | 4 +- 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 | 10 +- plugins/plugin_sched_switch.c | 4 +- plugins/plugin_tlb.c | 2 +- python/ctracecmd.i | 10 +- tracecmd/trace-hist.c | 22 +-- tracecmd/trace-mem.c | 18 +- tracecmd/trace-profile.c | 10 +- tracecmd/trace-read.c | 16 +- tracecmd/trace-record.c | 2 +- 34 files changed, 255 insertions(+), 255 deletions(-)
include/trace-cmd/trace-cmd.h +1 -1
@@ -90,7 +90,7 @@ enum {struct tracecmd_ftrace {struct tracecmd_input *handle; -struct event_format *fgraph_ret_event; +struct tep_event_format *fgraph_ret_event;int fgraph_ret_id;int long_size; };
include/traceevent/event-parse.h +32 -32
171 lines not on this page · raw message
kernel-shark-qt/examples/datafilter.c +1 -1
@@ -19,7 +19,7 @@ int main(int argc, char **argv)struct kshark_context *kshark_ctx;struct kshark_entry **data =NULL ;struct event_filter *adv_filter; -struct event_format *event; +struct tep_event_format *event;char *entry_str;bool status;int *pids;
kernel-shark-qt/src/libkshark-configio.c +2 -2
@@ -794,7 +794,7 @@ static bool kshark_event_filter_from_json(struct tep_handle *pevent, {json_object *jfilter, *jevent, *jsystem, *jname;const char *system_str, *name_str; -struct event_format *event; +struct tep_event_format *event;int i, length;/*
@@ -1011,7 +1011,7 @@ static bool kshark_adv_filters_to_json(struct kshark_context *kshark_ctx, {struct event_filter *adv_filter = kshark_ctx->advanced_event_filter;json_object *jfilter_data, *jevent, *jsystem, *jname, *jfilter; -struct event_format **events; +struct tep_event_format **events;char *str;int i;
kernel-shark-qt/src/libkshark.c +2 -2
@@ -868,7 +868,7 @@ static const char *kshark_get_latency(struct tep_handle *pe,static const char *kshark_get_info (struct tep_handle *pe,struct tep_record *record, -struct event_format *event) +struct tep_event_format *event) {char *pos;
@@ -903,7 +903,7 @@ char* kshark_dump_entry(const struct kshark_entry *entry)const char *event_name, *task, *lat, *info;struct kshark_context *kshark_ctx;struct tep_record *data; -struct event_format *event; +struct tep_event_format *event;char *temp_str, *entry_str;int event_id, size =0 ;
kernel-shark-qt/src/plugins/sched_events.c +1 -1
@@ -26,7 +26,7 @@ struct plugin_sched_context *plugin_sched_context_handler = NULL;static bool plugin_sched_init_context (struct kshark_context *kshark_ctx) {struct plugin_sched_context *plugin_ctx; -struct event_format *event; +struct tep_event_format *event;/* No context should exist when we initialize the plugin. */ assert (plugin_sched_context_handler ==NULL );
kernel-shark-qt/src/plugins/sched_events.h +3 -3
@@ -28,7 +28,7 @@ struct plugin_sched_context {struct tep_handle *pevent;/** Pointer to the sched_switch_event object. */ -struct event_format *sched_switch_event; +struct tep_event_format *sched_switch_event;/** Pointer to the sched_switch_next_field format descriptor. */ struct format_field *sched_switch_next_field;
@@ -37,7 +37,7 @@ struct plugin_sched_context {struct format_field *sched_switch_comm_field;/** Pointer to the sched_wakeup_event object. */ -struct event_format *sched_wakeup_event; +struct tep_event_format *sched_wakeup_event;/** Pointer to the sched_wakeup_pid_field format descriptor. */ struct format_field *sched_wakeup_pid_field;
@@ -46,7 +46,7 @@ struct plugin_sched_context {struct format_field *sched_wakeup_success_field;/** Pointer to the sched_wakeup_new_event object. */ -struct event_format *sched_wakeup_new_event; +struct tep_event_format *sched_wakeup_new_event;/** Pointer to the sched_wakeup_new_pid_field format descriptor. */ struct format_field *sched_wakeup_new_pid_field;
kernel-shark/include/trace-view-store.h +3 -3
@@ -83,11 +83,11 @@ struct trace_view_store/* Tracecmd specific info */ struct tracecmd_input *handle; -struct event_format *sched_switch_event; +struct tep_event_format *sched_switch_event;struct format_field *sched_switch_next_field; -struct event_format *sched_wakeup_event; +struct tep_event_format *sched_wakeup_event;struct format_field *sched_wakeup_pid_field; -struct event_format *sched_wakeup_new_event; +struct tep_event_format *sched_wakeup_new_event;struct format_field *sched_wakeup_new_pid_field;int cpus;
kernel-shark/trace-capture.c +3 -3
@@ -349,7 +349,7 @@ static char *find_tracecmd(void)static int add_trace_cmd_words (struct trace_capture *cap,char **args) { -struct event_format *event; +struct tep_event_format *event;char **systems = cap->info->cap_systems;const gchar *output;int *events = cap->info->cap_events;
@@ -808,7 +808,7 @@ static int load_events(struct trace_capture *cap, {struct shark_info *info = cap->info;struct tracecmd_xml_system_node *event_node; -struct event_format *event; +struct tep_event_format *event;struct tep_handle *pevent = cap->pevent;const char *name;int *events =NULL ;
@@ -997,7 +997,7 @@ static void save_events(struct trace_capture *cap, struct tracecmd_xml_handle *handle) {struct tep_handle *pevent = cap->pevent; -struct event_format *event; +struct tep_event_format *event;char **systems = cap->info->cap_systems;int *events = cap->info->cap_events;int i;
kernel-shark/trace-dialog.c +2 -2
@@ -373,7 +373,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 tep_event_format *event,struct tep_record *record) {struct format_field **fields;
@@ -395,7 +395,7 @@ static void read_raw_events(struct trace_seq *s,void trace_show_record_dialog (GtkWindow *parent,struct tep_handle *pevent,struct tep_record *record,gboolean raw) { -struct event_format *event; +struct tep_event_format *event;struct trace_seq s;int type;
kernel-shark/trace-filter.c +12 -12
@@ -87,8 +87,8 @@ static GtkTreeModel *create_event_combo_model(gpointer data)GtkTreeStore *tree;GtkTreeIter sys_iter;GtkTreeIter iter; -struct event_format **events; -struct event_format *event; +struct tep_event_format **events; +struct tep_event_format *event;const char *last_sys =NULL ;int i;
@@ -145,7 +145,7 @@ static GtkTreeModel *create_field_combo_model(gpointer data)struct tep_handle *pevent = data;GtkListStore *list;GtkTreeIter iter; -struct event_format **events; +struct tep_event_format **events;struct format_field **fields;struct format_field *field;int i;
@@ -177,8 +177,8 @@ static void update_field_combo(struct tep_handle *pevent,const char *system, const char *event_name) { - struct event_format **events; -struct event_format *event; + struct tep_event_format **events; +struct tep_event_format *event;struct format_field **fields;struct format_field *field;GtkTreeModel *model;
@@ -457,7 +457,7 @@ create_tree_filter_model(struct tep_handle *pevent, {GtkTreeStore *treestore;GtkTreeIter iter_events; -struct event_format **events; +struct tep_event_format **events;char *str;gint i;
@@ -1063,8 +1063,8 @@ create_tree_event_model(struct tep_handle *pevent, {GtkTreeStore *treestore;GtkTreeIter iter_all, iter_sys, iter_events; -struct event_format **events; -struct event_format *event; +struct tep_event_format **events; +struct tep_event_format *event;char *last_system =NULL ;gboolean sysactive;gboolean active, normal;
@@ -1923,8 +1923,8 @@ void trace_filter_convert_filter_to_names(struct event_filter *filter, gint **event_ids) {struct tep_handle *pevent = filter->pevent; -struct event_format **events; -struct event_format *event; +struct tep_event_format **events; +struct tep_event_format *event;char *last_system =NULL ;int all_selected =1 ;int start_sys =0 ;
@@ -1986,7 +1986,7 @@ void trace_filter_convert_char_to_filter(struct event_filter *filter, {struct tep_handle *pevent;struct event_filter *copy; -struct event_format *event; +struct tep_event_format *event;int i; pevent = filter->pevent;
@@ -2019,7 +2019,7 @@ void trace_filter_convert_char_to_filter(struct event_filter *filter,int trace_filter_save_events (struct tracecmd_xml_handle *handle,struct event_filter *filter) { -struct event_format *event; +struct tep_event_format *event;char **systems;gint *event_ids;char *str;
kernel-shark/trace-graph.c +4 -4
@@ -1007,7 +1007,7 @@ int trace_graph_check_sched_wakeup(struct graph_info *ginfo,struct tep_record *record, gint *pid) { - struct event_format *event; + struct tep_event_format *event;unsigned long long val;gboolean found;gint id;
@@ -1074,7 +1074,7 @@ int trace_graph_check_sched_switch(struct graph_info *ginfo, gint *pid, const char **comm) {unsigned long long val; -struct event_format *event; +struct tep_event_format *event;gint this_pid;gint id;int ret =1 ;
@@ -1153,8 +1153,8 @@ enum graph_irq_type trace_graph_check_irq(struct graph_info *ginfo, struct tep_record *record) { - struct event_format *event; -struct event_format **events; + struct tep_event_format *event; +struct tep_event_format **events;gint id;int i;
kernel-shark/trace-plot-cpu.c +2 -2
@@ -117,7 +117,7 @@ static int cpu_plot_display_last_event(struct graph_info *ginfo, unsigned long long time) {struct cpu_plot_info *cpu_info = plot->private; -struct event_format *event; +struct tep_event_format *event;struct tep_record *record;int cpu = cpu_info->cpu;unsigned long long offset =0 ;
@@ -353,7 +353,7 @@ int cpu_plot_display_info(struct graph_info *ginfo, unsigned long long time) {struct cpu_plot_info *cpu_info = plot->private; -struct event_format *event; +struct tep_event_format *event;struct tep_record *record;struct tep_record *next_record;struct tep_handle *pevent;
kernel-shark/trace-plot-task.c +2 -2
@@ -240,7 +240,7 @@ static int task_plot_display_last_event(struct graph_info *ginfo, unsigned long long time) {struct task_plot_info *task_info = plot->private; -struct event_format *event; +struct tep_event_format *event;struct tep_record *record;struct offset_cache *offsets;gboolean is_sched;
@@ -734,7 +734,7 @@ int task_plot_display_info(struct graph_info *ginfo, unsigned long long time) {struct task_plot_info *task_info = plot->private; -struct event_format *event; +struct tep_event_format *event;struct tep_record *record;struct tep_handle *pevent;unsigned long sec, usec;
kernel-shark/trace-view-store.c +1 -1
@@ -406,7 +406,7 @@ trace_view_store_get_value (GtkTreeModel *tree_model,TraceViewStore *trace_view_store;struct trace_seq s;struct tep_handle *pevent; -struct event_format *event; +struct tep_event_format *event;struct tep_record *data;const gchar *comm;gchar *str;
lib/trace-cmd/trace-blk-hack.c +1 -1
@@ -32,7 +32,7 @@ static const char blk_body[] = "\n"int tracecmd_blk_hack (struct tracecmd_input *handle) {struct tep_handle *pevent; -struct event_format *event; +struct tep_event_format *event;struct format_field *field;char buf[4096 ];/* way more than enough! */ int id;
lib/trace-cmd/trace-ftrace.c +8 -8
@@ -44,7 +44,7 @@ static void find_long_size(struct tracecmd_ftrace *finfo)static int find_ret_event (struct tracecmd_ftrace *finfo,struct tep_handle *pevent) { -struct event_format *event; +struct tep_event_format *event;/* Store the func ret id and event for later use */ event =tep_find_event_by_name (pevent,"ftrace" ,"funcgraph_exit" );
@@ -63,7 +63,7 @@ static int find_ret_event(struct tracecmd_ftrace *finfo, struct tep_handle *peve }while (0 ) static int function_handler(struct trace_seq *s, struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {struct tep_handle *pevent = event->pevent;unsigned long long function;
@@ -187,7 +187,7 @@ 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 tep_event_format *event,struct tep_record *record,struct tep_record *ret_rec,struct tracecmd_ftrace *finfo)
@@ -237,7 +237,7 @@ print_graph_entry_leaf(struct trace_seq *s, }static int print_graph_nested (struct trace_seq *s, -struct event_format *event, +struct tep_event_format *event,struct tep_record *record) {struct tep_handle *pevent = event->pevent;
@@ -278,7 +278,7 @@ static int print_graph_nested(struct trace_seq *s,static int fgraph_ent_handler (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {struct tracecmd_ftrace *finfo = context;struct tep_record *rec;
@@ -312,7 +312,7 @@ fgraph_ent_handler(struct trace_seq *s, struct tep_record *record,static int fgraph_ret_handler (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {struct tracecmd_ftrace *finfo = context;unsigned long long rettime, calltime;
@@ -363,7 +363,7 @@ fgraph_ret_handler(struct trace_seq *s, struct tep_record *record,static int trace_stack_handler (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {struct tracecmd_ftrace *finfo = context;struct format_field *field;
@@ -415,7 +415,7 @@ int tracecmd_ftrace_overrides(struct tracecmd_input *handle, struct tracecmd_ftrace *finfo) {struct tep_handle *pevent; -struct event_format *event; +struct tep_event_format *event; finfo->handle = handle;
lib/traceevent/event-parse.c +93 -93
664 lines not on this page · raw message
lib/traceevent/parse-filter.c +21 -21
162 lines not on this page · raw message
plugins/plugin_blk.c +2 -2
@@ -17,7 +17,7 @@struct blk_data {unsigned long long sector; -struct event_format *event; +struct tep_event_format *event;unsigned int action;unsigned int pid;unsigned int device;
@@ -279,7 +279,7 @@ static const struct { };static int blktrace_handler (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {struct format_field *field;unsigned long long val;
plugins/plugin_function.c +1 -1
@@ -129,7 +129,7 @@ static void show_function(struct trace_seq *s, struct tep_handle *pevent, }static int function_handler (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {struct tep_handle *pevent = event->pevent;unsigned long long function;
plugins/plugin_futex.c +1 -1
@@ -65,7 +65,7 @@ static void futex_print(struct trace_seq *s, const struct futex_args *args, }static int futex_handler (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {const struct futex_op *fop;struct futex_args args;
plugins/plugin_hrtimer.c +2 -2
@@ -11,7 +11,7 @@#include "trace-seq.h" static int timer_expire_handler (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {trace_seq_printf (s,"hrtimer=" );
@@ -28,7 +28,7 @@ static int timer_expire_handler(struct trace_seq *s, struct tep_record *record, }static int timer_start_handler (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {trace_seq_printf (s,"hrtimer=" );
plugins/plugin_kmem.c +1 -1
@@ -10,7 +10,7 @@#include "trace-seq.h" static int call_site_handler (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {struct format_field *field;unsigned long long val, addr;
plugins/plugin_kvm.c +7 -7
@@ -250,7 +250,7 @@ static const char *find_exit_reason(unsigned isa, int val) }static int print_exit_reason (struct trace_seq *s,struct tep_record *record, -struct event_format *event,const char *field) +struct tep_event_format *event,const char *field) {unsigned long long isa;unsigned long long val;
@@ -271,7 +271,7 @@ static int print_exit_reason(struct trace_seq *s, struct tep_record *record, }static int kvm_exit_handler (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {unsigned long long info1 =0 , info2 =0 ;
@@ -293,7 +293,7 @@ static int kvm_exit_handler(struct trace_seq *s, struct tep_record *record,#define KVM_EMUL_INSN_F_CS_L (1 << 3)static int kvm_emulate_insn_handler (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {unsigned long long rip, csbase, len, flags, failed;int llen;
@@ -333,7 +333,7 @@ static int kvm_emulate_insn_handler(struct trace_seq *s, struct tep_record *recostatic int kvm_nested_vmexit_inject_handler (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {if (print_exit_reason (s, record, event,"exit_code" ) <0 )return -1 ;
@@ -347,7 +347,7 @@ static int kvm_nested_vmexit_inject_handler(struct trace_seq *s, struct tep_reco }static int kvm_nested_vmexit_handler (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {tep_print_num_field (s,"rip %lx " , event,"rip" , record,1 );
@@ -370,7 +370,7 @@ union kvm_mmu_page_role { };static int kvm_mmu_print_role (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {unsigned long long val; static const char *access_str[] =
@@ -412,7 +412,7 @@ static int kvm_mmu_print_role(struct trace_seq *s, struct tep_record *record,return 0 ; }static int kvm_mmu_get_page_handler (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {unsigned long long val;
plugins/plugin_mac80211.c +5 -5
@@ -11,7 +11,7 @@#define INDENT 65 -static void print_string (struct trace_seq *s,struct event_format *event, +static void print_string (struct trace_seq *s,struct tep_event_format *event,const char *name,const void *data) {struct format_field *f =tep_find_field (event, name);
@@ -44,7 +44,7 @@ struct value_name {const char *name; }; -static void _print_enum (struct trace_seq *s,struct event_format *event, +static void _print_enum (struct trace_seq *s,struct tep_event_format *event,const char *name,const void *data,const struct value_name *names,int n_names) {
@@ -77,7 +77,7 @@ static void _print_enum(struct trace_seq *s, struct event_format *event,_print_enum (s, ev, name, data, __n,sizeof (__n)/sizeof (__n[0 ])); \ }) -static void _print_flag (struct trace_seq *s,struct event_format *event, +static void _print_flag (struct trace_seq *s,struct tep_event_format *event,const char *name,const void *data,const struct value_name *names,int n_names) {
@@ -125,7 +125,7 @@ static void _print_flag(struct trace_seq *s, struct event_format *event,#define SP () trace_seq_putc(s, ' ')static int drv_bss_info_changed (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {void *data = record->data;
@@ -153,7 +153,7 @@ static int drv_bss_info_changed(struct trace_seq *s, struct tep_record *record, }static int drv_config (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {void *data = record->data;
plugins/plugin_sched_switch.c +2 -2
@@ -51,7 +51,7 @@ static void write_and_save_comm(struct format_field *field, }static int sched_wakeup_handler (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {struct format_field *field;unsigned long long val;
@@ -79,7 +79,7 @@ static int sched_wakeup_handler(struct trace_seq *s, struct tep_record *record, }static int sched_switch_handler (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {struct format_field *field;unsigned long long val;
plugins/plugin_tlb.c +1 -1
@@ -17,7 +17,7 @@ enum tlb_flush_reason { };static int tlb_flush_handler (struct trace_seq *s,struct tep_record *record, -struct event_format *event,void *context) +struct tep_event_format *event,void *context) {unsigned long long val;
python/ctracecmd.i +5 -5
@@ -32,7 +32,7 @@ %inline %{ static int python_callback(struct trace_seq *s, struct tep_record *record, - struct event_format *event, + struct tep_event_format *event, void *context); static int skip_output = 0;
@@ -82,7 +82,7 @@ void py_pevent_register_event_handler(struct tep_handle *pevent, int id, static PyObject *py_field_get_stack(struct tep_handle *pevent, struct tep_record *record, - struct event_format *event, + struct tep_event_format *event, int long_size) { PyObject *list;
@@ -169,7 +169,7 @@ static PyObject *py_field_get_str(struct format_field *f, struct tep_record *r) strnlen((char *)r->data + f->offset, f->size)); } -static PyObject *py_format_get_keys(struct event_format *ef) +static PyObject *py_format_get_keys(struct tep_event_format *ef) { PyObject *list; struct format_field *f;
@@ -191,7 +191,7 @@ static PyObject *py_format_get_keys(struct event_format *ef) %wrapper %{ static int python_callback(struct trace_seq *s, struct tep_record *record, - struct event_format *event, + struct tep_event_format *event, void *context) { PyObject *arglist, *result;
@@ -205,7 +205,7 @@ static int python_callback(struct trace_seq *s, SWIG_NewPointerObj(SWIG_as_voidptr(record), SWIGTYPE_p_tep_record, 0), SWIG_NewPointerObj(SWIG_as_voidptr(event), - SWIGTYPE_p_event_format, 0)); + SWIGTYPE_p_tep_event_format, 0)); result = PyEval_CallObject(context, arglist); Py_XDECREF(arglist);
tracecmd/trace-hist.c +11 -11
@@ -530,7 +530,7 @@ process_sched_switch(struct tep_handle *pevent, struct tep_record *record)static void process_event (struct tep_handle *pevent,struct tep_record *record,int type) { -struct event_format *event; +struct tep_event_format *event;const char *event_name;unsigned long long val;int pid;
@@ -592,11 +592,11 @@ process_record(struct tep_handle *pevent, struct tep_record *record)process_event (pevent, record, type); } -static struct event_format * +static struct tep_event_format *update_event (struct tep_handle *pevent,const char *sys,const char *name,int *id) { -struct event_format *event; +struct tep_event_format *event; event =tep_find_event_by_name (pevent, sys, name);if (!event)
@@ -609,7 +609,7 @@ update_event(struct tep_handle *pevent,static void update_sched_wakeup (struct tep_handle *pevent) { -struct event_format *event; +struct tep_event_format *event; event =update_event (pevent,"sched" ,"sched_wakeup" , &sched_wakeup_type);if (!event)
@@ -621,7 +621,7 @@ static void update_sched_wakeup(struct tep_handle *pevent)static void update_sched_wakeup_new (struct tep_handle *pevent) { -struct event_format *event; +struct tep_event_format *event; event =update_event (pevent,"sched" ,"sched_wakeup_new" , &sched_wakeup_new_type);if (!event)
@@ -633,7 +633,7 @@ static void update_sched_wakeup_new(struct tep_handle *pevent)static void update_sched_switch (struct tep_handle *pevent) { -struct event_format *event; +struct tep_event_format *event; event =update_event (pevent,"sched" ,"sched_switch" , &sched_switch_type);if (!event)
@@ -647,7 +647,7 @@ static void update_sched_switch(struct tep_handle *pevent)static void update_function (struct tep_handle *pevent) { -struct event_format *event; +struct tep_event_format *event; event =update_event (pevent,"ftrace" ,"function" , &function_type);if (!event)
@@ -659,7 +659,7 @@ static void update_function(struct tep_handle *pevent)static void update_function_graph_entry (struct tep_handle *pevent) { -struct event_format *event; +struct tep_event_format *event; event =update_event (pevent,"ftrace" ,"funcgraph_entry" , &function_graph_entry_type);if (!event)
@@ -671,7 +671,7 @@ static void update_function_graph_entry(struct tep_handle *pevent)static void update_function_graph_exit (struct tep_handle *pevent) { -struct event_format *event; +struct tep_event_format *event; event =update_event (pevent,"ftrace" ,"funcgraph_exit" , &function_graph_exit_type);if (!event)
@@ -686,7 +686,7 @@ static void update_function_graph_exit(struct tep_handle *pevent)static void update_kernel_stack (struct tep_handle *pevent) { -struct event_format *event; +struct tep_event_format *event; event =update_event (pevent,"ftrace" ,"kernel_stack" , &kernel_stack_type);if (!event)
@@ -934,7 +934,7 @@ static void print_chains(struct tep_handle *pevent)static void do_trace_hist (struct tracecmd_input *handle) {struct tep_handle *pevent =tracecmd_get_pevent (handle); -struct event_format *event; +struct tep_event_format *event;struct tep_record *record;int cpus;int cpu;
tracecmd/trace-mem.c +9 -9
@@ -61,11 +61,11 @@ static void *zalloc(size_t size)return calloc (1 , size); } -static struct event_format * +static struct tep_event_format *update_event (struct tep_handle *pevent,const char *sys,const char *name,int *id) { -struct event_format *event; +struct tep_event_format *event; event =tep_find_event_by_name (pevent, sys, name);if (!event)
@@ -78,7 +78,7 @@ update_event(struct tep_handle *pevent,static void update_kmalloc (struct tep_handle *pevent) { -struct event_format *event; +struct tep_event_format *event; event =update_event (pevent,"kmem" ,"kmalloc" , &kmalloc_type);if (!event)
@@ -92,7 +92,7 @@ static void update_kmalloc(struct tep_handle *pevent)static void update_kmalloc_node (struct tep_handle *pevent) { -struct event_format *event; +struct tep_event_format *event; event =update_event (pevent,"kmem" ,"kmalloc_node" , &kmalloc_node_type);if (!event)
@@ -106,7 +106,7 @@ static void update_kmalloc_node(struct tep_handle *pevent)static void update_kfree (struct tep_handle *pevent) { -struct event_format *event; +struct tep_event_format *event; event =update_event (pevent,"kmem" ,"kfree" , &kfree_type);if (!event)
@@ -117,7 +117,7 @@ static void update_kfree(struct tep_handle *pevent)static void update_kmem_cache_alloc (struct tep_handle *pevent) { -struct event_format *event; +struct tep_event_format *event; event =update_event (pevent,"kmem" ,"kmem_cache_alloc" , &kmem_cache_alloc_type);if (!event)
@@ -131,7 +131,7 @@ static void update_kmem_cache_alloc(struct tep_handle *pevent)static void update_kmem_cache_alloc_node (struct tep_handle *pevent) { -struct event_format *event; +struct tep_event_format *event; event =update_event (pevent,"kmem" ,"kmem_cache_alloc_node" , &kmem_cache_alloc_node_type);
@@ -146,7 +146,7 @@ static void update_kmem_cache_alloc_node(struct tep_handle *pevent)static void update_kmem_cache_free (struct tep_handle *pevent) { -struct event_format *event; +struct tep_event_format *event; event =update_event (pevent,"kmem" ,"kmem_cache_free" , &kmem_cache_free_type);if (!event)
@@ -462,7 +462,7 @@ static void print_list(void)static void do_trace_mem (struct tracecmd_input *handle) {struct tep_handle *pevent =tracecmd_get_pevent (handle); -struct event_format *event; +struct tep_event_format *event;struct tep_record *record;int missed_events =0 ;int cpus;
tracecmd/trace-profile.c +5 -5
@@ -71,7 +71,7 @@ struct event_data {struct trace_hash_item hash;int id;int trace; -struct event_format *event; +struct tep_event_format *event;struct event_data *end;struct event_data *start;
@@ -795,7 +795,7 @@ static struct event_data * add_event(struct handle_data *h, const char *system, const char *event_name, enum event_data_type type) { - struct event_format *event; + struct tep_event_format *event;struct event_data *event_data; event =tep_find_event_by_name (h->pevent, system, event_name);
@@ -870,9 +870,9 @@ mate_events(struct handle_data *h, struct event_data *start,* @global: The events are global and not per task */ void tracecmd_mate_events (struct tracecmd_input *handle, -struct event_format *start_event, +struct tep_event_format *start_event,const char *pid_field,const char *end_match_field, -struct event_format *end_event, +struct tep_event_format *end_event,const char *start_match_field,int migrate,int global) {
@@ -1268,7 +1268,7 @@ void trace_init_profile(struct tracecmd_input *handle, struct hook_list *hook, int global) {struct tep_handle *pevent =tracecmd_get_pevent (handle); -struct event_format **events; +struct tep_event_format **events;struct format_field **fields;struct handle_data *h;struct event_data *event_data;
tracecmd/trace-read.c +8 -8
@@ -530,7 +530,7 @@ static void process_filters(struct handle_list *handles)static void init_wakeup (struct tracecmd_input *handle) { -struct event_format *event; +struct tep_event_format *event;struct tep_handle *pevent;if (!show_wakeup)
@@ -790,7 +790,7 @@ void trace_show_data(struct tracecmd_input *handle, struct tep_record *record) } use_trace_clock =tracecmd_get_use_trace_clock (handle);if (tsdiff) { -struct event_format *event; +struct tep_event_format *event;unsigned long long rec_ts = record->ts; event =tep_find_event_by_record (pevent, record);
@@ -928,7 +928,7 @@ test_stacktrace(struct handle_list *handles, struct tep_record *record,struct stack_info_cpu *cpu_info;struct handle_list *h;struct tracecmd_input *handle; -struct event_format *event; +struct tep_event_format *event;struct tep_handle *pevent;static int init;int ret;
@@ -1117,7 +1117,7 @@ static void read_data_info(struct list_head *handle_list, enum output_type otypestruct handle_list *last_handle;struct tep_record *record;struct tep_record *last_record; -struct event_format *event; +struct tep_event_format *event;struct tep_handle *pevent;int cpus;int ret;
@@ -1336,8 +1336,8 @@ static void process_plugin_option(char *option)static void set_event_flags (struct tep_handle *pevent,struct event_str *list,unsigned int flag) { -struct event_format **events; -struct event_format *event; +struct tep_event_format **events; +struct tep_event_format *event;struct event_str *str;regex_t regex;int ret;
@@ -1736,8 +1736,8 @@ void trace_report (int argc, char **argv) }if (show_events) { -struct event_format **events; -struct event_format *event; +struct tep_event_format **events; +struct tep_event_format *event;int i; events =tep_list_events (pevent,EVENT_SORT_SYSTEM );
tracecmd/trace-record.c +1 -1
@@ -3346,7 +3346,7 @@ static void add_func(struct func_list **list, const char *mod, const char *func)static unsigned long long find_ts_in_page (struct tep_handle *pevent,void *page,int size) { -struct event_format *event; +struct tep_event_format *event;struct format_field *field;struct tep_record *last_record =NULL ;struct tep_record *record;
Signature · 1 line
2.17.1
PATCH 3/16 tools lib traceevent, perf tools: Rename struct format{_field} to struct tep_format{_field}
In reply to Tzvetomir StoyanovFrom: "Tzvetomir Stoyanov (VMware)" <[email protected]>
In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_". This renames struct format to struct tep_format and struct format_field to struct tep_format_field
--- include/traceevent/event-parse.h | 42 +++++------ kernel-shark-qt/src/plugins/sched_events.h | 12 ++-- kernel-shark/include/trace-graph.h | 18 ++--- kernel-shark/include/trace-view-store.h | 6 +- kernel-shark/trace-dialog.c | 2 +- kernel-shark/trace-filter.c | 8 +-- lib/trace-cmd/trace-blk-hack.c | 2 +- lib/trace-cmd/trace-ftrace.c | 2 +- lib/traceevent/event-parse.c | 82 +++++++++++----------- lib/traceevent/parse-filter.c | 8 +-- plugins/plugin_blk.c | 2 +- plugins/plugin_kmem.c | 2 +- plugins/plugin_mac80211.c | 6 +- plugins/plugin_sched_switch.c | 6 +- python/ctracecmd.i | 10 +-- tracecmd/trace-hist.c | 42 +++++------ tracecmd/trace-mem.c | 48 ++++++------- tracecmd/trace-profile.c | 22 +++--- tracecmd/trace-read.c | 12 ++-- tracecmd/trace-record.c | 2 +- 20 files changed, 167 insertions(+), 167 deletions(-)
include/traceevent/event-parse.h +21 -21
@@ -127,8 +127,8 @@ enum format_flags { FIELD_IS_SYMBOLIC = 128, }; -struct format_field { -struct format_field *next; +struct tep_format_field { +struct tep_format_field *next;struct tep_event_format *event;char *type;char *name;
@@ -140,11 +140,11 @@ struct format_field {unsigned long flags; }; -struct format { +struct tep_format {int nr_common;int nr_fields; -struct format_field *common_fields; -struct format_field *fields; +struct tep_format_field *common_fields; +struct tep_format_field *fields; };struct print_arg_atom {
@@ -163,7 +163,7 @@ struct print_arg_bitmask {struct print_arg_field {char *name; -struct format_field *field; +struct tep_format_field *field; };struct print_flag_sym {
@@ -200,7 +200,7 @@ struct print_arg_int_array { };struct print_arg_dynarray { -struct format_field *field; +struct tep_format_field *field;struct print_arg *index; };
@@ -268,7 +268,7 @@ struct tep_event_format {char *name;int id;int flags; -struct format format; +struct tep_format format;struct print_fmt print_fmt;char *system;tep_event_handler_func handler;
@@ -463,9 +463,9 @@ struct tep_handle {int flags; -struct format_field *bprint_ip_field; -struct format_field *bprint_fmt_field; -struct format_field *bprint_buf_field; +struct tep_format_field *bprint_ip_field; +struct tep_format_field *bprint_fmt_field; +struct tep_format_field *bprint_buf_field;struct event_handler *handlers;struct tep_function_handler *func_handlers;
@@ -595,7 +595,7 @@ enum tep_errno tep_parse_format(struct tep_handle *pevent,const char *buf, unsigned long size, const char *sys);void tep_free_format (struct tep_event_format *event); -void tep_free_format_field (struct format_field *field); +void tep_free_format_field (struct tep_format_field *field); void *tep_get_field_raw(struct trace_seq *s, struct tep_event_format *event, const char *name, struct tep_record *record,
@@ -632,15 +632,15 @@ int tep_register_print_function(struct tep_handle *pevent,int tep_unregister_print_function (struct tep_handle *pevent,tep_func_handler func,char *name); -struct format_field *tep_find_common_field (struct tep_event_format *event,const char *name); -struct format_field *tep_find_field (struct tep_event_format *event,const char *name); -struct format_field *tep_find_any_field (struct tep_event_format *event,const char *name); +struct tep_format_field *tep_find_common_field (struct tep_event_format *event,const char *name); +struct tep_format_field *tep_find_field (struct tep_event_format *event,const char *name); +struct tep_format_field *tep_find_any_field (struct tep_event_format *event,const char *name);const char *tep_find_function (struct tep_handle *pevent,unsigned long long addr);unsigned long long 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, +int tep_read_number_field (struct tep_format_field *field,const void *data,unsigned long long *value);struct tep_event_format *tep_find_event (struct tep_handle *pevent,int id);
@@ -665,7 +665,7 @@ struct cmdline *tep_data_pid_from_comm(struct tep_handle *pevent, const char *coint tep_cmdline_pid (struct tep_handle *pevent,struct cmdline *cmdline);void tep_print_field (struct trace_seq *s,void *data, -struct format_field *field); +struct tep_format_field *field);void tep_print_fields (struct trace_seq *s,void *data,int size__maybe_unused ,struct tep_event_format *event); void tep_event_info(struct trace_seq *s, struct tep_event_format *event,
@@ -674,8 +674,8 @@ int tep_strerror(struct tep_handle *pevent, enum tep_errno errnum, char *buf, size_t buflen);struct tep_event_format **tep_list_events (struct tep_handle *pevent,enum event_sort_type ); -struct format_field **tep_event_common_fields (struct tep_event_format *event); -struct format_field **tep_event_fields (struct tep_event_format *event); +struct tep_format_field **tep_event_common_fields (struct tep_event_format *event); +struct tep_format_field **tep_event_fields (struct tep_event_format *event);static inline int tep_get_cpus (struct tep_handle *pevent) {
@@ -820,7 +820,7 @@ struct filter_arg_boolean { };struct filter_arg_field { -struct format_field *field; +struct tep_format_field *field; };struct filter_arg_value {
@@ -851,7 +851,7 @@ struct filter_arg_num {struct filter_arg_str {enum filter_cmp_type type; -struct format_field *field; +struct tep_format_field *field;char *val;char *buffer;regex_t reg;
kernel-shark-qt/src/plugins/sched_events.h +6 -6
@@ -31,30 +31,30 @@ struct plugin_sched_context {struct tep_event_format *sched_switch_event;/** Pointer to the sched_switch_next_field format descriptor. */ -struct format_field *sched_switch_next_field; +struct tep_format_field *sched_switch_next_field;/** Pointer to the sched_switch_comm_field format descriptor. */ -struct format_field *sched_switch_comm_field; +struct tep_format_field *sched_switch_comm_field;/** Pointer to the sched_wakeup_event object. */ struct tep_event_format *sched_wakeup_event;/** Pointer to the sched_wakeup_pid_field format descriptor. */ -struct format_field *sched_wakeup_pid_field; +struct tep_format_field *sched_wakeup_pid_field;/** Pointer to the sched_wakeup_success_field format descriptor. */ -struct format_field *sched_wakeup_success_field; +struct tep_format_field *sched_wakeup_success_field;/** Pointer to the sched_wakeup_new_event object. */ struct tep_event_format *sched_wakeup_new_event;/** Pointer to the sched_wakeup_new_pid_field format descriptor. */ -struct format_field *sched_wakeup_new_pid_field; +struct tep_format_field *sched_wakeup_new_pid_field;/** * Pointer to the sched_wakeup_new_success_field format descriptor. */ -struct format_field *sched_wakeup_new_success_field; +struct tep_format_field *sched_wakeup_new_success_field; };int plugin_get_next_pid (struct tep_record *record);
kernel-shark/include/trace-graph.h +9 -9
@@ -220,15 +220,15 @@ struct graph_info {gint *hard_irq_exit_ids;gint *soft_irq_entry_ids;gint *soft_irq_exit_ids; -struct format_field *event_prev_state; -struct format_field *event_pid_field; -struct format_field *event_comm_field; -struct format_field *ftrace_pid_field; -struct format_field *ftrace_comm_field; -struct format_field *wakeup_pid_field; -struct format_field *wakeup_success_field; -struct format_field *wakeup_new_pid_field; -struct format_field *wakeup_new_success_field; +struct tep_format_field *event_prev_state; +struct tep_format_field *event_pid_field; +struct tep_format_field *event_comm_field; +struct tep_format_field *ftrace_pid_field; +struct tep_format_field *ftrace_comm_field; +struct tep_format_field *wakeup_pid_field; +struct tep_format_field *wakeup_success_field; +struct tep_format_field *wakeup_new_pid_field; +struct tep_format_field *wakeup_new_success_field;gboolean no_irqs;
kernel-shark/include/trace-view-store.h +3 -3
@@ -84,11 +84,11 @@ struct trace_view_store/* Tracecmd specific info */ struct tracecmd_input *handle;struct tep_event_format *sched_switch_event; -struct format_field *sched_switch_next_field; +struct tep_format_field *sched_switch_next_field;struct tep_event_format *sched_wakeup_event; -struct format_field *sched_wakeup_pid_field; +struct tep_format_field *sched_wakeup_pid_field;struct tep_event_format *sched_wakeup_new_event; -struct format_field *sched_wakeup_new_pid_field; +struct tep_format_field *sched_wakeup_new_pid_field;int cpus;TraceViewRecord **cpu_list;
kernel-shark/trace-dialog.c +1 -1
@@ -376,7 +376,7 @@ static void read_raw_events(struct trace_seq *s,struct tep_event_format *event, struct tep_record *record) { - struct format_field **fields; + struct tep_format_field **fields;int i; fields =tep_event_fields (event);
kernel-shark/trace-filter.c +4 -4
@@ -146,8 +146,8 @@ static GtkTreeModel *create_field_combo_model(gpointer data)GtkListStore *list;GtkTreeIter iter;struct tep_event_format **events; -struct format_field **fields; -struct format_field *field; +struct tep_format_field **fields; +struct tep_format_field *field;int i; events =tep_list_events (pevent,EVENT_SORT_SYSTEM );
@@ -179,8 +179,8 @@ static void update_field_combo(struct tep_handle *pevent, {struct tep_event_format **events;struct tep_event_format *event; -struct format_field **fields; -struct format_field *field; +struct tep_format_field **fields; +struct tep_format_field *field;GtkTreeModel *model;GtkListStore *list;GtkTreeIter iter;
lib/trace-cmd/trace-blk-hack.c +1 -1
@@ -33,7 +33,7 @@ int tracecmd_blk_hack(struct tracecmd_input *handle) {struct tep_handle *pevent;struct tep_event_format *event; -struct format_field *field; +struct tep_format_field *field;char buf[4096 ];/* way more than enough! */ int id;int l;
lib/trace-cmd/trace-ftrace.c +1 -1
@@ -366,7 +366,7 @@ trace_stack_handler(struct trace_seq *s, struct tep_record *record, struct tep_event_format *event, void *context) { struct tracecmd_ftrace *finfo = context; -struct format_field *field; +struct tep_format_field *field;unsigned long long addr;const char *func;void *data = record->data;
lib/traceevent/event-parse.c +41 -41
290 lines not on this page · raw message
lib/traceevent/parse-filter.c +4 -4
@@ -16,11 +16,11 @@#define COMM "COMM"#define CPU "CPU" -static struct format_field comm = { +static struct tep_format_field comm = { .name ="COMM" , }; -static struct format_field cpu = { +static struct tep_format_field cpu = { .name ="CPU" , };
@@ -336,7 +336,7 @@ static enum tep_errno create_arg_item(struct tep_event_format *event, const char *token, enum event_type type, struct filter_arg **parg, char *error_str) { - struct format_field *field; + struct tep_format_field *field;struct filter_arg *arg; arg =allocate_arg ();
@@ -1698,7 +1698,7 @@ get_comm(struct tep_event_format *event, struct tep_record *record)static unsigned long long get_value (struct tep_event_format *event, -struct format_field *field,struct tep_record *record) +struct tep_format_field *field,struct tep_record *record) {unsigned long long val;
plugins/plugin_blk.c +1 -1
@@ -281,7 +281,7 @@ static const struct {static int blktrace_handler (struct trace_seq *s,struct tep_record *record,struct tep_event_format *event,void *context) { -struct format_field *field; +struct tep_format_field *field;unsigned long long val;void *data = record->data;struct blk_data blk_data;
plugins/plugin_kmem.c +1 -1
@@ -12,7 +12,7 @@static int call_site_handler (struct trace_seq *s,struct tep_record *record,struct tep_event_format *event,void *context) { -struct format_field *field; +struct tep_format_field *field;unsigned long long val, addr;void *data = record->data;const char *func;
plugins/plugin_mac80211.c +3 -3
@@ -14,7 +14,7 @@static void print_string (struct trace_seq *s,struct tep_event_format *event,const char *name,const void *data) { -struct format_field *f =tep_find_field (event, name); +struct tep_format_field *f =tep_find_field (event, name);int offset;int length;
@@ -48,7 +48,7 @@ static void _print_enum(struct trace_seq *s, struct tep_event_format *event, const char *name, const void *data, const struct value_name *names, int n_names) { - struct format_field *f = tep_find_field(event, name); + struct tep_format_field *f = tep_find_field(event, name);unsigned long long val;int i;
@@ -81,7 +81,7 @@ static void _print_flag(struct trace_seq *s, struct tep_event_format *event, const char *name, const void *data, const struct value_name *names, int n_names) { - struct format_field *f = tep_find_field(event, name); + struct tep_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
@@ -30,7 +30,7 @@ static void write_state(struct trace_seq *s, int val)trace_seq_putc (s,'R' ); } -static void write_and_save_comm (struct format_field *field, +static void write_and_save_comm (struct tep_format_field *field,struct tep_record *record,struct trace_seq *s,int pid) {
@@ -53,7 +53,7 @@ static void write_and_save_comm(struct format_field *field,static int sched_wakeup_handler (struct trace_seq *s,struct tep_record *record,struct tep_event_format *event,void *context) { -struct format_field *field; +struct tep_format_field *field;unsigned long long val;if (tep_get_field_val (s, event,"pid" , record, &val,1 ))
@@ -81,7 +81,7 @@ static int sched_wakeup_handler(struct trace_seq *s, struct tep_record *record,static int sched_switch_handler (struct trace_seq *s,struct tep_record *record,struct tep_event_format *event,void *context) { -struct format_field *field; +struct tep_format_field *field;unsigned long long val;if (tep_get_field_val (s, event,"prev_pid" , record, &val,1 ))
python/ctracecmd.i +5 -5
@@ -8,7 +8,7 @@ %apply Pointer NONNULL { struct tracecmd_input *handle }; %apply Pointer NONNULL { struct tep_handle *pevent }; -%apply Pointer NONNULL { struct format_field * }; +%apply Pointer NONNULL { struct tep_format_field * }; %apply unsigned long long *OUTPUT {unsigned long long *} %apply int *OUTPUT {int *}
@@ -86,7 +86,7 @@ static PyObject *py_field_get_stack(struct tep_handle *pevent, int long_size) { PyObject *list; - struct format_field *field; + struct tep_format_field *field; void *data = record->data; const char *func = NULL; unsigned long addr;
@@ -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 tep_record *r) +static PyObject *py_field_get_data(struct tep_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 tep_record *r) return PyBuffer_FromMemory((char *)r->data + f->offset, f->size); } -static PyObject *py_field_get_str(struct format_field *f, struct tep_record *r) +static PyObject *py_field_get_str(struct tep_format_field *f, struct tep_record *r) { if (!strncmp(f->type, "__data_loc ", 11)) { unsigned long long val;
@@ -172,7 +172,7 @@ static PyObject *py_field_get_str(struct format_field *f, struct tep_record *r) static PyObject *py_format_get_keys(struct tep_event_format *ef) { PyObject *list; - struct format_field *f; + struct tep_format_field *f; list = PyList_New(0);
tracecmd/trace-hist.c +21 -21
54 lines not on this page · raw message
tracecmd/trace-mem.c +24 -24
72 lines not on this page · raw message
tracecmd/trace-profile.c +11 -11
@@ -76,10 +76,10 @@ struct event_data {struct event_data *end;struct event_data *start; -struct format_field *pid_field; -struct format_field *start_match_field;/* match with start */ -struct format_field *end_match_field;/* match with end */ -struct format_field *data_field;/* optional */ +struct tep_format_field *pid_field; +struct tep_format_field *start_match_field;/* match with start */ +struct tep_format_field *end_match_field;/* match with end */ +struct tep_format_field *data_field;/* optional */ event_data_print print_func;handle_event_func handle_event;
@@ -168,7 +168,7 @@ struct cpu_info { };struct sched_switch_data { -struct format_field *prev_state; +struct tep_format_field *prev_state;int match_state; };
@@ -182,10 +182,10 @@ struct handle_data {struct cpu_info **cpu_data; -struct format_field *common_pid; -struct format_field *wakeup_comm; -struct format_field *switch_prev_comm; -struct format_field *switch_next_comm; +struct tep_format_field *common_pid; +struct tep_format_field *wakeup_comm; +struct tep_format_field *switch_prev_comm; +struct tep_format_field *switch_next_comm;struct sched_switch_data sched_switch_blocked;struct sched_switch_data sched_switch_preempt;
@@ -531,7 +531,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, +add_task_comm (struct task_data *task,struct tep_format_field *field,struct tep_record *record) {const char *comm;
@@ -1269,7 +1269,7 @@ void trace_init_profile(struct tracecmd_input *handle, struct hook_list *hook, {struct tep_handle *pevent =tracecmd_get_pevent (handle);struct tep_event_format **events; -struct format_field **fields; +struct tep_format_field **fields;struct handle_data *h;struct event_data *event_data;struct event_data *sched_switch;
tracecmd/trace-read.c +6 -6
@@ -100,12 +100,12 @@ static int no_softirqs;static int tsdiff; -static struct format_field *wakeup_task; -static struct format_field *wakeup_success; -static struct format_field *wakeup_new_task; -static struct format_field *wakeup_new_success; -static struct format_field *sched_task; -static struct format_field *sched_prio; +static struct tep_format_field *wakeup_task; +static struct tep_format_field *wakeup_success; +static struct tep_format_field *wakeup_new_task; +static struct tep_format_field *wakeup_new_success; +static struct tep_format_field *sched_task; +static struct tep_format_field *sched_prio;static unsigned long long total_wakeup_lat;static unsigned long wakeup_lat_count;
tracecmd/trace-record.c +1 -1
@@ -3347,7 +3347,7 @@ static unsigned long long find_ts_in_page(struct tep_handle *pevent, void *page, int size) { struct tep_event_format *event; -struct format_field *field; +struct tep_format_field *field;struct tep_record *last_record =NULL ;struct tep_record *record;unsigned long long ts =0 ;
Signature · 1 line
2.17.1
PATCH 4/16 tools lib traceevent, perf tools: Rename enum format_flags to enum tep_format_flags
In reply to Tzvetomir StoyanovFrom: "Tzvetomir Stoyanov (VMware)" <[email protected]>
In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_". This renames enum format_flags to enum tep_format_flags and adds prefix TEP_ to all of its members.
--- include/traceevent/event-parse.h | 18 ++++++------ lib/traceevent/event-parse.c | 48 ++++++++++++++++---------------- lib/traceevent/parse-filter.c | 8 +++--- 3 files changed, 37 insertions(+), 37 deletions(-)
include/traceevent/event-parse.h +9 -9
@@ -116,15 +116,15 @@ struct tep_plugin_option {#define TEP_PLUGIN_OPTIONS_NAME MAKE_STR(TEP_PLUGIN_OPTIONS)#define TEP_PLUGIN_ALIAS_NAME MAKE_STR(TEP_PLUGIN_ALIAS) -enum format_flags { -FIELD_IS_ARRAY =1 , -FIELD_IS_POINTER =2 , -FIELD_IS_SIGNED =4 , -FIELD_IS_STRING =8 , -FIELD_IS_DYNAMIC =16 , -FIELD_IS_LONG =32 , -FIELD_IS_FLAG =64 , -FIELD_IS_SYMBOLIC =128 , +enum tep_format_flags { +TEP_FIELD_IS_ARRAY =1 , +TEP_FIELD_IS_POINTER =2 , +TEP_FIELD_IS_SIGNED =4 , +TEP_FIELD_IS_STRING =8 , +TEP_FIELD_IS_DYNAMIC =16 , +TEP_FIELD_IS_LONG =32 , +TEP_FIELD_IS_FLAG =64 , +TEP_FIELD_IS_SYMBOLIC =128 , };struct tep_format_field {
lib/traceevent/event-parse.c +24 -24
153 lines not on this page · raw message
lib/traceevent/parse-filter.c +4 -4
@@ -1716,7 +1716,7 @@ get_value(struct tep_event_format *event,tep_read_number_field (field, record->data, &val); -if (!(field->flags &FIELD_IS_SIGNED )) +if (!(field->flags &TEP_FIELD_IS_SIGNED ))return val;switch (field->size) {
@@ -1867,11 +1867,11 @@ static const char *get_field_str(struct filter_arg *arg, struct tep_record *recochar hex[64 ];/* If the field is not a string convert it */ -if (arg->str.field->flags &FIELD_IS_STRING ) { +if (arg->str.field->flags &TEP_FIELD_IS_STRING ) { val = record->data + arg->str.field->offset; size = arg->str.field->size; -if (arg->str.field->flags &FIELD_IS_DYNAMIC ) { +if (arg->str.field->flags &TEP_FIELD_IS_DYNAMIC ) { addr = *(unsigned int *)val; val = record->data + (addr &0xffff ); size = addr >>16 ;
@@ -1893,7 +1893,7 @@ static const char *get_field_str(struct filter_arg *arg, struct tep_record *reco pevent = event->pevent; addr =get_value (event, arg->str.field, record); -if (arg->str.field->flags & (FIELD_IS_POINTER |FIELD_IS_LONG )) +if (arg->str.field->flags & (TEP_FIELD_IS_POINTER |TEP_FIELD_IS_LONG ))/* convert to a kernel symbol */ val =tep_find_function (pevent, addr);
Signature · 1 line
2.17.1
PATCH 5/16 tools lib traceevent: Rename enum event_{sort_}type to enum tep_event_{sort_}type
In reply to Tzvetomir StoyanovFrom: "Tzvetomir Stoyanov (VMware)" <[email protected]>
In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_". This renames enum event_type to enum tep_event_type, enum event_sort_type to enum tep_event_sort_type and add prefix TEP_ to all enum's members
--- include/traceevent/event-parse.h | 34 +- kernel-shark-qt/src/libkshark-configio.c | 2 +- kernel-shark/trace-filter.c | 12 +- kernel-shark/trace-graph.c | 2 +- lib/traceevent/event-parse.c | 488 +++++++++++------------ lib/traceevent/parse-filter.c | 36 +- tracecmd/trace-profile.c | 2 +- tracecmd/trace-read.c | 2 +- 8 files changed, 289 insertions(+), 289 deletions(-)
include/traceevent/event-parse.h +17 -17
@@ -287,22 +287,22 @@ enum {EVENT_FL_FAILED =0x80000000 }; -enum event_sort_type { -EVENT_SORT_ID , -EVENT_SORT_NAME , -EVENT_SORT_SYSTEM , +enum tep_event_sort_type { +TEP_EVENT_SORT_ID , +TEP_EVENT_SORT_NAME , +TEP_EVENT_SORT_SYSTEM , }; -enum event_type { -EVENT_ERROR , -EVENT_NONE , -EVENT_SPACE , -EVENT_NEWLINE , -EVENT_OP , -EVENT_DELIM , -EVENT_ITEM , -EVENT_DQUOTE , -EVENT_SQUOTE , +enum tep_event_type { +TEP_EVENT_ERROR , +TEP_EVENT_NONE , +TEP_EVENT_SPACE , +TEP_EVENT_NEWLINE , +TEP_EVENT_OP , +TEP_EVENT_DELIM , +TEP_EVENT_ITEM , +TEP_EVENT_DQUOTE , +TEP_EVENT_SQUOTE , }; typedef unsigned long long (*tep_func_handler)(struct trace_seq *s,
@@ -440,7 +440,7 @@ struct tep_handle {struct tep_event_format **events;int nr_events;struct tep_event_format **sort_events; -enum event_sort_type last_type; +enum tep_event_sort_type last_type;int type_offset;int type_size;
@@ -673,7 +673,7 @@ void tep_event_info(struct trace_seq *s, struct tep_event_format *event,int tep_strerror (struct tep_handle *pevent,enum tep_errno errnum,char *buf,size_t buflen); -struct tep_event_format **tep_list_events (struct tep_handle *pevent,enum event_sort_type ); +struct tep_event_format **tep_list_events (struct tep_handle *pevent,enum tep_event_sort_type );struct tep_format_field **tep_event_common_fields (struct tep_event_format *event);struct tep_format_field **tep_event_fields (struct tep_event_format *event);
@@ -744,7 +744,7 @@ void tep_unref(struct tep_handle *pevent);/* access to the internal parser */ void tep_buffer_init (const char *buf,unsigned long long size); -enum event_type tep_read_token (char **tok); +enum tep_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 );
kernel-shark-qt/src/libkshark-configio.c +1 -1
@@ -1032,7 +1032,7 @@ static bool kshark_adv_filters_to_json(struct kshark_context *kshark_ctx,if (!jfilter_data) goto fail; - events =tep_list_events (kshark_ctx->pevent,EVENT_SORT_SYSTEM ); + events =tep_list_events (kshark_ctx->pevent,TEP_EVENT_SORT_SYSTEM );if (!events)return false;
kernel-shark/trace-filter.c +6 -6
@@ -92,7 +92,7 @@ static GtkTreeModel *create_event_combo_model(gpointer data)const char *last_sys =NULL ;int i; - events =tep_list_events (pevent,EVENT_SORT_SYSTEM ); + events =tep_list_events (pevent,TEP_EVENT_SORT_SYSTEM );if (!events)return NULL ;
@@ -150,7 +150,7 @@ static GtkTreeModel *create_field_combo_model(gpointer data)struct tep_format_field *field;int i; - events =tep_list_events (pevent,EVENT_SORT_SYSTEM ); + events =tep_list_events (pevent,TEP_EVENT_SORT_SYSTEM );if (!events)return NULL ;
@@ -199,7 +199,7 @@ static void update_field_combo(struct tep_handle *pevent,return ; }else {/* use any event */ - events =tep_list_events (pevent,EVENT_SORT_SYSTEM ); + events =tep_list_events (pevent,TEP_EVENT_SORT_SYSTEM );if (!events)return ; event = events[0 ];
@@ -465,7 +465,7 @@ create_tree_filter_model(struct tep_handle *pevent,G_TYPE_STRING ,G_TYPE_STRING , G_TYPE_INT); - events =tep_list_events (pevent,EVENT_SORT_SYSTEM ); + events =tep_list_events (pevent,TEP_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 =tep_list_events (pevent,EVENT_SORT_SYSTEM ); + events =tep_list_events (pevent,TEP_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 =tep_list_events (pevent,EVENT_SORT_SYSTEM ); + events =tep_list_events (pevent,TEP_EVENT_SORT_SYSTEM );for (i =0 ; events[i]; i++) { event = events[i];
kernel-shark/trace-graph.c +1 -1
@@ -1196,7 +1196,7 @@ trace_graph_check_irq(struct graph_info *ginfo,else ginfo->soft_irq_entry_ids = null_int_array; - events =tep_list_events (ginfo->pevent,EVENT_SORT_SYSTEM ); + events =tep_list_events (ginfo->pevent,TEP_EVENT_SORT_SYSTEM );for (i =0 ; events[i]; i++) { event = events[i];
lib/traceevent/event-parse.c +244 -244
1,431 lines not on this page · raw message
lib/traceevent/parse-filter.c +18 -18
@@ -61,15 +61,15 @@ static void free_token(char *token)tep_free_token (token); } -static enum event_type read_token (char **tok) +static enum tep_event_type read_token (char **tok) { -enum event_type type; +enum tep_event_type type;char *token =NULL ;do {free_token (token); type =tep_read_token (&token); - }while (type ==EVENT_NEWLINE || type ==EVENT_SPACE ); + }while (type ==TEP_EVENT_NEWLINE || type ==TEP_EVENT_SPACE );/* If token is = or ! check to see if the next char is ~ */ if (token &&
@@ -79,7 +79,7 @@ static enum event_type read_token(char **tok) *tok =malloc (3 );if (*tok ==NULL ) {free_token (token); -return EVENT_ERROR ; +return TEP_EVENT_ERROR ; }sprintf (*tok,"%c%c" , *token,'~' );free_token (token);
@@ -334,7 +334,7 @@ static void free_events(struct event_list *events)static enum tep_errno create_arg_item (struct tep_event_format *event,const char *token, -enum event_type type,struct filter_arg **parg,char *error_str) +enum tep_event_type type,struct filter_arg **parg,char *error_str) {struct tep_format_field *field;struct filter_arg *arg;
@@ -347,11 +347,11 @@ create_arg_item(struct tep_event_format *event, const char *token,switch (type) { -case EVENT_SQUOTE : -case EVENT_DQUOTE : +case TEP_EVENT_SQUOTE : +case TEP_EVENT_DQUOTE : arg->type =FILTER_ARG_VALUE ; arg->value.type = - type ==EVENT_DQUOTE ?FILTER_STRING :FILTER_CHAR ; + type ==TEP_EVENT_DQUOTE ?FILTER_STRING :FILTER_CHAR ; arg->value.str =strdup (token);if (!arg->value.str) {free_arg (arg);
@@ -359,7 +359,7 @@ create_arg_item(struct tep_event_format *event, const char *token,return TEP_ERRNO__MEM_ALLOC_FAILED ; }break ; -case EVENT_ITEM : +case TEP_EVENT_ITEM :/* if it is a number, then convert it */ if (isdigit (token[0 ])) { arg->type =FILTER_ARG_VALUE ;
@@ -942,7 +942,7 @@ static enum tep_errno process_filter(struct tep_event_format *event, struct filter_arg **parg, char *error_str, int not) { - enum event_type type; + enum tep_event_type type;char *token =NULL ;struct filter_arg *current_op =NULL ;struct filter_arg *current_exp =NULL ;
@@ -960,9 +960,9 @@ process_filter(struct tep_event_format *event, struct filter_arg **parg,free (token); type =read_token (&token);switch (type) { -case EVENT_SQUOTE : -case EVENT_DQUOTE : -case EVENT_ITEM : +case TEP_EVENT_SQUOTE : +case TEP_EVENT_DQUOTE : +case TEP_EVENT_ITEM : ret =create_arg_item (event, token, type, &arg, error_str);if (ret <0 ) goto fail;
@@ -987,7 +987,7 @@ process_filter(struct tep_event_format *event, struct filter_arg **parg, arg =NULL ;break ; -case EVENT_DELIM : +case TEP_EVENT_DELIM :if (*token ==',' ) {show_error (error_str,"Illegal token ','" ); ret =TEP_ERRNO__ILLEGAL_TOKEN ;
@@ -1054,7 +1054,7 @@ process_filter(struct tep_event_format *event, struct filter_arg **parg, }break ; -case EVENT_OP : +case TEP_EVENT_OP : op_type =process_op (token, &btype, &ctype, &etype);/* All expect a left arg except for NOT */
@@ -1139,14 +1139,14 @@ process_filter(struct tep_event_format *event, struct filter_arg **parg,if (ret <0 ) goto fail_syntax;break ; -case EVENT_NONE : +case TEP_EVENT_NONE :break ; -case EVENT_ERROR : +case TEP_EVENT_ERROR : goto fail_alloc;default : goto fail_syntax; } - }while (type !=EVENT_NONE ); + }while (type !=TEP_EVENT_NONE );if (!current_op && !current_exp) goto fail_syntax;
tracecmd/trace-profile.c +1 -1
@@ -1458,7 +1458,7 @@ void trace_init_profile(struct tracecmd_input *handle, struct hook_list *hook, syscall_exit->print_func = syscall_print; } - events =tep_list_events (pevent,EVENT_SORT_ID ); + events =tep_list_events (pevent,TEP_EVENT_SORT_ID );if (!events)die ("malloc" );
tracecmd/trace-read.c +1 -1
@@ -1740,7 +1740,7 @@ void trace_report (int argc, char **argv)struct tep_event_format *event;int i; - events =tep_list_events (pevent,EVENT_SORT_SYSTEM ); + events =tep_list_events (pevent,TEP_EVENT_SORT_SYSTEM );for (i =0 ; events[i]; i++) { event = events[i];if (event->system)
Signature · 1 line
2.17.1
PATCH 6/16 tools lib traceevent: Add prefix TEP_ to all EVENT_FL_* flags
In reply to Tzvetomir StoyanovFrom: "Tzvetomir Stoyanov (VMware)" <[email protected]>
In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_". This adds prefix TEP_ to all members of nameless enum EVENT_FL_*
--- include/traceevent/event-parse.h | 18 +++++++------- lib/traceevent/event-parse.c | 42 ++++++++++++++++---------------- tracecmd/trace-read.c | 4 +-- 3 files changed, 32 insertions(+), 32 deletions(-)
include/traceevent/event-parse.h +9 -9
@@ -276,15 +276,15 @@ struct tep_event_format { };enum { -EVENT_FL_ISFTRACE =0x01 , -EVENT_FL_ISPRINT =0x02 , -EVENT_FL_ISBPRINT =0x04 , -EVENT_FL_ISFUNCENT =0x10 , -EVENT_FL_ISFUNCRET =0x20 , -EVENT_FL_NOHANDLE =0x40 , -EVENT_FL_PRINTRAW =0x80 , - -EVENT_FL_FAILED =0x80000000 +TEP_EVENT_FL_ISFTRACE =0x01 , +TEP_EVENT_FL_ISPRINT =0x02 , +TEP_EVENT_FL_ISBPRINT =0x04 , +TEP_EVENT_FL_ISFUNCENT =0x10 , +TEP_EVENT_FL_ISFUNCRET =0x20 , +TEP_EVENT_FL_NOHANDLE =0x40 , +TEP_EVENT_FL_PRINTRAW =0x80 , + +TEP_EVENT_FL_FAILED =0x80000000 };enum tep_event_sort_type {
lib/traceevent/event-parse.c +21 -21
158 lines not on this page · raw message
tracecmd/trace-read.c +2 -2
@@ -1750,8 +1750,8 @@ void trace_report (int argc, char **argv)return ; } -set_event_flags (pevent, nohandler_events,EVENT_FL_NOHANDLE ); -set_event_flags (pevent, raw_events,EVENT_FL_PRINTRAW ); +set_event_flags (pevent, nohandler_events,TEP_EVENT_FL_NOHANDLE ); +set_event_flags (pevent, raw_events,TEP_EVENT_FL_PRINTRAW ); }if (latency_format)
Signature · 1 line
2.17.1
PATCH 7/16 tools lib traceevent, perf tools: Add prefix tep_ to all print_* structures
In reply to Tzvetomir StoyanovFrom: "Tzvetomir Stoyanov (VMware)" <[email protected]>
In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_". This adds prefix tep_ to all print_* structures
--- include/traceevent/event-parse.h | 98 ++++++++++----------- lib/traceevent/event-parse.c | 144 +++++++++++++++---------------- 2 files changed, 121 insertions(+), 121 deletions(-)
include/traceevent/event-parse.h +49 -49
@@ -147,77 +147,77 @@ struct tep_format {struct tep_format_field *fields; }; -struct print_arg_atom { +struct tep_print_arg_atom {char *atom; }; -struct print_arg_string { +struct tep_print_arg_string {char *string;int offset; }; -struct print_arg_bitmask { +struct tep_print_arg_bitmask {char *bitmask;int offset; }; -struct print_arg_field { +struct tep_print_arg_field {char *name;struct tep_format_field *field; }; -struct print_flag_sym { -struct print_flag_sym *next; -char *value; -char *str; +struct tep_print_flag_sym { +struct tep_print_flag_sym *next; +char *value; +char *str; }; -struct print_arg_typecast { +struct tep_print_arg_typecast {char *type; -struct print_arg *item; +struct tep_print_arg *item; }; -struct print_arg_flags { -struct print_arg *field; -char *delim; -struct print_flag_sym *flags; +struct tep_print_arg_flags { +struct tep_print_arg *field; +char *delim; +struct tep_print_flag_sym *flags; }; -struct print_arg_symbol { -struct print_arg *field; -struct print_flag_sym *symbols; +struct tep_print_arg_symbol { +struct tep_print_arg *field; +struct tep_print_flag_sym *symbols; }; -struct print_arg_hex { -struct print_arg *field; -struct print_arg *size; +struct tep_print_arg_hex { +struct tep_print_arg *field; +struct tep_print_arg *size; }; -struct print_arg_int_array { -struct print_arg *field; -struct print_arg *count; -struct print_arg *el_size; +struct tep_print_arg_int_array { +struct tep_print_arg *field; +struct tep_print_arg *count; +struct tep_print_arg *el_size; }; -struct print_arg_dynarray { +struct tep_print_arg_dynarray {struct tep_format_field *field; -struct print_arg *index; +struct tep_print_arg *index; }; -struct print_arg ; +struct tep_print_arg ; -struct print_arg_op { +struct tep_print_arg_op {char *op;int prio; -struct print_arg *left; -struct print_arg *right; +struct tep_print_arg *left; +struct tep_print_arg *right; };struct tep_function_handler ; -struct print_arg_func { +struct tep_print_arg_func {struct tep_function_handler *func; -struct print_arg *args; +struct tep_print_arg *args; };enum print_arg_type {
@@ -239,28 +239,28 @@ enum print_arg_type { PRINT_HEX_STR, }; -struct print_arg { -struct print_arg *next; +struct tep_print_arg { +struct tep_print_arg *next;enum print_arg_type type;union { -struct print_arg_atom atom; -struct print_arg_field field; -struct print_arg_typecast typecast; -struct print_arg_flags flags; -struct print_arg_symbol symbol; -struct print_arg_hex hex; -struct print_arg_int_array int_array; -struct print_arg_func func; -struct print_arg_string string; -struct print_arg_bitmask bitmask; -struct print_arg_op op; -struct print_arg_dynarray dynarray; +struct tep_print_arg_atom atom; +struct tep_print_arg_field field; +struct tep_print_arg_typecast typecast; +struct tep_print_arg_flags flags; +struct tep_print_arg_symbol symbol; +struct tep_print_arg_hex hex; +struct tep_print_arg_int_array int_array; +struct tep_print_arg_func func; +struct tep_print_arg_string string; +struct tep_print_arg_bitmask bitmask; +struct tep_print_arg_op op; +struct tep_print_arg_dynarray dynarray; }; }; -struct print_fmt { +struct tep_print_fmt {char *format; -struct print_arg *args; +struct tep_print_arg *args; };struct tep_event_format {
@@ -269,7 +269,7 @@ struct tep_event_format {int id;int flags;struct tep_format format; -struct print_fmt print_fmt; +struct tep_print_fmt print_fmt;char *system;tep_event_handler_func handler;void *context;
lib/traceevent/event-parse.c +72 -72
464 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH 8/16 tools lib traceevent, perf tools: Rename enum print_arg_type to enum tep_print_arg_type
In reply to Tzvetomir StoyanovFrom: "Tzvetomir Stoyanov (VMware)" <[email protected]>
In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_". This renames enum print_arg_type to enum tep_print_arg_type and add prefix TEP_ to all its members.
--- include/traceevent/event-parse.h | 36 ++--- lib/traceevent/event-parse.c | 248 +++++++++++++++---------------- 2 files changed, 142 insertions(+), 142 deletions(-)
include/traceevent/event-parse.h +18 -18
@@ -220,28 +220,28 @@ struct tep_print_arg_func {struct tep_print_arg *args; }; -enum print_arg_type { -PRINT_NULL , -PRINT_ATOM , -PRINT_FIELD , -PRINT_FLAGS , -PRINT_SYMBOL , -PRINT_HEX , -PRINT_INT_ARRAY , -PRINT_TYPE , -PRINT_STRING , -PRINT_BSTRING , -PRINT_DYNAMIC_ARRAY , -PRINT_OP , -PRINT_FUNC , -PRINT_BITMASK , -PRINT_DYNAMIC_ARRAY_LEN , -PRINT_HEX_STR , +enum tep_print_arg_type { +TEP_PRINT_NULL , +TEP_PRINT_ATOM , +TEP_PRINT_FIELD , +TEP_PRINT_FLAGS , +TEP_PRINT_SYMBOL , +TEP_PRINT_HEX , +TEP_PRINT_INT_ARRAY , +TEP_PRINT_TYPE , +TEP_PRINT_STRING , +TEP_PRINT_BSTRING , +TEP_PRINT_DYNAMIC_ARRAY , +TEP_PRINT_OP , +TEP_PRINT_FUNC , +TEP_PRINT_BITMASK , +TEP_PRINT_DYNAMIC_ARRAY_LEN , +TEP_PRINT_HEX_STR , };struct tep_print_arg {struct tep_print_arg *next; -enum print_arg_type type; +enum tep_print_arg_type type;union {struct tep_print_arg_atom atom;struct tep_print_arg_field field;
lib/traceevent/event-parse.c +124 -124
739 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH 9/16 tools lib traceevent: Add prefix tep_ to enums filter_{boolean,op,cmp}_type
In reply to Tzvetomir StoyanovFrom: "Tzvetomir Stoyanov (VMware)" <[email protected]>
In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_". This adds prefix tep_ to enums filter_boolean_type, filter_op_type, filter_cmp_type and all enum's members
--- include/traceevent/event-parse.h | 46 +++++----- lib/traceevent/parse-filter.c | 144 +++++++++++++++---------------- 2 files changed, 95 insertions(+), 95 deletions(-)
include/traceevent/event-parse.h +23 -23
@@ -756,29 +756,29 @@ void tep_print_printk(struct tep_handle *pevent);/* ----------------------- filtering ----------------------- */ -enum filter_boolean_type { -FILTER_FALSE , -FILTER_TRUE , +enum tep_filter_boolean_type { +TEP_FILTER_FALSE , +TEP_FILTER_TRUE , }; -enum filter_op_type { -FILTER_OP_AND =1 , -FILTER_OP_OR , -FILTER_OP_NOT , +enum tep_filter_op_type { +TEP_FILTER_OP_AND =1 , +TEP_FILTER_OP_OR , +TEP_FILTER_OP_NOT , }; -enum filter_cmp_type { -FILTER_CMP_NONE , -FILTER_CMP_EQ , -FILTER_CMP_NE , -FILTER_CMP_GT , -FILTER_CMP_LT , -FILTER_CMP_GE , -FILTER_CMP_LE , -FILTER_CMP_MATCH , -FILTER_CMP_NOT_MATCH , -FILTER_CMP_REGEX , -FILTER_CMP_NOT_REGEX , +enum tep_filter_cmp_type { +TEP_FILTER_CMP_NONE , +TEP_FILTER_CMP_EQ , +TEP_FILTER_CMP_NE , +TEP_FILTER_CMP_GT , +TEP_FILTER_CMP_LT , +TEP_FILTER_CMP_GE , +TEP_FILTER_CMP_LE , +TEP_FILTER_CMP_MATCH , +TEP_FILTER_CMP_NOT_MATCH , +TEP_FILTER_CMP_REGEX , +TEP_FILTER_CMP_NOT_REGEX , };enum filter_exp_type {
@@ -816,7 +816,7 @@ enum filter_value_type {struct fliter_arg ;struct filter_arg_boolean { -enum filter_boolean_type value; +enum tep_filter_boolean_type value; };struct filter_arg_field {
@@ -832,7 +832,7 @@ struct filter_arg_value { };struct filter_arg_op { -enum filter_op_type type; +enum tep_filter_op_type type;struct filter_arg *left;struct filter_arg *right; };
@@ -844,13 +844,13 @@ struct filter_arg_exp { };struct filter_arg_num { -enum filter_cmp_type type; +enum tep_filter_cmp_type type;struct filter_arg *left;struct filter_arg *right; };struct filter_arg_str { -enum filter_cmp_type type; +enum tep_filter_cmp_type type;struct tep_format_field *field;char *val;char *buffer;
lib/traceevent/parse-filter.c +72 -72
376 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH 10/16 tools lib traceevent: Add prefix tep_ to enums filter_{exp,arg}_type
In reply to Tzvetomir StoyanovFrom: "Tzvetomir Stoyanov (VMware)" <[email protected]>
In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_". This adds prefix tep_ to enums filter_exp_type, filter_arg_type and all enum's members
--- include/traceevent/event-parse.h | 56 ++++----- lib/traceevent/parse-filter.c | 210 +++++++++++++++---------------- 2 files changed, 133 insertions(+), 133 deletions(-)
include/traceevent/event-parse.h +28 -28
@@ -781,30 +781,30 @@ enum tep_filter_cmp_type { TEP_FILTER_CMP_NOT_REGEX, }; -enum filter_exp_type { -FILTER_EXP_NONE , -FILTER_EXP_ADD , -FILTER_EXP_SUB , -FILTER_EXP_MUL , -FILTER_EXP_DIV , -FILTER_EXP_MOD , -FILTER_EXP_RSHIFT , -FILTER_EXP_LSHIFT , -FILTER_EXP_AND , -FILTER_EXP_OR , -FILTER_EXP_XOR , -FILTER_EXP_NOT , -}; - -enum filter_arg_type { -FILTER_ARG_NONE , -FILTER_ARG_BOOLEAN , -FILTER_ARG_VALUE , -FILTER_ARG_FIELD , -FILTER_ARG_EXP , -FILTER_ARG_OP , -FILTER_ARG_NUM , -FILTER_ARG_STR , +enum tep_filter_exp_type { +TEP_FILTER_EXP_NONE , +TEP_FILTER_EXP_ADD , +TEP_FILTER_EXP_SUB , +TEP_FILTER_EXP_MUL , +TEP_FILTER_EXP_DIV , +TEP_FILTER_EXP_MOD , +TEP_FILTER_EXP_RSHIFT , +TEP_FILTER_EXP_LSHIFT , +TEP_FILTER_EXP_AND , +TEP_FILTER_EXP_OR , +TEP_FILTER_EXP_XOR , +TEP_FILTER_EXP_NOT , +}; + +enum tep_filter_arg_type { +TEP_FILTER_ARG_NONE , +TEP_FILTER_ARG_BOOLEAN , +TEP_FILTER_ARG_VALUE , +TEP_FILTER_ARG_FIELD , +TEP_FILTER_ARG_EXP , +TEP_FILTER_ARG_OP , +TEP_FILTER_ARG_NUM , +TEP_FILTER_ARG_STR , };enum filter_value_type {
@@ -838,9 +838,9 @@ struct filter_arg_op { };struct filter_arg_exp { -enum filter_exp_type type; -struct filter_arg *left; -struct filter_arg *right; +enum tep_filter_exp_type type; +struct filter_arg *left; +struct filter_arg *right; };struct filter_arg_num {
@@ -858,7 +858,7 @@ struct filter_arg_str { };struct filter_arg { -enum filter_arg_type type; +enum tep_filter_arg_type type;union {struct filter_arg_boolean boolean;struct filter_arg_field field;
lib/traceevent/parse-filter.c +105 -105
553 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH 11/16 tools lib traceevent: Add prefix tep_ to struct filter_{arg,value_type}
In reply to Tzvetomir StoyanovFrom: "Tzvetomir Stoyanov (VMware)" <[email protected]>
In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_". This adds prefix tep_ to struct filter_arg, enum filter_value_type and all enum's members.
--- include/traceevent/event-parse.h | 28 ++++---- lib/traceevent/parse-filter.c | 120 +++++++++++++++---------------- 2 files changed, 74 insertions(+), 74 deletions(-)
include/traceevent/event-parse.h +14 -14
@@ -807,13 +807,13 @@ enum tep_filter_arg_type { TEP_FILTER_ARG_STR, }; -enum filter_value_type { -FILTER_NUMBER , -FILTER_STRING , -FILTER_CHAR +enum tep_filter_value_type { +TEP_FILTER_NUMBER , +TEP_FILTER_STRING , +TEP_FILTER_CHAR }; -struct fliter_arg ; +struct tep_filter_arg ;struct filter_arg_boolean {enum tep_filter_boolean_type value;
@@ -824,7 +824,7 @@ struct filter_arg_field { };struct filter_arg_value { -enum filter_value_type type; +enum tep_filter_value_type type;union {char *str;unsigned long long val;
@@ -833,20 +833,20 @@ struct filter_arg_value {struct filter_arg_op {enum tep_filter_op_type type; -struct filter_arg *left; -struct filter_arg *right; +struct tep_filter_arg *left; +struct tep_filter_arg *right; };struct filter_arg_exp {enum tep_filter_exp_type type; -struct filter_arg *left; -struct filter_arg *right; +struct tep_filter_arg *left; +struct tep_filter_arg *right; };struct filter_arg_num {enum tep_filter_cmp_type type; -struct filter_arg *left; -struct filter_arg *right; +struct tep_filter_arg *left; +struct tep_filter_arg *right; };struct filter_arg_str {
@@ -857,7 +857,7 @@ struct filter_arg_str {regex_t reg; }; -struct filter_arg { +struct tep_filter_arg {enum tep_filter_arg_type type;union {struct filter_arg_boolean boolean;
@@ -873,7 +873,7 @@ struct filter_arg {struct filter_type {int event_id;struct tep_event_format *event; -struct filter_arg *filter; +struct tep_filter_arg *filter; };#define TEP_FILTER_ERROR_BUFSZ 1024
lib/traceevent/parse-filter.c +60 -60
381 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH 12/16 tools lib traceevent: Add prefix tep_ to various structs filter_arg_*.
In reply to Tzvetomir StoyanovFrom: "Tzvetomir Stoyanov (VMware)" <[email protected]>
In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_". This adds prefix tep_ to to various structs filter_arg_*..
--- include/traceevent/event-parse.h | 48 ++++++++++++++++---------------- 1 file changed, 24 insertions(+), 24 deletions(-)
include/traceevent/event-parse.h +24 -24
@@ -815,15 +815,15 @@ enum tep_filter_value_type {struct tep_filter_arg ; -struct filter_arg_boolean { +struct tep_filter_arg_boolean {enum tep_filter_boolean_type value; }; -struct filter_arg_field { -struct tep_format_field *field; +struct tep_filter_arg_field { +struct tep_format_field *field; }; -struct filter_arg_value { +struct tep_filter_arg_value {enum tep_filter_value_type type;union {char *str;
@@ -831,42 +831,42 @@ struct filter_arg_value { }; }; -struct filter_arg_op { -enum tep_filter_op_type type; -struct tep_filter_arg *left; -struct tep_filter_arg *right; +struct tep_filter_arg_op { +enum tep_filter_op_type type; +struct tep_filter_arg *left; +struct tep_filter_arg *right; }; -struct filter_arg_exp { +struct tep_filter_arg_exp {enum tep_filter_exp_type type;struct tep_filter_arg *left;struct tep_filter_arg *right; }; -struct filter_arg_num { +struct tep_filter_arg_num {enum tep_filter_cmp_type type; -struct tep_filter_arg *left; -struct tep_filter_arg *right; +struct tep_filter_arg *left; +struct tep_filter_arg *right; }; -struct filter_arg_str { +struct tep_filter_arg_str {enum tep_filter_cmp_type type; -struct tep_format_field *field; -char *val; -char *buffer; -regex_t reg; +struct tep_format_field *field; +char *val; +char *buffer; +regex_t reg; };struct tep_filter_arg {enum tep_filter_arg_type type;union { -struct filter_arg_boolean boolean; -struct filter_arg_field field; -struct filter_arg_value value; -struct filter_arg_op op; -struct filter_arg_exp exp; -struct filter_arg_num num; -struct filter_arg_str str; +struct tep_filter_arg_boolean boolean; +struct tep_filter_arg_field field; +struct tep_filter_arg_value value; +struct tep_filter_arg_op op; +struct tep_filter_arg_exp exp; +struct tep_filter_arg_num num; +struct tep_filter_arg_str str; }; };
Signature · 1 line
2.17.1
PATCH 13/16 tools lib traceevent: Add prefix tep_ to structs filter_type and event_filter
In reply to Tzvetomir StoyanovFrom: "Tzvetomir Stoyanov (VMware)" <[email protected]>
In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_". This adds prefix tep_ to structs filter_type and event_filter
--- include/traceevent/event-parse.h | 34 ++++----- kernel-shark-qt/examples/datafilter.c | 2 +- kernel-shark-qt/src/libkshark-configio.c | 4 +- kernel-shark-qt/src/libkshark.c | 2 +- kernel-shark-qt/src/libkshark.h | 2 +- kernel-shark/include/trace-filter.h | 16 ++-- kernel-shark/include/trace-graph.h | 4 +- kernel-shark/include/trace-view-store.h | 4 +- kernel-shark/include/trace-view.h | 2 +- kernel-shark/kernel-shark.c | 8 +- kernel-shark/trace-filter.c | 26 +++---- kernel-shark/trace-graph.c | 8 +- kernel-shark/trace-view-main.c | 4 +- kernel-shark/trace-view.c | 12 +-- lib/traceevent/parse-filter.c | 96 ++++++++++++------------ tracecmd/trace-read.c | 2 +- 16 files changed, 113 insertions(+), 113 deletions(-)
include/traceevent/event-parse.h +17 -17
@@ -870,7 +870,7 @@ struct tep_filter_arg { }; }; -struct filter_type { +struct tep_filter_type {int event_id;struct tep_event_format *event;struct tep_filter_arg *filter;
@@ -878,14 +878,14 @@ struct filter_type {#define TEP_FILTER_ERROR_BUFSZ 1024 -struct event_filter { +struct tep_event_filter {struct tep_handle *pevent;int filters; -struct filter_type *event_filters; +struct tep_filter_type *event_filters;char error_buffer[TEP_FILTER_ERROR_BUFSZ ]; }; -struct event_filter *tep_filter_alloc (struct tep_handle *pevent); +struct tep_event_filter *tep_filter_alloc (struct tep_handle *pevent);/* for backward compatibility */ #define FILTER_NONE TEP_ERRNO__NO_FILTER
@@ -899,39 +899,39 @@ enum filter_trivial_type { FILTER_TRIVIAL_BOTH, }; -enum tep_errno tep_filter_add_filter_str (struct event_filter *filter, +enum tep_errno tep_filter_add_filter_str (struct tep_event_filter *filter,const char *filter_str); -enum tep_errno tep_filter_match (struct event_filter *filter, +enum tep_errno tep_filter_match (struct tep_event_filter *filter,struct tep_record *record); -int tep_filter_strerror (struct event_filter *filter,enum tep_errno err, +int tep_filter_strerror (struct tep_event_filter *filter,enum tep_errno err,char *buf,size_t buflen); -int tep_event_filtered (struct event_filter *filter, +int tep_event_filtered (struct tep_event_filter *filter,int event_id); -void tep_filter_reset (struct event_filter *filter); +void tep_filter_reset (struct tep_event_filter *filter); -int tep_filter_clear_trivial (struct event_filter *filter, +int tep_filter_clear_trivial (struct tep_event_filter *filter,enum filter_trivial_type type); -void tep_filter_free (struct event_filter *filter); +void tep_filter_free (struct tep_event_filter *filter); -char *tep_filter_make_string (struct event_filter *filter,int event_id); +char *tep_filter_make_string (struct tep_event_filter *filter,int event_id); -int tep_filter_remove_event (struct event_filter *filter, +int tep_filter_remove_event (struct tep_event_filter *filter,int event_id); -int tep_filter_event_has_trivial (struct event_filter *filter, +int tep_filter_event_has_trivial (struct tep_event_filter *filter,int event_id,enum filter_trivial_type type); -int tep_filter_copy (struct event_filter *dest,struct event_filter *source); +int tep_filter_copy (struct tep_event_filter *dest,struct tep_event_filter *source); -int tep_update_trivial (struct event_filter *dest,struct event_filter *source, +int tep_update_trivial (struct tep_event_filter *dest,struct tep_event_filter *source,enum filter_trivial_type type); -int tep_filter_compare (struct event_filter *filter1,struct event_filter *filter2); +int tep_filter_compare (struct tep_event_filter *filter1,struct tep_event_filter *filter2);#endif /* _PARSE_EVENTS_H */
kernel-shark-qt/examples/datafilter.c +1 -1
@@ -18,7 +18,7 @@ int main(int argc, char **argv)size_t i, n_rows, n_tasks, n_evts, count;struct kshark_context *kshark_ctx;struct kshark_entry **data =NULL ; -struct event_filter *adv_filter; +struct tep_event_filter *adv_filter;struct tep_event_format *event;char *entry_str;bool status;
kernel-shark-qt/src/libkshark-configio.c +2 -2
@@ -1009,7 +1009,7 @@ bool kshark_import_task_filter(struct tracecmd_filter_id *filter,static bool kshark_adv_filters_to_json (struct kshark_context *kshark_ctx,struct json_object *jobj) { -struct event_filter *adv_filter = kshark_ctx->advanced_event_filter; +struct tep_event_filter *adv_filter = kshark_ctx->advanced_event_filter;json_object *jfilter_data, *jevent, *jsystem, *jname, *jfilter;struct tep_event_format **events;char *str;
@@ -1107,7 +1107,7 @@ bool kshark_export_adv_filters(struct kshark_context *kshark_ctx,static bool kshark_adv_filters_from_json (struct kshark_context *kshark_ctx,struct json_object *jobj) { -struct event_filter *adv_filter = kshark_ctx->advanced_event_filter; +struct tep_event_filter *adv_filter = kshark_ctx->advanced_event_filter;json_object *jfilter, *jsystem, *jname, *jcond;int i, length, n, ret =0 ;char *filter_str =NULL ;
kernel-shark-qt/src/libkshark.c +1 -1
@@ -574,7 +574,7 @@ static size_t get_records(struct kshark_context *kshark_ctx, struct rec_list ***rec_list, enum rec_type type) {struct kshark_event_handler *evt_handler; -struct event_filter *adv_filter; +struct tep_event_filter *adv_filter;struct kshark_task_list *task;struct tep_record *rec;struct rec_list **temp_next;
kernel-shark-qt/src/libkshark.h +1 -1
@@ -120,7 +120,7 @@ struct kshark_context {* Filter allowing sophisticated filtering based on the content of * the event. */ -struct event_filter *advanced_event_filter; +struct tep_event_filter *advanced_event_filter;/** List of Data collections. */ struct kshark_entry_collection *collections;
kernel-shark/include/trace-filter.h +8 -8
@@ -71,7 +71,7 @@ typedef void (*trace_filter_event_cb_func)(gboolean accept, gpointer data);void trace_adv_filter_dialog (struct tracecmd_input *handle, -struct event_filter *event_filter, +struct tep_event_filter *event_filter,trace_adv_filter_cb_func func,gpointer data);
@@ -94,16 +94,16 @@ void trace_filter_pevent_dialog(struct tep_handle *pevent, gpointer data);void trace_filter_event_filter_dialog (struct tracecmd_input *handle, -struct event_filter *filter, +struct tep_event_filter *filter,gboolean all_events,trace_filter_event_cb_func func,gpointer data); -void trace_filter_convert_filter_to_names (struct event_filter *filter, +void trace_filter_convert_filter_to_names (struct tep_event_filter *filter,gchar ***systems,gint **events); -void trace_filter_convert_char_to_filter (struct event_filter *filter, +void trace_filter_convert_char_to_filter (struct tep_event_filter *filter,gchar **systems,gint *events);/**
@@ -130,10 +130,10 @@ void trace_array_add(gint **array, gint *count, gint val);/* save and load filters */ int trace_filter_save_events (struct tracecmd_xml_handle *handle, -struct event_filter *filter); +struct tep_event_filter *filter);int trace_filter_save_tasks (struct tracecmd_xml_handle *handle,struct tracecmd_filter_id *filter); -int trace_filter_load_events (struct event_filter *event_filter, +int trace_filter_load_events (struct tep_event_filter *event_filter,struct tracecmd_xml_handle *handle,struct tracecmd_xml_system_node *node); int trace_filter_load_task_filter(struct tracecmd_filter_id *filter,
@@ -149,7 +149,7 @@ int trace_filter_save_filters(struct tracecmd_xml_handle *handle, struct tracecmd_filter_id *hide_tasks);GtkWidget *trace_create_event_list_view (struct tep_handle *pevent, -struct event_filter *filter, +struct tep_event_filter *filter,gboolean all_events,gchar **systems,gint *events); gint trace_extract_event_list_view(GtkWidget *event_view,
@@ -158,7 +158,7 @@ gint trace_extract_event_list_view(GtkWidget *event_view, gint **events);int trace_update_event_view (GtkWidget *event_view,struct tep_handle *pevent, -struct event_filter *filter, +struct tep_event_filter *filter,gboolean all_events,gchar **systems,gint *events);
kernel-shark/include/trace-graph.h +2 -2
@@ -209,7 +209,7 @@ struct graph_info {gboolean filter_available;gboolean all_events;/* all events enabled */ -struct event_filter *event_filter;/* filtered events */ +struct tep_event_filter *event_filter;/* filtered events */ /* cache of event fields */ gint ftrace_sched_switch_id;
@@ -309,7 +309,7 @@ gboolean trace_graph_filter_on_event(struct graph_info *ginfo, struct tep_recordvoid trace_graph_copy_filter (struct graph_info *ginfo,gboolean all_events, -struct event_filter *event_filter); +struct tep_event_filter *event_filter);gint *trace_graph_task_list (struct graph_info *ginfo); int trace_graph_load_filters(struct graph_info *ginfo,
kernel-shark/include/trace-view-store.h +2 -2
@@ -102,7 +102,7 @@ struct trace_view_store/* filters */ gint all_events;/* set 1 when all events are enabled */ /* else */ -struct event_filter *event_filter;/* Filtered events */ +struct tep_event_filter *event_filter;/* Filtered events */ struct tracecmd_filter_id *task_filter;/* hash of tasks to filter on */ struct tracecmd_filter_id *hide_tasks;/* hash of tasks to not display */
@@ -235,7 +235,7 @@ static inline gboolean trace_view_store_get_all_events_enabled(TraceViewStore *sreturn store->all_events; } -static inline struct event_filter * +static inline struct tep_event_filter *trace_view_store_get_event_filter (TraceViewStore *store) {g_return_val_if_fail (TRACE_VIEW_IS_LIST (store), FALSE);
kernel-shark/include/trace-view.h +1 -1
@@ -45,7 +45,7 @@ void trace_view_cpu_filter_callback(gboolean accept,void trace_view_copy_filter (GtkWidget *treeview,gboolean all_events, -struct event_filter *event_filter); +struct tep_event_filter *event_filter);void trace_view_search_setup (GtkBox *box,GtkTreeView *treeview);
kernel-shark/kernel-shark.c +4 -4
@@ -395,7 +395,7 @@ static void load_filter(struct shark_info *info, const char *filename)struct tracecmd_xml_handle *handle;struct tracecmd_filter_id *task_filter;struct tracecmd_filter_id *hide_tasks; -struct event_filter *event_filter; +struct tep_event_filter *event_filter;int ret; handle =tracecmd_xml_open (filename);
@@ -818,7 +818,7 @@ sync_events_filter_clicked (GtkWidget *subitem, gpointer data) {struct shark_info *info = data;struct graph_info *ginfo = info->ginfo; -struct event_filter *event_filter; +struct tep_event_filter *event_filter;GtkTreeView *trace_tree =GTK_TREE_VIEW (info->treeview);GtkTreeModel *model;TraceViewStore *store;
@@ -1087,7 +1087,7 @@ static void list_events_clicked (gpointer data) {struct shark_info *info = data; -struct event_filter *event_filter; +struct tep_event_filter *event_filter;GtkTreeView *trace_tree =GTK_TREE_VIEW (info->treeview);GtkTreeModel *model;TraceViewStore *store;
@@ -1151,7 +1151,7 @@ static void adv_list_filter_clicked (gpointer data) {struct shark_info *info = data; -struct event_filter *event_filter; +struct tep_event_filter *event_filter;GtkTreeView *trace_tree =GTK_TREE_VIEW (info->treeview);GtkTreeModel *model;TraceViewStore *store;
kernel-shark/trace-filter.c +13 -13
@@ -453,7 +453,7 @@ static gint *get_event_ids(GtkTreeView *treeview)static GtkTreeModel *create_tree_filter_model (struct tep_handle *pevent, -struct event_filter *event_filter) +struct tep_event_filter *event_filter) {GtkTreeStore *treestore;GtkTreeIter iter_events;
@@ -539,7 +539,7 @@ static void adv_filter_cursor_changed(GtkTreeView *treeview, gpointer data)static GtkWidget *create_adv_filter_view (struct tep_handle *pevent, -struct event_filter *event_filter) +struct tep_event_filter *event_filter) {GtkTreeViewColumn *col;GtkCellRenderer *renderer;
@@ -615,7 +615,7 @@ create_adv_filter_view(struct tep_handle *pevent,* @data: data to pass to the function @func */ void trace_adv_filter_dialog (struct tracecmd_input *handle, -struct event_filter *event_filter, +struct tep_event_filter *event_filter,trace_adv_filter_cb_func func,gpointer data) {
@@ -1057,7 +1057,7 @@ gboolean event_is_enabled(gint *events, gint events_size, gint event)static GtkTreeModel *create_tree_event_model (struct tep_handle *pevent, -struct event_filter *filter, +struct tep_event_filter *filter,gboolean all_events,gchar **systems_set,gint *event_ids_set) {
@@ -1353,7 +1353,7 @@ static void expand_rows(GtkTreeView *tree, GtkTreeModel *model,*/ int trace_update_event_view (GtkWidget *event_view,struct tep_handle *pevent, -struct event_filter *filter, +struct tep_event_filter *filter,gboolean all_events,gchar **systems,gint *events) {
@@ -1386,7 +1386,7 @@ int trace_update_event_view(GtkWidget *event_view,*/ GtkWidget *trace_create_event_list_view (struct tep_handle *pevent, -struct event_filter *filter, +struct tep_event_filter *filter,gboolean all_events,gchar **systems,gint *events) {
@@ -1553,7 +1553,7 @@ static void accept_events(GtkWidget *view, } static void filter_event_dialog(struct tep_handle *pevent, - struct event_filter *filter, + struct tep_event_filter *filter, gboolean all_events, gchar **systems, gint *events, trace_filter_event_cb_func func,
@@ -1659,7 +1659,7 @@ void trace_filter_pevent_dialog(struct tep_handle *pevent,* If @all_events is set, then @systems and @events are ignored. */ void trace_filter_event_filter_dialog (struct tracecmd_input *handle, -struct event_filter *filter, +struct tep_event_filter *filter,gboolean all_events,trace_filter_event_cb_func func,gpointer data)
@@ -1918,7 +1918,7 @@ void trace_filter_cpu_dialog(gboolean all_cpus, guint64 *cpus_selected, gint cpu* @event_ids will be all events selected (not including those selected * by @systems) */ -void trace_filter_convert_filter_to_names (struct event_filter *filter, +void trace_filter_convert_filter_to_names (struct tep_event_filter *filter,gchar ***systems,gint **event_ids) {
@@ -1980,12 +1980,12 @@ void trace_filter_convert_filter_to_names(struct event_filter *filter,* @systems: array of systems that will have its events selected in @filter * @events: array of event ids that will be selected in @filter */ -void trace_filter_convert_char_to_filter (struct event_filter *filter, +void trace_filter_convert_char_to_filter (struct tep_event_filter *filter,gchar **systems,gint *events) {struct tep_handle *pevent; -struct event_filter *copy; +struct tep_event_filter *copy;struct tep_event_format *event;int i;
@@ -2017,7 +2017,7 @@ void trace_filter_convert_char_to_filter(struct event_filter *filter, }int trace_filter_save_events (struct tracecmd_xml_handle *handle, -struct event_filter *filter) +struct tep_event_filter *filter) {struct tep_event_format *event;char **systems;
@@ -2082,7 +2082,7 @@ int trace_filter_save_tasks(struct tracecmd_xml_handle *handle,return 0 ; } -int trace_filter_load_events (struct event_filter *event_filter, +int trace_filter_load_events (struct tep_event_filter *event_filter,struct tracecmd_xml_handle *handle,struct tracecmd_xml_system_node *node) {
kernel-shark/trace-graph.c +4 -4
@@ -2256,7 +2256,7 @@ void trace_graph_adv_filter_callback(gboolean accept, gpointer data) {struct graph_info *ginfo = data; -struct event_filter *event_filter; +struct tep_event_filter *event_filter;char error_str[200 ];int ret;int i;
@@ -2295,7 +2295,7 @@ void trace_graph_adv_filter_callback(gboolean accept,void trace_graph_copy_filter (struct graph_info *ginfo,gboolean all_events, -struct event_filter *event_filter) +struct tep_event_filter *event_filter) {if (all_events) { ginfo->all_events = TRUE;
@@ -2625,7 +2625,7 @@ static int load_event_filter(struct graph_info *ginfo, struct tracecmd_xml_system_node *node) {struct tracecmd_xml_system_node *child; -struct event_filter *event_filter; +struct tep_event_filter *event_filter;const char *name;const char *value;
@@ -2706,7 +2706,7 @@ int trace_graph_load_filters(struct graph_info *ginfo,int trace_graph_save_filters (struct graph_info *ginfo,struct tracecmd_xml_handle *handle) { -struct event_filter *event_filter; +struct tep_event_filter *event_filter;tracecmd_xml_start_system (handle,"TraceGraph" );
kernel-shark/trace-view-main.c +2 -2
@@ -146,7 +146,7 @@ static void events_clicked (gpointer data) {struct trace_tree_info *info = data; -struct event_filter *event_filter; +struct tep_event_filter *event_filter;GtkTreeView *trace_tree =GTK_TREE_VIEW (info->trace_tree);GtkTreeModel *model;TraceViewStore *store;
@@ -172,7 +172,7 @@ static void adv_filter_clicked (gpointer data) {struct trace_tree_info *info = data; -struct event_filter *event_filter; +struct tep_event_filter *event_filter;GtkTreeView *trace_tree =GTK_TREE_VIEW (info->trace_tree);GtkTreeModel *model;TraceViewStore *store;
kernel-shark/trace-view.c +6 -6
@@ -404,7 +404,7 @@ void trace_view_event_filter_callback(gboolean accept, gint *events, gpointer data) { -struct event_filter *event_filter; +struct tep_event_filter *event_filter;GtkTreeView *trace_tree = data;GtkTreeModel *model;TraceViewStore *store;
@@ -439,7 +439,7 @@ void trace_view_adv_filter_callback(gboolean accept, gint *event_ids, gpointer data) { -struct event_filter *event_filter; +struct tep_event_filter *event_filter;GtkTreeView *trace_tree = data;GtkTreeModel *model;TraceViewStore *store;
@@ -484,10 +484,10 @@ void trace_view_adv_filter_callback(gboolean accept,void trace_view_copy_filter (GtkWidget *treeview,gboolean all_events, -struct event_filter *src_event_filter) +struct tep_event_filter *src_event_filter) {GtkTreeView *trace_tree; -struct event_filter *event_filter; +struct tep_event_filter *event_filter;GtkTreeModel *model;TraceViewStore *store;
@@ -944,7 +944,7 @@ void trace_view_search_setup(GtkBox *box, GtkTreeView *treeview)int trace_view_save_filters (struct tracecmd_xml_handle *handle,GtkTreeView *trace_tree) { -struct event_filter *event_filter; +struct tep_event_filter *event_filter;GtkTreeModel *model;TraceViewStore *store;gboolean all_events;
@@ -981,7 +981,7 @@ static int load_event_filter(TraceViewStore *store, struct tracecmd_xml_system_node *node) {struct tracecmd_xml_system_node *child; -struct event_filter *event_filter; +struct tep_event_filter *event_filter;const char *name;const char *value;
lib/traceevent/parse-filter.c +48 -48
286 lines not on this page · raw message
tracecmd/trace-read.c +1 -1
@@ -36,7 +36,7 @@ static struct filter_str **filter_next = &filter_strings;struct filter {struct filter *next; -struct event_filter *filter; +struct tep_event_filter *filter; };struct event_str {
Signature · 1 line
2.17.1
PATCH 14/16 tools lib traceevent: Rename struct plugin_list to struct tep_plugin_list
In reply to Tzvetomir StoyanovFrom: "Tzvetomir Stoyanov (VMware)" <[email protected]>
In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_". This renames struct plugin_list to struct tep_plugin_list
--- include/trace-cmd/trace-cmd.h | 8 ++++---- include/traceevent/event-parse.h | 8 ++++---- lib/trace-cmd/trace-input.c | 4 ++-- lib/trace-cmd/trace-util.c | 18 +++++++++--------- lib/traceevent/event-plugin.c | 18 +++++++++--------- tracecmd/trace-check-events.c | 2 +- tracecmd/trace-list.c | 4 ++-- 7 files changed, 31 insertions(+), 31 deletions(-)
include/trace-cmd/trace-cmd.h +4 -4
@@ -25,9 +25,9 @@ void tracecmd_parse_ftrace_printk(struct tep_handle *pevent, char *file, unsigneextern int tracecmd_disable_sys_plugins;extern int tracecmd_disable_plugins; -struct plugin_list ; -struct plugin_list *tracecmd_load_plugins (struct tep_handle *pevent); -void tracecmd_unload_plugins (struct plugin_list *list,struct tep_handle *pevent); +struct tep_plugin_list ; +struct tep_plugin_list *tracecmd_load_plugins (struct tep_handle *pevent); +void tracecmd_unload_plugins (struct tep_plugin_list *list,struct tep_handle *pevent);char **tracecmd_event_systems (const char *tracing_dir);char **tracecmd_system_events (const char *tracing_dir,const char *system);
@@ -346,7 +346,7 @@ 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, -const struct plugin_list *list); +const struct tep_plugin_list *list);void trace_util_print_plugin_options (struct trace_seq *s);char **trace_util_list_plugin_options (void );void trace_util_free_plugin_options_list (char **list);
include/traceevent/event-parse.h +4 -4
@@ -375,12 +375,12 @@ enum tep_errno { };#undef _PE -struct plugin_list ; +struct tep_plugin_list ;#define INVALID_PLUGIN_LIST_OPTION ((char **)((unsigned long)-1)) -struct plugin_list *tep_load_plugins (struct tep_handle *pevent); -void tep_unload_plugins (struct plugin_list *plugin_list, +struct tep_plugin_list *tep_load_plugins (struct tep_handle *pevent); +void tep_unload_plugins (struct tep_plugin_list *plugin_list,struct tep_handle *pevent);char **tep_plugin_list_options (void );void tep_plugin_free_options_list (char **list);
@@ -389,7 +389,7 @@ int tep_plugin_add_options(const char *name,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); +const struct tep_plugin_list *list);struct cmdline ;struct cmdline_list ;
lib/trace-cmd/trace-input.c +2 -2
@@ -85,8 +85,8 @@ struct input_buffer_instance { };struct tracecmd_input { -struct tep_handle *pevent; -struct plugin_list *plugin_list; +struct tep_handle *pevent; +struct tep_plugin_list *plugin_list;struct tracecmd_input *parent;unsigned long flags;int fd;
lib/trace-cmd/trace-util.c +9 -9
@@ -43,8 +43,8 @@ static struct trace_plugin_options {#define _STR (x) #x#define STR (x) _STR(x) -struct plugin_list { -struct plugin_list *next; +struct tep_plugin_list { +struct tep_plugin_list *next;char *name;void *handle; };
@@ -164,7 +164,7 @@ void trace_util_remove_options(struct tep_plugin_option *options)*/ void trace_util_print_plugins (struct trace_seq *s,const char *prefix,const char *suffix, -const struct plugin_list *list) +const struct tep_plugin_list *list) {while (list) {trace_seq_printf (s,"%s%s%s" , prefix, list->name, suffix);
@@ -592,9 +592,9 @@ static int update_option(const char *file, struct tep_plugin_option *option)static int load_plugin (struct tep_handle *pevent,const char *path,const char *file,void *data) { -struct plugin_list **plugin_list = data; +struct tep_plugin_list **plugin_list = data;tep_plugin_load_func func; -struct plugin_list *list; +struct tep_plugin_list *list;struct tep_plugin_option *options;const char *alias;char *plugin;
@@ -1548,9 +1548,9 @@ void trace_util_free_options(struct tep_plugin_option *options) } } -struct plugin_list *tracecmd_load_plugins (struct tep_handle *pevent) +struct tep_plugin_list *tracecmd_load_plugins (struct tep_handle *pevent) { -struct plugin_list *list =NULL ; +struct tep_plugin_list *list =NULL ;trace_util_load_plugins (pevent,".so" , load_plugin, &list);
@@ -1558,10 +1558,10 @@ struct plugin_list *tracecmd_load_plugins(struct tep_handle *pevent) }void -tracecmd_unload_plugins (struct plugin_list *plugin_list,struct tep_handle *pevent) +tracecmd_unload_plugins (struct tep_plugin_list *plugin_list,struct tep_handle *pevent) {tep_plugin_unload_func func; -struct plugin_list *list; +struct tep_plugin_list *list;while (plugin_list) { list = plugin_list;
lib/traceevent/event-plugin.c +9 -9
@@ -31,8 +31,8 @@ static struct trace_plugin_options {char *value; } *trace_plugin_options; -struct plugin_list { -struct plugin_list *next; +struct tep_plugin_list { +struct tep_plugin_list *next;char *name;void *handle; };
@@ -259,7 +259,7 @@ 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) +const struct tep_plugin_list *list) {while (list) {trace_seq_printf (s,"%s%s%s" , prefix, list->name, suffix);
@@ -271,9 +271,9 @@ static void load_plugin(struct tep_handle *pevent, const char *path, const char *file, void *data) { - struct plugin_list **plugin_list = data; + struct tep_plugin_list **plugin_list = data;tep_plugin_load_func func; -struct plugin_list *list; +struct tep_plugin_list *list;const char *alias;char *plugin;void *handle;
@@ -417,20 +417,20 @@ load_plugins(struct tep_handle *pevent, const char *suffix,free (path); } -struct plugin_list * +struct tep_plugin_list *tep_load_plugins (struct tep_handle *pevent) { -struct plugin_list *list =NULL ; +struct tep_plugin_list *list =NULL ;load_plugins (pevent,".so" , load_plugin, &list);return list; }void -tep_unload_plugins (struct plugin_list *plugin_list,struct tep_handle *pevent) +tep_unload_plugins (struct tep_plugin_list *plugin_list,struct tep_handle *pevent) {tep_plugin_unload_func func; -struct plugin_list *list; +struct tep_plugin_list *list;while (plugin_list) { list = plugin_list;
tracecmd/trace-check-events.c +1 -1
@@ -14,7 +14,7 @@ void trace_check_events(int argc, char **argv)const char *tracing;int ret, c;struct tep_handle *pevent =NULL ; -struct plugin_list *list =NULL ; +struct tep_plugin_list *list =NULL ;while ((c =getopt (argc-1 , argv+1 ,"+hN" )) >=0 ) {switch (c) {
tracecmd/trace-list.c +2 -2
@@ -308,7 +308,7 @@ static void show_buffers(void)static void show_plugin_options (void ) {struct tep_handle *pevent; -struct plugin_list *list; +struct tep_plugin_list *list;struct trace_seq s;tracecmd_ftrace_load_options ();
@@ -336,7 +336,7 @@ void trace_option(int argc, char **argv)static void show_plugins (void ) {struct tep_handle *pevent; -struct plugin_list *list; +struct tep_plugin_list *list;struct trace_seq s; pevent =tep_alloc ();
Signature · 1 line
2.17.1
PATCH 15/16 tools lib traceevent: Rename data2host*() APIs
In reply to Tzvetomir StoyanovFrom: "Tzvetomir Stoyanov (VMware)" <[email protected]>
In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_". This renames data2host*() APIs
--- include/traceevent/event-parse.h | 14 +++++++------- lib/trace-cmd/trace-input.c | 14 +++++++------- lib/traceevent/event-parse.c | 10 +++++----- tracecmd/trace-output.c | 6 +++--- tracecmd/trace-split.c | 12 ++++++------ 5 files changed, 28 insertions(+), 28 deletions(-)
include/traceevent/event-parse.h +7 -7
@@ -484,7 +484,7 @@ static inline void tep_set_flag(struct tep_handle *pevent, int flag) }static inline unsigned short -__data2host2 (struct tep_handle *pevent,unsigned short data) +__tep_data2host2 (struct tep_handle *pevent,unsigned short data) {unsigned short swap;
@@ -498,7 +498,7 @@ __data2host2(struct tep_handle *pevent, unsigned short data) }static inline unsigned int -__data2host4 (struct tep_handle *pevent,unsigned int data) +__tep_data2host4 (struct tep_handle *pevent,unsigned int data) {unsigned int swap;
@@ -514,7 +514,7 @@ __data2host4(struct tep_handle *pevent, unsigned int data) }static inline unsigned long long -__data2host8 (struct tep_handle *pevent,unsigned long long data) +__tep_data2host8 (struct tep_handle *pevent,unsigned long long data) {unsigned long long swap;
@@ -533,14 +533,14 @@ __data2host8(struct tep_handle *pevent, unsigned long long data)return swap; } -#define data2host2 (pevent, ptr) __data2host2(pevent, *(unsigned short *)(ptr)) -#define data2host4 (pevent, ptr) __data2host4(pevent, *(unsigned int *)(ptr)) -#define data2host8 (pevent, ptr) \ +#define tep_data2host2 (pevent, ptr) __tep_data2host2(pevent, *(unsigned short *)(ptr)) +#define tep_data2host4 (pevent, ptr) __tep_data2host4(pevent, *(unsigned int *)(ptr)) +#define tep_data2host8 (pevent, ptr) \ ({ \ unsigned long long __val; \ \ memcpy(&__val, (ptr), sizeof(unsigned long long)); \ - __data2host8(pevent, __val); \ + __tep_data2host8(pevent, __val); \ })static inline int tep_host_bigendian (void )
lib/trace-cmd/trace-input.c +7 -7
@@ -294,7 +294,7 @@ static int read4(struct tracecmd_input *handle, unsigned int *size)if (do_read_check (handle, &data,4 ))return -1 ; - *size =__data2host4 (pevent, data); + *size =__tep_data2host4 (pevent, data);return 0 ; }
@@ -306,7 +306,7 @@ static int read8(struct tracecmd_input *handle, unsigned long long *size)if (do_read_check (handle, &data,8 ))return -1 ; - *size =__data2host8 (pevent, data); + *size =__tep_data2host8 (pevent, data);return 0 ; }
@@ -2128,7 +2128,7 @@ static int handle_options(struct tracecmd_input *handle)/* next 4 bytes is the size of the option */ if (do_read_check (handle, &size,4 ))return -1 ; - size =__data2host4 (handle->pevent, size); + size =__tep_data2host4 (handle->pevent, size); buf =malloc (size);if (!buf)return -ENOMEM ;
@@ -2184,7 +2184,7 @@ static int handle_options(struct tracecmd_input *handle)return -ENOMEM ; } offset = *(unsigned long long *)buf; - buffer->offset =__data2host8 (handle->pevent, offset); + buffer->offset =__tep_data2host8 (handle->pevent, offset);break ;case TRACECMD_OPTION_TRACECLOCK :if (!handle->ts2secs)
@@ -2200,7 +2200,7 @@ static int handle_options(struct tracecmd_input *handle)break ;case TRACECMD_OPTION_CPUCOUNT : cpus = *(int *)buf; - handle->cpus =__data2host4 (handle->pevent, cpus); + handle->cpus =__tep_data2host4 (handle->pevent, cpus);break ;default :warning ("unknown option %d" , option);
@@ -2818,7 +2818,7 @@ static int read_copy_size8(struct tracecmd_input *handle, int fd, unsigned longif (__do_write_check (fd, size,8 ))return -1 ; - *size =__data2host8 (handle->pevent, *size); + *size =__tep_data2host8 (handle->pevent, *size);return 0 ; }
@@ -2831,7 +2831,7 @@ static int read_copy_size4(struct tracecmd_input *handle, int fd, unsigned int *if (__do_write_check (fd, size,4 ))return -1 ; - *size =__data2host4 (handle->pevent, *size); + *size =__tep_data2host4 (handle->pevent, *size);return 0 ; }
lib/traceevent/event-parse.c +5 -5
@@ -3331,11 +3331,11 @@ unsigned long long tep_read_number(struct tep_handle *pevent,case 1 :return *(unsigned char *)ptr;case 2 : -return data2host2 (pevent, ptr); +return tep_data2host2 (pevent, ptr);case 4 : -return data2host4 (pevent, ptr); +return tep_data2host4 (pevent, ptr);case 8 : -return data2host8 (pevent, ptr); +return tep_data2host8 (pevent, ptr);default :/* BUG! */ return 0 ;
@@ -4061,7 +4061,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size, f =tep_find_any_field (event, arg->string.string); arg->string.offset = f->offset; } - str_offset =data2host4 (pevent, data + arg->string.offset); + str_offset =tep_data2host4 (pevent, data + arg->string.offset); str_offset &=0xffff ;print_str_to_seq (s, format, len_arg, ((char *)data) + str_offset);break ;
@@ -4079,7 +4079,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size, f =tep_find_any_field (event, arg->bitmask.bitmask); arg->bitmask.offset = f->offset; } - bitmask_offset =data2host4 (pevent, data + arg->bitmask.offset); + bitmask_offset =tep_data2host4 (pevent, data + arg->bitmask.offset); bitmask_size = bitmask_offset >>16 ; bitmask_offset &=0xffff ; print_bitmask_to_seq(pevent, s, format, len_arg,
tracecmd/trace-output.c +3 -3
@@ -85,7 +85,7 @@ static short convert_endian_2(struct tracecmd_output *handle, short val)if (!handle->pevent)return val; -return __data2host2 (handle->pevent, val); +return __tep_data2host2 (handle->pevent, val); }static int convert_endian_4 (struct tracecmd_output *handle,int val)
@@ -93,7 +93,7 @@ static int convert_endian_4(struct tracecmd_output *handle, int val)if (!handle->pevent)return val; -return __data2host4 (handle->pevent, val); +return __tep_data2host4 (handle->pevent, val); } static unsigned long long convert_endian_8(struct tracecmd_output *handle,
@@ -102,7 +102,7 @@ static unsigned long long convert_endian_8(struct tracecmd_output *handle,if (!handle->pevent)return val; -return __data2host8 (handle->pevent, val); +return __tep_data2host8 (handle->pevent, val); }void tracecmd_output_free (struct tracecmd_output *handle)
tracecmd/trace-split.c +6 -6
@@ -70,7 +70,7 @@ static int create_type_len(struct tep_handle *pevent, int time, int len)else time = (time <<5 ) | len; -return __data2host4 (pevent, time); +return __tep_data2host4 (pevent, time); } static int write_record(struct tracecmd_input *handle,
@@ -101,7 +101,7 @@ static int write_record(struct tracecmd_input *handle, *(unsigned *)ptr = time; ptr +=4 ; time = (unsigned int )(diff >>27 ); - *(unsigned *)ptr =__data2host4 (pevent, time); + *(unsigned *)ptr =__tep_data2host4 (pevent, time); cpu_data->ts = record->ts; cpu_data->index +=8 ;return 0 ;
@@ -123,7 +123,7 @@ static int write_record(struct tracecmd_input *handle,if (!len) { len = record->size +4 ; - *(unsigned *)ptr =__data2host4 (pevent, len); + *(unsigned *)ptr =__tep_data2host4 (pevent, len); ptr +=4 ; index +=4 ; }
@@ -144,10 +144,10 @@ static void write_page(struct tep_handle *pevent, {if (long_size ==8 ) *(unsigned long long *)cpu_data->commit = -__data2host8 (pevent, (unsigned long long )cpu_data->index -16 ); +__tep_data2host8 (pevent, (unsigned long long )cpu_data->index -16 );else *(unsigned int *)cpu_data->commit = -__data2host4 (pevent, cpu_data->index -12 ); +__tep_data2host4 (pevent, cpu_data->index -12 );write (cpu_data->fd, cpu_data->page, page_size); }
@@ -240,7 +240,7 @@ static int parse_cpu(struct tracecmd_input *handle, ptr = cpu_data[cpu].page; *(unsigned long long *)ptr = -__data2host8 (pevent, record->ts); +__tep_data2host8 (pevent, record->ts); cpu_data[cpu].ts = record->ts; ptr +=8 ; cpu_data[cpu].commit = ptr;
Signature · 1 line
2.17.1
PATCH 16/16 tools lib traceevent: Add prefix tep_ to enum filter_trivial_type
In reply to Tzvetomir StoyanovFrom: "Tzvetomir Stoyanov (VMware)" <[email protected]>
In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_". This adds prefix tep_ to enum filter_trivial_type and all its members.
--- include/traceevent/event-parse.h | 14 +++++++------- kernel-shark/trace-filter.c | 8 ++++---- kernel-shark/trace-graph.c | 6 +++--- kernel-shark/trace-view-store.c | 2 +- lib/traceevent/parse-filter.c | 22 +++++++++++----------- 5 files changed, 26 insertions(+), 26 deletions(-)
include/traceevent/event-parse.h +7 -7
@@ -893,10 +893,10 @@ struct tep_event_filter *tep_filter_alloc(struct tep_handle *pevent);#define FILTER_MISS TEP_ERRNO__FILTER_MISS#define FILTER_MATCH TEP_ERRNO__FILTER_MATCH -enum filter_trivial_type { -FILTER_TRIVIAL_FALSE , -FILTER_TRIVIAL_TRUE , -FILTER_TRIVIAL_BOTH , +enum tep_filter_trivial_type { +TEP_FILTER_TRIVIAL_FALSE , +TEP_FILTER_TRIVIAL_TRUE , +TEP_FILTER_TRIVIAL_BOTH , }; enum tep_errno tep_filter_add_filter_str(struct tep_event_filter *filter,
@@ -914,7 +914,7 @@ int tep_event_filtered(struct tep_event_filter *filter,void tep_filter_reset (struct tep_event_filter *filter);int tep_filter_clear_trivial (struct tep_event_filter *filter, -enum filter_trivial_type type); +enum tep_filter_trivial_type type);void tep_filter_free (struct tep_event_filter *filter);
@@ -925,12 +925,12 @@ int tep_filter_remove_event(struct tep_event_filter *filter,int tep_filter_event_has_trivial (struct tep_event_filter *filter,int event_id, -enum filter_trivial_type type); +enum tep_filter_trivial_type type);int tep_filter_copy (struct tep_event_filter *dest,struct tep_event_filter *source);int tep_update_trivial (struct tep_event_filter *dest,struct tep_event_filter *source, -enum filter_trivial_type type); +enum tep_filter_trivial_type type);int tep_filter_compare (struct tep_event_filter *filter1,struct tep_event_filter *filter2);
kernel-shark/trace-filter.c +4 -4
@@ -1127,11 +1127,11 @@ create_tree_event_model(struct tep_handle *pevent,if (active && filter) {if (tep_event_filtered (filter, event->id) && !tep_filter_event_has_trivial (filter, event->id, -FILTER_TRIVIAL_BOTH )) +TEP_FILTER_TRIVIAL_BOTH )) normal = FALSE;/* Make trivial false not selected */ else if (tep_filter_event_has_trivial (filter, event->id, -FILTER_TRIVIAL_FALSE )) +TEP_FILTER_TRIVIAL_FALSE )) active = FALSE; }gtk_tree_store_append (treestore, &iter_events, &iter_sys);
@@ -1951,7 +1951,7 @@ void trace_filter_convert_filter_to_names(struct tep_event_filter *filter, }if (tep_filter_event_has_trivial (filter, event->id, -FILTER_TRIVIAL_TRUE )) { +TEP_FILTER_TRIVIAL_TRUE )) {if (!all_selected || !systems) *event_ids =tracecmd_add_id (*event_ids, event->id, event_count++); }else {
@@ -2011,7 +2011,7 @@ void trace_filter_convert_char_to_filter(struct tep_event_filter *filter, } } -tep_update_trivial (filter, copy,FILTER_TRIVIAL_BOTH ); +tep_update_trivial (filter, copy,TEP_FILTER_TRIVIAL_BOTH );tep_filter_free (copy); }
kernel-shark/trace-graph.c +3 -3
@@ -2242,7 +2242,7 @@ void trace_graph_event_filter_callback(gboolean accept, ginfo->all_events = FALSE; -tep_filter_clear_trivial (ginfo->event_filter,FILTER_TRIVIAL_BOTH ); +tep_filter_clear_trivial (ginfo->event_filter,TEP_FILTER_TRIVIAL_BOTH );trace_filter_convert_char_to_filter (ginfo->event_filter, systems, events);
@@ -2279,7 +2279,7 @@ void trace_graph_adv_filter_callback(gboolean accept, ginfo->all_events = FALSE;tep_filter_clear_trivial (event_filter, -FILTER_TRIVIAL_BOTH ); +TEP_FILTER_TRIVIAL_BOTH ); ret =tep_filter_add_filter_str (event_filter, text);if (ret <0 ) {
@@ -2645,7 +2645,7 @@ static int load_event_filter(struct graph_info *ginfo,if (!node)return -1 ; -tep_filter_clear_trivial (event_filter,FILTER_TRIVIAL_BOTH ); +tep_filter_clear_trivial (event_filter,TEP_FILTER_TRIVIAL_BOTH ); ginfo->all_events = FALSE;trace_filter_load_events (event_filter, handle, node);
kernel-shark/trace-view-store.c +1 -1
@@ -512,7 +512,7 @@ void trace_view_store_clear_all_events_enabled(TraceViewStore *store) {g_return_if_fail (TRACE_VIEW_IS_LIST (store)); -tep_filter_clear_trivial (store->event_filter,FILTER_TRIVIAL_BOTH ); +tep_filter_clear_trivial (store->event_filter,TEP_FILTER_TRIVIAL_BOTH ); store->all_events =0 ; }
lib/traceevent/parse-filter.c +11 -11
@@ -1534,7 +1534,7 @@ int tep_filter_copy(struct tep_event_filter *dest, struct tep_event_filter *sour* events may have still been updated on error. */ int tep_update_trivial (struct tep_event_filter *dest,struct tep_event_filter *source, -enum filter_trivial_type type) +enum tep_filter_trivial_type type) {struct tep_handle *src_pevent;struct tep_handle *dest_pevent;
@@ -1556,8 +1556,8 @@ int tep_update_trivial(struct tep_event_filter *dest, struct tep_event_filter *s arg = filter_type->filter;if (arg->type !=TEP_FILTER_ARG_BOOLEAN )continue ; -if ((arg->boolean.value && type ==FILTER_TRIVIAL_FALSE ) || - (!arg->boolean.value && type ==FILTER_TRIVIAL_TRUE )) +if ((arg->boolean.value && type ==TEP_FILTER_TRIVIAL_FALSE ) || + (!arg->boolean.value && type ==TEP_FILTER_TRIVIAL_TRUE ))continue ; event = filter_type->event;
@@ -1593,7 +1593,7 @@ int tep_update_trivial(struct tep_event_filter *dest, struct tep_event_filter *s* Returns 0 on success and -1 if there was a problem. */ int tep_filter_clear_trivial (struct tep_event_filter *filter, -enum filter_trivial_type type) +enum tep_filter_trivial_type type) {struct tep_filter_type *filter_type;int count =0 ;
@@ -1614,11 +1614,11 @@ int tep_filter_clear_trivial(struct tep_event_filter *filter,if (filter_type->filter->type !=TEP_FILTER_ARG_BOOLEAN )continue ;switch (type) { -case FILTER_TRIVIAL_FALSE : +case TEP_FILTER_TRIVIAL_FALSE :if (filter_type->filter->boolean.value)continue ;break ; -case FILTER_TRIVIAL_TRUE : +case TEP_FILTER_TRIVIAL_TRUE :if (!filter_type->filter->boolean.value)continue ;default :
@@ -1656,7 +1656,7 @@ int tep_filter_clear_trivial(struct tep_event_filter *filter,*/ int tep_filter_event_has_trivial (struct tep_event_filter *filter,int event_id, -enum filter_trivial_type type) +enum tep_filter_trivial_type type) {struct tep_filter_type *filter_type;
@@ -1672,10 +1672,10 @@ int tep_filter_event_has_trivial(struct tep_event_filter *filter,return 0 ;switch (type) { -case FILTER_TRIVIAL_FALSE : +case TEP_FILTER_TRIVIAL_FALSE :return !filter_type->filter->boolean.value; -case FILTER_TRIVIAL_TRUE : +case TEP_FILTER_TRIVIAL_TRUE :return filter_type->filter->boolean.value;default :return 1 ;
@@ -2409,8 +2409,8 @@ int tep_filter_compare(struct tep_event_filter *filter1, struct tep_event_filterif (filter_type1->filter->type != filter_type2->filter->type)break ;switch (filter_type1->filter->type) { -case FILTER_TRIVIAL_FALSE : -case FILTER_TRIVIAL_TRUE : +case TEP_FILTER_TRIVIAL_FALSE : +case TEP_FILTER_TRIVIAL_TRUE :/* trivial types just need the type compared */ continue ;default :
Signature · 1 line
2.17.1