Commit 096177a8 authored by Tzvetomir Stoyanov (VMware)'s avatar Tzvetomir Stoyanov (VMware) Committed by Arnaldo Carvalho de Melo

tools lib traceevent, perf tools: Rename struct pevent to struct tep_handle

In order to make libtraceevent into a proper library, variables, data
structures and functions require a unique prefix to prevent name space
conflicts. That prefix will be "tep_" and not "pevent_". This changes
the struct pevent to struct tep_handle.
Signed-off-by: default avatarTzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
Cc: linux-trace-devel@vger.kernel.org
Link: http://lkml.kernel.org/r/20180808180659.706175783@goodmis.orgSigned-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 354b064b
This diff is collapsed.
This diff is collapsed.
......@@ -281,7 +281,7 @@ void traceevent_print_plugins(struct trace_seq *s,
}
static void
load_plugin(struct pevent *pevent, const char *path,
load_plugin(struct tep_handle *pevent, const char *path,
const char *file, void *data)
{
struct plugin_list **plugin_list = data;
......@@ -336,9 +336,9 @@ load_plugin(struct pevent *pevent, const char *path,
}
static void
load_plugins_dir(struct pevent *pevent, const char *suffix,
load_plugins_dir(struct tep_handle *pevent, const char *suffix,
const char *path,
void (*load_plugin)(struct pevent *pevent,
void (*load_plugin)(struct tep_handle *pevent,
const char *path,
const char *name,
void *data),
......@@ -378,8 +378,8 @@ load_plugins_dir(struct pevent *pevent, const char *suffix,
}
static void
load_plugins(struct pevent *pevent, const char *suffix,
void (*load_plugin)(struct pevent *pevent,
load_plugins(struct tep_handle *pevent, const char *suffix,
void (*load_plugin)(struct tep_handle *pevent,
const char *path,
const char *name,
void *data),
......@@ -431,7 +431,7 @@ load_plugins(struct pevent *pevent, const char *suffix,
}
struct plugin_list*
traceevent_load_plugins(struct pevent *pevent)
traceevent_load_plugins(struct tep_handle *pevent)
{
struct plugin_list *list = NULL;
......@@ -440,7 +440,7 @@ traceevent_load_plugins(struct pevent *pevent)
}
void
traceevent_unload_plugins(struct plugin_list *plugin_list, struct pevent *pevent)
traceevent_unload_plugins(struct plugin_list *plugin_list, struct tep_handle *pevent)
{
pevent_plugin_unload_func func;
struct plugin_list *list;
......
......@@ -179,7 +179,7 @@ add_filter_type(struct event_filter *filter, int id)
* pevent_filter_alloc - create a new event filter
* @pevent: The pevent that this filter is associated with
*/
struct event_filter *pevent_filter_alloc(struct pevent *pevent)
struct event_filter *pevent_filter_alloc(struct tep_handle *pevent)
{
struct event_filter *filter;
......@@ -269,7 +269,7 @@ static int event_match(struct event_format *event,
}
static enum pevent_errno
find_event(struct pevent *pevent, struct event_list **events,
find_event(struct tep_handle *pevent, struct event_list **events,
char *sys_name, char *event_name)
{
struct event_format *event;
......@@ -1270,7 +1270,7 @@ static void filter_init_error_buf(struct event_filter *filter)
enum pevent_errno pevent_filter_add_filter_str(struct event_filter *filter,
const char *filter_str)
{
struct pevent *pevent = filter->pevent;
struct tep_handle *pevent = filter->pevent;
struct event_list *event;
struct event_list *events = NULL;
const char *filter_start;
......@@ -1550,8 +1550,8 @@ int pevent_filter_copy(struct event_filter *dest, struct event_filter *source)
int pevent_update_trivial(struct event_filter *dest, struct event_filter *source,
enum filter_trivial_type type)
{
struct pevent *src_pevent;
struct pevent *dest_pevent;
struct tep_handle *src_pevent;
struct tep_handle *dest_pevent;
struct event_format *event;
struct filter_type *filter_type;
struct filter_arg *arg;
......@@ -1874,7 +1874,7 @@ static int test_num(struct event_format *event, struct filter_arg *arg,
static const char *get_field_str(struct filter_arg *arg, struct pevent_record *record)
{
struct event_format *event;
struct pevent *pevent;
struct tep_handle *pevent;
unsigned long long addr;
const char *val = NULL;
unsigned int size;
......@@ -2049,7 +2049,7 @@ int pevent_event_filtered(struct event_filter *filter, int event_id)
enum pevent_errno pevent_filter_match(struct event_filter *filter,
struct pevent_record *record)
{
struct pevent *pevent = filter->pevent;
struct tep_handle *pevent = filter->pevent;
struct filter_type *filter_type;
int event_id;
int ret;
......
......@@ -25,7 +25,7 @@ process___le16_to_cpup(struct trace_seq *s, unsigned long long *args)
return val ? (long long) le16toh(*val) : 0;
}
int PEVENT_PLUGIN_LOADER(struct pevent *pevent)
int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent)
{
pevent_register_print_function(pevent,
process___le16_to_cpup,
......@@ -36,7 +36,7 @@ int PEVENT_PLUGIN_LOADER(struct pevent *pevent)
return 0;
}
void PEVENT_PLUGIN_UNLOADER(struct pevent *pevent)
void PEVENT_PLUGIN_UNLOADER(struct tep_handle *pevent)
{
pevent_unregister_print_function(pevent, process___le16_to_cpup,
"__le16_to_cpup");
......
......@@ -125,7 +125,7 @@ static int add_and_get_index(const char *parent, const char *child, int cpu)
static int function_handler(struct trace_seq *s, struct pevent_record *record,
struct event_format *event, void *context)
{
struct pevent *pevent = event->pevent;
struct tep_handle *pevent = event->pevent;
unsigned long long function;
unsigned long long pfunction;
const char *func;
......@@ -163,7 +163,7 @@ static int function_handler(struct trace_seq *s, struct pevent_record *record,
return 0;
}
int PEVENT_PLUGIN_LOADER(struct pevent *pevent)
int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent)
{
pevent_register_event_handler(pevent, -1, "ftrace", "function",
function_handler, NULL);
......@@ -173,7 +173,7 @@ int PEVENT_PLUGIN_LOADER(struct pevent *pevent)
return 0;
}
void PEVENT_PLUGIN_UNLOADER(struct pevent *pevent)
void PEVENT_PLUGIN_UNLOADER(struct tep_handle *pevent)
{
int i, x;
......
......@@ -66,7 +66,7 @@ static int timer_start_handler(struct trace_seq *s,
return 0;
}
int PEVENT_PLUGIN_LOADER(struct pevent *pevent)
int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent)
{
pevent_register_event_handler(pevent, -1,
"timer", "hrtimer_expire_entry",
......@@ -77,7 +77,7 @@ int PEVENT_PLUGIN_LOADER(struct pevent *pevent)
return 0;
}
void PEVENT_PLUGIN_UNLOADER(struct pevent *pevent)
void PEVENT_PLUGIN_UNLOADER(struct tep_handle *pevent)
{
pevent_unregister_event_handler(pevent, -1,
"timer", "hrtimer_expire_entry",
......
......@@ -47,7 +47,7 @@ process_jiffies_to_msecs(struct trace_seq *s, unsigned long long *args)
return jiffies;
}
int PEVENT_PLUGIN_LOADER(struct pevent *pevent)
int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent)
{
pevent_register_print_function(pevent,
process_jbd2_dev_to_name,
......@@ -65,7 +65,7 @@ int PEVENT_PLUGIN_LOADER(struct pevent *pevent)
return 0;
}
void PEVENT_PLUGIN_UNLOADER(struct pevent *pevent)
void PEVENT_PLUGIN_UNLOADER(struct tep_handle *pevent)
{
pevent_unregister_print_function(pevent, process_jbd2_dev_to_name,
"jbd2_dev_to_name");
......
......@@ -48,7 +48,7 @@ static int call_site_handler(struct trace_seq *s, struct pevent_record *record,
return 1;
}
int PEVENT_PLUGIN_LOADER(struct pevent *pevent)
int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent)
{
pevent_register_event_handler(pevent, -1, "kmem", "kfree",
call_site_handler, NULL);
......@@ -71,7 +71,7 @@ int PEVENT_PLUGIN_LOADER(struct pevent *pevent)
return 0;
}
void PEVENT_PLUGIN_UNLOADER(struct pevent *pevent)
void PEVENT_PLUGIN_UNLOADER(struct tep_handle *pevent)
{
pevent_unregister_event_handler(pevent, -1, "kmem", "kfree",
call_site_handler, NULL);
......
......@@ -444,7 +444,7 @@ process_is_writable_pte(struct trace_seq *s, unsigned long long *args)
return pte & PT_WRITABLE_MASK;
}
int PEVENT_PLUGIN_LOADER(struct pevent *pevent)
int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent)
{
init_disassembler();
......@@ -486,7 +486,7 @@ int PEVENT_PLUGIN_LOADER(struct pevent *pevent)
return 0;
}
void PEVENT_PLUGIN_UNLOADER(struct pevent *pevent)
void PEVENT_PLUGIN_UNLOADER(struct tep_handle *pevent)
{
pevent_unregister_event_handler(pevent, -1, "kvm", "kvm_exit",
kvm_exit_handler, NULL);
......
......@@ -86,7 +86,7 @@ static int drv_bss_info_changed(struct trace_seq *s,
return 0;
}
int PEVENT_PLUGIN_LOADER(struct pevent *pevent)
int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent)
{
pevent_register_event_handler(pevent, -1, "mac80211",
"drv_bss_info_changed",
......@@ -94,7 +94,7 @@ int PEVENT_PLUGIN_LOADER(struct pevent *pevent)
return 0;
}
void PEVENT_PLUGIN_UNLOADER(struct pevent *pevent)
void PEVENT_PLUGIN_UNLOADER(struct tep_handle *pevent)
{
pevent_unregister_event_handler(pevent, -1, "mac80211",
"drv_bss_info_changed",
......
......@@ -134,7 +134,7 @@ static int sched_switch_handler(struct trace_seq *s,
return 0;
}
int PEVENT_PLUGIN_LOADER(struct pevent *pevent)
int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent)
{
pevent_register_event_handler(pevent, -1, "sched", "sched_switch",
sched_switch_handler, NULL);
......@@ -147,7 +147,7 @@ int PEVENT_PLUGIN_LOADER(struct pevent *pevent)
return 0;
}
void PEVENT_PLUGIN_UNLOADER(struct pevent *pevent)
void PEVENT_PLUGIN_UNLOADER(struct tep_handle *pevent)
{
pevent_unregister_event_handler(pevent, -1, "sched", "sched_switch",
sched_switch_handler, NULL);
......
......@@ -413,7 +413,7 @@ unsigned long long process_scsi_trace_parse_cdb(struct trace_seq *s,
return 0;
}
int PEVENT_PLUGIN_LOADER(struct pevent *pevent)
int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent)
{
pevent_register_print_function(pevent,
process_scsi_trace_parse_cdb,
......@@ -426,7 +426,7 @@ int PEVENT_PLUGIN_LOADER(struct pevent *pevent)
return 0;
}
void PEVENT_PLUGIN_UNLOADER(struct pevent *pevent)
void PEVENT_PLUGIN_UNLOADER(struct tep_handle *pevent)
{
pevent_unregister_print_function(pevent, process_scsi_trace_parse_cdb,
"scsi_trace_parse_cdb");
......
......@@ -119,7 +119,7 @@ unsigned long long process_xen_hypercall_name(struct trace_seq *s,
return 0;
}
int PEVENT_PLUGIN_LOADER(struct pevent *pevent)
int PEVENT_PLUGIN_LOADER(struct tep_handle *pevent)
{
pevent_register_print_function(pevent,
process_xen_hypercall_name,
......@@ -130,7 +130,7 @@ int PEVENT_PLUGIN_LOADER(struct pevent *pevent)
return 0;
}
void PEVENT_PLUGIN_UNLOADER(struct pevent *pevent)
void PEVENT_PLUGIN_UNLOADER(struct tep_handle *pevent)
{
pevent_unregister_print_function(pevent, process_xen_hypercall_name,
"xen_hypercall_name");
......
......@@ -3204,7 +3204,7 @@ static int read_attr(int fd, struct perf_header *ph,
}
static int perf_evsel__prepare_tracepoint_event(struct perf_evsel *evsel,
struct pevent *pevent)
struct tep_handle *pevent)
{
struct event_format *event;
char bf[128];
......@@ -3236,7 +3236,7 @@ static int perf_evsel__prepare_tracepoint_event(struct perf_evsel *evsel,
}
static int perf_evlist__prepare_tracepoint_events(struct perf_evlist *evlist,
struct pevent *pevent)
struct tep_handle *pevent)
{
struct perf_evsel *pos;
......
......@@ -341,7 +341,7 @@ static bool is_tracepoint(struct pyrf_event *pevent)
static PyObject*
tracepoint_field(struct pyrf_event *pe, struct format_field *field)
{
struct pevent *pevent = field->event->pevent;
struct tep_handle *pevent = field->event->pevent;
void *data = pe->sample.raw_data;
PyObject *ret = NULL;
unsigned long long val;
......
......@@ -535,7 +535,7 @@ static int perl_stop_script(void)
return 0;
}
static int perl_generate_script(struct pevent *pevent, const char *outfile)
static int perl_generate_script(struct tep_handle *pevent, const char *outfile)
{
struct event_format *event = NULL;
struct format_field *f;
......
......@@ -1588,7 +1588,7 @@ static int python_stop_script(void)
return 0;
}
static int python_generate_script(struct pevent *pevent, const char *outfile)
static int python_generate_script(struct tep_handle *pevent, const char *outfile)
{
struct event_format *event = NULL;
struct format_field *f;
......
......@@ -276,7 +276,7 @@ extern struct sort_entry sort_thread;
extern struct list_head hist_entry__sort_list;
struct perf_evlist;
struct pevent;
struct tep_handle;
int setup_sorting(struct perf_evlist *evlist);
int setup_output_field(void);
void reset_output_field(void);
......
......@@ -32,7 +32,7 @@
static int get_common_field(struct scripting_context *context,
int *offset, int *size, const char *type)
{
struct pevent *pevent = context->pevent;
struct tep_handle *pevent = context->pevent;
struct event_format *event;
struct format_field *field;
......@@ -136,7 +136,7 @@ void event_format__print(struct event_format *event,
return event_format__fprintf(event, cpu, data, size, stdout);
}
void parse_ftrace_printk(struct pevent *pevent,
void parse_ftrace_printk(struct tep_handle *pevent,
char *file, unsigned int size __maybe_unused)
{
unsigned long long addr;
......@@ -161,7 +161,7 @@ void parse_ftrace_printk(struct pevent *pevent,
}
}
void parse_saved_cmdline(struct pevent *pevent,
void parse_saved_cmdline(struct tep_handle *pevent,
char *file, unsigned int size __maybe_unused)
{
char *comm;
......@@ -178,18 +178,18 @@ void parse_saved_cmdline(struct pevent *pevent,
}
}
int parse_ftrace_file(struct pevent *pevent, char *buf, unsigned long size)
int parse_ftrace_file(struct tep_handle *pevent, char *buf, unsigned long size)
{
return pevent_parse_event(pevent, buf, size, "ftrace");
}
int parse_event_file(struct pevent *pevent,
int parse_event_file(struct tep_handle *pevent,
char *buf, unsigned long size, char *sys)
{
return pevent_parse_event(pevent, buf, size, sys);
}
struct event_format *trace_find_next_event(struct pevent *pevent,
struct event_format *trace_find_next_event(struct tep_handle *pevent,
struct event_format *event)
{
static int idx;
......
......@@ -96,7 +96,7 @@ static void skip(int size)
};
}
static unsigned int read4(struct pevent *pevent)
static unsigned int read4(struct tep_handle *pevent)
{
unsigned int data;
......@@ -105,7 +105,7 @@ static unsigned int read4(struct pevent *pevent)
return __data2host4(pevent, data);
}
static unsigned long long read8(struct pevent *pevent)
static unsigned long long read8(struct tep_handle *pevent)
{
unsigned long long data;
......@@ -158,7 +158,7 @@ static char *read_string(void)
return str;
}
static int read_proc_kallsyms(struct pevent *pevent)
static int read_proc_kallsyms(struct tep_handle *pevent)
{
unsigned int size;
......@@ -181,7 +181,7 @@ static int read_proc_kallsyms(struct pevent *pevent)
return 0;
}
static int read_ftrace_printk(struct pevent *pevent)
static int read_ftrace_printk(struct tep_handle *pevent)
{
unsigned int size;
char *buf;
......@@ -208,7 +208,7 @@ static int read_ftrace_printk(struct pevent *pevent)
return 0;
}
static int read_header_files(struct pevent *pevent)
static int read_header_files(struct tep_handle *pevent)
{
unsigned long long size;
char *header_page;
......@@ -259,7 +259,7 @@ static int read_header_files(struct pevent *pevent)
return ret;
}
static int read_ftrace_file(struct pevent *pevent, unsigned long long size)
static int read_ftrace_file(struct tep_handle *pevent, unsigned long long size)
{
int ret;
char *buf;
......@@ -284,7 +284,7 @@ static int read_ftrace_file(struct pevent *pevent, unsigned long long size)
return ret;
}
static int read_event_file(struct pevent *pevent, char *sys,
static int read_event_file(struct tep_handle *pevent, char *sys,
unsigned long long size)
{
int ret;
......@@ -310,7 +310,7 @@ static int read_event_file(struct pevent *pevent, char *sys,
return ret;
}
static int read_ftrace_files(struct pevent *pevent)
static int read_ftrace_files(struct tep_handle *pevent)
{
unsigned long long size;
int count;
......@@ -328,7 +328,7 @@ static int read_ftrace_files(struct pevent *pevent)
return 0;
}
static int read_event_files(struct pevent *pevent)
static int read_event_files(struct tep_handle *pevent)
{
unsigned long long size;
char *sys;
......@@ -356,7 +356,7 @@ static int read_event_files(struct pevent *pevent)
return 0;
}
static int read_saved_cmdline(struct pevent *pevent)
static int read_saved_cmdline(struct tep_handle *pevent)
{
unsigned long long size;
char *buf;
......@@ -399,7 +399,7 @@ ssize_t trace_report(int fd, struct trace_event *tevent, bool __repipe)
int host_bigendian;
int file_long_size;
int file_page_size;
struct pevent *pevent = NULL;
struct tep_handle *pevent = NULL;
int err;
repipe = __repipe;
......
......@@ -66,7 +66,7 @@ static int python_start_script_unsupported(const char *script __maybe_unused,
return -1;
}
static int python_generate_script_unsupported(struct pevent *pevent
static int python_generate_script_unsupported(struct tep_handle *pevent
__maybe_unused,
const char *outfile
__maybe_unused)
......@@ -130,7 +130,7 @@ static int perl_start_script_unsupported(const char *script __maybe_unused,
return -1;
}
static int perl_generate_script_unsupported(struct pevent *pevent
static int perl_generate_script_unsupported(struct tep_handle *pevent
__maybe_unused,
const char *outfile __maybe_unused)
{
......
......@@ -28,7 +28,7 @@ static bool tevent_initialized;
int trace_event__init(struct trace_event *t)
{
struct pevent *pevent = pevent_alloc();
struct tep_handle *pevent = pevent_alloc();
if (pevent) {
t->plugin_list = traceevent_load_plugins(pevent);
......@@ -41,7 +41,7 @@ int trace_event__init(struct trace_event *t)
static int trace_event__init2(void)
{
int be = traceevent_host_bigendian();
struct pevent *pevent;
struct tep_handle *pevent;
if (trace_event__init(&tevent))
return -1;
......@@ -76,7 +76,7 @@ static struct event_format*
tp_format(const char *sys, const char *name)
{
char *tp_dir = get_events_file(sys);
struct pevent *pevent = tevent.pevent;
struct tep_handle *pevent = tevent.pevent;
struct event_format *event = NULL;
char path[PATH_MAX];
size_t size;
......
......@@ -13,7 +13,7 @@ struct thread;
struct plugin_list;
struct trace_event {
struct pevent *pevent;
struct tep_handle *pevent;
struct plugin_list *plugin_list;
};
......@@ -34,20 +34,20 @@ void event_format__fprintf(struct event_format *event,
void event_format__print(struct event_format *event,
int cpu, void *data, int size);
int parse_ftrace_file(struct pevent *pevent, char *buf, unsigned long size);
int parse_event_file(struct pevent *pevent,
int parse_ftrace_file(struct tep_handle *pevent, char *buf, unsigned long size);
int parse_event_file(struct tep_handle *pevent,
char *buf, unsigned long size, char *sys);
unsigned long long
raw_field_value(struct event_format *event, const char *name, void *data);
void parse_proc_kallsyms(struct pevent *pevent, char *file, unsigned int size);
void parse_ftrace_printk(struct pevent *pevent, char *file, unsigned int size);
void parse_saved_cmdline(struct pevent *pevent, char *file, unsigned int size);
void parse_proc_kallsyms(struct tep_handle *pevent, char *file, unsigned int size);
void parse_ftrace_printk(struct tep_handle *pevent, char *file, unsigned int size);
void parse_saved_cmdline(struct tep_handle *pevent, char *file, unsigned int size);
ssize_t trace_report(int fd, struct trace_event *tevent, bool repipe);
struct event_format *trace_find_next_event(struct pevent *pevent,
struct event_format *trace_find_next_event(struct tep_handle *pevent,
struct event_format *event);
unsigned long long read_size(struct event_format *event, void *ptr, int size);
unsigned long long eval_flag(const char *flag);
......@@ -83,7 +83,7 @@ struct scripting_ops {
void (*process_stat)(struct perf_stat_config *config,
struct perf_evsel *evsel, u64 tstamp);
void (*process_stat_interval)(u64 tstamp);
int (*generate_script) (struct pevent *pevent, const char *outfile);
int (*generate_script) (struct tep_handle *pevent, const char *outfile);
};
extern unsigned int scripting_max_stack;
......@@ -94,7 +94,7 @@ void setup_perl_scripting(void);
void setup_python_scripting(void);
struct scripting_context {
struct pevent *pevent;
struct tep_handle *pevent;
void *event_data;
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment