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

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: default avatarTzvetomir 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.orgSigned-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent bb39ccb2
This diff is collapsed.
......@@ -301,22 +301,22 @@ enum {
EVENT_FL_FAILED = 0x80000000
};
enum event_sort_type {
EVENT_SORT_ID,
EVENT_SORT_NAME,
EVENT_SORT_SYSTEM,
enum tep_event_sort_type {
TEP_EVENT_SORT_ID,
TEP_EVENT_SORT_NAME,
TEP_EVENT_SORT_SYSTEM,
};
enum event_type {
EVENT_ERROR,
EVENT_NONE,
EVENT_SPACE,
EVENT_NEWLINE,
EVENT_OP,
EVENT_DELIM,
EVENT_ITEM,
EVENT_DQUOTE,
EVENT_SQUOTE,
enum tep_event_type {
TEP_EVENT_ERROR,
TEP_EVENT_NONE,
TEP_EVENT_SPACE,
TEP_EVENT_NEWLINE,
TEP_EVENT_OP,
TEP_EVENT_DELIM,
TEP_EVENT_ITEM,
TEP_EVENT_DQUOTE,
TEP_EVENT_SQUOTE,
};
typedef unsigned long long (*tep_func_handler)(struct trace_seq *s,
......@@ -454,7 +454,7 @@ struct tep_handle {
struct tep_event_format **events;
int nr_events;
struct tep_event_format **sort_events;
enum event_sort_type last_type;
enum tep_event_sort_type last_type;
int type_offset;
int type_size;
......@@ -685,7 +685,7 @@ void tep_event_info(struct trace_seq *s, struct tep_event_format *event,
int tep_strerror(struct tep_handle *pevent, enum tep_errno errnum,
char *buf, size_t buflen);
struct tep_event_format **tep_list_events(struct tep_handle *pevent, enum event_sort_type);
struct tep_event_format **tep_list_events(struct tep_handle *pevent, enum tep_event_sort_type);
struct tep_format_field **tep_event_common_fields(struct tep_event_format *event);
struct tep_format_field **tep_event_fields(struct tep_event_format *event);
......@@ -756,7 +756,7 @@ void tep_unref(struct tep_handle *pevent);
/* access to the internal parser */
void tep_buffer_init(const char *buf, unsigned long long size);
enum event_type tep_read_token(char **tok);
enum tep_event_type tep_read_token(char **tok);
void tep_free_token(char *token);
int tep_peek_char(void);
const char *tep_get_input_buf(void);
......
......@@ -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;
......
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