aboutsummaryrefslogtreecommitdiffstats
path: root/tracecmd
diff options
context:
space:
mode:
authorTzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>2018-08-27 11:17:40 +0300
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2018-08-28 18:06:55 -0400
commit3948b692b8aacf5180ffadd3b65760e53af000f5 (patch)
tree5df5dcbe9a413f19af561a7bf59c444871f362d3 /tracecmd
parent307055f6e2679b1373fe45662bdab1ff878efc64 (diff)
downloadtrace-cmd-3948b692b8aacf5180ffadd3b65760e53af000f5.tar.gz
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: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Yordan Karadzhov (VMware) <y.karadz@gmail.com> Cc: linux-trace-devel@vger.kernel.org Link: http://lkml.kernel.org/r/20180808180700.316995920@goodmis.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'tracecmd')
-rw-r--r--tracecmd/trace-hist.c40
-rw-r--r--tracecmd/trace-mem.c38
-rw-r--r--tracecmd/trace-profile.c24
-rw-r--r--tracecmd/trace-read.c12
-rw-r--r--tracecmd/trace-record.c2
5 files changed, 58 insertions, 58 deletions
diff --git a/tracecmd/trace-hist.c b/tracecmd/trace-hist.c
index b8ff77d7..d2adda92 100644
--- a/tracecmd/trace-hist.c
+++ b/tracecmd/trace-hist.c
@@ -615,8 +615,8 @@ static void update_sched_wakeup(struct tep_handle *pevent)
if (!event)
return;
- sched_wakeup_comm_field = pevent_find_field(event, "comm");
- sched_wakeup_pid_field = pevent_find_field(event, "pid");
+ sched_wakeup_comm_field = tep_find_field(event, "comm");
+ sched_wakeup_pid_field = tep_find_field(event, "pid");
}
static void update_sched_wakeup_new(struct tep_handle *pevent)
@@ -627,8 +627,8 @@ static void update_sched_wakeup_new(struct tep_handle *pevent)
if (!event)
return;
- sched_wakeup_new_comm_field = pevent_find_field(event, "comm");
- sched_wakeup_new_pid_field = pevent_find_field(event, "pid");
+ sched_wakeup_new_comm_field = tep_find_field(event, "comm");
+ sched_wakeup_new_pid_field = tep_find_field(event, "pid");
}
static void update_sched_switch(struct tep_handle *pevent)
@@ -639,10 +639,10 @@ static void update_sched_switch(struct tep_handle *pevent)
if (!event)
return;
- sched_switch_prev_field = pevent_find_field(event, "prev_comm");
- sched_switch_next_field = pevent_find_field(event, "next_comm");
- sched_switch_prev_pid_field = pevent_find_field(event, "prev_pid");
- sched_switch_next_pid_field = pevent_find_field(event, "next_pid");
+ sched_switch_prev_field = tep_find_field(event, "prev_comm");
+ sched_switch_next_field = tep_find_field(event, "next_comm");
+ sched_switch_prev_pid_field = tep_find_field(event, "prev_pid");
+ sched_switch_next_pid_field = tep_find_field(event, "next_pid");
}
static void update_function(struct tep_handle *pevent)
@@ -653,8 +653,8 @@ static void update_function(struct tep_handle *pevent)
if (!event)
return;
- function_ip_field = pevent_find_field(event, "ip");
- function_parent_ip_field = pevent_find_field(event, "parent_ip");
+ function_ip_field = tep_find_field(event, "ip");
+ function_parent_ip_field = tep_find_field(event, "parent_ip");
}
static void update_function_graph_entry(struct tep_handle *pevent)
@@ -665,8 +665,8 @@ static void update_function_graph_entry(struct tep_handle *pevent)
if (!event)
return;
- function_graph_entry_func_field = pevent_find_field(event, "func");
- function_graph_entry_depth_field = pevent_find_field(event, "depth");
+ function_graph_entry_func_field = tep_find_field(event, "func");
+ function_graph_entry_depth_field = tep_find_field(event, "depth");
}
static void update_function_graph_exit(struct tep_handle *pevent)
@@ -677,11 +677,11 @@ static void update_function_graph_exit(struct tep_handle *pevent)
if (!event)
return;
- function_graph_exit_func_field = pevent_find_field(event, "func");
- function_graph_exit_depth_field = pevent_find_field(event, "depth");
- function_graph_exit_calltime_field = pevent_find_field(event, "calltime");
- function_graph_exit_rettime_field = pevent_find_field(event, "rettime");
- function_graph_exit_overrun_field = pevent_find_field(event, "overrun");
+ function_graph_exit_func_field = tep_find_field(event, "func");
+ function_graph_exit_depth_field = tep_find_field(event, "depth");
+ function_graph_exit_calltime_field = tep_find_field(event, "calltime");
+ function_graph_exit_rettime_field = tep_find_field(event, "rettime");
+ function_graph_exit_overrun_field = tep_find_field(event, "overrun");
}
static void update_kernel_stack(struct tep_handle *pevent)
@@ -692,7 +692,7 @@ static void update_kernel_stack(struct tep_handle *pevent)
if (!event)
return;
- kernel_stack_caller_field = pevent_find_field(event, "caller");
+ kernel_stack_caller_field = tep_find_field(event, "caller");
}
enum field { NEXT_PTR, SIB_PTR };
@@ -956,11 +956,11 @@ static void do_trace_hist(struct tracecmd_input *handle)
long_size = tracecmd_long_size(handle);
- common_type_field = pevent_find_common_field(event, "common_type");
+ common_type_field = tep_find_common_field(event, "common_type");
if (!common_type_field)
die("Can't find a 'type' field?");
- common_pid_field = pevent_find_common_field(event, "common_pid");
+ common_pid_field = tep_find_common_field(event, "common_pid");
if (!common_pid_field)
die("Can't find a 'pid' field?");
diff --git a/tracecmd/trace-mem.c b/tracecmd/trace-mem.c
index 42953b29..d5a4df2e 100644
--- a/tracecmd/trace-mem.c
+++ b/tracecmd/trace-mem.c
@@ -84,10 +84,10 @@ static void update_kmalloc(struct tep_handle *pevent)
if (!event)
return;
- kmalloc_callsite_field = pevent_find_field(event, "call_site");
- kmalloc_bytes_req_field = pevent_find_field(event, "bytes_req");
- kmalloc_bytes_alloc_field = pevent_find_field(event, "bytes_alloc");
- kmalloc_ptr_field = pevent_find_field(event, "ptr");
+ kmalloc_callsite_field = tep_find_field(event, "call_site");
+ kmalloc_bytes_req_field = tep_find_field(event, "bytes_req");
+ kmalloc_bytes_alloc_field = tep_find_field(event, "bytes_alloc");
+ kmalloc_ptr_field = tep_find_field(event, "ptr");
}
static void update_kmalloc_node(struct tep_handle *pevent)
@@ -98,10 +98,10 @@ static void update_kmalloc_node(struct tep_handle *pevent)
if (!event)
return;
- kmalloc_node_callsite_field = pevent_find_field(event, "call_site");
- kmalloc_node_bytes_req_field = pevent_find_field(event, "bytes_req");
- kmalloc_node_bytes_alloc_field = pevent_find_field(event, "bytes_alloc");
- kmalloc_node_ptr_field = pevent_find_field(event, "ptr");
+ kmalloc_node_callsite_field = tep_find_field(event, "call_site");
+ kmalloc_node_bytes_req_field = tep_find_field(event, "bytes_req");
+ kmalloc_node_bytes_alloc_field = tep_find_field(event, "bytes_alloc");
+ kmalloc_node_ptr_field = tep_find_field(event, "ptr");
}
static void update_kfree(struct tep_handle *pevent)
@@ -112,7 +112,7 @@ static void update_kfree(struct tep_handle *pevent)
if (!event)
return;
- kfree_ptr_field = pevent_find_field(event, "ptr");
+ kfree_ptr_field = tep_find_field(event, "ptr");
}
static void update_kmem_cache_alloc(struct tep_handle *pevent)
@@ -123,10 +123,10 @@ static void update_kmem_cache_alloc(struct tep_handle *pevent)
if (!event)
return;
- kmem_cache_callsite_field = pevent_find_field(event, "call_site");
- kmem_cache_bytes_req_field = pevent_find_field(event, "bytes_req");
- kmem_cache_bytes_alloc_field = pevent_find_field(event, "bytes_alloc");
- kmem_cache_ptr_field = pevent_find_field(event, "ptr");
+ kmem_cache_callsite_field = tep_find_field(event, "call_site");
+ kmem_cache_bytes_req_field = tep_find_field(event, "bytes_req");
+ kmem_cache_bytes_alloc_field = tep_find_field(event, "bytes_alloc");
+ kmem_cache_ptr_field = tep_find_field(event, "ptr");
}
static void update_kmem_cache_alloc_node(struct tep_handle *pevent)
@@ -138,10 +138,10 @@ static void update_kmem_cache_alloc_node(struct tep_handle *pevent)
if (!event)
return;
- kmem_cache_node_callsite_field = pevent_find_field(event, "call_site");
- kmem_cache_node_bytes_req_field = pevent_find_field(event, "bytes_req");
- kmem_cache_node_bytes_alloc_field = pevent_find_field(event, "bytes_alloc");
- kmem_cache_node_ptr_field = pevent_find_field(event, "ptr");
+ kmem_cache_node_callsite_field = tep_find_field(event, "call_site");
+ kmem_cache_node_bytes_req_field = tep_find_field(event, "bytes_req");
+ kmem_cache_node_bytes_alloc_field = tep_find_field(event, "bytes_alloc");
+ kmem_cache_node_ptr_field = tep_find_field(event, "ptr");
}
static void update_kmem_cache_free(struct tep_handle *pevent)
@@ -152,7 +152,7 @@ static void update_kmem_cache_free(struct tep_handle *pevent)
if (!event)
return;
- kmem_cache_free_ptr_field = pevent_find_field(event, "ptr");
+ kmem_cache_free_ptr_field = tep_find_field(event, "ptr");
}
struct func_descr {
@@ -490,7 +490,7 @@ static void do_trace_mem(struct tracecmd_input *handle)
ret = pevent_data_type(pevent, record);
event = pevent_data_event_from_type(pevent, ret);
- common_type_field = pevent_find_common_field(event, "common_type");
+ common_type_field = tep_find_common_field(event, "common_type");
if (!common_type_field)
die("Can't find a 'type' field?");
diff --git a/tracecmd/trace-profile.c b/tracecmd/trace-profile.c
index 964a65fa..2df208c6 100644
--- a/tracecmd/trace-profile.c
+++ b/tracecmd/trace-profile.c
@@ -803,7 +803,7 @@ add_event(struct handle_data *h, const char *system, const char *event_name,
return NULL;
if (!h->common_pid) {
- h->common_pid = pevent_find_common_field(event, "common_pid");
+ h->common_pid = tep_find_common_field(event, "common_pid");
if (!h->common_pid)
die("No 'common_pid' found in event");
}
@@ -834,20 +834,20 @@ mate_events(struct handle_data *h, struct event_data *start,
end->start = start;
if (pid_field) {
- start->pid_field = pevent_find_field(start->event, pid_field);
+ start->pid_field = tep_find_field(start->event, pid_field);
if (!start->pid_field)
die("Event: %s does not have field %s",
start->event->name, pid_field);
}
/* Field to match with end */
- start->end_match_field = pevent_find_field(start->event, end_match_field);
+ start->end_match_field = tep_find_field(start->event, end_match_field);
if (!start->end_match_field)
die("Event: %s does not have field %s",
start->event->name, end_match_field);
/* Field to match with start */
- end->start_match_field = pevent_find_field(end->event, start_match_field);
+ end->start_match_field = tep_find_field(end->event, start_match_field);
if (!end->start_match_field)
die("Event: %s does not have field %s",
end->event->name, start_match_field);
@@ -1372,7 +1372,7 @@ void trace_init_profile(struct tracecmd_input *handle, struct hook_list *hook,
if (stacktrace_event) {
stacktrace_event->handle_event = handle_stacktrace_event;
- stacktrace_event->data_field = pevent_find_field(stacktrace_event->event,
+ stacktrace_event->data_field = tep_find_field(stacktrace_event->event,
"caller");
if (!stacktrace_event->data_field)
die("Event: %s does not have field caller",
@@ -1381,25 +1381,25 @@ void trace_init_profile(struct tracecmd_input *handle, struct hook_list *hook,
if (process_exec) {
process_exec->handle_event = handle_process_exec;
- process_exec->data_field = pevent_find_field(process_exec->event,
+ process_exec->data_field = tep_find_field(process_exec->event,
"old_pid");
}
if (sched_switch) {
sched_switch->handle_event = handle_sched_switch_event;
- sched_switch->data_field = pevent_find_field(sched_switch->event,
+ sched_switch->data_field = tep_find_field(sched_switch->event,
"prev_state");
if (!sched_switch->data_field)
die("Event: %s does not have field prev_state",
sched_switch->event->name);
- h->switch_prev_comm = pevent_find_field(sched_switch->event,
+ h->switch_prev_comm = tep_find_field(sched_switch->event,
"prev_comm");
if (!h->switch_prev_comm)
die("Event: %s does not have field prev_comm",
sched_switch->event->name);
- h->switch_next_comm = pevent_find_field(sched_switch->event,
+ h->switch_next_comm = tep_find_field(sched_switch->event,
"next_comm");
if (!h->switch_next_comm)
die("Event: %s does not have field next_comm",
@@ -1416,10 +1416,10 @@ void trace_init_profile(struct tracecmd_input *handle, struct hook_list *hook,
sched_wakeup->handle_event = handle_sched_wakeup_event;
/* The 'success' field may or may not be present */
- sched_wakeup->data_field = pevent_find_field(sched_wakeup->event,
+ sched_wakeup->data_field = tep_find_field(sched_wakeup->event,
"success");
- h->wakeup_comm = pevent_find_field(sched_wakeup->event, "comm");
+ h->wakeup_comm = tep_find_field(sched_wakeup->event, "comm");
if (!h->wakeup_comm)
die("Event: %s does not have field comm",
sched_wakeup->event->name);
@@ -1466,7 +1466,7 @@ void trace_init_profile(struct tracecmd_input *handle, struct hook_list *hook,
event_data = add_event(h, "ftrace", "function", EVENT_TYPE_FUNC);
if (event_data) {
event_data->data_field =
- pevent_find_field(event_data->event, "ip");
+ tep_find_field(event_data->event, "ip");
}
/* Add any user defined hooks */
diff --git a/tracecmd/trace-read.c b/tracecmd/trace-read.c
index ac748765..9df3f919 100644
--- a/tracecmd/trace-read.c
+++ b/tracecmd/trace-read.c
@@ -544,20 +544,20 @@ static void init_wakeup(struct tracecmd_input *handle)
if (!event)
goto fail;
wakeup_id = event->id;
- wakeup_task = pevent_find_field(event, "pid");
+ wakeup_task = tep_find_field(event, "pid");
if (!wakeup_task)
goto fail;
- wakeup_success = pevent_find_field(event, "success");
+ wakeup_success = tep_find_field(event, "success");
event = pevent_find_event_by_name(pevent, "sched", "sched_switch");
if (!event)
goto fail;
sched_id = event->id;
- sched_task = pevent_find_field(event, "next_pid");
+ sched_task = tep_find_field(event, "next_pid");
if (!sched_task)
goto fail;
- sched_prio = pevent_find_field(event, "next_prio");
+ sched_prio = tep_find_field(event, "next_prio");
if (!sched_prio)
goto fail;
@@ -568,10 +568,10 @@ static void init_wakeup(struct tracecmd_input *handle)
if (!event)
goto skip;
wakeup_new_id = event->id;
- wakeup_new_task = pevent_find_field(event, "pid");
+ wakeup_new_task = tep_find_field(event, "pid");
if (!wakeup_new_task)
goto fail;
- wakeup_new_success = pevent_find_field(event, "success");
+ wakeup_new_success = tep_find_field(event, "success");
skip:
return;
diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c
index 8fb923e5..5e57f4a1 100644
--- a/tracecmd/trace-record.c
+++ b/tracecmd/trace-record.c
@@ -3366,7 +3366,7 @@ find_ts_in_page(struct tep_handle *pevent, void *page, int size)
event = pevent_data_event_from_type(pevent, id);
if (event) {
/* Make sure this is our event */
- field = pevent_find_field(event, "buf");
+ field = tep_find_field(event, "buf");
/* the trace_marker adds a '\n' */
if (field && strcmp(STAMP"\n", record->data + field->offset) == 0)
ts = record->ts;