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

tools lib traceevent, perf tools: Rename pevent find APIs

In order to make libtraceevent into a proper library, variables, data
structures and functions require a unique prefix to prevent name space
conflicts. That prefix will be "tep_" and not "pevent_". This changes
APIs: pevent_find_any_field, pevent_find_common_field,
pevent_find_event, pevent_find_field
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/20180808180700.316995920@goodmis.orgSigned-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 4d5c58b1
This diff is collapsed.
...@@ -686,9 +686,9 @@ int pevent_register_print_function(struct tep_handle *pevent, ...@@ -686,9 +686,9 @@ int pevent_register_print_function(struct tep_handle *pevent,
int pevent_unregister_print_function(struct tep_handle *pevent, int pevent_unregister_print_function(struct tep_handle *pevent,
pevent_func_handler func, char *name); pevent_func_handler func, char *name);
struct format_field *pevent_find_common_field(struct event_format *event, const char *name); struct format_field *tep_find_common_field(struct event_format *event, const char *name);
struct format_field *pevent_find_field(struct event_format *event, const char *name); struct format_field *tep_find_field(struct event_format *event, const char *name);
struct format_field *pevent_find_any_field(struct event_format *event, const char *name); struct format_field *tep_find_any_field(struct event_format *event, const char *name);
const char *pevent_find_function(struct tep_handle *pevent, unsigned long long addr); const char *pevent_find_function(struct tep_handle *pevent, unsigned long long addr);
unsigned long long unsigned long long
...@@ -697,7 +697,7 @@ unsigned long long pevent_read_number(struct tep_handle *pevent, const void *ptr ...@@ -697,7 +697,7 @@ unsigned long long pevent_read_number(struct tep_handle *pevent, const void *ptr
int pevent_read_number_field(struct format_field *field, const void *data, int pevent_read_number_field(struct format_field *field, const void *data,
unsigned long long *value); unsigned long long *value);
struct event_format *pevent_find_event(struct tep_handle *pevent, int id); struct event_format *tep_find_event(struct tep_handle *pevent, int id);
struct event_format * struct event_format *
pevent_find_event_by_name(struct tep_handle *pevent, const char *sys, const char *name); pevent_find_event_by_name(struct tep_handle *pevent, const char *sys, const char *name);
......
...@@ -167,7 +167,7 @@ add_filter_type(struct event_filter *filter, int id) ...@@ -167,7 +167,7 @@ add_filter_type(struct event_filter *filter, int id)
filter_type = &filter->event_filters[i]; filter_type = &filter->event_filters[i];
filter_type->event_id = id; filter_type->event_id = id;
filter_type->event = pevent_find_event(filter->pevent, id); filter_type->event = tep_find_event(filter->pevent, id);
filter_type->filter = NULL; filter_type->filter = NULL;
filter->filters++; filter->filters++;
...@@ -382,7 +382,7 @@ create_arg_item(struct event_format *event, const char *token, ...@@ -382,7 +382,7 @@ create_arg_item(struct event_format *event, const char *token,
break; break;
} }
/* Consider this a field */ /* Consider this a field */
field = pevent_find_any_field(event, token); field = tep_find_any_field(event, token);
if (!field) { if (!field) {
/* If token is 'COMM' or 'CPU' then it is special */ /* If token is 'COMM' or 'CPU' then it is special */
if (strcmp(token, COMM) == 0) { if (strcmp(token, COMM) == 0) {
......
...@@ -31,7 +31,7 @@ static int call_site_handler(struct trace_seq *s, struct tep_record *record, ...@@ -31,7 +31,7 @@ static int call_site_handler(struct trace_seq *s, struct tep_record *record,
void *data = record->data; void *data = record->data;
const char *func; const char *func;
field = pevent_find_field(event, "call_site"); field = tep_find_field(event, "call_site");
if (!field) if (!field)
return 1; return 1;
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
static void print_string(struct trace_seq *s, struct event_format *event, static void print_string(struct trace_seq *s, struct event_format *event,
const char *name, const void *data) const char *name, const void *data)
{ {
struct format_field *f = pevent_find_field(event, name); struct format_field *f = tep_find_field(event, name);
int offset; int offset;
int length; int length;
......
...@@ -74,7 +74,7 @@ static int sched_wakeup_handler(struct trace_seq *s, ...@@ -74,7 +74,7 @@ static int sched_wakeup_handler(struct trace_seq *s,
if (pevent_get_field_val(s, event, "pid", record, &val, 1)) if (pevent_get_field_val(s, event, "pid", record, &val, 1))
return trace_seq_putc(s, '!'); return trace_seq_putc(s, '!');
field = pevent_find_any_field(event, "comm"); field = tep_find_any_field(event, "comm");
if (field) { if (field) {
write_and_save_comm(field, record, s, val); write_and_save_comm(field, record, s, val);
trace_seq_putc(s, ':'); trace_seq_putc(s, ':');
...@@ -103,7 +103,7 @@ static int sched_switch_handler(struct trace_seq *s, ...@@ -103,7 +103,7 @@ static int sched_switch_handler(struct trace_seq *s,
if (pevent_get_field_val(s, event, "prev_pid", record, &val, 1)) if (pevent_get_field_val(s, event, "prev_pid", record, &val, 1))
return trace_seq_putc(s, '!'); return trace_seq_putc(s, '!');
field = pevent_find_any_field(event, "prev_comm"); field = tep_find_any_field(event, "prev_comm");
if (field) { if (field) {
write_and_save_comm(field, record, s, val); write_and_save_comm(field, record, s, val);
trace_seq_putc(s, ':'); trace_seq_putc(s, ':');
...@@ -121,7 +121,7 @@ static int sched_switch_handler(struct trace_seq *s, ...@@ -121,7 +121,7 @@ static int sched_switch_handler(struct trace_seq *s,
if (pevent_get_field_val(s, event, "next_pid", record, &val, 1)) if (pevent_get_field_val(s, event, "next_pid", record, &val, 1))
return trace_seq_putc(s, '!'); return trace_seq_putc(s, '!');
field = pevent_find_any_field(event, "next_comm"); field = tep_find_any_field(event, "next_comm");
if (field) { if (field) {
write_and_save_comm(field, record, s, val); write_and_save_comm(field, record, s, val);
trace_seq_putc(s, ':'); trace_seq_putc(s, ':');
......
...@@ -2683,7 +2683,7 @@ int perf_event__synthesize_sample(union perf_event *event, u64 type, ...@@ -2683,7 +2683,7 @@ int perf_event__synthesize_sample(union perf_event *event, u64 type,
struct format_field *perf_evsel__field(struct perf_evsel *evsel, const char *name) struct format_field *perf_evsel__field(struct perf_evsel *evsel, const char *name)
{ {
return pevent_find_field(evsel->tp_format, name); return tep_find_field(evsel->tp_format, name);
} }
void *perf_evsel__rawptr(struct perf_evsel *evsel, struct perf_sample *sample, void *perf_evsel__rawptr(struct perf_evsel *evsel, struct perf_sample *sample,
......
...@@ -3218,7 +3218,7 @@ static int perf_evsel__prepare_tracepoint_event(struct perf_evsel *evsel, ...@@ -3218,7 +3218,7 @@ static int perf_evsel__prepare_tracepoint_event(struct perf_evsel *evsel,
return -1; return -1;
} }
event = pevent_find_event(pevent, evsel->attr.config); event = tep_find_event(pevent, evsel->attr.config);
if (event == NULL) { if (event == NULL) {
pr_debug("cannot find event format for %d\n", (int)evsel->attr.config); pr_debug("cannot find event format for %d\n", (int)evsel->attr.config);
return -1; return -1;
......
...@@ -394,7 +394,7 @@ get_tracepoint_field(struct pyrf_event *pevent, PyObject *attr_name) ...@@ -394,7 +394,7 @@ get_tracepoint_field(struct pyrf_event *pevent, PyObject *attr_name)
evsel->tp_format = tp_format; evsel->tp_format = tp_format;
} }
field = pevent_find_any_field(evsel->tp_format, str); field = tep_find_any_field(evsel->tp_format, str);
if (!field) if (!field)
return NULL; return NULL;
......
...@@ -2311,7 +2311,7 @@ static int add_all_matching_fields(struct perf_evlist *evlist, ...@@ -2311,7 +2311,7 @@ static int add_all_matching_fields(struct perf_evlist *evlist,
if (evsel->attr.type != PERF_TYPE_TRACEPOINT) if (evsel->attr.type != PERF_TYPE_TRACEPOINT)
continue; continue;
field = pevent_find_any_field(evsel->tp_format, field_name); field = tep_find_any_field(evsel->tp_format, field_name);
if (field == NULL) if (field == NULL)
continue; continue;
...@@ -2378,7 +2378,7 @@ static int add_dynamic_entry(struct perf_evlist *evlist, const char *tok, ...@@ -2378,7 +2378,7 @@ static int add_dynamic_entry(struct perf_evlist *evlist, const char *tok,
if (!strcmp(field_name, "*")) { if (!strcmp(field_name, "*")) {
ret = add_evsel_fields(evsel, raw_trace, level); ret = add_evsel_fields(evsel, raw_trace, level);
} else { } else {
field = pevent_find_any_field(evsel->tp_format, field_name); field = tep_find_any_field(evsel->tp_format, field_name);
if (field == NULL) { if (field == NULL) {
pr_debug("Cannot find event field for %s.%s\n", pr_debug("Cannot find event field for %s.%s\n",
event_name, field_name); event_name, field_name);
......
...@@ -41,7 +41,7 @@ static int get_common_field(struct scripting_context *context, ...@@ -41,7 +41,7 @@ static int get_common_field(struct scripting_context *context,
return 0; return 0;
event = pevent->events[0]; event = pevent->events[0];
field = pevent_find_common_field(event, type); field = tep_find_common_field(event, type);
if (!field) if (!field)
return 0; return 0;
*offset = field->offset; *offset = field->offset;
...@@ -99,7 +99,7 @@ raw_field_value(struct event_format *event, const char *name, void *data) ...@@ -99,7 +99,7 @@ raw_field_value(struct event_format *event, const char *name, void *data)
struct format_field *field; struct format_field *field;
unsigned long long val; unsigned long long val;
field = pevent_find_any_field(event, name); field = tep_find_any_field(event, name);
if (!field) if (!field)
return 0ULL; return 0ULL;
......
...@@ -116,5 +116,5 @@ struct event_format *trace_event__tp_format_id(int id) ...@@ -116,5 +116,5 @@ struct event_format *trace_event__tp_format_id(int id)
if (!tevent_initialized && trace_event__init2()) if (!tevent_initialized && trace_event__init2())
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
return pevent_find_event(tevent.pevent, id); return tep_find_event(tevent.pevent, id);
} }
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