aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/lib/traceevent/event-parse.c186
-rw-r--r--tools/lib/traceevent/event-parse.h66
-rw-r--r--tools/lib/traceevent/parse-filter.c42
-rw-r--r--tools/lib/traceevent/plugin_function.c2
-rw-r--r--tools/lib/traceevent/plugin_hrtimer.c4
-rw-r--r--tools/lib/traceevent/plugin_kmem.c2
-rw-r--r--tools/lib/traceevent/plugin_kvm.c14
-rw-r--r--tools/lib/traceevent/plugin_mac80211.c4
-rw-r--r--tools/lib/traceevent/plugin_sched_switch.c4
-rw-r--r--tools/perf/builtin-trace.c2
-rw-r--r--tools/perf/util/evsel.h4
-rw-r--r--tools/perf/util/header.c2
-rw-r--r--tools/perf/util/python.c4
-rw-r--r--tools/perf/util/scripting-engines/trace-event-perl.c6
-rw-r--r--tools/perf/util/scripting-engines/trace-event-python.c8
-rw-r--r--tools/perf/util/trace-event-parse.c14
-rw-r--r--tools/perf/util/trace-event.c8
-rw-r--r--tools/perf/util/trace-event.h16
18 files changed, 194 insertions, 194 deletions
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index 70a42bec6931..bb2ebb322124 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -95,7 +95,7 @@ struct tep_function_handler {
95 95
96static unsigned long long 96static unsigned long long
97process_defined_func(struct trace_seq *s, void *data, int size, 97process_defined_func(struct trace_seq *s, void *data, int size,
98 struct event_format *event, struct print_arg *arg); 98 struct tep_event_format *event, struct print_arg *arg);
99 99
100static void free_func_handle(struct tep_function_handler *func); 100static void free_func_handle(struct tep_function_handler *func);
101 101
@@ -738,16 +738,16 @@ void tep_print_printk(struct tep_handle *pevent)
738 } 738 }
739} 739}
740 740
741static struct event_format *alloc_event(void) 741static struct tep_event_format *alloc_event(void)
742{ 742{
743 return calloc(1, sizeof(struct event_format)); 743 return calloc(1, sizeof(struct tep_event_format));
744} 744}
745 745
746static int add_event(struct tep_handle *pevent, struct event_format *event) 746static int add_event(struct tep_handle *pevent, struct tep_event_format *event)
747{ 747{
748 int i; 748 int i;
749 struct event_format **events = realloc(pevent->events, sizeof(event) * 749 struct tep_event_format **events = realloc(pevent->events, sizeof(event) *
750 (pevent->nr_events + 1)); 750 (pevent->nr_events + 1));
751 if (!events) 751 if (!events)
752 return -1; 752 return -1;
753 753
@@ -1354,7 +1354,7 @@ static unsigned int type_size(const char *name)
1354 return 0; 1354 return 0;
1355} 1355}
1356 1356
1357static int event_read_fields(struct event_format *event, struct format_field **fields) 1357static int event_read_fields(struct tep_event_format *event, struct format_field **fields)
1358{ 1358{
1359 struct format_field *field = NULL; 1359 struct format_field *field = NULL;
1360 enum event_type type; 1360 enum event_type type;
@@ -1641,7 +1641,7 @@ fail_expect:
1641 return -1; 1641 return -1;
1642} 1642}
1643 1643
1644static int event_read_format(struct event_format *event) 1644static int event_read_format(struct tep_event_format *event)
1645{ 1645{
1646 char *token; 1646 char *token;
1647 int ret; 1647 int ret;
@@ -1674,11 +1674,11 @@ static int event_read_format(struct event_format *event)
1674} 1674}
1675 1675
1676static enum event_type 1676static enum event_type
1677process_arg_token(struct event_format *event, struct print_arg *arg, 1677process_arg_token(struct tep_event_format *event, struct print_arg *arg,
1678 char **tok, enum event_type type); 1678 char **tok, enum event_type type);
1679 1679
1680static enum event_type 1680static enum event_type
1681process_arg(struct event_format *event, struct print_arg *arg, char **tok) 1681process_arg(struct tep_event_format *event, struct print_arg *arg, char **tok)
1682{ 1682{
1683 enum event_type type; 1683 enum event_type type;
1684 char *token; 1684 char *token;
@@ -1690,14 +1690,14 @@ process_arg(struct event_format *event, struct print_arg *arg, char **tok)
1690} 1690}
1691 1691
1692static enum event_type 1692static enum event_type
1693process_op(struct event_format *event, struct print_arg *arg, char **tok); 1693process_op(struct tep_event_format *event, struct print_arg *arg, char **tok);
1694 1694
1695/* 1695/*
1696 * For __print_symbolic() and __print_flags, we need to completely 1696 * For __print_symbolic() and __print_flags, we need to completely
1697 * evaluate the first argument, which defines what to print next. 1697 * evaluate the first argument, which defines what to print next.
1698 */ 1698 */
1699static enum event_type 1699static enum event_type
1700process_field_arg(struct event_format *event, struct print_arg *arg, char **tok) 1700process_field_arg(struct tep_event_format *event, struct print_arg *arg, char **tok)
1701{ 1701{
1702 enum event_type type; 1702 enum event_type type;
1703 1703
@@ -1711,7 +1711,7 @@ process_field_arg(struct event_format *event, struct print_arg *arg, char **tok)
1711} 1711}
1712 1712
1713static enum event_type 1713static enum event_type
1714process_cond(struct event_format *event, struct print_arg *top, char **tok) 1714process_cond(struct tep_event_format *event, struct print_arg *top, char **tok)
1715{ 1715{
1716 struct print_arg *arg, *left, *right; 1716 struct print_arg *arg, *left, *right;
1717 enum event_type type; 1717 enum event_type type;
@@ -1767,7 +1767,7 @@ out_free:
1767} 1767}
1768 1768
1769static enum event_type 1769static enum event_type
1770process_array(struct event_format *event, struct print_arg *top, char **tok) 1770process_array(struct tep_event_format *event, struct print_arg *top, char **tok)
1771{ 1771{
1772 struct print_arg *arg; 1772 struct print_arg *arg;
1773 enum event_type type; 1773 enum event_type type;
@@ -1869,7 +1869,7 @@ static int set_op_prio(struct print_arg *arg)
1869 1869
1870/* Note, *tok does not get freed, but will most likely be saved */ 1870/* Note, *tok does not get freed, but will most likely be saved */
1871static enum event_type 1871static enum event_type
1872process_op(struct event_format *event, struct print_arg *arg, char **tok) 1872process_op(struct tep_event_format *event, struct print_arg *arg, char **tok)
1873{ 1873{
1874 struct print_arg *left, *right = NULL; 1874 struct print_arg *left, *right = NULL;
1875 enum event_type type; 1875 enum event_type type;
@@ -2070,7 +2070,7 @@ out_free:
2070} 2070}
2071 2071
2072static enum event_type 2072static enum event_type
2073process_entry(struct event_format *event __maybe_unused, struct print_arg *arg, 2073process_entry(struct tep_event_format *event __maybe_unused, struct print_arg *arg,
2074 char **tok) 2074 char **tok)
2075{ 2075{
2076 enum event_type type; 2076 enum event_type type;
@@ -2109,7 +2109,7 @@ process_entry(struct event_format *event __maybe_unused, struct print_arg *arg,
2109 return EVENT_ERROR; 2109 return EVENT_ERROR;
2110} 2110}
2111 2111
2112static int alloc_and_process_delim(struct event_format *event, char *next_token, 2112static int alloc_and_process_delim(struct tep_event_format *event, char *next_token,
2113 struct print_arg **print_arg) 2113 struct print_arg **print_arg)
2114{ 2114{
2115 struct print_arg *field; 2115 struct print_arg *field;
@@ -2444,7 +2444,7 @@ static char *arg_eval (struct print_arg *arg)
2444} 2444}
2445 2445
2446static enum event_type 2446static enum event_type
2447process_fields(struct event_format *event, struct print_flag_sym **list, char **tok) 2447process_fields(struct tep_event_format *event, struct print_flag_sym **list, char **tok)
2448{ 2448{
2449 enum event_type type; 2449 enum event_type type;
2450 struct print_arg *arg = NULL; 2450 struct print_arg *arg = NULL;
@@ -2525,7 +2525,7 @@ out_free:
2525} 2525}
2526 2526
2527static enum event_type 2527static enum event_type
2528process_flags(struct event_format *event, struct print_arg *arg, char **tok) 2528process_flags(struct tep_event_format *event, struct print_arg *arg, char **tok)
2529{ 2529{
2530 struct print_arg *field; 2530 struct print_arg *field;
2531 enum event_type type; 2531 enum event_type type;
@@ -2578,7 +2578,7 @@ out_free:
2578} 2578}
2579 2579
2580static enum event_type 2580static enum event_type
2581process_symbols(struct event_format *event, struct print_arg *arg, char **tok) 2581process_symbols(struct tep_event_format *event, struct print_arg *arg, char **tok)
2582{ 2582{
2583 struct print_arg *field; 2583 struct print_arg *field;
2584 enum event_type type; 2584 enum event_type type;
@@ -2617,7 +2617,7 @@ out_free:
2617} 2617}
2618 2618
2619static enum event_type 2619static enum event_type
2620process_hex_common(struct event_format *event, struct print_arg *arg, 2620process_hex_common(struct tep_event_format *event, struct print_arg *arg,
2621 char **tok, enum print_arg_type type) 2621 char **tok, enum print_arg_type type)
2622{ 2622{
2623 memset(arg, 0, sizeof(*arg)); 2623 memset(arg, 0, sizeof(*arg));
@@ -2640,20 +2640,20 @@ out:
2640} 2640}
2641 2641
2642static enum event_type 2642static enum event_type
2643process_hex(struct event_format *event, struct print_arg *arg, char **tok) 2643process_hex(struct tep_event_format *event, struct print_arg *arg, char **tok)
2644{ 2644{
2645 return process_hex_common(event, arg, tok, PRINT_HEX); 2645 return process_hex_common(event, arg, tok, PRINT_HEX);
2646} 2646}
2647 2647
2648static enum event_type 2648static enum event_type
2649process_hex_str(struct event_format *event, struct print_arg *arg, 2649process_hex_str(struct tep_event_format *event, struct print_arg *arg,
2650 char **tok) 2650 char **tok)
2651{ 2651{
2652 return process_hex_common(event, arg, tok, PRINT_HEX_STR); 2652 return process_hex_common(event, arg, tok, PRINT_HEX_STR);
2653} 2653}
2654 2654
2655static enum event_type 2655static enum event_type
2656process_int_array(struct event_format *event, struct print_arg *arg, char **tok) 2656process_int_array(struct tep_event_format *event, struct print_arg *arg, char **tok)
2657{ 2657{
2658 memset(arg, 0, sizeof(*arg)); 2658 memset(arg, 0, sizeof(*arg));
2659 arg->type = PRINT_INT_ARRAY; 2659 arg->type = PRINT_INT_ARRAY;
@@ -2681,7 +2681,7 @@ out:
2681} 2681}
2682 2682
2683static enum event_type 2683static enum event_type
2684process_dynamic_array(struct event_format *event, struct print_arg *arg, char **tok) 2684process_dynamic_array(struct tep_event_format *event, struct print_arg *arg, char **tok)
2685{ 2685{
2686 struct format_field *field; 2686 struct format_field *field;
2687 enum event_type type; 2687 enum event_type type;
@@ -2745,7 +2745,7 @@ process_dynamic_array(struct event_format *event, struct print_arg *arg, char **
2745} 2745}
2746 2746
2747static enum event_type 2747static enum event_type
2748process_dynamic_array_len(struct event_format *event, struct print_arg *arg, 2748process_dynamic_array_len(struct tep_event_format *event, struct print_arg *arg,
2749 char **tok) 2749 char **tok)
2750{ 2750{
2751 struct format_field *field; 2751 struct format_field *field;
@@ -2781,7 +2781,7 @@ process_dynamic_array_len(struct event_format *event, struct print_arg *arg,
2781} 2781}
2782 2782
2783static enum event_type 2783static enum event_type
2784process_paren(struct event_format *event, struct print_arg *arg, char **tok) 2784process_paren(struct tep_event_format *event, struct print_arg *arg, char **tok)
2785{ 2785{
2786 struct print_arg *item_arg; 2786 struct print_arg *item_arg;
2787 enum event_type type; 2787 enum event_type type;
@@ -2844,7 +2844,7 @@ process_paren(struct event_format *event, struct print_arg *arg, char **tok)
2844 2844
2845 2845
2846static enum event_type 2846static enum event_type
2847process_str(struct event_format *event __maybe_unused, struct print_arg *arg, 2847process_str(struct tep_event_format *event __maybe_unused, struct print_arg *arg,
2848 char **tok) 2848 char **tok)
2849{ 2849{
2850 enum event_type type; 2850 enum event_type type;
@@ -2873,8 +2873,8 @@ process_str(struct event_format *event __maybe_unused, struct print_arg *arg,
2873} 2873}
2874 2874
2875static enum event_type 2875static enum event_type
2876process_bitmask(struct event_format *event __maybe_unused, struct print_arg *arg, 2876process_bitmask(struct tep_event_format *event __maybe_unused, struct print_arg *arg,
2877 char **tok) 2877 char **tok)
2878{ 2878{
2879 enum event_type type; 2879 enum event_type type;
2880 char *token; 2880 char *token;
@@ -2934,7 +2934,7 @@ static void remove_func_handler(struct tep_handle *pevent, char *func_name)
2934} 2934}
2935 2935
2936static enum event_type 2936static enum event_type
2937process_func_handler(struct event_format *event, struct tep_function_handler *func, 2937process_func_handler(struct tep_event_format *event, struct tep_function_handler *func,
2938 struct print_arg *arg, char **tok) 2938 struct print_arg *arg, char **tok)
2939{ 2939{
2940 struct print_arg **next_arg; 2940 struct print_arg **next_arg;
@@ -2992,7 +2992,7 @@ err:
2992} 2992}
2993 2993
2994static enum event_type 2994static enum event_type
2995process_function(struct event_format *event, struct print_arg *arg, 2995process_function(struct tep_event_format *event, struct print_arg *arg,
2996 char *token, char **tok) 2996 char *token, char **tok)
2997{ 2997{
2998 struct tep_function_handler *func; 2998 struct tep_function_handler *func;
@@ -3048,7 +3048,7 @@ process_function(struct event_format *event, struct print_arg *arg,
3048} 3048}
3049 3049
3050static enum event_type 3050static enum event_type
3051process_arg_token(struct event_format *event, struct print_arg *arg, 3051process_arg_token(struct tep_event_format *event, struct print_arg *arg,
3052 char **tok, enum event_type type) 3052 char **tok, enum event_type type)
3053{ 3053{
3054 char *token; 3054 char *token;
@@ -3136,7 +3136,7 @@ process_arg_token(struct event_format *event, struct print_arg *arg,
3136 return type; 3136 return type;
3137} 3137}
3138 3138
3139static int event_read_print_args(struct event_format *event, struct print_arg **list) 3139static int event_read_print_args(struct tep_event_format *event, struct print_arg **list)
3140{ 3140{
3141 enum event_type type = EVENT_ERROR; 3141 enum event_type type = EVENT_ERROR;
3142 struct print_arg *arg; 3142 struct print_arg *arg;
@@ -3194,7 +3194,7 @@ static int event_read_print_args(struct event_format *event, struct print_arg **
3194 return args; 3194 return args;
3195} 3195}
3196 3196
3197static int event_read_print(struct event_format *event) 3197static int event_read_print(struct tep_event_format *event)
3198{ 3198{
3199 enum event_type type; 3199 enum event_type type;
3200 char *token; 3200 char *token;
@@ -3260,7 +3260,7 @@ static int event_read_print(struct event_format *event)
3260 * This only searchs the common fields and not all field. 3260 * This only searchs the common fields and not all field.
3261 */ 3261 */
3262struct format_field * 3262struct format_field *
3263tep_find_common_field(struct event_format *event, const char *name) 3263tep_find_common_field(struct tep_event_format *event, const char *name)
3264{ 3264{
3265 struct format_field *format; 3265 struct format_field *format;
3266 3266
@@ -3282,7 +3282,7 @@ tep_find_common_field(struct event_format *event, const char *name)
3282 * This does not search common fields. 3282 * This does not search common fields.
3283 */ 3283 */
3284struct format_field * 3284struct format_field *
3285tep_find_field(struct event_format *event, const char *name) 3285tep_find_field(struct tep_event_format *event, const char *name)
3286{ 3286{
3287 struct format_field *format; 3287 struct format_field *format;
3288 3288
@@ -3305,7 +3305,7 @@ tep_find_field(struct event_format *event, const char *name)
3305 * the non-common ones if a common one was not found. 3305 * the non-common ones if a common one was not found.
3306 */ 3306 */
3307struct format_field * 3307struct format_field *
3308tep_find_any_field(struct event_format *event, const char *name) 3308tep_find_any_field(struct tep_event_format *event, const char *name)
3309{ 3309{
3310 struct format_field *format; 3310 struct format_field *format;
3311 3311
@@ -3374,7 +3374,7 @@ int tep_read_number_field(struct format_field *field, const void *data,
3374static int get_common_info(struct tep_handle *pevent, 3374static int get_common_info(struct tep_handle *pevent,
3375 const char *type, int *offset, int *size) 3375 const char *type, int *offset, int *size)
3376{ 3376{
3377 struct event_format *event; 3377 struct tep_event_format *event;
3378 struct format_field *field; 3378 struct format_field *field;
3379 3379
3380 /* 3380 /*
@@ -3461,11 +3461,11 @@ static int events_id_cmp(const void *a, const void *b);
3461 * 3461 *
3462 * Returns an event that has a given @id. 3462 * Returns an event that has a given @id.
3463 */ 3463 */
3464struct event_format *tep_find_event(struct tep_handle *pevent, int id) 3464struct tep_event_format *tep_find_event(struct tep_handle *pevent, int id)
3465{ 3465{
3466 struct event_format **eventptr; 3466 struct tep_event_format **eventptr;
3467 struct event_format key; 3467 struct tep_event_format key;
3468 struct event_format *pkey = &key; 3468 struct tep_event_format *pkey = &key;
3469 3469
3470 /* Check cache first */ 3470 /* Check cache first */
3471 if (pevent->last_event && pevent->last_event->id == id) 3471 if (pevent->last_event && pevent->last_event->id == id)
@@ -3493,11 +3493,11 @@ struct event_format *tep_find_event(struct tep_handle *pevent, int id)
3493 * This returns an event with a given @name and under the system 3493 * This returns an event with a given @name and under the system
3494 * @sys. If @sys is NULL the first event with @name is returned. 3494 * @sys. If @sys is NULL the first event with @name is returned.
3495 */ 3495 */
3496struct event_format * 3496struct tep_event_format *
3497tep_find_event_by_name(struct tep_handle *pevent, 3497tep_find_event_by_name(struct tep_handle *pevent,
3498 const char *sys, const char *name) 3498 const char *sys, const char *name)
3499{ 3499{
3500 struct event_format *event; 3500 struct tep_event_format *event;
3501 int i; 3501 int i;
3502 3502
3503 if (pevent->last_event && 3503 if (pevent->last_event &&
@@ -3522,7 +3522,7 @@ tep_find_event_by_name(struct tep_handle *pevent,
3522} 3522}
3523 3523
3524static unsigned long long 3524static unsigned long long
3525eval_num_arg(void *data, int size, struct event_format *event, struct print_arg *arg) 3525eval_num_arg(void *data, int size, struct tep_event_format *event, struct print_arg *arg)
3526{ 3526{
3527 struct tep_handle *pevent = event->pevent; 3527 struct tep_handle *pevent = event->pevent;
3528 unsigned long long val = 0; 3528 unsigned long long val = 0;
@@ -3862,7 +3862,7 @@ static void print_bitmask_to_seq(struct tep_handle *pevent,
3862} 3862}
3863 3863
3864static void print_str_arg(struct trace_seq *s, void *data, int size, 3864static void print_str_arg(struct trace_seq *s, void *data, int size,
3865 struct event_format *event, const char *format, 3865 struct tep_event_format *event, const char *format,
3866 int len_arg, struct print_arg *arg) 3866 int len_arg, struct print_arg *arg)
3867{ 3867{
3868 struct tep_handle *pevent = event->pevent; 3868 struct tep_handle *pevent = event->pevent;
@@ -4117,7 +4117,7 @@ out_warning_field:
4117 4117
4118static unsigned long long 4118static unsigned long long
4119process_defined_func(struct trace_seq *s, void *data, int size, 4119process_defined_func(struct trace_seq *s, void *data, int size,
4120 struct event_format *event, struct print_arg *arg) 4120 struct tep_event_format *event, struct print_arg *arg)
4121{ 4121{
4122 struct tep_function_handler *func_handle = arg->func.func; 4122 struct tep_function_handler *func_handle = arg->func.func;
4123 struct func_params *param; 4123 struct func_params *param;
@@ -4212,7 +4212,7 @@ static void free_args(struct print_arg *args)
4212 } 4212 }
4213} 4213}
4214 4214
4215static struct print_arg *make_bprint_args(char *fmt, void *data, int size, struct event_format *event) 4215static struct print_arg *make_bprint_args(char *fmt, void *data, int size, struct tep_event_format *event)
4216{ 4216{
4217 struct tep_handle *pevent = event->pevent; 4217 struct tep_handle *pevent = event->pevent;
4218 struct format_field *field, *ip_field; 4218 struct format_field *field, *ip_field;
@@ -4389,7 +4389,7 @@ out_free:
4389 4389
4390static char * 4390static char *
4391get_bprint_format(void *data, int size __maybe_unused, 4391get_bprint_format(void *data, int size __maybe_unused,
4392 struct event_format *event) 4392 struct tep_event_format *event)
4393{ 4393{
4394 struct tep_handle *pevent = event->pevent; 4394 struct tep_handle *pevent = event->pevent;
4395 unsigned long long addr; 4395 unsigned long long addr;
@@ -4424,7 +4424,7 @@ get_bprint_format(void *data, int size __maybe_unused,
4424} 4424}
4425 4425
4426static void print_mac_arg(struct trace_seq *s, int mac, void *data, int size, 4426static void print_mac_arg(struct trace_seq *s, int mac, void *data, int size,
4427 struct event_format *event, struct print_arg *arg) 4427 struct tep_event_format *event, struct print_arg *arg)
4428{ 4428{
4429 unsigned char *buf; 4429 unsigned char *buf;
4430 const char *fmt = "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x"; 4430 const char *fmt = "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x";
@@ -4577,7 +4577,7 @@ static void print_ip6_addr(struct trace_seq *s, char i, unsigned char *buf)
4577 * %pISpc print an IP address based on sockaddr; p adds port. 4577 * %pISpc print an IP address based on sockaddr; p adds port.
4578 */ 4578 */
4579static int print_ipv4_arg(struct trace_seq *s, const char *ptr, char i, 4579static int print_ipv4_arg(struct trace_seq *s, const char *ptr, char i,
4580 void *data, int size, struct event_format *event, 4580 void *data, int size, struct tep_event_format *event,
4581 struct print_arg *arg) 4581 struct print_arg *arg)
4582{ 4582{
4583 unsigned char *buf; 4583 unsigned char *buf;
@@ -4614,7 +4614,7 @@ static int print_ipv4_arg(struct trace_seq *s, const char *ptr, char i,
4614} 4614}
4615 4615
4616static int print_ipv6_arg(struct trace_seq *s, const char *ptr, char i, 4616static int print_ipv6_arg(struct trace_seq *s, const char *ptr, char i,
4617 void *data, int size, struct event_format *event, 4617 void *data, int size, struct tep_event_format *event,
4618 struct print_arg *arg) 4618 struct print_arg *arg)
4619{ 4619{
4620 char have_c = 0; 4620 char have_c = 0;
@@ -4664,7 +4664,7 @@ static int print_ipv6_arg(struct trace_seq *s, const char *ptr, char i,
4664} 4664}
4665 4665
4666static int print_ipsa_arg(struct trace_seq *s, const char *ptr, char i, 4666static int print_ipsa_arg(struct trace_seq *s, const char *ptr, char i,
4667 void *data, int size, struct event_format *event, 4667 void *data, int size, struct tep_event_format *event,
4668 struct print_arg *arg) 4668 struct print_arg *arg)
4669{ 4669{
4670 char have_c = 0, have_p = 0; 4670 char have_c = 0, have_p = 0;
@@ -4746,7 +4746,7 @@ static int print_ipsa_arg(struct trace_seq *s, const char *ptr, char i,
4746} 4746}
4747 4747
4748static int print_ip_arg(struct trace_seq *s, const char *ptr, 4748static int print_ip_arg(struct trace_seq *s, const char *ptr,
4749 void *data, int size, struct event_format *event, 4749 void *data, int size, struct tep_event_format *event,
4750 struct print_arg *arg) 4750 struct print_arg *arg)
4751{ 4751{
4752 char i = *ptr; /* 'i' or 'I' */ 4752 char i = *ptr; /* 'i' or 'I' */
@@ -4853,7 +4853,7 @@ void tep_print_field(struct trace_seq *s, void *data,
4853} 4853}
4854 4854
4855void tep_print_fields(struct trace_seq *s, void *data, 4855void tep_print_fields(struct trace_seq *s, void *data,
4856 int size __maybe_unused, struct event_format *event) 4856 int size __maybe_unused, struct tep_event_format *event)
4857{ 4857{
4858 struct format_field *field; 4858 struct format_field *field;
4859 4859
@@ -4865,7 +4865,7 @@ void tep_print_fields(struct trace_seq *s, void *data,
4865 } 4865 }
4866} 4866}
4867 4867
4868static void pretty_print(struct trace_seq *s, void *data, int size, struct event_format *event) 4868static void pretty_print(struct trace_seq *s, void *data, int size, struct tep_event_format *event)
4869{ 4869{
4870 struct tep_handle *pevent = event->pevent; 4870 struct tep_handle *pevent = event->pevent;
4871 struct print_fmt *print_fmt = &event->print_fmt; 4871 struct print_fmt *print_fmt = &event->print_fmt;
@@ -5228,7 +5228,7 @@ int tep_data_type(struct tep_handle *pevent, struct tep_record *rec)
5228 * 5228 *
5229 * This returns the event form a given @type; 5229 * This returns the event form a given @type;
5230 */ 5230 */
5231struct event_format *tep_data_event_from_type(struct tep_handle *pevent, int type) 5231struct tep_event_format *tep_data_event_from_type(struct tep_handle *pevent, int type)
5232{ 5232{
5233 return tep_find_event(pevent, type); 5233 return tep_find_event(pevent, type);
5234} 5234}
@@ -5386,7 +5386,7 @@ int tep_cmdline_pid(struct tep_handle *pevent, struct cmdline *cmdline)
5386 * This parses the raw @data using the given @event information and 5386 * This parses the raw @data using the given @event information and
5387 * writes the print format into the trace_seq. 5387 * writes the print format into the trace_seq.
5388 */ 5388 */
5389void tep_event_info(struct trace_seq *s, struct event_format *event, 5389void tep_event_info(struct trace_seq *s, struct tep_event_format *event,
5390 struct tep_record *record) 5390 struct tep_record *record)
5391{ 5391{
5392 int print_pretty = 1; 5392 int print_pretty = 1;
@@ -5427,7 +5427,7 @@ static bool is_timestamp_in_us(char *trace_clock, bool use_trace_clock)
5427 * Returns the associated event for a given record, or NULL if non is 5427 * Returns the associated event for a given record, or NULL if non is
5428 * is found. 5428 * is found.
5429 */ 5429 */
5430struct event_format * 5430struct tep_event_format *
5431tep_find_event_by_record(struct tep_handle *pevent, struct tep_record *record) 5431tep_find_event_by_record(struct tep_handle *pevent, struct tep_record *record)
5432{ 5432{
5433 int type; 5433 int type;
@@ -5452,7 +5452,7 @@ tep_find_event_by_record(struct tep_handle *pevent, struct tep_record *record)
5452 * Writes the tasks comm, pid and CPU to @s. 5452 * Writes the tasks comm, pid and CPU to @s.
5453 */ 5453 */
5454void tep_print_event_task(struct tep_handle *pevent, struct trace_seq *s, 5454void tep_print_event_task(struct tep_handle *pevent, struct trace_seq *s,
5455 struct event_format *event, 5455 struct tep_event_format *event,
5456 struct tep_record *record) 5456 struct tep_record *record)
5457{ 5457{
5458 void *data = record->data; 5458 void *data = record->data;
@@ -5480,7 +5480,7 @@ void tep_print_event_task(struct tep_handle *pevent, struct trace_seq *s,
5480 * Writes the timestamp of the record into @s. 5480 * Writes the timestamp of the record into @s.
5481 */ 5481 */
5482void tep_print_event_time(struct tep_handle *pevent, struct trace_seq *s, 5482void tep_print_event_time(struct tep_handle *pevent, struct trace_seq *s,
5483 struct event_format *event, 5483 struct tep_event_format *event,
5484 struct tep_record *record, 5484 struct tep_record *record,
5485 bool use_trace_clock) 5485 bool use_trace_clock)
5486{ 5486{
@@ -5530,7 +5530,7 @@ void tep_print_event_time(struct tep_handle *pevent, struct trace_seq *s,
5530 * Writes the parsing of the record's data to @s. 5530 * Writes the parsing of the record's data to @s.
5531 */ 5531 */
5532void tep_print_event_data(struct tep_handle *pevent, struct trace_seq *s, 5532void tep_print_event_data(struct tep_handle *pevent, struct trace_seq *s,
5533 struct event_format *event, 5533 struct tep_event_format *event,
5534 struct tep_record *record) 5534 struct tep_record *record)
5535{ 5535{
5536 static const char *spaces = " "; /* 20 spaces */ 5536 static const char *spaces = " "; /* 20 spaces */
@@ -5549,7 +5549,7 @@ void tep_print_event_data(struct tep_handle *pevent, struct trace_seq *s,
5549void tep_print_event(struct tep_handle *pevent, struct trace_seq *s, 5549void tep_print_event(struct tep_handle *pevent, struct trace_seq *s,
5550 struct tep_record *record, bool use_trace_clock) 5550 struct tep_record *record, bool use_trace_clock)
5551{ 5551{
5552 struct event_format *event; 5552 struct tep_event_format *event;
5553 5553
5554 event = tep_find_event_by_record(pevent, record); 5554 event = tep_find_event_by_record(pevent, record);
5555 if (!event) { 5555 if (!event) {
@@ -5571,8 +5571,8 @@ void tep_print_event(struct tep_handle *pevent, struct trace_seq *s,
5571 5571
5572static int events_id_cmp(const void *a, const void *b) 5572static int events_id_cmp(const void *a, const void *b)
5573{ 5573{
5574 struct event_format * const * ea = a; 5574 struct tep_event_format * const * ea = a;
5575 struct event_format * const * eb = b; 5575 struct tep_event_format * const * eb = b;
5576 5576
5577 if ((*ea)->id < (*eb)->id) 5577 if ((*ea)->id < (*eb)->id)
5578 return -1; 5578 return -1;
@@ -5585,8 +5585,8 @@ static int events_id_cmp(const void *a, const void *b)
5585 5585
5586static int events_name_cmp(const void *a, const void *b) 5586static int events_name_cmp(const void *a, const void *b)
5587{ 5587{
5588 struct event_format * const * ea = a; 5588 struct tep_event_format * const * ea = a;
5589 struct event_format * const * eb = b; 5589 struct tep_event_format * const * eb = b;
5590 int res; 5590 int res;
5591 5591
5592 res = strcmp((*ea)->name, (*eb)->name); 5592 res = strcmp((*ea)->name, (*eb)->name);
@@ -5602,8 +5602,8 @@ static int events_name_cmp(const void *a, const void *b)
5602 5602
5603static int events_system_cmp(const void *a, const void *b) 5603static int events_system_cmp(const void *a, const void *b)
5604{ 5604{
5605 struct event_format * const * ea = a; 5605 struct tep_event_format * const * ea = a;
5606 struct event_format * const * eb = b; 5606 struct tep_event_format * const * eb = b;
5607 int res; 5607 int res;
5608 5608
5609 res = strcmp((*ea)->system, (*eb)->system); 5609 res = strcmp((*ea)->system, (*eb)->system);
@@ -5617,9 +5617,9 @@ static int events_system_cmp(const void *a, const void *b)
5617 return events_id_cmp(a, b); 5617 return events_id_cmp(a, b);
5618} 5618}
5619 5619
5620struct event_format **tep_list_events(struct tep_handle *pevent, enum event_sort_type sort_type) 5620struct tep_event_format **tep_list_events(struct tep_handle *pevent, enum event_sort_type sort_type)
5621{ 5621{
5622 struct event_format **events; 5622 struct tep_event_format **events;
5623 int (*sort)(const void *a, const void *b); 5623 int (*sort)(const void *a, const void *b);
5624 5624
5625 events = pevent->sort_events; 5625 events = pevent->sort_events;
@@ -5702,7 +5702,7 @@ get_event_fields(const char *type, const char *name,
5702 * Returns an allocated array of fields. The last item in the array is NULL. 5702 * Returns an allocated array of fields. The last item in the array is NULL.
5703 * The array must be freed with free(). 5703 * The array must be freed with free().
5704 */ 5704 */
5705struct format_field **tep_event_common_fields(struct event_format *event) 5705struct format_field **tep_event_common_fields(struct tep_event_format *event)
5706{ 5706{
5707 return get_event_fields("common", event->name, 5707 return get_event_fields("common", event->name,
5708 event->format.nr_common, 5708 event->format.nr_common,
@@ -5716,7 +5716,7 @@ struct format_field **tep_event_common_fields(struct event_format *event)
5716 * Returns an allocated array of fields. The last item in the array is NULL. 5716 * Returns an allocated array of fields. The last item in the array is NULL.
5717 * The array must be freed with free(). 5717 * The array must be freed with free().
5718 */ 5718 */
5719struct format_field **tep_event_fields(struct event_format *event) 5719struct format_field **tep_event_fields(struct tep_event_format *event)
5720{ 5720{
5721 return get_event_fields("event", event->name, 5721 return get_event_fields("event", event->name,
5722 event->format.nr_fields, 5722 event->format.nr_fields,
@@ -5958,7 +5958,7 @@ int tep_parse_header_page(struct tep_handle *pevent, char *buf, unsigned long si
5958 return 0; 5958 return 0;
5959} 5959}
5960 5960
5961static int event_matches(struct event_format *event, 5961static int event_matches(struct tep_event_format *event,
5962 int id, const char *sys_name, 5962 int id, const char *sys_name,
5963 const char *event_name) 5963 const char *event_name)
5964{ 5964{
@@ -5981,7 +5981,7 @@ static void free_handler(struct event_handler *handle)
5981 free(handle); 5981 free(handle);
5982} 5982}
5983 5983
5984static int find_event_handle(struct tep_handle *pevent, struct event_format *event) 5984static int find_event_handle(struct tep_handle *pevent, struct tep_event_format *event)
5985{ 5985{
5986 struct event_handler *handle, **next; 5986 struct event_handler *handle, **next;
5987 5987
@@ -6022,11 +6022,11 @@ static int find_event_handle(struct tep_handle *pevent, struct event_format *eve
6022 * 6022 *
6023 * /sys/kernel/debug/tracing/events/.../.../format 6023 * /sys/kernel/debug/tracing/events/.../.../format
6024 */ 6024 */
6025enum tep_errno __tep_parse_format(struct event_format **eventp, 6025enum tep_errno __tep_parse_format(struct tep_event_format **eventp,
6026 struct tep_handle *pevent, const char *buf, 6026 struct tep_handle *pevent, const char *buf,
6027 unsigned long size, const char *sys) 6027 unsigned long size, const char *sys)
6028{ 6028{
6029 struct event_format *event; 6029 struct tep_event_format *event;
6030 int ret; 6030 int ret;
6031 6031
6032 init_input_buf(buf, size); 6032 init_input_buf(buf, size);
@@ -6131,12 +6131,12 @@ enum tep_errno __tep_parse_format(struct event_format **eventp,
6131 6131
6132static enum tep_errno 6132static enum tep_errno
6133__parse_event(struct tep_handle *pevent, 6133__parse_event(struct tep_handle *pevent,
6134 struct event_format **eventp, 6134 struct tep_event_format **eventp,
6135 const char *buf, unsigned long size, 6135 const char *buf, unsigned long size,
6136 const char *sys) 6136 const char *sys)
6137{ 6137{
6138 int ret = __tep_parse_format(eventp, pevent, buf, size, sys); 6138 int ret = __tep_parse_format(eventp, pevent, buf, size, sys);
6139 struct event_format *event = *eventp; 6139 struct tep_event_format *event = *eventp;
6140 6140
6141 if (event == NULL) 6141 if (event == NULL)
6142 return ret; 6142 return ret;
@@ -6173,7 +6173,7 @@ event_add_failed:
6173 * /sys/kernel/debug/tracing/events/.../.../format 6173 * /sys/kernel/debug/tracing/events/.../.../format
6174 */ 6174 */
6175enum tep_errno tep_parse_format(struct tep_handle *pevent, 6175enum tep_errno tep_parse_format(struct tep_handle *pevent,
6176 struct event_format **eventp, 6176 struct tep_event_format **eventp,
6177 const char *buf, 6177 const char *buf,
6178 unsigned long size, const char *sys) 6178 unsigned long size, const char *sys)
6179{ 6179{
@@ -6197,7 +6197,7 @@ enum tep_errno tep_parse_format(struct tep_handle *pevent,
6197enum tep_errno tep_parse_event(struct tep_handle *pevent, const char *buf, 6197enum tep_errno tep_parse_event(struct tep_handle *pevent, const char *buf,
6198 unsigned long size, const char *sys) 6198 unsigned long size, const char *sys)
6199{ 6199{
6200 struct event_format *event = NULL; 6200 struct tep_event_format *event = NULL;
6201 return __parse_event(pevent, &event, buf, size, sys); 6201 return __parse_event(pevent, &event, buf, size, sys);
6202} 6202}
6203 6203
@@ -6263,7 +6263,7 @@ int get_field_val(struct trace_seq *s, struct format_field *field,
6263 * 6263 *
6264 * On failure, it returns NULL. 6264 * On failure, it returns NULL.
6265 */ 6265 */
6266void *tep_get_field_raw(struct trace_seq *s, struct event_format *event, 6266void *tep_get_field_raw(struct trace_seq *s, struct tep_event_format *event,
6267 const char *name, struct tep_record *record, 6267 const char *name, struct tep_record *record,
6268 int *len, int err) 6268 int *len, int err)
6269{ 6269{
@@ -6310,7 +6310,7 @@ void *tep_get_field_raw(struct trace_seq *s, struct event_format *event,
6310 * 6310 *
6311 * Returns 0 on success -1 on field not found. 6311 * Returns 0 on success -1 on field not found.
6312 */ 6312 */
6313int tep_get_field_val(struct trace_seq *s, struct event_format *event, 6313int tep_get_field_val(struct trace_seq *s, struct tep_event_format *event,
6314 const char *name, struct tep_record *record, 6314 const char *name, struct tep_record *record,
6315 unsigned long long *val, int err) 6315 unsigned long long *val, int err)
6316{ 6316{
@@ -6335,7 +6335,7 @@ int tep_get_field_val(struct trace_seq *s, struct event_format *event,
6335 * 6335 *
6336 * Returns 0 on success -1 on field not found. 6336 * Returns 0 on success -1 on field not found.
6337 */ 6337 */
6338int tep_get_common_field_val(struct trace_seq *s, struct event_format *event, 6338int tep_get_common_field_val(struct trace_seq *s, struct tep_event_format *event,
6339 const char *name, struct tep_record *record, 6339 const char *name, struct tep_record *record,
6340 unsigned long long *val, int err) 6340 unsigned long long *val, int err)
6341{ 6341{
@@ -6360,7 +6360,7 @@ int tep_get_common_field_val(struct trace_seq *s, struct event_format *event,
6360 * 6360 *
6361 * Returns 0 on success -1 on field not found. 6361 * Returns 0 on success -1 on field not found.
6362 */ 6362 */
6363int tep_get_any_field_val(struct trace_seq *s, struct event_format *event, 6363int tep_get_any_field_val(struct trace_seq *s, struct tep_event_format *event,
6364 const char *name, struct tep_record *record, 6364 const char *name, struct tep_record *record,
6365 unsigned long long *val, int err) 6365 unsigned long long *val, int err)
6366{ 6366{
@@ -6386,7 +6386,7 @@ int tep_get_any_field_val(struct trace_seq *s, struct event_format *event,
6386 * Returns: 0 on success, -1 field not found, or 1 if buffer is full. 6386 * Returns: 0 on success, -1 field not found, or 1 if buffer is full.
6387 */ 6387 */
6388int tep_print_num_field(struct trace_seq *s, const char *fmt, 6388int tep_print_num_field(struct trace_seq *s, const char *fmt,
6389 struct event_format *event, const char *name, 6389 struct tep_event_format *event, const char *name,
6390 struct tep_record *record, int err) 6390 struct tep_record *record, int err)
6391{ 6391{
6392 struct format_field *field = tep_find_field(event, name); 6392 struct format_field *field = tep_find_field(event, name);
@@ -6418,7 +6418,7 @@ int tep_print_num_field(struct trace_seq *s, const char *fmt,
6418 * Returns: 0 on success, -1 field not found, or 1 if buffer is full. 6418 * Returns: 0 on success, -1 field not found, or 1 if buffer is full.
6419 */ 6419 */
6420int tep_print_func_field(struct trace_seq *s, const char *fmt, 6420int tep_print_func_field(struct trace_seq *s, const char *fmt,
6421 struct event_format *event, const char *name, 6421 struct tep_event_format *event, const char *name,
6422 struct tep_record *record, int err) 6422 struct tep_record *record, int err)
6423{ 6423{
6424 struct format_field *field = tep_find_field(event, name); 6424 struct format_field *field = tep_find_field(event, name);
@@ -6578,11 +6578,11 @@ int tep_unregister_print_function(struct tep_handle *pevent,
6578 return -1; 6578 return -1;
6579} 6579}
6580 6580
6581static struct event_format *search_event(struct tep_handle *pevent, int id, 6581static struct tep_event_format *search_event(struct tep_handle *pevent, int id,
6582 const char *sys_name, 6582 const char *sys_name,
6583 const char *event_name) 6583 const char *event_name)
6584{ 6584{
6585 struct event_format *event; 6585 struct tep_event_format *event;
6586 6586
6587 if (id >= 0) { 6587 if (id >= 0) {
6588 /* search by id */ 6588 /* search by id */
@@ -6622,7 +6622,7 @@ int tep_register_event_handler(struct tep_handle *pevent, int id,
6622 const char *sys_name, const char *event_name, 6622 const char *sys_name, const char *event_name,
6623 tep_event_handler_func func, void *context) 6623 tep_event_handler_func func, void *context)
6624{ 6624{
6625 struct event_format *event; 6625 struct tep_event_format *event;
6626 struct event_handler *handle; 6626 struct event_handler *handle;
6627 6627
6628 event = search_event(pevent, id, sys_name, event_name); 6628 event = search_event(pevent, id, sys_name, event_name);
@@ -6706,7 +6706,7 @@ int tep_unregister_event_handler(struct tep_handle *pevent, int id,
6706 const char *sys_name, const char *event_name, 6706 const char *sys_name, const char *event_name,
6707 tep_event_handler_func func, void *context) 6707 tep_event_handler_func func, void *context)
6708{ 6708{
6709 struct event_format *event; 6709 struct tep_event_format *event;
6710 struct event_handler *handle; 6710 struct event_handler *handle;
6711 struct event_handler **next; 6711 struct event_handler **next;
6712 6712
@@ -6784,7 +6784,7 @@ static void free_formats(struct format *format)
6784 free_format_fields(format->fields); 6784 free_format_fields(format->fields);
6785} 6785}
6786 6786
6787void tep_free_format(struct event_format *event) 6787void tep_free_format(struct tep_event_format *event)
6788{ 6788{
6789 free(event->name); 6789 free(event->name);
6790 free(event->system); 6790 free(event->system);
diff --git a/tools/lib/traceevent/event-parse.h b/tools/lib/traceevent/event-parse.h
index fa665c66bfa4..82de69c2b054 100644
--- a/tools/lib/traceevent/event-parse.h
+++ b/tools/lib/traceevent/event-parse.h
@@ -54,14 +54,14 @@ struct tep_record {
54#endif 54#endif
55}; 55};
56 56
57/* ----------------------- pevent ----------------------- */ 57/* ----------------------- tep ----------------------- */
58 58
59struct tep_handle; 59struct tep_handle;
60struct event_format; 60struct tep_event_format;
61 61
62typedef int (*tep_event_handler_func)(struct trace_seq *s, 62typedef int (*tep_event_handler_func)(struct trace_seq *s,
63 struct tep_record *record, 63 struct tep_record *record,
64 struct event_format *event, 64 struct tep_event_format *event,
65 void *context); 65 void *context);
66 66
67typedef int (*tep_plugin_load_func)(struct tep_handle *pevent); 67typedef int (*tep_plugin_load_func)(struct tep_handle *pevent);
@@ -143,7 +143,7 @@ enum format_flags {
143 143
144struct format_field { 144struct format_field {
145 struct format_field *next; 145 struct format_field *next;
146 struct event_format *event; 146 struct tep_event_format *event;
147 char *type; 147 char *type;
148 char *name; 148 char *name;
149 char *alias; 149 char *alias;
@@ -277,7 +277,7 @@ struct print_fmt {
277 struct print_arg *args; 277 struct print_arg *args;
278}; 278};
279 279
280struct event_format { 280struct tep_event_format {
281 struct tep_handle *pevent; 281 struct tep_handle *pevent;
282 char *name; 282 char *name;
283 int id; 283 int id;
@@ -451,9 +451,9 @@ struct tep_handle {
451 unsigned int printk_count; 451 unsigned int printk_count;
452 452
453 453
454 struct event_format **events; 454 struct tep_event_format **events;
455 int nr_events; 455 int nr_events;
456 struct event_format **sort_events; 456 struct tep_event_format **sort_events;
457 enum event_sort_type last_type; 457 enum event_sort_type last_type;
458 458
459 int type_offset; 459 int type_offset;
@@ -485,7 +485,7 @@ struct tep_handle {
485 struct tep_function_handler *func_handlers; 485 struct tep_function_handler *func_handlers;
486 486
487 /* cache */ 487 /* cache */
488 struct event_format *last_event; 488 struct tep_event_format *last_event;
489 489
490 char *trace_clock; 490 char *trace_clock;
491}; 491};
@@ -585,14 +585,14 @@ int tep_register_print_string(struct tep_handle *pevent, const char *fmt,
585int tep_pid_is_registered(struct tep_handle *pevent, int pid); 585int tep_pid_is_registered(struct tep_handle *pevent, int pid);
586 586
587void tep_print_event_task(struct tep_handle *pevent, struct trace_seq *s, 587void tep_print_event_task(struct tep_handle *pevent, struct trace_seq *s,
588 struct event_format *event, 588 struct tep_event_format *event,
589 struct tep_record *record); 589 struct tep_record *record);
590void tep_print_event_time(struct tep_handle *pevent, struct trace_seq *s, 590void tep_print_event_time(struct tep_handle *pevent, struct trace_seq *s,
591 struct event_format *event, 591 struct tep_event_format *event,
592 struct tep_record *record, 592 struct tep_record *record,
593 bool use_trace_clock); 593 bool use_trace_clock);
594void tep_print_event_data(struct tep_handle *pevent, struct trace_seq *s, 594void tep_print_event_data(struct tep_handle *pevent, struct trace_seq *s,
595 struct event_format *event, 595 struct tep_event_format *event,
596 struct tep_record *record); 596 struct tep_record *record);
597void tep_print_event(struct tep_handle *pevent, struct trace_seq *s, 597void tep_print_event(struct tep_handle *pevent, struct trace_seq *s,
598 struct tep_record *record, bool use_trace_clock); 598 struct tep_record *record, bool use_trace_clock);
@@ -603,32 +603,32 @@ int tep_parse_header_page(struct tep_handle *pevent, char *buf, unsigned long si
603enum tep_errno tep_parse_event(struct tep_handle *pevent, const char *buf, 603enum tep_errno tep_parse_event(struct tep_handle *pevent, const char *buf,
604 unsigned long size, const char *sys); 604 unsigned long size, const char *sys);
605enum tep_errno tep_parse_format(struct tep_handle *pevent, 605enum tep_errno tep_parse_format(struct tep_handle *pevent,
606 struct event_format **eventp, 606 struct tep_event_format **eventp,
607 const char *buf, 607 const char *buf,
608 unsigned long size, const char *sys); 608 unsigned long size, const char *sys);
609void tep_free_format(struct event_format *event); 609void tep_free_format(struct tep_event_format *event);
610void tep_free_format_field(struct format_field *field); 610void tep_free_format_field(struct format_field *field);
611 611
612void *tep_get_field_raw(struct trace_seq *s, struct event_format *event, 612void *tep_get_field_raw(struct trace_seq *s, struct tep_event_format *event,
613 const char *name, struct tep_record *record, 613 const char *name, struct tep_record *record,
614 int *len, int err); 614 int *len, int err);
615 615
616int tep_get_field_val(struct trace_seq *s, struct event_format *event, 616int tep_get_field_val(struct trace_seq *s, struct tep_event_format *event,
617 const char *name, struct tep_record *record, 617 const char *name, struct tep_record *record,
618 unsigned long long *val, int err); 618 unsigned long long *val, int err);
619int tep_get_common_field_val(struct trace_seq *s, struct event_format *event, 619int tep_get_common_field_val(struct trace_seq *s, struct tep_event_format *event,
620 const char *name, struct tep_record *record, 620 const char *name, struct tep_record *record,
621 unsigned long long *val, int err); 621 unsigned long long *val, int err);
622int tep_get_any_field_val(struct trace_seq *s, struct event_format *event, 622int tep_get_any_field_val(struct trace_seq *s, struct tep_event_format *event,
623 const char *name, struct tep_record *record, 623 const char *name, struct tep_record *record,
624 unsigned long long *val, int err); 624 unsigned long long *val, int err);
625 625
626int tep_print_num_field(struct trace_seq *s, const char *fmt, 626int tep_print_num_field(struct trace_seq *s, const char *fmt,
627 struct event_format *event, const char *name, 627 struct tep_event_format *event, const char *name,
628 struct tep_record *record, int err); 628 struct tep_record *record, int err);
629 629
630int tep_print_func_field(struct trace_seq *s, const char *fmt, 630int tep_print_func_field(struct trace_seq *s, const char *fmt,
631 struct event_format *event, const char *name, 631 struct tep_event_format *event, const char *name,
632 struct tep_record *record, int err); 632 struct tep_record *record, int err);
633 633
634int tep_register_event_handler(struct tep_handle *pevent, int id, 634int tep_register_event_handler(struct tep_handle *pevent, int id,
@@ -644,9 +644,9 @@ int tep_register_print_function(struct tep_handle *pevent,
644int tep_unregister_print_function(struct tep_handle *pevent, 644int tep_unregister_print_function(struct tep_handle *pevent,
645 tep_func_handler func, char *name); 645 tep_func_handler func, char *name);
646 646
647struct format_field *tep_find_common_field(struct event_format *event, const char *name); 647struct format_field *tep_find_common_field(struct tep_event_format *event, const char *name);
648struct format_field *tep_find_field(struct event_format *event, const char *name); 648struct format_field *tep_find_field(struct tep_event_format *event, const char *name);
649struct format_field *tep_find_any_field(struct event_format *event, const char *name); 649struct format_field *tep_find_any_field(struct tep_event_format *event, const char *name);
650 650
651const char *tep_find_function(struct tep_handle *pevent, unsigned long long addr); 651const char *tep_find_function(struct tep_handle *pevent, unsigned long long addr);
652unsigned long long 652unsigned long long
@@ -655,18 +655,18 @@ unsigned long long tep_read_number(struct tep_handle *pevent, const void *ptr, i
655int tep_read_number_field(struct format_field *field, const void *data, 655int tep_read_number_field(struct format_field *field, const void *data,
656 unsigned long long *value); 656 unsigned long long *value);
657 657
658struct event_format *tep_find_event(struct tep_handle *pevent, int id); 658struct tep_event_format *tep_find_event(struct tep_handle *pevent, int id);
659 659
660struct event_format * 660struct tep_event_format *
661tep_find_event_by_name(struct tep_handle *pevent, const char *sys, const char *name); 661tep_find_event_by_name(struct tep_handle *pevent, const char *sys, const char *name);
662 662
663struct event_format * 663struct tep_event_format *
664tep_find_event_by_record(struct tep_handle *pevent, struct tep_record *record); 664tep_find_event_by_record(struct tep_handle *pevent, struct tep_record *record);
665 665
666void tep_data_lat_fmt(struct tep_handle *pevent, 666void tep_data_lat_fmt(struct tep_handle *pevent,
667 struct trace_seq *s, struct tep_record *record); 667 struct trace_seq *s, struct tep_record *record);
668int tep_data_type(struct tep_handle *pevent, struct tep_record *rec); 668int tep_data_type(struct tep_handle *pevent, struct tep_record *rec);
669struct event_format *tep_data_event_from_type(struct tep_handle *pevent, int type); 669struct tep_event_format *tep_data_event_from_type(struct tep_handle *pevent, int type);
670int tep_data_pid(struct tep_handle *pevent, struct tep_record *rec); 670int tep_data_pid(struct tep_handle *pevent, struct tep_record *rec);
671int tep_data_preempt_count(struct tep_handle *pevent, struct tep_record *rec); 671int tep_data_preempt_count(struct tep_handle *pevent, struct tep_record *rec);
672int tep_data_flags(struct tep_handle *pevent, struct tep_record *rec); 672int tep_data_flags(struct tep_handle *pevent, struct tep_record *rec);
@@ -679,15 +679,15 @@ int tep_cmdline_pid(struct tep_handle *pevent, struct cmdline *cmdline);
679void tep_print_field(struct trace_seq *s, void *data, 679void tep_print_field(struct trace_seq *s, void *data,
680 struct format_field *field); 680 struct format_field *field);
681void tep_print_fields(struct trace_seq *s, void *data, 681void tep_print_fields(struct trace_seq *s, void *data,
682 int size __maybe_unused, struct event_format *event); 682 int size __maybe_unused, struct tep_event_format *event);
683void tep_event_info(struct trace_seq *s, struct event_format *event, 683void tep_event_info(struct trace_seq *s, struct tep_event_format *event,
684 struct tep_record *record); 684 struct tep_record *record);
685int tep_strerror(struct tep_handle *pevent, enum tep_errno errnum, 685int tep_strerror(struct tep_handle *pevent, enum tep_errno errnum,
686 char *buf, size_t buflen); 686 char *buf, size_t buflen);
687 687
688struct event_format **tep_list_events(struct tep_handle *pevent, enum event_sort_type); 688struct tep_event_format **tep_list_events(struct tep_handle *pevent, enum event_sort_type);
689struct format_field **tep_event_common_fields(struct event_format *event); 689struct format_field **tep_event_common_fields(struct tep_event_format *event);
690struct format_field **tep_event_fields(struct event_format *event); 690struct format_field **tep_event_fields(struct tep_event_format *event);
691 691
692static inline int tep_get_cpus(struct tep_handle *pevent) 692static inline int tep_get_cpus(struct tep_handle *pevent)
693{ 693{
@@ -884,7 +884,7 @@ struct filter_arg {
884 884
885struct filter_type { 885struct filter_type {
886 int event_id; 886 int event_id;
887 struct event_format *event; 887 struct tep_event_format *event;
888 struct filter_arg *filter; 888 struct filter_arg *filter;
889}; 889};
890 890
diff --git a/tools/lib/traceevent/parse-filter.c b/tools/lib/traceevent/parse-filter.c
index e76154c02ee7..5572756307ab 100644
--- a/tools/lib/traceevent/parse-filter.c
+++ b/tools/lib/traceevent/parse-filter.c
@@ -26,7 +26,7 @@ static struct format_field cpu = {
26 26
27struct event_list { 27struct event_list {
28 struct event_list *next; 28 struct event_list *next;
29 struct event_format *event; 29 struct tep_event_format *event;
30}; 30};
31 31
32static void show_error(char *error_buf, const char *fmt, ...) 32static void show_error(char *error_buf, const char *fmt, ...)
@@ -228,7 +228,7 @@ static void free_arg(struct filter_arg *arg)
228} 228}
229 229
230static int add_event(struct event_list **events, 230static int add_event(struct event_list **events,
231 struct event_format *event) 231 struct tep_event_format *event)
232{ 232{
233 struct event_list *list; 233 struct event_list *list;
234 234
@@ -242,7 +242,7 @@ static int add_event(struct event_list **events,
242 return 0; 242 return 0;
243} 243}
244 244
245static int event_match(struct event_format *event, 245static int event_match(struct tep_event_format *event,
246 regex_t *sreg, regex_t *ereg) 246 regex_t *sreg, regex_t *ereg)
247{ 247{
248 if (sreg) { 248 if (sreg) {
@@ -258,7 +258,7 @@ static enum tep_errno
258find_event(struct tep_handle *pevent, struct event_list **events, 258find_event(struct tep_handle *pevent, struct event_list **events,
259 char *sys_name, char *event_name) 259 char *sys_name, char *event_name)
260{ 260{
261 struct event_format *event; 261 struct tep_event_format *event;
262 regex_t ereg; 262 regex_t ereg;
263 regex_t sreg; 263 regex_t sreg;
264 int match = 0; 264 int match = 0;
@@ -333,7 +333,7 @@ static void free_events(struct event_list *events)
333} 333}
334 334
335static enum tep_errno 335static enum tep_errno
336create_arg_item(struct event_format *event, const char *token, 336create_arg_item(struct tep_event_format *event, const char *token,
337 enum event_type type, struct filter_arg **parg, char *error_str) 337 enum event_type type, struct filter_arg **parg, char *error_str)
338{ 338{
339 struct format_field *field; 339 struct format_field *field;
@@ -939,7 +939,7 @@ static int collapse_tree(struct filter_arg *arg,
939} 939}
940 940
941static enum tep_errno 941static enum tep_errno
942process_filter(struct event_format *event, struct filter_arg **parg, 942process_filter(struct tep_event_format *event, struct filter_arg **parg,
943 char *error_str, int not) 943 char *error_str, int not)
944{ 944{
945 enum event_type type; 945 enum event_type type;
@@ -1179,7 +1179,7 @@ process_filter(struct event_format *event, struct filter_arg **parg,
1179} 1179}
1180 1180
1181static enum tep_errno 1181static enum tep_errno
1182process_event(struct event_format *event, const char *filter_str, 1182process_event(struct tep_event_format *event, const char *filter_str,
1183 struct filter_arg **parg, char *error_str) 1183 struct filter_arg **parg, char *error_str)
1184{ 1184{
1185 int ret; 1185 int ret;
@@ -1204,7 +1204,7 @@ process_event(struct event_format *event, const char *filter_str,
1204} 1204}
1205 1205
1206static enum tep_errno 1206static enum tep_errno
1207filter_event(struct event_filter *filter, struct event_format *event, 1207filter_event(struct event_filter *filter, struct tep_event_format *event,
1208 const char *filter_str, char *error_str) 1208 const char *filter_str, char *error_str)
1209{ 1209{
1210 struct filter_type *filter_type; 1210 struct filter_type *filter_type;
@@ -1456,7 +1456,7 @@ static int copy_filter_type(struct event_filter *filter,
1456 struct filter_type *filter_type) 1456 struct filter_type *filter_type)
1457{ 1457{
1458 struct filter_arg *arg; 1458 struct filter_arg *arg;
1459 struct event_format *event; 1459 struct tep_event_format *event;
1460 const char *sys; 1460 const char *sys;
1461 const char *name; 1461 const char *name;
1462 char *str; 1462 char *str;
@@ -1538,7 +1538,7 @@ int tep_update_trivial(struct event_filter *dest, struct event_filter *source,
1538{ 1538{
1539 struct tep_handle *src_pevent; 1539 struct tep_handle *src_pevent;
1540 struct tep_handle *dest_pevent; 1540 struct tep_handle *dest_pevent;
1541 struct event_format *event; 1541 struct tep_event_format *event;
1542 struct filter_type *filter_type; 1542 struct filter_type *filter_type;
1543 struct filter_arg *arg; 1543 struct filter_arg *arg;
1544 char *str; 1544 char *str;
@@ -1682,11 +1682,11 @@ int tep_filter_event_has_trivial(struct event_filter *filter,
1682 } 1682 }
1683} 1683}
1684 1684
1685static int test_filter(struct event_format *event, struct filter_arg *arg, 1685static int test_filter(struct tep_event_format *event, struct filter_arg *arg,
1686 struct tep_record *record, enum tep_errno *err); 1686 struct tep_record *record, enum tep_errno *err);
1687 1687
1688static const char * 1688static const char *
1689get_comm(struct event_format *event, struct tep_record *record) 1689get_comm(struct tep_event_format *event, struct tep_record *record)
1690{ 1690{
1691 const char *comm; 1691 const char *comm;
1692 int pid; 1692 int pid;
@@ -1697,7 +1697,7 @@ get_comm(struct event_format *event, struct tep_record *record)
1697} 1697}
1698 1698
1699static unsigned long long 1699static unsigned long long
1700get_value(struct event_format *event, 1700get_value(struct tep_event_format *event,
1701 struct format_field *field, struct tep_record *record) 1701 struct format_field *field, struct tep_record *record)
1702{ 1702{
1703 unsigned long long val; 1703 unsigned long long val;
@@ -1733,11 +1733,11 @@ get_value(struct event_format *event,
1733} 1733}
1734 1734
1735static unsigned long long 1735static unsigned long long
1736get_arg_value(struct event_format *event, struct filter_arg *arg, 1736get_arg_value(struct tep_event_format *event, struct filter_arg *arg,
1737 struct tep_record *record, enum tep_errno *err); 1737 struct tep_record *record, enum tep_errno *err);
1738 1738
1739static unsigned long long 1739static unsigned long long
1740get_exp_value(struct event_format *event, struct filter_arg *arg, 1740get_exp_value(struct tep_event_format *event, struct filter_arg *arg,
1741 struct tep_record *record, enum tep_errno *err) 1741 struct tep_record *record, enum tep_errno *err)
1742{ 1742{
1743 unsigned long long lval, rval; 1743 unsigned long long lval, rval;
@@ -1792,7 +1792,7 @@ get_exp_value(struct event_format *event, struct filter_arg *arg,
1792} 1792}
1793 1793
1794static unsigned long long 1794static unsigned long long
1795get_arg_value(struct event_format *event, struct filter_arg *arg, 1795get_arg_value(struct tep_event_format *event, struct filter_arg *arg,
1796 struct tep_record *record, enum tep_errno *err) 1796 struct tep_record *record, enum tep_errno *err)
1797{ 1797{
1798 switch (arg->type) { 1798 switch (arg->type) {
@@ -1816,7 +1816,7 @@ get_arg_value(struct event_format *event, struct filter_arg *arg,
1816 return 0; 1816 return 0;
1817} 1817}
1818 1818
1819static int test_num(struct event_format *event, struct filter_arg *arg, 1819static int test_num(struct tep_event_format *event, struct filter_arg *arg,
1820 struct tep_record *record, enum tep_errno *err) 1820 struct tep_record *record, enum tep_errno *err)
1821{ 1821{
1822 unsigned long long lval, rval; 1822 unsigned long long lval, rval;
@@ -1859,7 +1859,7 @@ static int test_num(struct event_format *event, struct filter_arg *arg,
1859 1859
1860static const char *get_field_str(struct filter_arg *arg, struct tep_record *record) 1860static const char *get_field_str(struct filter_arg *arg, struct tep_record *record)
1861{ 1861{
1862 struct event_format *event; 1862 struct tep_event_format *event;
1863 struct tep_handle *pevent; 1863 struct tep_handle *pevent;
1864 unsigned long long addr; 1864 unsigned long long addr;
1865 const char *val = NULL; 1865 const char *val = NULL;
@@ -1907,7 +1907,7 @@ static const char *get_field_str(struct filter_arg *arg, struct tep_record *reco
1907 return val; 1907 return val;
1908} 1908}
1909 1909
1910static int test_str(struct event_format *event, struct filter_arg *arg, 1910static int test_str(struct tep_event_format *event, struct filter_arg *arg,
1911 struct tep_record *record, enum tep_errno *err) 1911 struct tep_record *record, enum tep_errno *err)
1912{ 1912{
1913 const char *val; 1913 const char *val;
@@ -1938,7 +1938,7 @@ static int test_str(struct event_format *event, struct filter_arg *arg,
1938 } 1938 }
1939} 1939}
1940 1940
1941static int test_op(struct event_format *event, struct filter_arg *arg, 1941static int test_op(struct tep_event_format *event, struct filter_arg *arg,
1942 struct tep_record *record, enum tep_errno *err) 1942 struct tep_record *record, enum tep_errno *err)
1943{ 1943{
1944 switch (arg->op.type) { 1944 switch (arg->op.type) {
@@ -1960,7 +1960,7 @@ static int test_op(struct event_format *event, struct filter_arg *arg,
1960 } 1960 }
1961} 1961}
1962 1962
1963static int test_filter(struct event_format *event, struct filter_arg *arg, 1963static int test_filter(struct tep_event_format *event, struct filter_arg *arg,
1964 struct tep_record *record, enum tep_errno *err) 1964 struct tep_record *record, enum tep_errno *err)
1965{ 1965{
1966 if (*err) { 1966 if (*err) {
diff --git a/tools/lib/traceevent/plugin_function.c b/tools/lib/traceevent/plugin_function.c
index 2919042e7dc2..528acc75d81a 100644
--- a/tools/lib/traceevent/plugin_function.c
+++ b/tools/lib/traceevent/plugin_function.c
@@ -124,7 +124,7 @@ static int add_and_get_index(const char *parent, const char *child, int cpu)
124} 124}
125 125
126static int function_handler(struct trace_seq *s, struct tep_record *record, 126static int function_handler(struct trace_seq *s, struct tep_record *record,
127 struct event_format *event, void *context) 127 struct tep_event_format *event, void *context)
128{ 128{
129 struct tep_handle *pevent = event->pevent; 129 struct tep_handle *pevent = event->pevent;
130 unsigned long long function; 130 unsigned long long function;
diff --git a/tools/lib/traceevent/plugin_hrtimer.c b/tools/lib/traceevent/plugin_hrtimer.c
index 29b608076ea0..9aa05b4ca811 100644
--- a/tools/lib/traceevent/plugin_hrtimer.c
+++ b/tools/lib/traceevent/plugin_hrtimer.c
@@ -27,7 +27,7 @@
27 27
28static int timer_expire_handler(struct trace_seq *s, 28static int timer_expire_handler(struct trace_seq *s,
29 struct tep_record *record, 29 struct tep_record *record,
30 struct event_format *event, void *context) 30 struct tep_event_format *event, void *context)
31{ 31{
32 trace_seq_printf(s, "hrtimer="); 32 trace_seq_printf(s, "hrtimer=");
33 33
@@ -47,7 +47,7 @@ static int timer_expire_handler(struct trace_seq *s,
47 47
48static int timer_start_handler(struct trace_seq *s, 48static int timer_start_handler(struct trace_seq *s,
49 struct tep_record *record, 49 struct tep_record *record,
50 struct event_format *event, void *context) 50 struct tep_event_format *event, void *context)
51{ 51{
52 trace_seq_printf(s, "hrtimer="); 52 trace_seq_printf(s, "hrtimer=");
53 53
diff --git a/tools/lib/traceevent/plugin_kmem.c b/tools/lib/traceevent/plugin_kmem.c
index a7a162575e2c..5632aff43aba 100644
--- a/tools/lib/traceevent/plugin_kmem.c
+++ b/tools/lib/traceevent/plugin_kmem.c
@@ -25,7 +25,7 @@
25#include "trace-seq.h" 25#include "trace-seq.h"
26 26
27static int call_site_handler(struct trace_seq *s, struct tep_record *record, 27static int call_site_handler(struct trace_seq *s, struct tep_record *record,
28 struct event_format *event, void *context) 28 struct tep_event_format *event, void *context)
29{ 29{
30 struct format_field *field; 30 struct format_field *field;
31 unsigned long long val, addr; 31 unsigned long long val, addr;
diff --git a/tools/lib/traceevent/plugin_kvm.c b/tools/lib/traceevent/plugin_kvm.c
index a0dfd3d0f197..d13c22846fa9 100644
--- a/tools/lib/traceevent/plugin_kvm.c
+++ b/tools/lib/traceevent/plugin_kvm.c
@@ -249,7 +249,7 @@ static const char *find_exit_reason(unsigned isa, int val)
249} 249}
250 250
251static int print_exit_reason(struct trace_seq *s, struct tep_record *record, 251static int print_exit_reason(struct trace_seq *s, struct tep_record *record,
252 struct event_format *event, const char *field) 252 struct tep_event_format *event, const char *field)
253{ 253{
254 unsigned long long isa; 254 unsigned long long isa;
255 unsigned long long val; 255 unsigned long long val;
@@ -270,7 +270,7 @@ static int print_exit_reason(struct trace_seq *s, struct tep_record *record,
270} 270}
271 271
272static int kvm_exit_handler(struct trace_seq *s, struct tep_record *record, 272static int kvm_exit_handler(struct trace_seq *s, struct tep_record *record,
273 struct event_format *event, void *context) 273 struct tep_event_format *event, void *context)
274{ 274{
275 unsigned long long info1 = 0, info2 = 0; 275 unsigned long long info1 = 0, info2 = 0;
276 276
@@ -293,7 +293,7 @@ static int kvm_exit_handler(struct trace_seq *s, struct tep_record *record,
293 293
294static int kvm_emulate_insn_handler(struct trace_seq *s, 294static int kvm_emulate_insn_handler(struct trace_seq *s,
295 struct tep_record *record, 295 struct tep_record *record,
296 struct event_format *event, void *context) 296 struct tep_event_format *event, void *context)
297{ 297{
298 unsigned long long rip, csbase, len, flags, failed; 298 unsigned long long rip, csbase, len, flags, failed;
299 int llen; 299 int llen;
@@ -332,7 +332,7 @@ static int kvm_emulate_insn_handler(struct trace_seq *s,
332 332
333 333
334static int kvm_nested_vmexit_inject_handler(struct trace_seq *s, struct tep_record *record, 334static int kvm_nested_vmexit_inject_handler(struct trace_seq *s, struct tep_record *record,
335 struct event_format *event, void *context) 335 struct tep_event_format *event, void *context)
336{ 336{
337 if (print_exit_reason(s, record, event, "exit_code") < 0) 337 if (print_exit_reason(s, record, event, "exit_code") < 0)
338 return -1; 338 return -1;
@@ -346,7 +346,7 @@ static int kvm_nested_vmexit_inject_handler(struct trace_seq *s, struct tep_reco
346} 346}
347 347
348static int kvm_nested_vmexit_handler(struct trace_seq *s, struct tep_record *record, 348static int kvm_nested_vmexit_handler(struct trace_seq *s, struct tep_record *record,
349 struct event_format *event, void *context) 349 struct tep_event_format *event, void *context)
350{ 350{
351 tep_print_num_field(s, "rip %llx ", event, "rip", record, 1); 351 tep_print_num_field(s, "rip %llx ", event, "rip", record, 1);
352 352
@@ -372,7 +372,7 @@ union kvm_mmu_page_role {
372}; 372};
373 373
374static int kvm_mmu_print_role(struct trace_seq *s, struct tep_record *record, 374static int kvm_mmu_print_role(struct trace_seq *s, struct tep_record *record,
375 struct event_format *event, void *context) 375 struct tep_event_format *event, void *context)
376{ 376{
377 unsigned long long val; 377 unsigned long long val;
378 static const char *access_str[] = { 378 static const char *access_str[] = {
@@ -419,7 +419,7 @@ static int kvm_mmu_print_role(struct trace_seq *s, struct tep_record *record,
419 419
420static int kvm_mmu_get_page_handler(struct trace_seq *s, 420static int kvm_mmu_get_page_handler(struct trace_seq *s,
421 struct tep_record *record, 421 struct tep_record *record,
422 struct event_format *event, void *context) 422 struct tep_event_format *event, void *context)
423{ 423{
424 unsigned long long val; 424 unsigned long long val;
425 425
diff --git a/tools/lib/traceevent/plugin_mac80211.c b/tools/lib/traceevent/plugin_mac80211.c
index 0b7779444b63..c16469614690 100644
--- a/tools/lib/traceevent/plugin_mac80211.c
+++ b/tools/lib/traceevent/plugin_mac80211.c
@@ -26,7 +26,7 @@
26 26
27#define INDENT 65 27#define INDENT 65
28 28
29static void print_string(struct trace_seq *s, struct event_format *event, 29static void print_string(struct trace_seq *s, struct tep_event_format *event,
30 const char *name, const void *data) 30 const char *name, const void *data)
31{ 31{
32 struct format_field *f = tep_find_field(event, name); 32 struct format_field *f = tep_find_field(event, name);
@@ -60,7 +60,7 @@ static void print_string(struct trace_seq *s, struct event_format *event,
60 60
61static int drv_bss_info_changed(struct trace_seq *s, 61static int drv_bss_info_changed(struct trace_seq *s,
62 struct tep_record *record, 62 struct tep_record *record,
63 struct event_format *event, void *context) 63 struct tep_event_format *event, void *context)
64{ 64{
65 void *data = record->data; 65 void *data = record->data;
66 66
diff --git a/tools/lib/traceevent/plugin_sched_switch.c b/tools/lib/traceevent/plugin_sched_switch.c
index 582d3be2849b..a7eeb42894ae 100644
--- a/tools/lib/traceevent/plugin_sched_switch.c
+++ b/tools/lib/traceevent/plugin_sched_switch.c
@@ -67,7 +67,7 @@ static void write_and_save_comm(struct format_field *field,
67 67
68static int sched_wakeup_handler(struct trace_seq *s, 68static int sched_wakeup_handler(struct trace_seq *s,
69 struct tep_record *record, 69 struct tep_record *record,
70 struct event_format *event, void *context) 70 struct tep_event_format *event, void *context)
71{ 71{
72 struct format_field *field; 72 struct format_field *field;
73 unsigned long long val; 73 unsigned long long val;
@@ -96,7 +96,7 @@ static int sched_wakeup_handler(struct trace_seq *s,
96 96
97static int sched_switch_handler(struct trace_seq *s, 97static int sched_switch_handler(struct trace_seq *s,
98 struct tep_record *record, 98 struct tep_record *record,
99 struct event_format *event, void *context) 99 struct tep_event_format *event, void *context)
100{ 100{
101 struct format_field *field; 101 struct format_field *field;
102 unsigned long long val; 102 unsigned long long val;
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 7ce277d22a91..9f8c365dacb1 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -862,7 +862,7 @@ static struct syscall_fmt *syscall_fmt__find(const char *name)
862 * args_size: sum of the sizes of the syscall arguments, anything after that is augmented stuff: pathname for openat, etc. 862 * args_size: sum of the sizes of the syscall arguments, anything after that is augmented stuff: pathname for openat, etc.
863 */ 863 */
864struct syscall { 864struct syscall {
865 struct event_format *tp_format; 865 struct tep_event_format *tp_format;
866 int nr_args; 866 int nr_args;
867 int args_size; 867 int args_size;
868 bool is_exit; 868 bool is_exit;
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index 4f8430a85531..c0f275cf96ee 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -102,7 +102,7 @@ struct perf_evsel {
102 char *name; 102 char *name;
103 double scale; 103 double scale;
104 const char *unit; 104 const char *unit;
105 struct event_format *tp_format; 105 struct tep_event_format *tp_format;
106 off_t id_offset; 106 off_t id_offset;
107 struct perf_stat_evsel *stats; 107 struct perf_stat_evsel *stats;
108 void *priv; 108 void *priv;
@@ -211,7 +211,7 @@ static inline struct perf_evsel *perf_evsel__newtp(const char *sys, const char *
211 211
212struct perf_evsel *perf_evsel__new_cycles(bool precise); 212struct perf_evsel *perf_evsel__new_cycles(bool precise);
213 213
214struct event_format *event_format__new(const char *sys, const char *name); 214struct tep_event_format *event_format__new(const char *sys, const char *name);
215 215
216void perf_evsel__init(struct perf_evsel *evsel, 216void perf_evsel__init(struct perf_evsel *evsel,
217 struct perf_event_attr *attr, int idx); 217 struct perf_event_attr *attr, int idx);
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index c78051ad1fcc..1ec1d9bc2d63 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -3206,7 +3206,7 @@ static int read_attr(int fd, struct perf_header *ph,
3206static int perf_evsel__prepare_tracepoint_event(struct perf_evsel *evsel, 3206static int perf_evsel__prepare_tracepoint_event(struct perf_evsel *evsel,
3207 struct tep_handle *pevent) 3207 struct tep_handle *pevent)
3208{ 3208{
3209 struct event_format *event; 3209 struct tep_event_format *event;
3210 char bf[128]; 3210 char bf[128];
3211 3211
3212 /* already prepared */ 3212 /* already prepared */
diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c
index ce501ba14b08..6714d2c517db 100644
--- a/tools/perf/util/python.c
+++ b/tools/perf/util/python.c
@@ -386,7 +386,7 @@ get_tracepoint_field(struct pyrf_event *pevent, PyObject *attr_name)
386 struct format_field *field; 386 struct format_field *field;
387 387
388 if (!evsel->tp_format) { 388 if (!evsel->tp_format) {
389 struct event_format *tp_format; 389 struct tep_event_format *tp_format;
390 390
391 tp_format = trace_event__tp_format_id(evsel->attr.config); 391 tp_format = trace_event__tp_format_id(evsel->attr.config);
392 if (!tp_format) 392 if (!tp_format)
@@ -1240,7 +1240,7 @@ static struct {
1240static PyObject *pyrf__tracepoint(struct pyrf_evsel *pevsel, 1240static PyObject *pyrf__tracepoint(struct pyrf_evsel *pevsel,
1241 PyObject *args, PyObject *kwargs) 1241 PyObject *args, PyObject *kwargs)
1242{ 1242{
1243 struct event_format *tp_format; 1243 struct tep_event_format *tp_format;
1244 static char *kwlist[] = { "sys", "name", NULL }; 1244 static char *kwlist[] = { "sys", "name", NULL };
1245 char *sys = NULL; 1245 char *sys = NULL;
1246 char *name = NULL; 1246 char *name = NULL;
diff --git a/tools/perf/util/scripting-engines/trace-event-perl.c b/tools/perf/util/scripting-engines/trace-event-perl.c
index 45484f0f7292..370cc60f0afa 100644
--- a/tools/perf/util/scripting-engines/trace-event-perl.c
+++ b/tools/perf/util/scripting-engines/trace-event-perl.c
@@ -189,7 +189,7 @@ static void define_flag_field(const char *ev_name,
189 LEAVE; 189 LEAVE;
190} 190}
191 191
192static void define_event_symbols(struct event_format *event, 192static void define_event_symbols(struct tep_event_format *event,
193 const char *ev_name, 193 const char *ev_name,
194 struct print_arg *args) 194 struct print_arg *args)
195{ 195{
@@ -338,7 +338,7 @@ static void perl_process_tracepoint(struct perf_sample *sample,
338 struct addr_location *al) 338 struct addr_location *al)
339{ 339{
340 struct thread *thread = al->thread; 340 struct thread *thread = al->thread;
341 struct event_format *event = evsel->tp_format; 341 struct tep_event_format *event = evsel->tp_format;
342 struct format_field *field; 342 struct format_field *field;
343 static char handler[256]; 343 static char handler[256];
344 unsigned long long val; 344 unsigned long long val;
@@ -537,7 +537,7 @@ static int perl_stop_script(void)
537 537
538static int perl_generate_script(struct tep_handle *pevent, const char *outfile) 538static int perl_generate_script(struct tep_handle *pevent, const char *outfile)
539{ 539{
540 struct event_format *event = NULL; 540 struct tep_event_format *event = NULL;
541 struct format_field *f; 541 struct format_field *f;
542 char fname[PATH_MAX]; 542 char fname[PATH_MAX];
543 int not_first, count; 543 int not_first, count;
diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c
index dfc6093f118c..9a8a7b7ff64a 100644
--- a/tools/perf/util/scripting-engines/trace-event-python.c
+++ b/tools/perf/util/scripting-engines/trace-event-python.c
@@ -264,7 +264,7 @@ static void define_field(enum print_arg_type field_type,
264 Py_DECREF(t); 264 Py_DECREF(t);
265} 265}
266 266
267static void define_event_symbols(struct event_format *event, 267static void define_event_symbols(struct tep_event_format *event,
268 const char *ev_name, 268 const char *ev_name,
269 struct print_arg *args) 269 struct print_arg *args)
270{ 270{
@@ -332,7 +332,7 @@ static void define_event_symbols(struct event_format *event,
332 define_event_symbols(event, ev_name, args->next); 332 define_event_symbols(event, ev_name, args->next);
333} 333}
334 334
335static PyObject *get_field_numeric_entry(struct event_format *event, 335static PyObject *get_field_numeric_entry(struct tep_event_format *event,
336 struct format_field *field, void *data) 336 struct format_field *field, void *data)
337{ 337{
338 bool is_array = field->flags & FIELD_IS_ARRAY; 338 bool is_array = field->flags & FIELD_IS_ARRAY;
@@ -790,7 +790,7 @@ static void python_process_tracepoint(struct perf_sample *sample,
790 struct perf_evsel *evsel, 790 struct perf_evsel *evsel,
791 struct addr_location *al) 791 struct addr_location *al)
792{ 792{
793 struct event_format *event = evsel->tp_format; 793 struct tep_event_format *event = evsel->tp_format;
794 PyObject *handler, *context, *t, *obj = NULL, *callchain; 794 PyObject *handler, *context, *t, *obj = NULL, *callchain;
795 PyObject *dict = NULL, *all_entries_dict = NULL; 795 PyObject *dict = NULL, *all_entries_dict = NULL;
796 static char handler_name[256]; 796 static char handler_name[256];
@@ -1590,7 +1590,7 @@ static int python_stop_script(void)
1590 1590
1591static int python_generate_script(struct tep_handle *pevent, const char *outfile) 1591static int python_generate_script(struct tep_handle *pevent, const char *outfile)
1592{ 1592{
1593 struct event_format *event = NULL; 1593 struct tep_event_format *event = NULL;
1594 struct format_field *f; 1594 struct format_field *f;
1595 char fname[PATH_MAX]; 1595 char fname[PATH_MAX];
1596 int not_first, count; 1596 int not_first, count;
diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c
index e76214f8d596..643cf28e1345 100644
--- a/tools/perf/util/trace-event-parse.c
+++ b/tools/perf/util/trace-event-parse.c
@@ -33,7 +33,7 @@ static int get_common_field(struct scripting_context *context,
33 int *offset, int *size, const char *type) 33 int *offset, int *size, const char *type)
34{ 34{
35 struct tep_handle *pevent = context->pevent; 35 struct tep_handle *pevent = context->pevent;
36 struct event_format *event; 36 struct tep_event_format *event;
37 struct format_field *field; 37 struct format_field *field;
38 38
39 if (!*size) { 39 if (!*size) {
@@ -94,7 +94,7 @@ int common_pc(struct scripting_context *context)
94} 94}
95 95
96unsigned long long 96unsigned long long
97raw_field_value(struct event_format *event, const char *name, void *data) 97raw_field_value(struct tep_event_format *event, const char *name, void *data)
98{ 98{
99 struct format_field *field; 99 struct format_field *field;
100 unsigned long long val; 100 unsigned long long val;
@@ -108,12 +108,12 @@ raw_field_value(struct event_format *event, const char *name, void *data)
108 return val; 108 return val;
109} 109}
110 110
111unsigned long long read_size(struct event_format *event, void *ptr, int size) 111unsigned long long read_size(struct tep_event_format *event, void *ptr, int size)
112{ 112{
113 return tep_read_number(event->pevent, ptr, size); 113 return tep_read_number(event->pevent, ptr, size);
114} 114}
115 115
116void event_format__fprintf(struct event_format *event, 116void event_format__fprintf(struct tep_event_format *event,
117 int cpu, void *data, int size, FILE *fp) 117 int cpu, void *data, int size, FILE *fp)
118{ 118{
119 struct tep_record record; 119 struct tep_record record;
@@ -130,7 +130,7 @@ void event_format__fprintf(struct event_format *event,
130 trace_seq_destroy(&s); 130 trace_seq_destroy(&s);
131} 131}
132 132
133void event_format__print(struct event_format *event, 133void event_format__print(struct tep_event_format *event,
134 int cpu, void *data, int size) 134 int cpu, void *data, int size)
135{ 135{
136 return event_format__fprintf(event, cpu, data, size, stdout); 136 return event_format__fprintf(event, cpu, data, size, stdout);
@@ -188,8 +188,8 @@ int parse_event_file(struct tep_handle *pevent,
188 return tep_parse_event(pevent, buf, size, sys); 188 return tep_parse_event(pevent, buf, size, sys);
189} 189}
190 190
191struct event_format *trace_find_next_event(struct tep_handle *pevent, 191struct tep_event_format *trace_find_next_event(struct tep_handle *pevent,
192 struct event_format *event) 192 struct tep_event_format *event)
193{ 193{
194 static int idx; 194 static int idx;
195 195
diff --git a/tools/perf/util/trace-event.c b/tools/perf/util/trace-event.c
index 58bb72f266f3..95664b2f771e 100644
--- a/tools/perf/util/trace-event.c
+++ b/tools/perf/util/trace-event.c
@@ -72,12 +72,12 @@ void trace_event__cleanup(struct trace_event *t)
72/* 72/*
73 * Returns pointer with encoded error via <linux/err.h> interface. 73 * Returns pointer with encoded error via <linux/err.h> interface.
74 */ 74 */
75static struct event_format* 75static struct tep_event_format*
76tp_format(const char *sys, const char *name) 76tp_format(const char *sys, const char *name)
77{ 77{
78 char *tp_dir = get_events_file(sys); 78 char *tp_dir = get_events_file(sys);
79 struct tep_handle *pevent = tevent.pevent; 79 struct tep_handle *pevent = tevent.pevent;
80 struct event_format *event = NULL; 80 struct tep_event_format *event = NULL;
81 char path[PATH_MAX]; 81 char path[PATH_MAX];
82 size_t size; 82 size_t size;
83 char *data; 83 char *data;
@@ -102,7 +102,7 @@ tp_format(const char *sys, const char *name)
102/* 102/*
103 * Returns pointer with encoded error via <linux/err.h> interface. 103 * Returns pointer with encoded error via <linux/err.h> interface.
104 */ 104 */
105struct event_format* 105struct tep_event_format*
106trace_event__tp_format(const char *sys, const char *name) 106trace_event__tp_format(const char *sys, const char *name)
107{ 107{
108 if (!tevent_initialized && trace_event__init2()) 108 if (!tevent_initialized && trace_event__init2())
@@ -111,7 +111,7 @@ trace_event__tp_format(const char *sys, const char *name)
111 return tp_format(sys, name); 111 return tp_format(sys, name);
112} 112}
113 113
114struct event_format *trace_event__tp_format_id(int id) 114struct tep_event_format *trace_event__tp_format_id(int id)
115{ 115{
116 if (!tevent_initialized && trace_event__init2()) 116 if (!tevent_initialized && trace_event__init2())
117 return ERR_PTR(-ENOMEM); 117 return ERR_PTR(-ENOMEM);
diff --git a/tools/perf/util/trace-event.h b/tools/perf/util/trace-event.h
index c69d77d7cf55..2da6eff0caaf 100644
--- a/tools/perf/util/trace-event.h
+++ b/tools/perf/util/trace-event.h
@@ -22,17 +22,17 @@ int trace_event__init(struct trace_event *t);
22void trace_event__cleanup(struct trace_event *t); 22void trace_event__cleanup(struct trace_event *t);
23int trace_event__register_resolver(struct machine *machine, 23int trace_event__register_resolver(struct machine *machine,
24 tep_func_resolver_t *func); 24 tep_func_resolver_t *func);
25struct event_format* 25struct tep_event_format*
26trace_event__tp_format(const char *sys, const char *name); 26trace_event__tp_format(const char *sys, const char *name);
27 27
28struct event_format *trace_event__tp_format_id(int id); 28struct tep_event_format *trace_event__tp_format_id(int id);
29 29
30int bigendian(void); 30int bigendian(void);
31 31
32void event_format__fprintf(struct event_format *event, 32void event_format__fprintf(struct tep_event_format *event,
33 int cpu, void *data, int size, FILE *fp); 33 int cpu, void *data, int size, FILE *fp);
34 34
35void event_format__print(struct event_format *event, 35void event_format__print(struct tep_event_format *event,
36 int cpu, void *data, int size); 36 int cpu, void *data, int size);
37 37
38int parse_ftrace_file(struct tep_handle *pevent, char *buf, unsigned long size); 38int 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 char *buf, unsigned long size, char *sys); 40 char *buf, unsigned long size, char *sys);
41 41
42unsigned long long 42unsigned long long
43raw_field_value(struct event_format *event, const char *name, void *data); 43raw_field_value(struct tep_event_format *event, const char *name, void *data);
44 44
45void parse_proc_kallsyms(struct tep_handle *pevent, char *file, unsigned int size); 45void parse_proc_kallsyms(struct tep_handle *pevent, char *file, unsigned int size);
46void parse_ftrace_printk(struct tep_handle *pevent, char *file, unsigned int size); 46void 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 48
49ssize_t trace_report(int fd, struct trace_event *tevent, bool repipe); 49ssize_t trace_report(int fd, struct trace_event *tevent, bool repipe);
50 50
51struct event_format *trace_find_next_event(struct tep_handle *pevent, 51struct tep_event_format *trace_find_next_event(struct tep_handle *pevent,
52 struct event_format *event); 52 struct tep_event_format *event);
53unsigned long long read_size(struct event_format *event, void *ptr, int size); 53unsigned long long read_size(struct tep_event_format *event, void *ptr, int size);
54unsigned long long eval_flag(const char *flag); 54unsigned long long eval_flag(const char *flag);
55 55
56int read_tracing_data(int fd, struct list_head *pattrs); 56int read_tracing_data(int fd, struct list_head *pattrs);