Commit 97fbf3f0 authored by Tzvetomir Stoyanov's avatar Tzvetomir Stoyanov Committed by Arnaldo Carvalho de Melo

tools lib traceevent, perf tools: Rename 'struct tep_event_format' to 'struct tep_event'

In order to make libtraceevent into a proper library, variables, data
structures and functions require a unique prefix to prevent name space
conflicts.

This renames 'struct tep_event_format' to 'struct tep_event', which
describes more closely the purpose of the struct.
Signed-off-by: default avatarTzvetomir Stoyanov <tstoyanov@vmware.com>
Cc: Adrian Hunter <adrian.hunter@intel.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/20181130154647.436403995@goodmis.orgSigned-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
[ Fixup conflict with 6e33c250a88f ("tools lib traceevent: Fix compile warnings in tools/lib/traceevent/event-parse.c") ]
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 4c784894
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* This returns pointer to the first element of the events array * This returns pointer to the first element of the events array
* If @tep is NULL, NULL is returned. * If @tep is NULL, NULL is returned.
*/ */
struct tep_event_format *tep_get_first_event(struct tep_handle *tep) struct tep_event *tep_get_first_event(struct tep_handle *tep)
{ {
if (tep && tep->events) if (tep && tep->events)
return tep->events[0]; return tep->events[0];
......
...@@ -50,9 +50,9 @@ struct tep_handle { ...@@ -50,9 +50,9 @@ struct tep_handle {
unsigned int printk_count; unsigned int printk_count;
struct tep_event_format **events; struct tep_event **events;
int nr_events; int nr_events;
struct tep_event_format **sort_events; struct tep_event **sort_events;
enum tep_event_sort_type last_type; enum tep_event_sort_type last_type;
int type_offset; int type_offset;
...@@ -84,7 +84,7 @@ struct tep_handle { ...@@ -84,7 +84,7 @@ struct tep_handle {
struct tep_function_handler *func_handlers; struct tep_function_handler *func_handlers;
/* cache */ /* cache */
struct tep_event_format *last_event; struct tep_event *last_event;
char *trace_clock; char *trace_clock;
}; };
......
...@@ -96,7 +96,7 @@ struct tep_function_handler { ...@@ -96,7 +96,7 @@ struct tep_function_handler {
static unsigned long long static unsigned long long
process_defined_func(struct trace_seq *s, void *data, int size, process_defined_func(struct trace_seq *s, void *data, int size,
struct tep_event_format *event, struct tep_print_arg *arg); struct tep_event *event, struct tep_print_arg *arg);
static void free_func_handle(struct tep_function_handler *func); static void free_func_handle(struct tep_function_handler *func);
...@@ -739,16 +739,16 @@ void tep_print_printk(struct tep_handle *pevent) ...@@ -739,16 +739,16 @@ void tep_print_printk(struct tep_handle *pevent)
} }
} }
static struct tep_event_format *alloc_event(void) static struct tep_event *alloc_event(void)
{ {
return calloc(1, sizeof(struct tep_event_format)); return calloc(1, sizeof(struct tep_event));
} }
static int add_event(struct tep_handle *pevent, struct tep_event_format *event) static int add_event(struct tep_handle *pevent, struct tep_event *event)
{ {
int i; int i;
struct tep_event_format **events = realloc(pevent->events, sizeof(event) * struct tep_event **events = realloc(pevent->events, sizeof(event) *
(pevent->nr_events + 1)); (pevent->nr_events + 1));
if (!events) if (!events)
return -1; return -1;
...@@ -1355,7 +1355,7 @@ static unsigned int type_size(const char *name) ...@@ -1355,7 +1355,7 @@ static unsigned int type_size(const char *name)
return 0; return 0;
} }
static int event_read_fields(struct tep_event_format *event, struct tep_format_field **fields) static int event_read_fields(struct tep_event *event, struct tep_format_field **fields)
{ {
struct tep_format_field *field = NULL; struct tep_format_field *field = NULL;
enum tep_event_type type; enum tep_event_type type;
...@@ -1642,7 +1642,7 @@ static int event_read_fields(struct tep_event_format *event, struct tep_format_f ...@@ -1642,7 +1642,7 @@ static int event_read_fields(struct tep_event_format *event, struct tep_format_f
return -1; return -1;
} }
static int event_read_format(struct tep_event_format *event) static int event_read_format(struct tep_event *event)
{ {
char *token; char *token;
int ret; int ret;
...@@ -1675,11 +1675,11 @@ static int event_read_format(struct tep_event_format *event) ...@@ -1675,11 +1675,11 @@ static int event_read_format(struct tep_event_format *event)
} }
static enum tep_event_type static enum tep_event_type
process_arg_token(struct tep_event_format *event, struct tep_print_arg *arg, process_arg_token(struct tep_event *event, struct tep_print_arg *arg,
char **tok, enum tep_event_type type); char **tok, enum tep_event_type type);
static enum tep_event_type static enum tep_event_type
process_arg(struct tep_event_format *event, struct tep_print_arg *arg, char **tok) process_arg(struct tep_event *event, struct tep_print_arg *arg, char **tok)
{ {
enum tep_event_type type; enum tep_event_type type;
char *token; char *token;
...@@ -1691,14 +1691,14 @@ process_arg(struct tep_event_format *event, struct tep_print_arg *arg, char **to ...@@ -1691,14 +1691,14 @@ process_arg(struct tep_event_format *event, struct tep_print_arg *arg, char **to
} }
static enum tep_event_type static enum tep_event_type
process_op(struct tep_event_format *event, struct tep_print_arg *arg, char **tok); process_op(struct tep_event *event, struct tep_print_arg *arg, char **tok);
/* /*
* For __print_symbolic() and __print_flags, we need to completely * For __print_symbolic() and __print_flags, we need to completely
* evaluate the first argument, which defines what to print next. * evaluate the first argument, which defines what to print next.
*/ */
static enum tep_event_type static enum tep_event_type
process_field_arg(struct tep_event_format *event, struct tep_print_arg *arg, char **tok) process_field_arg(struct tep_event *event, struct tep_print_arg *arg, char **tok)
{ {
enum tep_event_type type; enum tep_event_type type;
...@@ -1712,7 +1712,7 @@ process_field_arg(struct tep_event_format *event, struct tep_print_arg *arg, cha ...@@ -1712,7 +1712,7 @@ process_field_arg(struct tep_event_format *event, struct tep_print_arg *arg, cha
} }
static enum tep_event_type static enum tep_event_type
process_cond(struct tep_event_format *event, struct tep_print_arg *top, char **tok) process_cond(struct tep_event *event, struct tep_print_arg *top, char **tok)
{ {
struct tep_print_arg *arg, *left, *right; struct tep_print_arg *arg, *left, *right;
enum tep_event_type type; enum tep_event_type type;
...@@ -1768,7 +1768,7 @@ process_cond(struct tep_event_format *event, struct tep_print_arg *top, char **t ...@@ -1768,7 +1768,7 @@ process_cond(struct tep_event_format *event, struct tep_print_arg *top, char **t
} }
static enum tep_event_type static enum tep_event_type
process_array(struct tep_event_format *event, struct tep_print_arg *top, char **tok) process_array(struct tep_event *event, struct tep_print_arg *top, char **tok)
{ {
struct tep_print_arg *arg; struct tep_print_arg *arg;
enum tep_event_type type; enum tep_event_type type;
...@@ -1870,7 +1870,7 @@ static int set_op_prio(struct tep_print_arg *arg) ...@@ -1870,7 +1870,7 @@ static int set_op_prio(struct tep_print_arg *arg)
/* Note, *tok does not get freed, but will most likely be saved */ /* Note, *tok does not get freed, but will most likely be saved */
static enum tep_event_type static enum tep_event_type
process_op(struct tep_event_format *event, struct tep_print_arg *arg, char **tok) process_op(struct tep_event *event, struct tep_print_arg *arg, char **tok)
{ {
struct tep_print_arg *left, *right = NULL; struct tep_print_arg *left, *right = NULL;
enum tep_event_type type; enum tep_event_type type;
...@@ -2071,7 +2071,7 @@ process_op(struct tep_event_format *event, struct tep_print_arg *arg, char **tok ...@@ -2071,7 +2071,7 @@ process_op(struct tep_event_format *event, struct tep_print_arg *arg, char **tok
} }
static enum tep_event_type static enum tep_event_type
process_entry(struct tep_event_format *event __maybe_unused, struct tep_print_arg *arg, process_entry(struct tep_event *event __maybe_unused, struct tep_print_arg *arg,
char **tok) char **tok)
{ {
enum tep_event_type type; enum tep_event_type type;
...@@ -2110,7 +2110,7 @@ process_entry(struct tep_event_format *event __maybe_unused, struct tep_print_ar ...@@ -2110,7 +2110,7 @@ process_entry(struct tep_event_format *event __maybe_unused, struct tep_print_ar
return TEP_EVENT_ERROR; return TEP_EVENT_ERROR;
} }
static int alloc_and_process_delim(struct tep_event_format *event, char *next_token, static int alloc_and_process_delim(struct tep_event *event, char *next_token,
struct tep_print_arg **print_arg) struct tep_print_arg **print_arg)
{ {
struct tep_print_arg *field; struct tep_print_arg *field;
...@@ -2445,7 +2445,7 @@ static char *arg_eval (struct tep_print_arg *arg) ...@@ -2445,7 +2445,7 @@ static char *arg_eval (struct tep_print_arg *arg)
} }
static enum tep_event_type static enum tep_event_type
process_fields(struct tep_event_format *event, struct tep_print_flag_sym **list, char **tok) process_fields(struct tep_event *event, struct tep_print_flag_sym **list, char **tok)
{ {
enum tep_event_type type; enum tep_event_type type;
struct tep_print_arg *arg = NULL; struct tep_print_arg *arg = NULL;
...@@ -2526,7 +2526,7 @@ process_fields(struct tep_event_format *event, struct tep_print_flag_sym **list, ...@@ -2526,7 +2526,7 @@ process_fields(struct tep_event_format *event, struct tep_print_flag_sym **list,
} }
static enum tep_event_type static enum tep_event_type
process_flags(struct tep_event_format *event, struct tep_print_arg *arg, char **tok) process_flags(struct tep_event *event, struct tep_print_arg *arg, char **tok)
{ {
struct tep_print_arg *field; struct tep_print_arg *field;
enum tep_event_type type; enum tep_event_type type;
...@@ -2579,7 +2579,7 @@ process_flags(struct tep_event_format *event, struct tep_print_arg *arg, char ** ...@@ -2579,7 +2579,7 @@ process_flags(struct tep_event_format *event, struct tep_print_arg *arg, char **
} }
static enum tep_event_type static enum tep_event_type
process_symbols(struct tep_event_format *event, struct tep_print_arg *arg, char **tok) process_symbols(struct tep_event *event, struct tep_print_arg *arg, char **tok)
{ {
struct tep_print_arg *field; struct tep_print_arg *field;
enum tep_event_type type; enum tep_event_type type;
...@@ -2618,7 +2618,7 @@ process_symbols(struct tep_event_format *event, struct tep_print_arg *arg, char ...@@ -2618,7 +2618,7 @@ process_symbols(struct tep_event_format *event, struct tep_print_arg *arg, char
} }
static enum tep_event_type static enum tep_event_type
process_hex_common(struct tep_event_format *event, struct tep_print_arg *arg, process_hex_common(struct tep_event *event, struct tep_print_arg *arg,
char **tok, enum tep_print_arg_type type) char **tok, enum tep_print_arg_type type)
{ {
memset(arg, 0, sizeof(*arg)); memset(arg, 0, sizeof(*arg));
...@@ -2641,20 +2641,20 @@ process_hex_common(struct tep_event_format *event, struct tep_print_arg *arg, ...@@ -2641,20 +2641,20 @@ process_hex_common(struct tep_event_format *event, struct tep_print_arg *arg,
} }
static enum tep_event_type static enum tep_event_type
process_hex(struct tep_event_format *event, struct tep_print_arg *arg, char **tok) process_hex(struct tep_event *event, struct tep_print_arg *arg, char **tok)
{ {
return process_hex_common(event, arg, tok, TEP_PRINT_HEX); return process_hex_common(event, arg, tok, TEP_PRINT_HEX);
} }
static enum tep_event_type static enum tep_event_type
process_hex_str(struct tep_event_format *event, struct tep_print_arg *arg, process_hex_str(struct tep_event *event, struct tep_print_arg *arg,
char **tok) char **tok)
{ {
return process_hex_common(event, arg, tok, TEP_PRINT_HEX_STR); return process_hex_common(event, arg, tok, TEP_PRINT_HEX_STR);
} }
static enum tep_event_type static enum tep_event_type
process_int_array(struct tep_event_format *event, struct tep_print_arg *arg, char **tok) process_int_array(struct tep_event *event, struct tep_print_arg *arg, char **tok)
{ {
memset(arg, 0, sizeof(*arg)); memset(arg, 0, sizeof(*arg));
arg->type = TEP_PRINT_INT_ARRAY; arg->type = TEP_PRINT_INT_ARRAY;
...@@ -2682,7 +2682,7 @@ process_int_array(struct tep_event_format *event, struct tep_print_arg *arg, cha ...@@ -2682,7 +2682,7 @@ process_int_array(struct tep_event_format *event, struct tep_print_arg *arg, cha
} }
static enum tep_event_type static enum tep_event_type
process_dynamic_array(struct tep_event_format *event, struct tep_print_arg *arg, char **tok) process_dynamic_array(struct tep_event *event, struct tep_print_arg *arg, char **tok)
{ {
struct tep_format_field *field; struct tep_format_field *field;
enum tep_event_type type; enum tep_event_type type;
...@@ -2746,7 +2746,7 @@ process_dynamic_array(struct tep_event_format *event, struct tep_print_arg *arg, ...@@ -2746,7 +2746,7 @@ process_dynamic_array(struct tep_event_format *event, struct tep_print_arg *arg,
} }
static enum tep_event_type static enum tep_event_type
process_dynamic_array_len(struct tep_event_format *event, struct tep_print_arg *arg, process_dynamic_array_len(struct tep_event *event, struct tep_print_arg *arg,
char **tok) char **tok)
{ {
struct tep_format_field *field; struct tep_format_field *field;
...@@ -2782,7 +2782,7 @@ process_dynamic_array_len(struct tep_event_format *event, struct tep_print_arg * ...@@ -2782,7 +2782,7 @@ process_dynamic_array_len(struct tep_event_format *event, struct tep_print_arg *
} }
static enum tep_event_type static enum tep_event_type
process_paren(struct tep_event_format *event, struct tep_print_arg *arg, char **tok) process_paren(struct tep_event *event, struct tep_print_arg *arg, char **tok)
{ {
struct tep_print_arg *item_arg; struct tep_print_arg *item_arg;
enum tep_event_type type; enum tep_event_type type;
...@@ -2845,7 +2845,7 @@ process_paren(struct tep_event_format *event, struct tep_print_arg *arg, char ** ...@@ -2845,7 +2845,7 @@ process_paren(struct tep_event_format *event, struct tep_print_arg *arg, char **
static enum tep_event_type static enum tep_event_type
process_str(struct tep_event_format *event __maybe_unused, struct tep_print_arg *arg, process_str(struct tep_event *event __maybe_unused, struct tep_print_arg *arg,
char **tok) char **tok)
{ {
enum tep_event_type type; enum tep_event_type type;
...@@ -2874,7 +2874,7 @@ process_str(struct tep_event_format *event __maybe_unused, struct tep_print_arg ...@@ -2874,7 +2874,7 @@ process_str(struct tep_event_format *event __maybe_unused, struct tep_print_arg
} }
static enum tep_event_type static enum tep_event_type
process_bitmask(struct tep_event_format *event __maybe_unused, struct tep_print_arg *arg, process_bitmask(struct tep_event *event __maybe_unused, struct tep_print_arg *arg,
char **tok) char **tok)
{ {
enum tep_event_type type; enum tep_event_type type;
...@@ -2935,7 +2935,7 @@ static void remove_func_handler(struct tep_handle *pevent, char *func_name) ...@@ -2935,7 +2935,7 @@ static void remove_func_handler(struct tep_handle *pevent, char *func_name)
} }
static enum tep_event_type static enum tep_event_type
process_func_handler(struct tep_event_format *event, struct tep_function_handler *func, process_func_handler(struct tep_event *event, struct tep_function_handler *func,
struct tep_print_arg *arg, char **tok) struct tep_print_arg *arg, char **tok)
{ {
struct tep_print_arg **next_arg; struct tep_print_arg **next_arg;
...@@ -2993,7 +2993,7 @@ process_func_handler(struct tep_event_format *event, struct tep_function_handler ...@@ -2993,7 +2993,7 @@ process_func_handler(struct tep_event_format *event, struct tep_function_handler
} }
static enum tep_event_type static enum tep_event_type
process_function(struct tep_event_format *event, struct tep_print_arg *arg, process_function(struct tep_event *event, struct tep_print_arg *arg,
char *token, char **tok) char *token, char **tok)
{ {
struct tep_function_handler *func; struct tep_function_handler *func;
...@@ -3049,7 +3049,7 @@ process_function(struct tep_event_format *event, struct tep_print_arg *arg, ...@@ -3049,7 +3049,7 @@ process_function(struct tep_event_format *event, struct tep_print_arg *arg,
} }
static enum tep_event_type static enum tep_event_type
process_arg_token(struct tep_event_format *event, struct tep_print_arg *arg, process_arg_token(struct tep_event *event, struct tep_print_arg *arg,
char **tok, enum tep_event_type type) char **tok, enum tep_event_type type)
{ {
char *token; char *token;
...@@ -3137,7 +3137,7 @@ process_arg_token(struct tep_event_format *event, struct tep_print_arg *arg, ...@@ -3137,7 +3137,7 @@ process_arg_token(struct tep_event_format *event, struct tep_print_arg *arg,
return type; return type;
} }
static int event_read_print_args(struct tep_event_format *event, struct tep_print_arg **list) static int event_read_print_args(struct tep_event *event, struct tep_print_arg **list)
{ {
enum tep_event_type type = TEP_EVENT_ERROR; enum tep_event_type type = TEP_EVENT_ERROR;
struct tep_print_arg *arg; struct tep_print_arg *arg;
...@@ -3195,7 +3195,7 @@ static int event_read_print_args(struct tep_event_format *event, struct tep_prin ...@@ -3195,7 +3195,7 @@ static int event_read_print_args(struct tep_event_format *event, struct tep_prin
return args; return args;
} }
static int event_read_print(struct tep_event_format *event) static int event_read_print(struct tep_event *event)
{ {
enum tep_event_type type; enum tep_event_type type;
char *token; char *token;
...@@ -3261,7 +3261,7 @@ static int event_read_print(struct tep_event_format *event) ...@@ -3261,7 +3261,7 @@ static int event_read_print(struct tep_event_format *event)
* This only searchs the common fields and not all field. * This only searchs the common fields and not all field.
*/ */
struct tep_format_field * struct tep_format_field *
tep_find_common_field(struct tep_event_format *event, const char *name) tep_find_common_field(struct tep_event *event, const char *name)
{ {
struct tep_format_field *format; struct tep_format_field *format;
...@@ -3283,7 +3283,7 @@ tep_find_common_field(struct tep_event_format *event, const char *name) ...@@ -3283,7 +3283,7 @@ tep_find_common_field(struct tep_event_format *event, const char *name)
* This does not search common fields. * This does not search common fields.
*/ */
struct tep_format_field * struct tep_format_field *
tep_find_field(struct tep_event_format *event, const char *name) tep_find_field(struct tep_event *event, const char *name)
{ {
struct tep_format_field *format; struct tep_format_field *format;
...@@ -3306,7 +3306,7 @@ tep_find_field(struct tep_event_format *event, const char *name) ...@@ -3306,7 +3306,7 @@ tep_find_field(struct tep_event_format *event, const char *name)
* the non-common ones if a common one was not found. * the non-common ones if a common one was not found.
*/ */
struct tep_format_field * struct tep_format_field *
tep_find_any_field(struct tep_event_format *event, const char *name) tep_find_any_field(struct tep_event *event, const char *name)
{ {
struct tep_format_field *format; struct tep_format_field *format;
...@@ -3375,7 +3375,7 @@ int tep_read_number_field(struct tep_format_field *field, const void *data, ...@@ -3375,7 +3375,7 @@ int tep_read_number_field(struct tep_format_field *field, const void *data,
static int get_common_info(struct tep_handle *pevent, static int get_common_info(struct tep_handle *pevent,
const char *type, int *offset, int *size) const char *type, int *offset, int *size)
{ {
struct tep_event_format *event; struct tep_event *event;
struct tep_format_field *field; struct tep_format_field *field;
/* /*
...@@ -3462,11 +3462,11 @@ static int events_id_cmp(const void *a, const void *b); ...@@ -3462,11 +3462,11 @@ static int events_id_cmp(const void *a, const void *b);
* *
* Returns an event that has a given @id. * Returns an event that has a given @id.
*/ */
struct tep_event_format *tep_find_event(struct tep_handle *pevent, int id) struct tep_event *tep_find_event(struct tep_handle *pevent, int id)
{ {
struct tep_event_format **eventptr; struct tep_event **eventptr;
struct tep_event_format key; struct tep_event key;
struct tep_event_format *pkey = &key; struct tep_event *pkey = &key;
/* Check cache first */ /* Check cache first */
if (pevent->last_event && pevent->last_event->id == id) if (pevent->last_event && pevent->last_event->id == id)
...@@ -3494,11 +3494,11 @@ struct tep_event_format *tep_find_event(struct tep_handle *pevent, int id) ...@@ -3494,11 +3494,11 @@ struct tep_event_format *tep_find_event(struct tep_handle *pevent, int id)
* This returns an event with a given @name and under the system * This returns an event with a given @name and under the system
* @sys. If @sys is NULL the first event with @name is returned. * @sys. If @sys is NULL the first event with @name is returned.
*/ */
struct tep_event_format * struct tep_event *
tep_find_event_by_name(struct tep_handle *pevent, tep_find_event_by_name(struct tep_handle *pevent,
const char *sys, const char *name) const char *sys, const char *name)
{ {
struct tep_event_format *event = NULL; struct tep_event *event = NULL;
int i; int i;
if (pevent->last_event && if (pevent->last_event &&
...@@ -3523,7 +3523,7 @@ tep_find_event_by_name(struct tep_handle *pevent, ...@@ -3523,7 +3523,7 @@ tep_find_event_by_name(struct tep_handle *pevent,
} }
static unsigned long long static unsigned long long
eval_num_arg(void *data, int size, struct tep_event_format *event, struct tep_print_arg *arg) eval_num_arg(void *data, int size, struct tep_event *event, struct tep_print_arg *arg)
{ {
struct tep_handle *pevent = event->pevent; struct tep_handle *pevent = event->pevent;
unsigned long long val = 0; unsigned long long val = 0;
...@@ -3863,7 +3863,7 @@ static void print_bitmask_to_seq(struct tep_handle *pevent, ...@@ -3863,7 +3863,7 @@ static void print_bitmask_to_seq(struct tep_handle *pevent,
} }
static void print_str_arg(struct trace_seq *s, void *data, int size, static void print_str_arg(struct trace_seq *s, void *data, int size,
struct tep_event_format *event, const char *format, struct tep_event *event, const char *format,
int len_arg, struct tep_print_arg *arg) int len_arg, struct tep_print_arg *arg)
{ {
struct tep_handle *pevent = event->pevent; struct tep_handle *pevent = event->pevent;
...@@ -4118,7 +4118,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size, ...@@ -4118,7 +4118,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,
static unsigned long long static unsigned long long
process_defined_func(struct trace_seq *s, void *data, int size, process_defined_func(struct trace_seq *s, void *data, int size,
struct tep_event_format *event, struct tep_print_arg *arg) struct tep_event *event, struct tep_print_arg *arg)
{ {
struct tep_function_handler *func_handle = arg->func.func; struct tep_function_handler *func_handle = arg->func.func;
struct func_params *param; struct func_params *param;
...@@ -4213,7 +4213,7 @@ static void free_args(struct tep_print_arg *args) ...@@ -4213,7 +4213,7 @@ static void free_args(struct tep_print_arg *args)
} }
} }
static struct tep_print_arg *make_bprint_args(char *fmt, void *data, int size, struct tep_event_format *event) static struct tep_print_arg *make_bprint_args(char *fmt, void *data, int size, struct tep_event *event)
{ {
struct tep_handle *pevent = event->pevent; struct tep_handle *pevent = event->pevent;
struct tep_format_field *field, *ip_field; struct tep_format_field *field, *ip_field;
...@@ -4390,7 +4390,7 @@ static struct tep_print_arg *make_bprint_args(char *fmt, void *data, int size, s ...@@ -4390,7 +4390,7 @@ static struct tep_print_arg *make_bprint_args(char *fmt, void *data, int size, s
static char * static char *
get_bprint_format(void *data, int size __maybe_unused, get_bprint_format(void *data, int size __maybe_unused,
struct tep_event_format *event) struct tep_event *event)
{ {
struct tep_handle *pevent = event->pevent; struct tep_handle *pevent = event->pevent;
unsigned long long addr; unsigned long long addr;
...@@ -4425,7 +4425,7 @@ get_bprint_format(void *data, int size __maybe_unused, ...@@ -4425,7 +4425,7 @@ get_bprint_format(void *data, int size __maybe_unused,
} }
static void print_mac_arg(struct trace_seq *s, int mac, void *data, int size, static void print_mac_arg(struct trace_seq *s, int mac, void *data, int size,
struct tep_event_format *event, struct tep_print_arg *arg) struct tep_event *event, struct tep_print_arg *arg)
{ {
unsigned char *buf; unsigned char *buf;
const char *fmt = "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x"; const char *fmt = "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x";
...@@ -4578,7 +4578,7 @@ static void print_ip6_addr(struct trace_seq *s, char i, unsigned char *buf) ...@@ -4578,7 +4578,7 @@ static void print_ip6_addr(struct trace_seq *s, char i, unsigned char *buf)
* %pISpc print an IP address based on sockaddr; p adds port. * %pISpc print an IP address based on sockaddr; p adds port.
*/ */
static int print_ipv4_arg(struct trace_seq *s, const char *ptr, char i, static int print_ipv4_arg(struct trace_seq *s, const char *ptr, char i,
void *data, int size, struct tep_event_format *event, void *data, int size, struct tep_event *event,
struct tep_print_arg *arg) struct tep_print_arg *arg)
{ {
unsigned char *buf; unsigned char *buf;
...@@ -4615,7 +4615,7 @@ static int print_ipv4_arg(struct trace_seq *s, const char *ptr, char i, ...@@ -4615,7 +4615,7 @@ static int print_ipv4_arg(struct trace_seq *s, const char *ptr, char i,
} }
static int print_ipv6_arg(struct trace_seq *s, const char *ptr, char i, static int print_ipv6_arg(struct trace_seq *s, const char *ptr, char i,
void *data, int size, struct tep_event_format *event, void *data, int size, struct tep_event *event,
struct tep_print_arg *arg) struct tep_print_arg *arg)
{ {
char have_c = 0; char have_c = 0;
...@@ -4665,7 +4665,7 @@ static int print_ipv6_arg(struct trace_seq *s, const char *ptr, char i, ...@@ -4665,7 +4665,7 @@ static int print_ipv6_arg(struct trace_seq *s, const char *ptr, char i,
} }
static int print_ipsa_arg(struct trace_seq *s, const char *ptr, char i, static int print_ipsa_arg(struct trace_seq *s, const char *ptr, char i,
void *data, int size, struct tep_event_format *event, void *data, int size, struct tep_event *event,
struct tep_print_arg *arg) struct tep_print_arg *arg)
{ {
char have_c = 0, have_p = 0; char have_c = 0, have_p = 0;
...@@ -4747,7 +4747,7 @@ static int print_ipsa_arg(struct trace_seq *s, const char *ptr, char i, ...@@ -4747,7 +4747,7 @@ static int print_ipsa_arg(struct trace_seq *s, const char *ptr, char i,
} }
static int print_ip_arg(struct trace_seq *s, const char *ptr, static int print_ip_arg(struct trace_seq *s, const char *ptr,
void *data, int size, struct tep_event_format *event, void *data, int size, struct tep_event *event,
struct tep_print_arg *arg) struct tep_print_arg *arg)
{ {
char i = *ptr; /* 'i' or 'I' */ char i = *ptr; /* 'i' or 'I' */
...@@ -4854,7 +4854,7 @@ void tep_print_field(struct trace_seq *s, void *data, ...@@ -4854,7 +4854,7 @@ void tep_print_field(struct trace_seq *s, void *data,
} }
void tep_print_fields(struct trace_seq *s, void *data, void tep_print_fields(struct trace_seq *s, void *data,
int size __maybe_unused, struct tep_event_format *event) int size __maybe_unused, struct tep_event *event)
{ {
struct tep_format_field *field; struct tep_format_field *field;
...@@ -4866,7 +4866,7 @@ void tep_print_fields(struct trace_seq *s, void *data, ...@@ -4866,7 +4866,7 @@ void tep_print_fields(struct trace_seq *s, void *data,
} }
} }
static void pretty_print(struct trace_seq *s, void *data, int size, struct tep_event_format *event) static void pretty_print(struct trace_seq *s, void *data, int size, struct tep_event *event)
{ {
struct tep_handle *pevent = event->pevent; struct tep_handle *pevent = event->pevent;
struct tep_print_fmt *print_fmt = &event->print_fmt; struct tep_print_fmt *print_fmt = &event->print_fmt;
...@@ -5229,7 +5229,7 @@ int tep_data_type(struct tep_handle *pevent, struct tep_record *rec) ...@@ -5229,7 +5229,7 @@ int tep_data_type(struct tep_handle *pevent, struct tep_record *rec)
* *
* This returns the event form a given @type; * This returns the event form a given @type;
*/ */
struct tep_event_format *tep_data_event_from_type(struct tep_handle *pevent, int type) struct tep_event *tep_data_event_from_type(struct tep_handle *pevent, int type)
{ {
return tep_find_event(pevent, type); return tep_find_event(pevent, type);
} }
...@@ -5387,7 +5387,7 @@ int tep_cmdline_pid(struct tep_handle *pevent, struct cmdline *cmdline) ...@@ -5387,7 +5387,7 @@ int tep_cmdline_pid(struct tep_handle *pevent, struct cmdline *cmdline)
* This parses the raw @data using the given @event information and * This parses the raw @data using the given @event information and
* writes the print format into the trace_seq. * writes the print format into the trace_seq.
*/ */
void tep_event_info(struct trace_seq *s, struct tep_event_format *event, void tep_event_info(struct trace_seq *s, struct tep_event *event,
struct tep_record *record) struct tep_record *record)
{ {
int print_pretty = 1; int print_pretty = 1;
...@@ -5428,7 +5428,7 @@ static bool is_timestamp_in_us(char *trace_clock, bool use_trace_clock) ...@@ -5428,7 +5428,7 @@ static bool is_timestamp_in_us(char *trace_clock, bool use_trace_clock)
* Returns the associated event for a given record, or NULL if non is * Returns the associated event for a given record, or NULL if non is
* is found. * is found.
*/ */
struct tep_event_format * struct tep_event *
tep_find_event_by_record(struct tep_handle *pevent, struct tep_record *record) tep_find_event_by_record(struct tep_handle *pevent, struct tep_record *record)
{ {
int type; int type;
...@@ -5453,7 +5453,7 @@ tep_find_event_by_record(struct tep_handle *pevent, struct tep_record *record) ...@@ -5453,7 +5453,7 @@ tep_find_event_by_record(struct tep_handle *pevent, struct tep_record *record)
* Writes the tasks comm, pid and CPU to @s. * Writes the tasks comm, pid and CPU to @s.
*/ */
void tep_print_event_task(struct tep_handle *pevent, struct trace_seq *s, void tep_print_event_task(struct tep_handle *pevent, struct trace_seq *s,
struct tep_event_format *event, struct tep_event *event,
struct tep_record *record) struct tep_record *record)
{ {
void *data = record->data; void *data = record->data;
...@@ -5481,7 +5481,7 @@ void tep_print_event_task(struct tep_handle *pevent, struct trace_seq *s, ...@@ -5481,7 +5481,7 @@ void tep_print_event_task(struct tep_handle *pevent, struct trace_seq *s,
* Writes the timestamp of the record into @s. * Writes the timestamp of the record into @s.
*/ */
void tep_print_event_time(struct tep_handle *pevent, struct trace_seq *s, void tep_print_event_time(struct tep_handle *pevent, struct trace_seq *s,
struct tep_event_format *event, struct tep_event *event,
struct tep_record *record, struct tep_record *record,
bool use_trace_clock) bool use_trace_clock)
{ {
...@@ -5531,7 +5531,7 @@ void tep_print_event_time(struct tep_handle *pevent, struct trace_seq *s, ...@@ -5531,7 +5531,7 @@ void tep_print_event_time(struct tep_handle *pevent, struct trace_seq *s,
* Writes the parsing of the record's data to @s. * Writes the parsing of the record's data to @s.
*/ */
void tep_print_event_data(struct tep_handle *pevent, struct trace_seq *s, void tep_print_event_data(struct tep_handle *pevent, struct trace_seq *s,
struct tep_event_format *event, struct tep_event *event,
struct tep_record *record) struct tep_record *record)
{ {
static const char *spaces = " "; /* 20 spaces */ static const char *spaces = " "; /* 20 spaces */
...@@ -5550,7 +5550,7 @@ void tep_print_event_data(struct tep_handle *pevent, struct trace_seq *s, ...@@ -5550,7 +5550,7 @@ void tep_print_event_data(struct tep_handle *pevent, struct trace_seq *s,
void tep_print_event(struct tep_handle *pevent, struct trace_seq *s, void tep_print_event(struct tep_handle *pevent, struct trace_seq *s,
struct tep_record *record, bool use_trace_clock) struct tep_record *record, bool use_trace_clock)
{ {
struct tep_event_format *event; struct tep_event *event;
event = tep_find_event_by_record(pevent, record); event = tep_find_event_by_record(pevent, record);
if (!event) { if (!event) {
...@@ -5572,8 +5572,8 @@ void tep_print_event(struct tep_handle *pevent, struct trace_seq *s, ...@@ -5572,8 +5572,8 @@ void tep_print_event(struct tep_handle *pevent, struct trace_seq *s,
static int events_id_cmp(const void *a, const void *b) static int events_id_cmp(const void *a, const void *b)
{ {
struct tep_event_format * const * ea = a; struct tep_event * const * ea = a;
struct tep_event_format * const * eb = b; struct tep_event * const * eb = b;
if ((*ea)->id < (*eb)->id) if ((*ea)->id < (*eb)->id)
return -1; return -1;
...@@ -5586,8 +5586,8 @@ static int events_id_cmp(const void *a, const void *b) ...@@ -5586,8 +5586,8 @@ static int events_id_cmp(const void *a, const void *b)
static int events_name_cmp(const void *a, const void *b) static int events_name_cmp(const void *a, const void *b)
{ {
struct tep_event_format * const * ea = a; struct tep_event * const * ea = a;
struct tep_event_format * const * eb = b; struct tep_event * const * eb = b;
int res; int res;
res = strcmp((*ea)->name, (*eb)->name); res = strcmp((*ea)->name, (*eb)->name);
...@@ -5603,8 +5603,8 @@ static int events_name_cmp(const void *a, const void *b) ...@@ -5603,8 +5603,8 @@ static int events_name_cmp(const void *a, const void *b)
static int events_system_cmp(const void *a, const void *b) static int events_system_cmp(const void *a, const void *b)
{ {
struct tep_event_format * const * ea = a; struct tep_event * const * ea = a;
struct tep_event_format * const * eb = b; struct tep_event * const * eb = b;
int res; int res;
res = strcmp((*ea)->system, (*eb)->system); res = strcmp((*ea)->system, (*eb)->system);
...@@ -5618,9 +5618,9 @@ static int events_system_cmp(const void *a, const void *b) ...@@ -5618,9 +5618,9 @@ static int events_system_cmp(const void *a, const void *b)
return events_id_cmp(a, b); return events_id_cmp(a, b);
} }
struct tep_event_format **tep_list_events(struct tep_handle *pevent, enum tep_event_sort_type sort_type) struct tep_event **tep_list_events(struct tep_handle *pevent, enum tep_event_sort_type sort_type)
{ {
struct tep_event_format **events; struct tep_event **events;
int (*sort)(const void *a, const void *b); int (*sort)(const void *a, const void *b);
events = pevent->sort_events; events = pevent->sort_events;
...@@ -5703,7 +5703,7 @@ get_event_fields(const char *type, const char *name, ...@@ -5703,7 +5703,7 @@ get_event_fields(const char *type, const char *name,
* Returns an allocated array of fields. The last item in the array is NULL. * Returns an allocated array of fields. The last item in the array is NULL.
* The array must be freed with free(). * The array must be freed with free().
*/ */
struct tep_format_field **tep_event_common_fields(struct tep_event_format *event) struct tep_format_field **tep_event_common_fields(struct tep_event *event)
{ {
return get_event_fields("common", event->name, return get_event_fields("common", event->name,
event->format.nr_common, event->format.nr_common,
...@@ -5717,7 +5717,7 @@ struct tep_format_field **tep_event_common_fields(struct tep_event_format *event ...@@ -5717,7 +5717,7 @@ struct tep_format_field **tep_event_common_fields(struct tep_event_format *event
* Returns an allocated array of fields. The last item in the array is NULL. * Returns an allocated array of fields. The last item in the array is NULL.
* The array must be freed with free(). * The array must be freed with free().
*/ */
struct tep_format_field **tep_event_fields(struct tep_event_format *event) struct tep_format_field **tep_event_fields(struct tep_event *event)
{ {
return get_event_fields("event", event->name, return get_event_fields("event", event->name,
event->format.nr_fields, event->format.nr_fields,
...@@ -5959,7 +5959,7 @@ int tep_parse_header_page(struct tep_handle *pevent, char *buf, unsigned long si ...@@ -5959,7 +5959,7 @@ int tep_parse_header_page(struct tep_handle *pevent, char *buf, unsigned long si
return 0; return 0;
} }
static int event_matches(struct tep_event_format *event, static int event_matches(struct tep_event *event,
int id, const char *sys_name, int id, const char *sys_name,
const char *event_name) const char *event_name)
{ {
...@@ -5982,7 +5982,7 @@ static void free_handler(struct event_handler *handle) ...@@ -5982,7 +5982,7 @@ static void free_handler(struct event_handler *handle)
free(handle); free(handle);
} }
static int find_event_handle(struct tep_handle *pevent, struct tep_event_format *event) static int find_event_handle(struct tep_handle *pevent, struct tep_event *event)
{ {
struct event_handler *handle, **next; struct event_handler *handle, **next;
...@@ -6023,11 +6023,11 @@ static int find_event_handle(struct tep_handle *pevent, struct tep_event_format ...@@ -6023,11 +6023,11 @@ static int find_event_handle(struct tep_handle *pevent, struct tep_event_format
* *
* /sys/kernel/debug/tracing/events/.../.../format * /sys/kernel/debug/tracing/events/.../.../format
*/ */
enum tep_errno __tep_parse_format(struct tep_event_format **eventp, enum tep_errno __tep_parse_format(struct tep_event **eventp,
struct tep_handle *pevent, const char *buf, struct tep_handle *pevent, const char *buf,
unsigned long size, const char *sys) unsigned long size, const char *sys)
{ {
struct tep_event_format *event; struct tep_event *event;
int ret; int ret;
init_input_buf(buf, size); init_input_buf(buf, size);
...@@ -6132,12 +6132,12 @@ enum tep_errno __tep_parse_format(struct tep_event_format **eventp, ...@@ -6132,12 +6132,12 @@ enum tep_errno __tep_parse_format(struct tep_event_format **eventp,
static enum tep_errno static enum tep_errno
__parse_event(struct tep_handle *pevent, __parse_event(struct tep_handle *pevent,
struct tep_event_format **eventp, struct tep_event **eventp,
const char *buf, unsigned long size, const char *buf, unsigned long size,
const char *sys) const char *sys)
{ {
int ret = __tep_parse_format(eventp, pevent, buf, size, sys); int ret = __tep_parse_format(eventp, pevent, buf, size, sys);
struct tep_event_format *event = *eventp; struct tep_event *event = *eventp;
if (event == NULL) if (event == NULL)
return ret; return ret;
...@@ -6174,7 +6174,7 @@ __parse_event(struct tep_handle *pevent, ...@@ -6174,7 +6174,7 @@ __parse_event(struct tep_handle *pevent,
* /sys/kernel/debug/tracing/events/.../.../format * /sys/kernel/debug/tracing/events/.../.../format
*/ */
enum tep_errno tep_parse_format(struct tep_handle *pevent, enum tep_errno tep_parse_format(struct tep_handle *pevent,
struct tep_event_format **eventp, struct tep_event **eventp,
const char *buf, const char *buf,
unsigned long size, const char *sys) unsigned long size, const char *sys)
{ {
...@@ -6198,7 +6198,7 @@ enum tep_errno tep_parse_format(struct tep_handle *pevent, ...@@ -6198,7 +6198,7 @@ enum tep_errno tep_parse_format(struct tep_handle *pevent,
enum tep_errno tep_parse_event(struct tep_handle *pevent, const char *buf, enum tep_errno tep_parse_event(struct tep_handle *pevent, const char *buf,
unsigned long size, const char *sys) unsigned long size, const char *sys)
{ {
struct tep_event_format *event = NULL; struct tep_event *event = NULL;
return __parse_event(pevent, &event, buf, size, sys); return __parse_event(pevent, &event, buf, size, sys);
} }
...@@ -6235,7 +6235,7 @@ int get_field_val(struct trace_seq *s, struct tep_format_field *field, ...@@ -6235,7 +6235,7 @@ int get_field_val(struct trace_seq *s, struct tep_format_field *field,
* *
* On failure, it returns NULL. * On failure, it returns NULL.
*/ */
void *tep_get_field_raw(struct trace_seq *s, struct tep_event_format *event, void *tep_get_field_raw(struct trace_seq *s, struct tep_event *event,
const char *name, struct tep_record *record, const char *name, struct tep_record *record,
int *len, int err) int *len, int err)
{ {
...@@ -6282,7 +6282,7 @@ void *tep_get_field_raw(struct trace_seq *s, struct tep_event_format *event, ...@@ -6282,7 +6282,7 @@ void *tep_get_field_raw(struct trace_seq *s, struct tep_event_format *event,
* *
* Returns 0 on success -1 on field not found. * Returns 0 on success -1 on field not found.
*/ */
int tep_get_field_val(struct trace_seq *s, struct tep_event_format *event, int tep_get_field_val(struct trace_seq *s, struct tep_event *event,
const char *name, struct tep_record *record, const char *name, struct tep_record *record,
unsigned long long *val, int err) unsigned long long *val, int err)
{ {
...@@ -6307,7 +6307,7 @@ int tep_get_field_val(struct trace_seq *s, struct tep_event_format *event, ...@@ -6307,7 +6307,7 @@ int tep_get_field_val(struct trace_seq *s, struct tep_event_format *event,
* *
* Returns 0 on success -1 on field not found. * Returns 0 on success -1 on field not found.
*/ */
int tep_get_common_field_val(struct trace_seq *s, struct tep_event_format *event, int tep_get_common_field_val(struct trace_seq *s, struct tep_event *event,
const char *name, struct tep_record *record, const char *name, struct tep_record *record,
unsigned long long *val, int err) unsigned long long *val, int err)
{ {
...@@ -6332,7 +6332,7 @@ int tep_get_common_field_val(struct trace_seq *s, struct tep_event_format *event ...@@ -6332,7 +6332,7 @@ int tep_get_common_field_val(struct trace_seq *s, struct tep_event_format *event
* *
* Returns 0 on success -1 on field not found. * Returns 0 on success -1 on field not found.
*/ */
int tep_get_any_field_val(struct trace_seq *s, struct tep_event_format *event, int tep_get_any_field_val(struct trace_seq *s, struct tep_event *event,
const char *name, struct tep_record *record, const char *name, struct tep_record *record,
unsigned long long *val, int err) unsigned long long *val, int err)
{ {
...@@ -6358,7 +6358,7 @@ int tep_get_any_field_val(struct trace_seq *s, struct tep_event_format *event, ...@@ -6358,7 +6358,7 @@ int tep_get_any_field_val(struct trace_seq *s, struct tep_event_format *event,
* Returns: 0 on success, -1 field not found, or 1 if buffer is full. * Returns: 0 on success, -1 field not found, or 1 if buffer is full.
*/ */
int tep_print_num_field(struct trace_seq *s, const char *fmt, int tep_print_num_field(struct trace_seq *s, const char *fmt,
struct tep_event_format *event, const char *name, struct tep_event *event, const char *name,
struct tep_record *record, int err) struct tep_record *record, int err)
{ {
struct tep_format_field *field = tep_find_field(event, name); struct tep_format_field *field = tep_find_field(event, name);
...@@ -6390,7 +6390,7 @@ int tep_print_num_field(struct trace_seq *s, const char *fmt, ...@@ -6390,7 +6390,7 @@ int tep_print_num_field(struct trace_seq *s, const char *fmt,
* Returns: 0 on success, -1 field not found, or 1 if buffer is full. * Returns: 0 on success, -1 field not found, or 1 if buffer is full.
*/ */
int tep_print_func_field(struct trace_seq *s, const char *fmt, int tep_print_func_field(struct trace_seq *s, const char *fmt,
struct tep_event_format *event, const char *name, struct tep_event *event, const char *name,
struct tep_record *record, int err) struct tep_record *record, int err)
{ {
struct tep_format_field *field = tep_find_field(event, name); struct tep_format_field *field = tep_find_field(event, name);
...@@ -6550,11 +6550,11 @@ int tep_unregister_print_function(struct tep_handle *pevent, ...@@ -6550,11 +6550,11 @@ int tep_unregister_print_function(struct tep_handle *pevent,
return -1; return -1;
} }
static struct tep_event_format *search_event(struct tep_handle *pevent, int id, static struct tep_event *search_event(struct tep_handle *pevent, int id,
const char *sys_name, const char *sys_name,
const char *event_name) const char *event_name)
{ {
struct tep_event_format *event; struct tep_event *event;
if (id >= 0) { if (id >= 0) {
/* search by id */ /* search by id */
...@@ -6594,7 +6594,7 @@ int tep_register_event_handler(struct tep_handle *pevent, int id, ...@@ -6594,7 +6594,7 @@ int tep_register_event_handler(struct tep_handle *pevent, int id,
const char *sys_name, const char *event_name, const char *sys_name, const char *event_name,
tep_event_handler_func func, void *context) tep_event_handler_func func, void *context)
{ {
struct tep_event_format *event; struct tep_event *event;
struct event_handler *handle; struct event_handler *handle;
event = search_event(pevent, id, sys_name, event_name); event = search_event(pevent, id, sys_name, event_name);
...@@ -6678,7 +6678,7 @@ int tep_unregister_event_handler(struct tep_handle *pevent, int id, ...@@ -6678,7 +6678,7 @@ int tep_unregister_event_handler(struct tep_handle *pevent, int id,
const char *sys_name, const char *event_name, const char *sys_name, const char *event_name,
tep_event_handler_func func, void *context) tep_event_handler_func func, void *context)
{ {
struct tep_event_format *event; struct tep_event *event;
struct event_handler *handle; struct event_handler *handle;
struct event_handler **next; struct event_handler **next;
...@@ -6763,7 +6763,7 @@ static void free_formats(struct tep_format *format) ...@@ -6763,7 +6763,7 @@ static void free_formats(struct tep_format *format)
free_format_fields(format->fields); free_format_fields(format->fields);
} }
void tep_free_format(struct tep_event_format *event) void tep_free_format(struct tep_event *event)
{ {
free(event->name); free(event->name);
free(event->system); free(event->system);
......
...@@ -57,11 +57,11 @@ struct tep_record { ...@@ -57,11 +57,11 @@ struct tep_record {
/* ----------------------- tep ----------------------- */ /* ----------------------- tep ----------------------- */
struct tep_handle; struct tep_handle;
struct tep_event_format; struct tep_event;
typedef int (*tep_event_handler_func)(struct trace_seq *s, typedef int (*tep_event_handler_func)(struct trace_seq *s,
struct tep_record *record, struct tep_record *record,
struct tep_event_format *event, struct tep_event *event,
void *context); void *context);
typedef int (*tep_plugin_load_func)(struct tep_handle *pevent); typedef int (*tep_plugin_load_func)(struct tep_handle *pevent);
...@@ -143,7 +143,7 @@ enum tep_format_flags { ...@@ -143,7 +143,7 @@ enum tep_format_flags {
struct tep_format_field { struct tep_format_field {
struct tep_format_field *next; struct tep_format_field *next;
struct tep_event_format *event; struct tep_event *event;
char *type; char *type;
char *name; char *name;
char *alias; char *alias;
...@@ -277,7 +277,7 @@ struct tep_print_fmt { ...@@ -277,7 +277,7 @@ struct tep_print_fmt {
struct tep_print_arg *args; struct tep_print_arg *args;
}; };
struct tep_event_format { struct tep_event {
struct tep_handle *pevent; struct tep_handle *pevent;
char *name; char *name;
int id; int id;
...@@ -454,14 +454,14 @@ int tep_register_print_string(struct tep_handle *pevent, const char *fmt, ...@@ -454,14 +454,14 @@ int tep_register_print_string(struct tep_handle *pevent, const char *fmt,
int tep_pid_is_registered(struct tep_handle *pevent, int pid); int tep_pid_is_registered(struct tep_handle *pevent, int pid);
void tep_print_event_task(struct tep_handle *pevent, struct trace_seq *s, void tep_print_event_task(struct tep_handle *pevent, struct trace_seq *s,
struct tep_event_format *event, struct tep_event *event,
struct tep_record *record); struct tep_record *record);
void tep_print_event_time(struct tep_handle *pevent, struct trace_seq *s, void tep_print_event_time(struct tep_handle *pevent, struct trace_seq *s,
struct tep_event_format *event, struct tep_event *event,
struct tep_record *record, struct tep_record *record,
bool use_trace_clock); bool use_trace_clock);
void tep_print_event_data(struct tep_handle *pevent, struct trace_seq *s, void tep_print_event_data(struct tep_handle *pevent, struct trace_seq *s,
struct tep_event_format *event, struct tep_event *event,
struct tep_record *record); struct tep_record *record);
void tep_print_event(struct tep_handle *pevent, struct trace_seq *s, void tep_print_event(struct tep_handle *pevent, struct trace_seq *s,
struct tep_record *record, bool use_trace_clock); struct tep_record *record, bool use_trace_clock);
...@@ -472,32 +472,32 @@ int tep_parse_header_page(struct tep_handle *pevent, char *buf, unsigned long si ...@@ -472,32 +472,32 @@ int tep_parse_header_page(struct tep_handle *pevent, char *buf, unsigned long si
enum tep_errno tep_parse_event(struct tep_handle *pevent, const char *buf, enum tep_errno tep_parse_event(struct tep_handle *pevent, const char *buf,
unsigned long size, const char *sys); unsigned long size, const char *sys);
enum tep_errno tep_parse_format(struct tep_handle *pevent, enum tep_errno tep_parse_format(struct tep_handle *pevent,
struct tep_event_format **eventp, struct tep_event **eventp,
const char *buf, const char *buf,
unsigned long size, const char *sys); unsigned long size, const char *sys);
void tep_free_format(struct tep_event_format *event); void tep_free_format(struct tep_event *event);
void tep_free_format_field(struct tep_format_field *field); void tep_free_format_field(struct tep_format_field *field);
void *tep_get_field_raw(struct trace_seq *s, struct tep_event_format *event, void *tep_get_field_raw(struct trace_seq *s, struct tep_event *event,
const char *name, struct tep_record *record, const char *name, struct tep_record *record,
int *len, int err); int *len, int err);
int tep_get_field_val(struct trace_seq *s, struct tep_event_format *event, int tep_get_field_val(struct trace_seq *s, struct tep_event *event,
const char *name, struct tep_record *record, const char *name, struct tep_record *record,
unsigned long long *val, int err); unsigned long long *val, int err);
int tep_get_common_field_val(struct trace_seq *s, struct tep_event_format *event, int tep_get_common_field_val(struct trace_seq *s, struct tep_event *event,
const char *name, struct tep_record *record, const char *name, struct tep_record *record,
unsigned long long *val, int err); unsigned long long *val, int err);
int tep_get_any_field_val(struct trace_seq *s, struct tep_event_format *event, int tep_get_any_field_val(struct trace_seq *s, struct tep_event *event,
const char *name, struct tep_record *record, const char *name, struct tep_record *record,
unsigned long long *val, int err); unsigned long long *val, int err);
int tep_print_num_field(struct trace_seq *s, const char *fmt, int tep_print_num_field(struct trace_seq *s, const char *fmt,
struct tep_event_format *event, const char *name, struct tep_event *event, const char *name,
struct tep_record *record, int err); struct tep_record *record, int err);
int tep_print_func_field(struct trace_seq *s, const char *fmt, int tep_print_func_field(struct trace_seq *s, const char *fmt,
struct tep_event_format *event, const char *name, struct tep_event *event, const char *name,
struct tep_record *record, int err); struct tep_record *record, int err);
int tep_register_event_handler(struct tep_handle *pevent, int id, int tep_register_event_handler(struct tep_handle *pevent, int id,
...@@ -513,9 +513,9 @@ int tep_register_print_function(struct tep_handle *pevent, ...@@ -513,9 +513,9 @@ int tep_register_print_function(struct tep_handle *pevent,
int tep_unregister_print_function(struct tep_handle *pevent, int tep_unregister_print_function(struct tep_handle *pevent,
tep_func_handler func, char *name); tep_func_handler func, char *name);
struct tep_format_field *tep_find_common_field(struct tep_event_format *event, const char *name); struct tep_format_field *tep_find_common_field(struct tep_event *event, const char *name);
struct tep_format_field *tep_find_field(struct tep_event_format *event, const char *name); struct tep_format_field *tep_find_field(struct tep_event *event, const char *name);
struct tep_format_field *tep_find_any_field(struct tep_event_format *event, const char *name); struct tep_format_field *tep_find_any_field(struct tep_event *event, const char *name);
const char *tep_find_function(struct tep_handle *pevent, unsigned long long addr); const char *tep_find_function(struct tep_handle *pevent, unsigned long long addr);
unsigned long long unsigned long long
...@@ -524,19 +524,19 @@ unsigned long long tep_read_number(struct tep_handle *pevent, const void *ptr, i ...@@ -524,19 +524,19 @@ unsigned long long tep_read_number(struct tep_handle *pevent, const void *ptr, i
int tep_read_number_field(struct tep_format_field *field, const void *data, int tep_read_number_field(struct tep_format_field *field, const void *data,
unsigned long long *value); unsigned long long *value);
struct tep_event_format *tep_get_first_event(struct tep_handle *tep); struct tep_event *tep_get_first_event(struct tep_handle *tep);
int tep_get_events_count(struct tep_handle *tep); int tep_get_events_count(struct tep_handle *tep);
struct tep_event_format *tep_find_event(struct tep_handle *pevent, int id); struct tep_event *tep_find_event(struct tep_handle *pevent, int id);
struct tep_event_format * struct tep_event *
tep_find_event_by_name(struct tep_handle *pevent, const char *sys, const char *name); tep_find_event_by_name(struct tep_handle *pevent, const char *sys, const char *name);
struct tep_event_format * struct tep_event *
tep_find_event_by_record(struct tep_handle *pevent, struct tep_record *record); tep_find_event_by_record(struct tep_handle *pevent, struct tep_record *record);
void tep_data_lat_fmt(struct tep_handle *pevent, void tep_data_lat_fmt(struct tep_handle *pevent,
struct trace_seq *s, struct tep_record *record); struct trace_seq *s, struct tep_record *record);
int tep_data_type(struct tep_handle *pevent, struct tep_record *rec); int tep_data_type(struct tep_handle *pevent, struct tep_record *rec);
struct tep_event_format *tep_data_event_from_type(struct tep_handle *pevent, int type); struct tep_event *tep_data_event_from_type(struct tep_handle *pevent, int type);
int tep_data_pid(struct tep_handle *pevent, struct tep_record *rec); 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);
...@@ -549,15 +549,15 @@ int tep_cmdline_pid(struct tep_handle *pevent, struct cmdline *cmdline); ...@@ -549,15 +549,15 @@ int tep_cmdline_pid(struct tep_handle *pevent, struct 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);
void tep_print_fields(struct trace_seq *s, void *data, void tep_print_fields(struct trace_seq *s, void *data,
int size __maybe_unused, struct tep_event_format *event); int size __maybe_unused, struct tep_event *event);
void tep_event_info(struct trace_seq *s, struct tep_event_format *event, void tep_event_info(struct trace_seq *s, struct tep_event *event,
struct tep_record *record); struct tep_record *record);
int tep_strerror(struct tep_handle *pevent, enum tep_errno errnum, int tep_strerror(struct tep_handle *pevent, enum tep_errno errnum,
char *buf, size_t buflen); char *buf, size_t buflen);
struct tep_event_format **tep_list_events(struct tep_handle *pevent, enum tep_event_sort_type); struct tep_event **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_common_fields(struct tep_event *event);
struct tep_format_field **tep_event_fields(struct tep_event_format *event); struct tep_format_field **tep_event_fields(struct tep_event *event);
enum tep_endian { enum tep_endian {
TEP_LITTLE_ENDIAN = 0, TEP_LITTLE_ENDIAN = 0,
...@@ -713,7 +713,7 @@ struct tep_filter_arg { ...@@ -713,7 +713,7 @@ struct tep_filter_arg {
struct tep_filter_type { struct tep_filter_type {
int event_id; int event_id;
struct tep_event_format *event; struct tep_event *event;
struct tep_filter_arg *filter; struct tep_filter_arg *filter;
}; };
......
...@@ -27,7 +27,7 @@ static struct tep_format_field cpu = { ...@@ -27,7 +27,7 @@ static struct tep_format_field cpu = {
struct event_list { struct event_list {
struct event_list *next; struct event_list *next;
struct tep_event_format *event; struct tep_event *event;
}; };
static void show_error(char *error_buf, const char *fmt, ...) static void show_error(char *error_buf, const char *fmt, ...)
...@@ -229,7 +229,7 @@ static void free_arg(struct tep_filter_arg *arg) ...@@ -229,7 +229,7 @@ static void free_arg(struct tep_filter_arg *arg)
} }
static int add_event(struct event_list **events, static int add_event(struct event_list **events,
struct tep_event_format *event) struct tep_event *event)
{ {
struct event_list *list; struct event_list *list;
...@@ -243,7 +243,7 @@ static int add_event(struct event_list **events, ...@@ -243,7 +243,7 @@ static int add_event(struct event_list **events,
return 0; return 0;
} }
static int event_match(struct tep_event_format *event, static int event_match(struct tep_event *event,
regex_t *sreg, regex_t *ereg) regex_t *sreg, regex_t *ereg)
{ {
if (sreg) { if (sreg) {
...@@ -259,7 +259,7 @@ static enum tep_errno ...@@ -259,7 +259,7 @@ static enum tep_errno
find_event(struct tep_handle *pevent, struct event_list **events, find_event(struct tep_handle *pevent, struct event_list **events,
char *sys_name, char *event_name) char *sys_name, char *event_name)
{ {
struct tep_event_format *event; struct tep_event *event;
regex_t ereg; regex_t ereg;
regex_t sreg; regex_t sreg;
int match = 0; int match = 0;
...@@ -334,7 +334,7 @@ static void free_events(struct event_list *events) ...@@ -334,7 +334,7 @@ static void free_events(struct event_list *events)
} }
static enum tep_errno static enum tep_errno
create_arg_item(struct tep_event_format *event, const char *token, create_arg_item(struct tep_event *event, const char *token,
enum tep_event_type type, struct tep_filter_arg **parg, char *error_str) enum tep_event_type type, struct tep_filter_arg **parg, char *error_str)
{ {
struct tep_format_field *field; struct tep_format_field *field;
...@@ -940,7 +940,7 @@ static int collapse_tree(struct tep_filter_arg *arg, ...@@ -940,7 +940,7 @@ static int collapse_tree(struct tep_filter_arg *arg,
} }
static enum tep_errno static enum tep_errno
process_filter(struct tep_event_format *event, struct tep_filter_arg **parg, process_filter(struct tep_event *event, struct tep_filter_arg **parg,
char *error_str, int not) char *error_str, int not)
{ {
enum tep_event_type type; enum tep_event_type type;
...@@ -1180,7 +1180,7 @@ process_filter(struct tep_event_format *event, struct tep_filter_arg **parg, ...@@ -1180,7 +1180,7 @@ process_filter(struct tep_event_format *event, struct tep_filter_arg **parg,
} }
static enum tep_errno static enum tep_errno
process_event(struct tep_event_format *event, const char *filter_str, process_event(struct tep_event *event, const char *filter_str,
struct tep_filter_arg **parg, char *error_str) struct tep_filter_arg **parg, char *error_str)
{ {
int ret; int ret;
...@@ -1205,7 +1205,7 @@ process_event(struct tep_event_format *event, const char *filter_str, ...@@ -1205,7 +1205,7 @@ process_event(struct tep_event_format *event, const char *filter_str,
} }
static enum tep_errno static enum tep_errno
filter_event(struct tep_event_filter *filter, struct tep_event_format *event, filter_event(struct tep_event_filter *filter, struct tep_event *event,
const char *filter_str, char *error_str) const char *filter_str, char *error_str)
{ {
struct tep_filter_type *filter_type; struct tep_filter_type *filter_type;
...@@ -1457,7 +1457,7 @@ static int copy_filter_type(struct tep_event_filter *filter, ...@@ -1457,7 +1457,7 @@ static int copy_filter_type(struct tep_event_filter *filter,
struct tep_filter_type *filter_type) struct tep_filter_type *filter_type)
{ {
struct tep_filter_arg *arg; struct tep_filter_arg *arg;
struct tep_event_format *event; struct tep_event *event;
const char *sys; const char *sys;
const char *name; const char *name;
char *str; char *str;
...@@ -1539,7 +1539,7 @@ int tep_update_trivial(struct tep_event_filter *dest, struct tep_event_filter *s ...@@ -1539,7 +1539,7 @@ int tep_update_trivial(struct tep_event_filter *dest, struct tep_event_filter *s
{ {
struct tep_handle *src_pevent; struct tep_handle *src_pevent;
struct tep_handle *dest_pevent; struct tep_handle *dest_pevent;
struct tep_event_format *event; struct tep_event *event;
struct tep_filter_type *filter_type; struct tep_filter_type *filter_type;
struct tep_filter_arg *arg; struct tep_filter_arg *arg;
char *str; char *str;
...@@ -1683,11 +1683,11 @@ int tep_filter_event_has_trivial(struct tep_event_filter *filter, ...@@ -1683,11 +1683,11 @@ int tep_filter_event_has_trivial(struct tep_event_filter *filter,
} }
} }
static int test_filter(struct tep_event_format *event, struct tep_filter_arg *arg, static int test_filter(struct tep_event *event, struct tep_filter_arg *arg,
struct tep_record *record, enum tep_errno *err); struct tep_record *record, enum tep_errno *err);
static const char * static const char *
get_comm(struct tep_event_format *event, struct tep_record *record) get_comm(struct tep_event *event, struct tep_record *record)
{ {
const char *comm; const char *comm;
int pid; int pid;
...@@ -1698,7 +1698,7 @@ get_comm(struct tep_event_format *event, struct tep_record *record) ...@@ -1698,7 +1698,7 @@ get_comm(struct tep_event_format *event, struct tep_record *record)
} }
static unsigned long long static unsigned long long
get_value(struct tep_event_format *event, get_value(struct tep_event *event,
struct tep_format_field *field, struct tep_record *record) struct tep_format_field *field, struct tep_record *record)
{ {
unsigned long long val; unsigned long long val;
...@@ -1734,11 +1734,11 @@ get_value(struct tep_event_format *event, ...@@ -1734,11 +1734,11 @@ get_value(struct tep_event_format *event,
} }
static unsigned long long static unsigned long long
get_arg_value(struct tep_event_format *event, struct tep_filter_arg *arg, get_arg_value(struct tep_event *event, struct tep_filter_arg *arg,
struct tep_record *record, enum tep_errno *err); struct tep_record *record, enum tep_errno *err);
static unsigned long long static unsigned long long
get_exp_value(struct tep_event_format *event, struct tep_filter_arg *arg, get_exp_value(struct tep_event *event, struct tep_filter_arg *arg,
struct tep_record *record, enum tep_errno *err) struct tep_record *record, enum tep_errno *err)
{ {
unsigned long long lval, rval; unsigned long long lval, rval;
...@@ -1793,7 +1793,7 @@ get_exp_value(struct tep_event_format *event, struct tep_filter_arg *arg, ...@@ -1793,7 +1793,7 @@ get_exp_value(struct tep_event_format *event, struct tep_filter_arg *arg,
} }
static unsigned long long static unsigned long long
get_arg_value(struct tep_event_format *event, struct tep_filter_arg *arg, get_arg_value(struct tep_event *event, struct tep_filter_arg *arg,
struct tep_record *record, enum tep_errno *err) struct tep_record *record, enum tep_errno *err)
{ {
switch (arg->type) { switch (arg->type) {
...@@ -1817,7 +1817,7 @@ get_arg_value(struct tep_event_format *event, struct tep_filter_arg *arg, ...@@ -1817,7 +1817,7 @@ get_arg_value(struct tep_event_format *event, struct tep_filter_arg *arg,
return 0; return 0;
} }
static int test_num(struct tep_event_format *event, struct tep_filter_arg *arg, static int test_num(struct tep_event *event, struct tep_filter_arg *arg,
struct tep_record *record, enum tep_errno *err) struct tep_record *record, enum tep_errno *err)
{ {
unsigned long long lval, rval; unsigned long long lval, rval;
...@@ -1860,7 +1860,7 @@ static int test_num(struct tep_event_format *event, struct tep_filter_arg *arg, ...@@ -1860,7 +1860,7 @@ static int test_num(struct tep_event_format *event, struct tep_filter_arg *arg,
static const char *get_field_str(struct tep_filter_arg *arg, struct tep_record *record) static const char *get_field_str(struct tep_filter_arg *arg, struct tep_record *record)
{ {
struct tep_event_format *event; struct tep_event *event;
struct tep_handle *pevent; struct tep_handle *pevent;
unsigned long long addr; unsigned long long addr;
const char *val = NULL; const char *val = NULL;
...@@ -1908,7 +1908,7 @@ static const char *get_field_str(struct tep_filter_arg *arg, struct tep_record * ...@@ -1908,7 +1908,7 @@ static const char *get_field_str(struct tep_filter_arg *arg, struct tep_record *
return val; return val;
} }
static int test_str(struct tep_event_format *event, struct tep_filter_arg *arg, static int test_str(struct tep_event *event, struct tep_filter_arg *arg,
struct tep_record *record, enum tep_errno *err) struct tep_record *record, enum tep_errno *err)
{ {
const char *val; const char *val;
...@@ -1939,7 +1939,7 @@ static int test_str(struct tep_event_format *event, struct tep_filter_arg *arg, ...@@ -1939,7 +1939,7 @@ static int test_str(struct tep_event_format *event, struct tep_filter_arg *arg,
} }
} }
static int test_op(struct tep_event_format *event, struct tep_filter_arg *arg, static int test_op(struct tep_event *event, struct tep_filter_arg *arg,
struct tep_record *record, enum tep_errno *err) struct tep_record *record, enum tep_errno *err)
{ {
switch (arg->op.type) { switch (arg->op.type) {
...@@ -1961,7 +1961,7 @@ static int test_op(struct tep_event_format *event, struct tep_filter_arg *arg, ...@@ -1961,7 +1961,7 @@ static int test_op(struct tep_event_format *event, struct tep_filter_arg *arg,
} }
} }
static int test_filter(struct tep_event_format *event, struct tep_filter_arg *arg, static int test_filter(struct tep_event *event, struct tep_filter_arg *arg,
struct tep_record *record, enum tep_errno *err) struct tep_record *record, enum tep_errno *err)
{ {
if (*err) { if (*err) {
......
...@@ -124,7 +124,7 @@ static int add_and_get_index(const char *parent, const char *child, int cpu) ...@@ -124,7 +124,7 @@ static int add_and_get_index(const char *parent, const char *child, int cpu)
} }
static int function_handler(struct trace_seq *s, struct tep_record *record, static int function_handler(struct trace_seq *s, struct tep_record *record,
struct tep_event_format *event, void *context) struct tep_event *event, void *context)
{ {
struct tep_handle *pevent = event->pevent; struct tep_handle *pevent = event->pevent;
unsigned long long function; unsigned long long function;
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
static int timer_expire_handler(struct trace_seq *s, static int timer_expire_handler(struct trace_seq *s,
struct tep_record *record, struct tep_record *record,
struct tep_event_format *event, void *context) struct tep_event *event, void *context)
{ {
trace_seq_printf(s, "hrtimer="); trace_seq_printf(s, "hrtimer=");
...@@ -47,7 +47,7 @@ static int timer_expire_handler(struct trace_seq *s, ...@@ -47,7 +47,7 @@ static int timer_expire_handler(struct trace_seq *s,
static int timer_start_handler(struct trace_seq *s, static int timer_start_handler(struct trace_seq *s,
struct tep_record *record, struct tep_record *record,
struct tep_event_format *event, void *context) struct tep_event *event, void *context)
{ {
trace_seq_printf(s, "hrtimer="); trace_seq_printf(s, "hrtimer=");
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include "trace-seq.h" #include "trace-seq.h"
static int call_site_handler(struct trace_seq *s, struct tep_record *record, static int call_site_handler(struct trace_seq *s, struct tep_record *record,
struct tep_event_format *event, void *context) struct tep_event *event, void *context)
{ {
struct tep_format_field *field; struct tep_format_field *field;
unsigned long long val, addr; unsigned long long val, addr;
......
...@@ -249,7 +249,7 @@ static const char *find_exit_reason(unsigned isa, int val) ...@@ -249,7 +249,7 @@ static const char *find_exit_reason(unsigned isa, int val)
} }
static int print_exit_reason(struct trace_seq *s, struct tep_record *record, static int print_exit_reason(struct trace_seq *s, struct tep_record *record,
struct tep_event_format *event, const char *field) struct tep_event *event, const char *field)
{ {
unsigned long long isa; unsigned long long isa;
unsigned long long val; unsigned long long val;
...@@ -270,7 +270,7 @@ static int print_exit_reason(struct trace_seq *s, struct tep_record *record, ...@@ -270,7 +270,7 @@ static int print_exit_reason(struct trace_seq *s, struct tep_record *record,
} }
static int kvm_exit_handler(struct trace_seq *s, struct tep_record *record, static int kvm_exit_handler(struct trace_seq *s, struct tep_record *record,
struct tep_event_format *event, void *context) struct tep_event *event, void *context)
{ {
unsigned long long info1 = 0, info2 = 0; unsigned long long info1 = 0, info2 = 0;
...@@ -293,7 +293,7 @@ static int kvm_exit_handler(struct trace_seq *s, struct tep_record *record, ...@@ -293,7 +293,7 @@ static int kvm_exit_handler(struct trace_seq *s, struct tep_record *record,
static int kvm_emulate_insn_handler(struct trace_seq *s, static int kvm_emulate_insn_handler(struct trace_seq *s,
struct tep_record *record, struct tep_record *record,
struct tep_event_format *event, void *context) struct tep_event *event, void *context)
{ {
unsigned long long rip, csbase, len, flags, failed; unsigned long long rip, csbase, len, flags, failed;
int llen; int llen;
...@@ -332,7 +332,7 @@ static int kvm_emulate_insn_handler(struct trace_seq *s, ...@@ -332,7 +332,7 @@ static int kvm_emulate_insn_handler(struct trace_seq *s,
static int kvm_nested_vmexit_inject_handler(struct trace_seq *s, struct tep_record *record, static int kvm_nested_vmexit_inject_handler(struct trace_seq *s, struct tep_record *record,
struct tep_event_format *event, void *context) struct tep_event *event, void *context)
{ {
if (print_exit_reason(s, record, event, "exit_code") < 0) if (print_exit_reason(s, record, event, "exit_code") < 0)
return -1; return -1;
...@@ -346,7 +346,7 @@ static int kvm_nested_vmexit_inject_handler(struct trace_seq *s, struct tep_reco ...@@ -346,7 +346,7 @@ static int kvm_nested_vmexit_inject_handler(struct trace_seq *s, struct tep_reco
} }
static int kvm_nested_vmexit_handler(struct trace_seq *s, struct tep_record *record, static int kvm_nested_vmexit_handler(struct trace_seq *s, struct tep_record *record,
struct tep_event_format *event, void *context) struct tep_event *event, void *context)
{ {
tep_print_num_field(s, "rip %llx ", event, "rip", record, 1); tep_print_num_field(s, "rip %llx ", event, "rip", record, 1);
...@@ -372,7 +372,7 @@ union kvm_mmu_page_role { ...@@ -372,7 +372,7 @@ union kvm_mmu_page_role {
}; };
static int kvm_mmu_print_role(struct trace_seq *s, struct tep_record *record, static int kvm_mmu_print_role(struct trace_seq *s, struct tep_record *record,
struct tep_event_format *event, void *context) struct tep_event *event, void *context)
{ {
unsigned long long val; unsigned long long val;
static const char *access_str[] = { static const char *access_str[] = {
...@@ -419,7 +419,7 @@ static int kvm_mmu_print_role(struct trace_seq *s, struct tep_record *record, ...@@ -419,7 +419,7 @@ static int kvm_mmu_print_role(struct trace_seq *s, struct tep_record *record,
static int kvm_mmu_get_page_handler(struct trace_seq *s, static int kvm_mmu_get_page_handler(struct trace_seq *s,
struct tep_record *record, struct tep_record *record,
struct tep_event_format *event, void *context) struct tep_event *event, void *context)
{ {
unsigned long long val; unsigned long long val;
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#define INDENT 65 #define INDENT 65
static void print_string(struct trace_seq *s, struct tep_event_format *event, static void print_string(struct trace_seq *s, struct tep_event *event,
const char *name, const void *data) const char *name, const void *data)
{ {
struct tep_format_field *f = tep_find_field(event, name); struct tep_format_field *f = tep_find_field(event, name);
...@@ -60,7 +60,7 @@ static void print_string(struct trace_seq *s, struct tep_event_format *event, ...@@ -60,7 +60,7 @@ static void print_string(struct trace_seq *s, struct tep_event_format *event,
static int drv_bss_info_changed(struct trace_seq *s, static int drv_bss_info_changed(struct trace_seq *s,
struct tep_record *record, struct tep_record *record,
struct tep_event_format *event, void *context) struct tep_event *event, void *context)
{ {
void *data = record->data; void *data = record->data;
......
...@@ -67,7 +67,7 @@ static void write_and_save_comm(struct tep_format_field *field, ...@@ -67,7 +67,7 @@ static void write_and_save_comm(struct tep_format_field *field,
static int sched_wakeup_handler(struct trace_seq *s, static int sched_wakeup_handler(struct trace_seq *s,
struct tep_record *record, struct tep_record *record,
struct tep_event_format *event, void *context) struct tep_event *event, void *context)
{ {
struct tep_format_field *field; struct tep_format_field *field;
unsigned long long val; unsigned long long val;
...@@ -96,7 +96,7 @@ static int sched_wakeup_handler(struct trace_seq *s, ...@@ -96,7 +96,7 @@ static int sched_wakeup_handler(struct trace_seq *s,
static int sched_switch_handler(struct trace_seq *s, static int sched_switch_handler(struct trace_seq *s,
struct tep_record *record, struct tep_record *record,
struct tep_event_format *event, void *context) struct tep_event *event, void *context)
{ {
struct tep_format_field *field; struct tep_format_field *field;
unsigned long long val; unsigned long long val;
......
...@@ -885,7 +885,7 @@ static struct syscall_fmt *syscall_fmt__find_by_alias(const char *alias) ...@@ -885,7 +885,7 @@ static struct syscall_fmt *syscall_fmt__find_by_alias(const char *alias)
* args_size: sum of the sizes of the syscall arguments, anything after that is augmented stuff: pathname for openat, etc. * args_size: sum of the sizes of the syscall arguments, anything after that is augmented stuff: pathname for openat, etc.
*/ */
struct syscall { struct syscall {
struct tep_event_format *tp_format; struct tep_event *tp_format;
int nr_args; int nr_args;
int args_size; int args_size;
bool is_exit; bool is_exit;
......
...@@ -106,7 +106,7 @@ struct perf_evsel { ...@@ -106,7 +106,7 @@ struct perf_evsel {
char *name; char *name;
double scale; double scale;
const char *unit; const char *unit;
struct tep_event_format *tp_format; struct tep_event *tp_format;
off_t id_offset; off_t id_offset;
struct perf_stat_evsel *stats; struct perf_stat_evsel *stats;
void *priv; void *priv;
...@@ -216,7 +216,7 @@ static inline struct perf_evsel *perf_evsel__newtp(const char *sys, const char * ...@@ -216,7 +216,7 @@ static inline struct perf_evsel *perf_evsel__newtp(const char *sys, const char *
struct perf_evsel *perf_evsel__new_cycles(bool precise); struct perf_evsel *perf_evsel__new_cycles(bool precise);
struct tep_event_format *event_format__new(const char *sys, const char *name); struct tep_event *event_format__new(const char *sys, const char *name);
void perf_evsel__init(struct perf_evsel *evsel, void perf_evsel__init(struct perf_evsel *evsel,
struct perf_event_attr *attr, int idx); struct perf_event_attr *attr, int idx);
......
...@@ -3268,7 +3268,7 @@ static int read_attr(int fd, struct perf_header *ph, ...@@ -3268,7 +3268,7 @@ static int read_attr(int fd, struct perf_header *ph,
static int perf_evsel__prepare_tracepoint_event(struct perf_evsel *evsel, static int perf_evsel__prepare_tracepoint_event(struct perf_evsel *evsel,
struct tep_handle *pevent) struct tep_handle *pevent)
{ {
struct tep_event_format *event; struct tep_event *event;
char bf[128]; char bf[128];
/* already prepared */ /* already prepared */
......
...@@ -386,7 +386,7 @@ get_tracepoint_field(struct pyrf_event *pevent, PyObject *attr_name) ...@@ -386,7 +386,7 @@ get_tracepoint_field(struct pyrf_event *pevent, PyObject *attr_name)
struct tep_format_field *field; struct tep_format_field *field;
if (!evsel->tp_format) { if (!evsel->tp_format) {
struct tep_event_format *tp_format; struct tep_event *tp_format;
tp_format = trace_event__tp_format_id(evsel->attr.config); tp_format = trace_event__tp_format_id(evsel->attr.config);
if (!tp_format) if (!tp_format)
...@@ -1240,7 +1240,7 @@ static struct { ...@@ -1240,7 +1240,7 @@ static struct {
static PyObject *pyrf__tracepoint(struct pyrf_evsel *pevsel, static PyObject *pyrf__tracepoint(struct pyrf_evsel *pevsel,
PyObject *args, PyObject *kwargs) PyObject *args, PyObject *kwargs)
{ {
struct tep_event_format *tp_format; struct tep_event *tp_format;
static char *kwlist[] = { "sys", "name", NULL }; static char *kwlist[] = { "sys", "name", NULL };
char *sys = NULL; char *sys = NULL;
char *name = NULL; char *name = NULL;
......
...@@ -189,7 +189,7 @@ static void define_flag_field(const char *ev_name, ...@@ -189,7 +189,7 @@ static void define_flag_field(const char *ev_name,
LEAVE; LEAVE;
} }
static void define_event_symbols(struct tep_event_format *event, static void define_event_symbols(struct tep_event *event,
const char *ev_name, const char *ev_name,
struct tep_print_arg *args) struct tep_print_arg *args)
{ {
...@@ -338,7 +338,7 @@ static void perl_process_tracepoint(struct perf_sample *sample, ...@@ -338,7 +338,7 @@ static void perl_process_tracepoint(struct perf_sample *sample,
struct addr_location *al) struct addr_location *al)
{ {
struct thread *thread = al->thread; struct thread *thread = al->thread;
struct tep_event_format *event = evsel->tp_format; struct tep_event *event = evsel->tp_format;
struct tep_format_field *field; struct tep_format_field *field;
static char handler[256]; static char handler[256];
unsigned long long val; unsigned long long val;
...@@ -537,7 +537,7 @@ static int perl_stop_script(void) ...@@ -537,7 +537,7 @@ static int perl_stop_script(void)
static int perl_generate_script(struct tep_handle *pevent, const char *outfile) static int perl_generate_script(struct tep_handle *pevent, const char *outfile)
{ {
struct tep_event_format *event = NULL; struct tep_event *event = NULL;
struct tep_format_field *f; struct tep_format_field *f;
char fname[PATH_MAX]; char fname[PATH_MAX];
int not_first, count; int not_first, count;
......
...@@ -264,7 +264,7 @@ static void define_field(enum tep_print_arg_type field_type, ...@@ -264,7 +264,7 @@ static void define_field(enum tep_print_arg_type field_type,
Py_DECREF(t); Py_DECREF(t);
} }
static void define_event_symbols(struct tep_event_format *event, static void define_event_symbols(struct tep_event *event,
const char *ev_name, const char *ev_name,
struct tep_print_arg *args) struct tep_print_arg *args)
{ {
...@@ -332,7 +332,7 @@ static void define_event_symbols(struct tep_event_format *event, ...@@ -332,7 +332,7 @@ static void define_event_symbols(struct tep_event_format *event,
define_event_symbols(event, ev_name, args->next); define_event_symbols(event, ev_name, args->next);
} }
static PyObject *get_field_numeric_entry(struct tep_event_format *event, static PyObject *get_field_numeric_entry(struct tep_event *event,
struct tep_format_field *field, void *data) struct tep_format_field *field, void *data)
{ {
bool is_array = field->flags & TEP_FIELD_IS_ARRAY; bool is_array = field->flags & TEP_FIELD_IS_ARRAY;
...@@ -790,7 +790,7 @@ static void python_process_tracepoint(struct perf_sample *sample, ...@@ -790,7 +790,7 @@ static void python_process_tracepoint(struct perf_sample *sample,
struct perf_evsel *evsel, struct perf_evsel *evsel,
struct addr_location *al) struct addr_location *al)
{ {
struct tep_event_format *event = evsel->tp_format; struct tep_event *event = evsel->tp_format;
PyObject *handler, *context, *t, *obj = NULL, *callchain; PyObject *handler, *context, *t, *obj = NULL, *callchain;
PyObject *dict = NULL, *all_entries_dict = NULL; PyObject *dict = NULL, *all_entries_dict = NULL;
static char handler_name[256]; static char handler_name[256];
...@@ -1590,7 +1590,7 @@ static int python_stop_script(void) ...@@ -1590,7 +1590,7 @@ static int python_stop_script(void)
static int python_generate_script(struct tep_handle *pevent, const char *outfile) static int python_generate_script(struct tep_handle *pevent, const char *outfile)
{ {
struct tep_event_format *event = NULL; struct tep_event *event = NULL;
struct tep_format_field *f; struct tep_format_field *f;
char fname[PATH_MAX]; char fname[PATH_MAX];
int not_first, count; int not_first, count;
......
...@@ -33,7 +33,7 @@ static int get_common_field(struct scripting_context *context, ...@@ -33,7 +33,7 @@ static int get_common_field(struct scripting_context *context,
int *offset, int *size, const char *type) int *offset, int *size, const char *type)
{ {
struct tep_handle *pevent = context->pevent; struct tep_handle *pevent = context->pevent;
struct tep_event_format *event; struct tep_event *event;
struct tep_format_field *field; struct tep_format_field *field;
if (!*size) { if (!*size) {
...@@ -95,7 +95,7 @@ int common_pc(struct scripting_context *context) ...@@ -95,7 +95,7 @@ int common_pc(struct scripting_context *context)
} }
unsigned long long unsigned long long
raw_field_value(struct tep_event_format *event, const char *name, void *data) raw_field_value(struct tep_event *event, const char *name, void *data)
{ {
struct tep_format_field *field; struct tep_format_field *field;
unsigned long long val; unsigned long long val;
...@@ -109,12 +109,12 @@ raw_field_value(struct tep_event_format *event, const char *name, void *data) ...@@ -109,12 +109,12 @@ raw_field_value(struct tep_event_format *event, const char *name, void *data)
return val; return val;
} }
unsigned long long read_size(struct tep_event_format *event, void *ptr, int size) unsigned long long read_size(struct tep_event *event, void *ptr, int size)
{ {
return tep_read_number(event->pevent, ptr, size); return tep_read_number(event->pevent, ptr, size);
} }
void event_format__fprintf(struct tep_event_format *event, void event_format__fprintf(struct tep_event *event,
int cpu, void *data, int size, FILE *fp) int cpu, void *data, int size, FILE *fp)
{ {
struct tep_record record; struct tep_record record;
...@@ -131,7 +131,7 @@ void event_format__fprintf(struct tep_event_format *event, ...@@ -131,7 +131,7 @@ void event_format__fprintf(struct tep_event_format *event,
trace_seq_destroy(&s); trace_seq_destroy(&s);
} }
void event_format__print(struct tep_event_format *event, void event_format__print(struct tep_event *event,
int cpu, void *data, int size) int cpu, void *data, int size)
{ {
return event_format__fprintf(event, cpu, data, size, stdout); return event_format__fprintf(event, cpu, data, size, stdout);
...@@ -190,12 +190,12 @@ int parse_event_file(struct tep_handle *pevent, ...@@ -190,12 +190,12 @@ int parse_event_file(struct tep_handle *pevent,
return tep_parse_event(pevent, buf, size, sys); return tep_parse_event(pevent, buf, size, sys);
} }
struct tep_event_format *trace_find_next_event(struct tep_handle *pevent, struct tep_event *trace_find_next_event(struct tep_handle *pevent,
struct tep_event_format *event) struct tep_event *event)
{ {
static int idx; static int idx;
int events_count; int events_count;
struct tep_event_format *all_events; struct tep_event *all_events;
all_events = tep_get_first_event(pevent); all_events = tep_get_first_event(pevent);
events_count = tep_get_events_count(pevent); events_count = tep_get_events_count(pevent);
......
...@@ -72,12 +72,12 @@ void trace_event__cleanup(struct trace_event *t) ...@@ -72,12 +72,12 @@ void trace_event__cleanup(struct trace_event *t)
/* /*
* Returns pointer with encoded error via <linux/err.h> interface. * Returns pointer with encoded error via <linux/err.h> interface.
*/ */
static struct tep_event_format* static struct tep_event*
tp_format(const char *sys, const char *name) tp_format(const char *sys, const char *name)
{ {
char *tp_dir = get_events_file(sys); char *tp_dir = get_events_file(sys);
struct tep_handle *pevent = tevent.pevent; struct tep_handle *pevent = tevent.pevent;
struct tep_event_format *event = NULL; struct tep_event *event = NULL;
char path[PATH_MAX]; char path[PATH_MAX];
size_t size; size_t size;
char *data; char *data;
...@@ -102,7 +102,7 @@ tp_format(const char *sys, const char *name) ...@@ -102,7 +102,7 @@ tp_format(const char *sys, const char *name)
/* /*
* Returns pointer with encoded error via <linux/err.h> interface. * Returns pointer with encoded error via <linux/err.h> interface.
*/ */
struct tep_event_format* struct tep_event*
trace_event__tp_format(const char *sys, const char *name) trace_event__tp_format(const char *sys, const char *name)
{ {
if (!tevent_initialized && trace_event__init2()) if (!tevent_initialized && trace_event__init2())
...@@ -111,7 +111,7 @@ trace_event__tp_format(const char *sys, const char *name) ...@@ -111,7 +111,7 @@ trace_event__tp_format(const char *sys, const char *name)
return tp_format(sys, name); return tp_format(sys, name);
} }
struct tep_event_format *trace_event__tp_format_id(int id) struct tep_event *trace_event__tp_format_id(int id)
{ {
if (!tevent_initialized && trace_event__init2()) if (!tevent_initialized && trace_event__init2())
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
......
...@@ -22,17 +22,17 @@ int trace_event__init(struct trace_event *t); ...@@ -22,17 +22,17 @@ int trace_event__init(struct trace_event *t);
void trace_event__cleanup(struct trace_event *t); void trace_event__cleanup(struct trace_event *t);
int trace_event__register_resolver(struct machine *machine, int trace_event__register_resolver(struct machine *machine,
tep_func_resolver_t *func); tep_func_resolver_t *func);
struct tep_event_format* struct tep_event*
trace_event__tp_format(const char *sys, const char *name); trace_event__tp_format(const char *sys, const char *name);
struct tep_event_format *trace_event__tp_format_id(int id); struct tep_event *trace_event__tp_format_id(int id);
int bigendian(void); int bigendian(void);
void event_format__fprintf(struct tep_event_format *event, void event_format__fprintf(struct tep_event *event,
int cpu, void *data, int size, FILE *fp); int cpu, void *data, int size, FILE *fp);
void event_format__print(struct tep_event_format *event, void event_format__print(struct tep_event *event,
int cpu, void *data, int size); int cpu, void *data, int size);
int parse_ftrace_file(struct tep_handle *pevent, char *buf, unsigned long size); int parse_ftrace_file(struct tep_handle *pevent, char *buf, unsigned long size);
...@@ -40,7 +40,7 @@ int parse_event_file(struct tep_handle *pevent, ...@@ -40,7 +40,7 @@ int parse_event_file(struct tep_handle *pevent,
char *buf, unsigned long size, char *sys); char *buf, unsigned long size, char *sys);
unsigned long long unsigned long long
raw_field_value(struct tep_event_format *event, const char *name, void *data); raw_field_value(struct tep_event *event, const char *name, void *data);
void parse_proc_kallsyms(struct tep_handle *pevent, char *file, unsigned int size); void parse_proc_kallsyms(struct tep_handle *pevent, char *file, unsigned int size);
void parse_ftrace_printk(struct tep_handle *pevent, char *file, unsigned int size); void parse_ftrace_printk(struct tep_handle *pevent, char *file, unsigned int size);
...@@ -48,9 +48,9 @@ void parse_saved_cmdline(struct tep_handle *pevent, char *file, unsigned int siz ...@@ -48,9 +48,9 @@ void parse_saved_cmdline(struct tep_handle *pevent, char *file, unsigned int siz
ssize_t trace_report(int fd, struct trace_event *tevent, bool repipe); ssize_t trace_report(int fd, struct trace_event *tevent, bool repipe);
struct tep_event_format *trace_find_next_event(struct tep_handle *pevent, struct tep_event *trace_find_next_event(struct tep_handle *pevent,
struct tep_event_format *event); struct tep_event *event);
unsigned long long read_size(struct tep_event_format *event, void *ptr, int size); unsigned long long read_size(struct tep_event *event, void *ptr, int size);
unsigned long long eval_flag(const char *flag); unsigned long long eval_flag(const char *flag);
int read_tracing_data(int fd, struct list_head *pattrs); int read_tracing_data(int fd, struct list_head *pattrs);
......
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