aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/lib/traceevent/parse-filter.c
diff options
context:
space:
mode:
authorTzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>2018-09-19 14:56:47 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2018-09-19 17:14:58 -0300
commitf25d9e09e9354bded677d21b51a7b1879cfa02a8 (patch)
treedf1f68c0740d7071887f7c1ac12c6836a640d3eb /tools/lib/traceevent/parse-filter.c
parenttools lib traceevent, perf tools: Rename enum format_flags to enum tep_format_flags (diff)
downloadwireguard-linux-f25d9e09e9354bded677d21b51a7b1879cfa02a8.tar.xz
wireguard-linux-f25d9e09e9354bded677d21b51a7b1879cfa02a8.zip
tools lib traceevent: Rename enum event_{sort_}type to enum tep_event_{sort_}type
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_". This renames enum event_type to enum tep_event_type, enum event_sort_type to enum tep_event_sort_type and add prefix TEP_ to all enum's members Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com> Cc: linux-trace-devel@vger.kernel.org Link: http://lkml.kernel.org/r/20180919185722.961022207@goodmis.org Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/lib/traceevent/parse-filter.c')
-rw-r--r--tools/lib/traceevent/parse-filter.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/tools/lib/traceevent/parse-filter.c b/tools/lib/traceevent/parse-filter.c
index dcd97acbbc49..153e248de75b 100644
--- a/tools/lib/traceevent/parse-filter.c
+++ b/tools/lib/traceevent/parse-filter.c
@@ -61,15 +61,15 @@ static void free_token(char *token)
tep_free_token(token);
}
-static enum event_type read_token(char **tok)
+static enum tep_event_type read_token(char **tok)
{
- enum event_type type;
+ enum tep_event_type type;
char *token = NULL;
do {
free_token(token);
type = tep_read_token(&token);
- } while (type == EVENT_NEWLINE || type == EVENT_SPACE);
+ } while (type == TEP_EVENT_NEWLINE || type == TEP_EVENT_SPACE);
/* If token is = or ! check to see if the next char is ~ */
if (token &&
@@ -79,7 +79,7 @@ static enum event_type read_token(char **tok)
*tok = malloc(3);
if (*tok == NULL) {
free_token(token);
- return EVENT_ERROR;
+ return TEP_EVENT_ERROR;
}
sprintf(*tok, "%c%c", *token, '~');
free_token(token);
@@ -334,7 +334,7 @@ static void free_events(struct event_list *events)
static enum tep_errno
create_arg_item(struct tep_event_format *event, const char *token,
- enum event_type type, struct filter_arg **parg, char *error_str)
+ enum tep_event_type type, struct filter_arg **parg, char *error_str)
{
struct tep_format_field *field;
struct filter_arg *arg;
@@ -347,11 +347,11 @@ create_arg_item(struct tep_event_format *event, const char *token,
switch (type) {
- case EVENT_SQUOTE:
- case EVENT_DQUOTE:
+ case TEP_EVENT_SQUOTE:
+ case TEP_EVENT_DQUOTE:
arg->type = FILTER_ARG_VALUE;
arg->value.type =
- type == EVENT_DQUOTE ? FILTER_STRING : FILTER_CHAR;
+ type == TEP_EVENT_DQUOTE ? FILTER_STRING : FILTER_CHAR;
arg->value.str = strdup(token);
if (!arg->value.str) {
free_arg(arg);
@@ -359,7 +359,7 @@ create_arg_item(struct tep_event_format *event, const char *token,
return TEP_ERRNO__MEM_ALLOC_FAILED;
}
break;
- case EVENT_ITEM:
+ case TEP_EVENT_ITEM:
/* if it is a number, then convert it */
if (isdigit(token[0])) {
arg->type = FILTER_ARG_VALUE;
@@ -942,7 +942,7 @@ static enum tep_errno
process_filter(struct tep_event_format *event, struct filter_arg **parg,
char *error_str, int not)
{
- enum event_type type;
+ enum tep_event_type type;
char *token = NULL;
struct filter_arg *current_op = NULL;
struct filter_arg *current_exp = NULL;
@@ -960,9 +960,9 @@ process_filter(struct tep_event_format *event, struct filter_arg **parg,
free(token);
type = read_token(&token);
switch (type) {
- case EVENT_SQUOTE:
- case EVENT_DQUOTE:
- case EVENT_ITEM:
+ case TEP_EVENT_SQUOTE:
+ case TEP_EVENT_DQUOTE:
+ case TEP_EVENT_ITEM:
ret = create_arg_item(event, token, type, &arg, error_str);
if (ret < 0)
goto fail;
@@ -987,7 +987,7 @@ process_filter(struct tep_event_format *event, struct filter_arg **parg,
arg = NULL;
break;
- case EVENT_DELIM:
+ case TEP_EVENT_DELIM:
if (*token == ',') {
show_error(error_str, "Illegal token ','");
ret = TEP_ERRNO__ILLEGAL_TOKEN;
@@ -1054,7 +1054,7 @@ process_filter(struct tep_event_format *event, struct filter_arg **parg,
}
break;
- case EVENT_OP:
+ case TEP_EVENT_OP:
op_type = process_op(token, &btype, &ctype, &etype);
/* All expect a left arg except for NOT */
@@ -1139,14 +1139,14 @@ process_filter(struct tep_event_format *event, struct filter_arg **parg,
if (ret < 0)
goto fail_syntax;
break;
- case EVENT_NONE:
+ case TEP_EVENT_NONE:
break;
- case EVENT_ERROR:
+ case TEP_EVENT_ERROR:
goto fail_alloc;
default:
goto fail_syntax;
}
- } while (type != EVENT_NONE);
+ } while (type != TEP_EVENT_NONE);
if (!current_op && !current_exp)
goto fail_syntax;