Commit 2e4318a2 authored by Tzvetomir Stoyanov's avatar Tzvetomir Stoyanov Committed by Arnaldo Carvalho de Melo

tools lib traceevent: Rename struct cmdline to struct tep_cmdline

In order to make libtraceevent a proper library, variables, data
structures and functions should have a unique prefix to prevent name
space conflicts. That prefix will be "tep_".

This patch renames 'struct cmdline' to 'struct tep_cmdline'.
Signed-off-by: default avatarTzvetomir Stoyanov <tstoyanov@vmware.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/20181201040852.358871851@goodmis.orgSigned-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent eed14f4b
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#ifndef _PARSE_EVENTS_INT_H #ifndef _PARSE_EVENTS_INT_H
#define _PARSE_EVENTS_INT_H #define _PARSE_EVENTS_INT_H
struct cmdline; struct tep_cmdline;
struct cmdline_list; struct cmdline_list;
struct func_map; struct func_map;
struct func_list; struct func_list;
...@@ -36,7 +36,7 @@ struct tep_handle { ...@@ -36,7 +36,7 @@ struct tep_handle {
int long_size; int long_size;
int page_size; int page_size;
struct cmdline *cmdlines; struct tep_cmdline *cmdlines;
struct cmdline_list *cmdlist; struct cmdline_list *cmdlist;
int cmdline_count; int cmdline_count;
......
...@@ -124,15 +124,15 @@ struct tep_print_arg *alloc_arg(void) ...@@ -124,15 +124,15 @@ struct tep_print_arg *alloc_arg(void)
return calloc(1, sizeof(struct tep_print_arg)); return calloc(1, sizeof(struct tep_print_arg));
} }
struct cmdline { struct tep_cmdline {
char *comm; char *comm;
int pid; int pid;
}; };
static int cmdline_cmp(const void *a, const void *b) static int cmdline_cmp(const void *a, const void *b)
{ {
const struct cmdline *ca = a; const struct tep_cmdline *ca = a;
const struct cmdline *cb = b; const struct tep_cmdline *cb = b;
if (ca->pid < cb->pid) if (ca->pid < cb->pid)
return -1; return -1;
...@@ -152,7 +152,7 @@ static int cmdline_init(struct tep_handle *pevent) ...@@ -152,7 +152,7 @@ static int cmdline_init(struct tep_handle *pevent)
{ {
struct cmdline_list *cmdlist = pevent->cmdlist; struct cmdline_list *cmdlist = pevent->cmdlist;
struct cmdline_list *item; struct cmdline_list *item;
struct cmdline *cmdlines; struct tep_cmdline *cmdlines;
int i; int i;
cmdlines = malloc(sizeof(*cmdlines) * pevent->cmdline_count); cmdlines = malloc(sizeof(*cmdlines) * pevent->cmdline_count);
...@@ -179,8 +179,8 @@ static int cmdline_init(struct tep_handle *pevent) ...@@ -179,8 +179,8 @@ static int cmdline_init(struct tep_handle *pevent)
static const char *find_cmdline(struct tep_handle *pevent, int pid) static const char *find_cmdline(struct tep_handle *pevent, int pid)
{ {
const struct cmdline *comm; const struct tep_cmdline *comm;
struct cmdline key; struct tep_cmdline key;
if (!pid) if (!pid)
return "<idle>"; return "<idle>";
...@@ -208,8 +208,8 @@ static const char *find_cmdline(struct tep_handle *pevent, int pid) ...@@ -208,8 +208,8 @@ static const char *find_cmdline(struct tep_handle *pevent, int pid)
*/ */
int tep_pid_is_registered(struct tep_handle *pevent, int pid) int tep_pid_is_registered(struct tep_handle *pevent, int pid)
{ {
const struct cmdline *comm; const struct tep_cmdline *comm;
struct cmdline key; struct tep_cmdline key;
if (!pid) if (!pid)
return 1; return 1;
...@@ -235,9 +235,9 @@ int tep_pid_is_registered(struct tep_handle *pevent, int pid) ...@@ -235,9 +235,9 @@ int tep_pid_is_registered(struct tep_handle *pevent, int pid)
static int add_new_comm(struct tep_handle *pevent, static int add_new_comm(struct tep_handle *pevent,
const char *comm, int pid, bool override) const char *comm, int pid, bool override)
{ {
struct cmdline *cmdlines = pevent->cmdlines; struct tep_cmdline *cmdlines = pevent->cmdlines;
struct cmdline *cmdline; struct tep_cmdline *cmdline;
struct cmdline key; struct tep_cmdline key;
char *new_comm; char *new_comm;
if (!pid) if (!pid)
...@@ -5331,8 +5331,8 @@ const char *tep_data_comm_from_pid(struct tep_handle *pevent, int pid) ...@@ -5331,8 +5331,8 @@ const char *tep_data_comm_from_pid(struct tep_handle *pevent, int pid)
return comm; return comm;
} }
static struct cmdline * static struct tep_cmdline *
pid_from_cmdlist(struct tep_handle *pevent, const char *comm, struct cmdline *next) pid_from_cmdlist(struct tep_handle *pevent, const char *comm, struct tep_cmdline *next)
{ {
struct cmdline_list *cmdlist = (struct cmdline_list *)next; struct cmdline_list *cmdlist = (struct cmdline_list *)next;
...@@ -5344,7 +5344,7 @@ pid_from_cmdlist(struct tep_handle *pevent, const char *comm, struct cmdline *ne ...@@ -5344,7 +5344,7 @@ pid_from_cmdlist(struct tep_handle *pevent, const char *comm, struct cmdline *ne
while (cmdlist && strcmp(cmdlist->comm, comm) != 0) while (cmdlist && strcmp(cmdlist->comm, comm) != 0)
cmdlist = cmdlist->next; cmdlist = cmdlist->next;
return (struct cmdline *)cmdlist; return (struct tep_cmdline *)cmdlist;
} }
/** /**
...@@ -5360,10 +5360,10 @@ pid_from_cmdlist(struct tep_handle *pevent, const char *comm, struct cmdline *ne ...@@ -5360,10 +5360,10 @@ pid_from_cmdlist(struct tep_handle *pevent, const char *comm, struct cmdline *ne
* next pid. * next pid.
* Also, it does a linear search, so it may be slow. * Also, it does a linear search, so it may be slow.
*/ */
struct cmdline *tep_data_pid_from_comm(struct tep_handle *pevent, const char *comm, struct tep_cmdline *tep_data_pid_from_comm(struct tep_handle *pevent, const char *comm,
struct cmdline *next) struct tep_cmdline *next)
{ {
struct cmdline *cmdline; struct tep_cmdline *cmdline;
/* /*
* If the cmdlines have not been converted yet, then use * If the cmdlines have not been converted yet, then use
...@@ -5402,7 +5402,7 @@ struct cmdline *tep_data_pid_from_comm(struct tep_handle *pevent, const char *co ...@@ -5402,7 +5402,7 @@ struct cmdline *tep_data_pid_from_comm(struct tep_handle *pevent, const char *co
* Returns the pid for a give cmdline. If @cmdline is NULL, then * Returns the pid for a give cmdline. If @cmdline is NULL, then
* -1 is returned. * -1 is returned.
*/ */
int tep_cmdline_pid(struct tep_handle *pevent, struct cmdline *cmdline) int tep_cmdline_pid(struct tep_handle *pevent, struct tep_cmdline *cmdline)
{ {
struct cmdline_list *cmdlist = (struct cmdline_list *)cmdline; struct cmdline_list *cmdlist = (struct cmdline_list *)cmdline;
......
...@@ -526,10 +526,10 @@ int tep_data_pid(struct tep_handle *pevent, struct tep_record *rec); ...@@ -526,10 +526,10 @@ int tep_data_pid(struct tep_handle *pevent, struct tep_record *rec);
int tep_data_preempt_count(struct tep_handle *pevent, struct tep_record *rec); int tep_data_preempt_count(struct tep_handle *pevent, struct tep_record *rec);
int tep_data_flags(struct tep_handle *pevent, struct tep_record *rec); int tep_data_flags(struct tep_handle *pevent, struct tep_record *rec);
const char *tep_data_comm_from_pid(struct tep_handle *pevent, int pid); const char *tep_data_comm_from_pid(struct tep_handle *pevent, int pid);
struct cmdline; struct tep_cmdline;
struct cmdline *tep_data_pid_from_comm(struct tep_handle *pevent, const char *comm, struct tep_cmdline *tep_data_pid_from_comm(struct tep_handle *pevent, const char *comm,
struct cmdline *next); struct tep_cmdline *next);
int tep_cmdline_pid(struct tep_handle *pevent, struct cmdline *cmdline); int tep_cmdline_pid(struct tep_handle *pevent, struct tep_cmdline *cmdline);
void tep_print_field(struct trace_seq *s, void *data, void tep_print_field(struct trace_seq *s, void *data,
struct tep_format_field *field); struct tep_format_field *field);
......
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