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

tools lib traceevent, perf tools: Rename pevent_register_* 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_register_comm, pevent_register_print_string
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.948980691@goodmis.orgSigned-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 59c1baee
...@@ -288,7 +288,7 @@ static int add_new_comm(struct tep_handle *pevent, const char *comm, int pid) ...@@ -288,7 +288,7 @@ static int add_new_comm(struct tep_handle *pevent, const char *comm, int pid)
} }
/** /**
* pevent_register_comm - register a pid / comm mapping * tep_register_comm - register a pid / comm mapping
* @pevent: handle for the pevent * @pevent: handle for the pevent
* @comm: the command line to register * @comm: the command line to register
* @pid: the pid to map the command line to * @pid: the pid to map the command line to
...@@ -296,7 +296,7 @@ static int add_new_comm(struct tep_handle *pevent, const char *comm, int pid) ...@@ -296,7 +296,7 @@ static int add_new_comm(struct tep_handle *pevent, const char *comm, int pid)
* This adds a mapping to search for command line names with * This adds a mapping to search for command line names with
* a given pid. The comm is duplicated. * a given pid. The comm is duplicated.
*/ */
int pevent_register_comm(struct tep_handle *pevent, const char *comm, int pid) int tep_register_comm(struct tep_handle *pevent, const char *comm, int pid)
{ {
struct cmdline_list *item; struct cmdline_list *item;
...@@ -685,7 +685,7 @@ find_printk(struct tep_handle *pevent, unsigned long long addr) ...@@ -685,7 +685,7 @@ find_printk(struct tep_handle *pevent, unsigned long long addr)
} }
/** /**
* pevent_register_print_string - register a string by its address * tep_register_print_string - register a string by its address
* @pevent: handle for the pevent * @pevent: handle for the pevent
* @fmt: the string format to register * @fmt: the string format to register
* @addr: the address the string was located at * @addr: the address the string was located at
...@@ -693,7 +693,7 @@ find_printk(struct tep_handle *pevent, unsigned long long addr) ...@@ -693,7 +693,7 @@ find_printk(struct tep_handle *pevent, unsigned long long addr)
* This registers a string by the address it was stored in the kernel. * This registers a string by the address it was stored in the kernel.
* The @fmt passed in is duplicated. * The @fmt passed in is duplicated.
*/ */
int pevent_register_print_string(struct tep_handle *pevent, const char *fmt, int tep_register_print_string(struct tep_handle *pevent, const char *fmt,
unsigned long long addr) unsigned long long addr)
{ {
struct printk_list *item = malloc(sizeof(*item)); struct printk_list *item = malloc(sizeof(*item));
......
...@@ -618,11 +618,11 @@ enum trace_flag_type { ...@@ -618,11 +618,11 @@ enum trace_flag_type {
int pevent_set_function_resolver(struct tep_handle *pevent, int pevent_set_function_resolver(struct tep_handle *pevent,
tep_func_resolver_t *func, void *priv); tep_func_resolver_t *func, void *priv);
void pevent_reset_function_resolver(struct tep_handle *pevent); void pevent_reset_function_resolver(struct tep_handle *pevent);
int pevent_register_comm(struct tep_handle *pevent, const char *comm, int pid); int tep_register_comm(struct tep_handle *pevent, const char *comm, int pid);
int pevent_register_trace_clock(struct tep_handle *pevent, const char *trace_clock); int pevent_register_trace_clock(struct tep_handle *pevent, const char *trace_clock);
int pevent_register_function(struct tep_handle *pevent, char *name, int pevent_register_function(struct tep_handle *pevent, char *name,
unsigned long long addr, char *mod); unsigned long long addr, char *mod);
int pevent_register_print_string(struct tep_handle *pevent, const char *fmt, int tep_register_print_string(struct tep_handle *pevent, const char *fmt,
unsigned long long addr); unsigned long long addr);
int pevent_pid_is_registered(struct tep_handle *pevent, int pid); int pevent_pid_is_registered(struct tep_handle *pevent, int pid);
......
...@@ -61,7 +61,7 @@ static void write_and_save_comm(struct format_field *field, ...@@ -61,7 +61,7 @@ static void write_and_save_comm(struct format_field *field,
comm = &s->buffer[len]; comm = &s->buffer[len];
/* Help out the comm to ids. This will handle dups */ /* Help out the comm to ids. This will handle dups */
pevent_register_comm(field->event->pevent, comm, pid); tep_register_comm(field->event->pevent, comm, pid);
} }
static int sched_wakeup_handler(struct trace_seq *s, static int sched_wakeup_handler(struct trace_seq *s,
......
...@@ -157,7 +157,7 @@ void parse_ftrace_printk(struct tep_handle *pevent, ...@@ -157,7 +157,7 @@ void parse_ftrace_printk(struct tep_handle *pevent,
/* fmt still has a space, skip it */ /* fmt still has a space, skip it */
printk = strdup(fmt+1); printk = strdup(fmt+1);
line = strtok_r(NULL, "\n", &next); line = strtok_r(NULL, "\n", &next);
pevent_register_print_string(pevent, printk, addr); tep_register_print_string(pevent, printk, addr);
} }
} }
...@@ -172,7 +172,7 @@ void parse_saved_cmdline(struct tep_handle *pevent, ...@@ -172,7 +172,7 @@ void parse_saved_cmdline(struct tep_handle *pevent,
line = strtok_r(file, "\n", &next); line = strtok_r(file, "\n", &next);
while (line) { while (line) {
sscanf(line, "%d %ms", &pid, &comm); sscanf(line, "%d %ms", &pid, &comm);
pevent_register_comm(pevent, comm, pid); tep_register_comm(pevent, comm, pid);
free(comm); free(comm);
line = strtok_r(NULL, "\n", &next); line = strtok_r(NULL, "\n", &next);
} }
......
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