summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTzvetomir Stoyanov <tstoyanov@vmware.com>2018-11-30 10:44:07 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2018-12-17 12:56:02 -0500
commit97fbf3f0e0aa854ed33141dc9a5410f0ac6c71f3 (patch)
treeaf372b9195ebb0b8ec0c5eefece85c030a45e7c5
parent4c784894ac29195af24362125a72beda4aeb8b9f (diff)
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: Tzvetomir 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.org Signed-off-by: Steven 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: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/lib/traceevent/event-parse-api.c2
-rw-r--r--tools/lib/traceevent/event-parse-local.h6
-rw-r--r--tools/lib/traceevent/event-parse.c188
-rw-r--r--tools/lib/traceevent/event-parse.h62
-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.c16
-rw-r--r--tools/perf/util/trace-event.c8
-rw-r--r--tools/perf/util/trace-event.h16
20 files changed, 198 insertions, 198 deletions
diff --git a/tools/lib/traceevent/event-parse-api.c b/tools/lib/traceevent/event-parse-api.c
index 61f7149085ee..0dc011154ee9 100644
--- a/tools/lib/traceevent/event-parse-api.c
+++ b/tools/lib/traceevent/event-parse-api.c
@@ -15,7 +15,7 @@
15 * This returns pointer to the first element of the events array 15 * This returns pointer to the first element of the events array
16 * If @tep is NULL, NULL is returned. 16 * If @tep is NULL, NULL is returned.
17 */ 17 */
18struct tep_event_format *tep_get_first_event(struct tep_handle *tep) 18struct tep_event *tep_get_first_event(struct tep_handle *tep)
19{ 19{
20 if (tep && tep->events) 20 if (tep && tep->events)
21 return tep->events[0]; 21 return tep->events[0];
diff --git a/tools/lib/traceevent/event-parse-local.h b/tools/lib/traceevent/event-parse-local.h
index b9bddde577f8..94746efef433 100644
--- a/tools/lib/traceevent/event-parse-local.h
+++ b/tools/lib/traceevent/event-parse-local.h
@@ -50,9 +50,9 @@ struct tep_handle {
50 unsigned int printk_count; 50 unsigned int printk_count;
51 51
52 52
53 struct tep_event_format **events; 53 struct tep_event **events;
54 int nr_events; 54 int nr_events;
55 struct tep_event_format **sort_events; 55 struct tep_event **sort_events;
56 enum tep_event_sort_type last_type; 56 enum tep_event_sort_type last_type;
57 57
58 int type_offset; 58 int type_offset;
@@ -84,7 +84,7 @@ struct tep_handle {
84 struct tep_function_handler *func_handlers; 84 struct tep_function_handler *func_handlers;
85 85
86 /* cache */ 86 /* cache */
87 struct tep_event_format *last_event; 87 struct tep_event *last_event;
88 88
89 char *trace_clock; 89 char *trace_clock;
90}; 90};
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index d1e6ee3d43cf..047be5f700b5 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -96,7 +96,7 @@ struct tep_function_handler {
96 96
97static unsigned long long 97static unsigned long long
98process_defined_func(struct trace_seq *s, void *data, int size, 98process_defined_func(struct trace_seq *s, void *data, int size,
99 struct tep_event_format *event, struct tep_print_arg *arg); 99 struct tep_event *event, struct tep_print_arg *arg);
100 100
101static void free_func_handle(struct tep_function_handler *func); 101static void free_func_handle(struct tep_function_handler *func);
102 102
@@ -739,16 +739,16 @@ void tep_print_printk(struct tep_handle *pevent)
739 } 739 }
740} 740}
741 741
742static struct tep_event_format *alloc_event(void) 742static struct tep_event *alloc_event(void)
743{ 743{
744 return calloc(1, sizeof(struct tep_event_format)); 744 return calloc(1, sizeof(struct tep_event));
745} 745}
746 746
747static int add_event(struct tep_handle *pevent, struct tep_event_format *event) 747static int add_event(struct tep_handle *pevent, struct tep_event *event)
748{ 748{
749 int i; 749 int i;
750 struct tep_event_format **events = realloc(pevent->events, sizeof(event) * 750 struct tep_event **events = realloc(pevent->events, sizeof(event) *
751 (pevent->nr_events + 1)); 751 (pevent->nr_events + 1));
752 if (!events) 752 if (!events)
753 return -1; 753 return -1;
754 754
@@ -1355,7 +1355,7 @@ static unsigned int type_size(const char *name)
1355 return 0; 1355 return 0;
1356} 1356}
1357 1357
1358static int event_read_fields(struct tep_event_format *event, struct tep_format_field **fields) 1358static int event_read_fields(struct tep_event *event, struct tep_format_field **fields)
1359{ 1359{
1360 struct tep_format_field *field = NULL; 1360 struct tep_format_field *field = NULL;
1361 enum tep_event_type type; 1361 enum tep_event_type type;
@@ -1642,7 +1642,7 @@ fail_expect:
1642 return -1; 1642 return -1;
1643} 1643}
1644 1644
1645static int event_read_format(struct tep_event_format *event) 1645static int event_read_format(struct tep_event *event)
1646{ 1646{
1647 char *token; 1647 char *token;
1648 int ret; 1648 int ret;
@@ -1675,11 +1675,11 @@ static int event_read_format(struct tep_event_format *event)
1675} 1675}
1676 1676
1677static enum tep_event_type 1677static enum tep_event_type
1678process_arg_token(struct tep_event_format *event, struct tep_print_arg *arg, 1678process_arg_token(struct tep_event *event, struct tep_print_arg *arg,
1679 char **tok, enum tep_event_type type); 1679 char **tok, enum tep_event_type type);
1680 1680
1681static enum tep_event_type 1681static enum tep_event_type
1682process_arg(struct tep_event_format *event, struct tep_print_arg *arg, char **tok) 1682process_arg(struct tep_event *event, struct tep_print_arg *arg, char **tok)
1683{ 1683{
1684 enum tep_event_type type; 1684 enum tep_event_type type;
1685 char *token; 1685 char *token;
@@ -1691,14 +1691,14 @@ process_arg(struct tep_event_format *event, struct tep_print_arg *arg, char **to
1691} 1691}
1692 1692
1693static enum tep_event_type 1693static enum tep_event_type
1694process_op(struct tep_event_format *event, struct tep_print_arg *arg, char **tok); 1694process_op(struct tep_event *event, struct tep_print_arg *arg, char **tok);
1695 1695
1696/* 1696/*
1697 * For __print_symbolic() and __print_flags, we need to completely 1697 * For __print_symbolic() and __print_flags, we need to completely
1698 * evaluate the first argument, which defines what to print next. 1698 * evaluate the first argument, which defines what to print next.
1699 */ 1699 */
1700static enum tep_event_type 1700static enum tep_event_type
1701process_field_arg(struct tep_event_format *event, struct tep_print_arg *arg, char **tok) 1701process_field_arg(struct tep_event *event, struct tep_print_arg *arg, char **tok)
1702{ 1702{
1703 enum tep_event_type type; 1703 enum tep_event_type type;
1704 1704
@@ -1712,7 +1712,7 @@ process_field_arg(struct tep_event_format *event, struct tep_print_arg *arg, cha
1712} 1712}
1713 1713
1714static enum tep_event_type 1714static enum tep_event_type
1715process_cond(struct tep_event_format *event, struct tep_print_arg *top, char **tok) 1715process_cond(struct tep_event *event, struct tep_print_arg *top, char **tok)
1716{ 1716{
1717 struct tep_print_arg *arg, *left, *right; 1717 struct tep_print_arg *arg, *left, *right;
1718 enum tep_event_type type; 1718 enum tep_event_type type;
@@ -1768,7 +1768,7 @@ out_free:
1768} 1768}
1769 1769
1770static enum tep_event_type 1770static enum tep_event_type
1771process_array(struct tep_event_format *event, struct tep_print_arg *top, char **tok) 1771process_array(struct tep_event *event, struct tep_print_arg *top, char **tok)
1772{ 1772{
1773 struct tep_print_arg *arg; 1773 struct tep_print_arg *arg;
1774 enum tep_event_type type; 1774 enum tep_event_type type;
@@ -1870,7 +1870,7 @@ static int set_op_prio(struct tep_print_arg *arg)
1870 1870
1871/* Note, *tok does not get freed, but will most likely be saved */ 1871/* Note, *tok does not get freed, but will most likely be saved */
1872static enum tep_event_type 1872static enum tep_event_type
1873process_op(struct tep_event_format *event, struct tep_print_arg *arg, char **tok) 1873process_op(struct tep_event *event, struct tep_print_arg *arg, char **tok)
1874{ 1874{
1875 struct tep_print_arg *left, *right = NULL; 1875 struct tep_print_arg *left, *right = NULL;
1876 enum tep_event_type type; 1876 enum tep_event_type type;
@@ -2071,7 +2071,7 @@ out_free:
2071} 2071}
2072 2072
2073static enum tep_event_type 2073static enum tep_event_type
2074process_entry(struct tep_event_format *event __maybe_unused, struct tep_print_arg *arg, 2074process_entry(struct tep_event *event __maybe_unused, struct tep_print_arg *arg,
2075 char **tok) 2075 char **tok)
2076{ 2076{
2077 enum tep_event_type type; 2077 enum tep_event_type type;
@@ -2110,7 +2110,7 @@ process_entry(struct tep_event_format *event __maybe_unused, struct tep_print_ar
2110 return TEP_EVENT_ERROR; 2110 return TEP_EVENT_ERROR;
2111} 2111}
2112 2112
2113static int alloc_and_process_delim(struct tep_event_format *event, char *next_token, 2113static int alloc_and_process_delim(struct tep_event *event, char *next_token,
2114 struct tep_print_arg **print_arg) 2114 struct tep_print_arg **print_arg)
2115{ 2115{
2116 struct tep_print_arg *field; 2116 struct tep_print_arg *field;
@@ -2445,7 +2445,7 @@ static char *arg_eval (struct tep_print_arg *arg)
2445} 2445}
2446 2446
2447static enum tep_event_type 2447static enum tep_event_type
2448process_fields(struct tep_event_format *event, struct tep_print_flag_sym **list, char **tok) 2448process_fields(struct tep_event *event, struct tep_print_flag_sym **list, char **tok)
2449{ 2449{
2450 enum tep_event_type type; 2450 enum tep_event_type type;
2451 struct tep_print_arg *arg = NULL; 2451 struct tep_print_arg *arg = NULL;
@@ -2526,7 +2526,7 @@ out_free:
2526} 2526}
2527 2527
2528static enum tep_event_type 2528static enum tep_event_type
2529process_flags(struct tep_event_format *event, struct tep_print_arg *arg, char **tok) 2529process_flags(struct tep_event *event, struct tep_print_arg *arg, char **tok)
2530{ 2530{
2531 struct tep_print_arg *field; 2531 struct tep_print_arg *field;
2532 enum tep_event_type type; 2532 enum tep_event_type type;
@@ -2579,7 +2579,7 @@ out_free:
2579} 2579}
2580 2580
2581static enum tep_event_type 2581static enum tep_event_type
2582process_symbols(struct tep_event_format *event, struct tep_print_arg *arg, char **tok) 2582process_symbols(struct tep_event *event, struct tep_print_arg *arg, char **tok)
2583{ 2583{
2584 struct tep_print_arg *field; 2584 struct tep_print_arg *field;
2585 enum tep_event_type type; 2585 enum tep_event_type type;
@@ -2618,7 +2618,7 @@ out_free:
2618} 2618}
2619 2619
2620static enum tep_event_type 2620static enum tep_event_type
2621process_hex_common(struct tep_event_format *event, struct tep_print_arg *arg, 2621process_hex_common(struct tep_event *event, struct tep_print_arg *arg,
2622 char **tok, enum tep_print_arg_type type) 2622 char **tok, enum tep_print_arg_type type)
2623{ 2623{
2624 memset(arg, 0, sizeof(*arg)); 2624 memset(arg, 0, sizeof(*arg));
@@ -2641,20 +2641,20 @@ out:
2641} 2641}
2642 2642
2643static enum tep_event_type 2643static enum tep_event_type
2644process_hex(struct tep_event_format *event, struct tep_print_arg *arg, char **tok) 2644process_hex(struct tep_event *event, struct tep_print_arg *arg, char **tok)
2645{ 2645{
2646 return process_hex_common(event, arg, tok, TEP_PRINT_HEX); 2646 return process_hex_common(event, arg, tok, TEP_PRINT_HEX);
2647} 2647}
2648 2648
2649static enum tep_event_type 2649static enum tep_event_type
2650process_hex_str(struct tep_event_format *event, struct tep_print_arg *arg, 2650process_hex_str(struct tep_event *event, struct tep_print_arg *arg,
2651 char **tok) 2651 char **tok)
2652{ 2652{
2653 return process_hex_common(event, arg, tok, TEP_PRINT_HEX_STR); 2653 return process_hex_common(event, arg, tok, TEP_PRINT_HEX_STR);
2654} 2654}
2655 2655
2656static enum tep_event_type 2656static enum tep_event_type
2657process_int_array(struct tep_event_format *event, struct tep_print_arg *arg, char **tok) 2657process_int_array(struct tep_event *event, struct tep_print_arg *arg, char **tok)
2658{ 2658{
2659 memset(arg, 0, sizeof(*arg)); 2659 memset(arg, 0, sizeof(*arg));
2660 arg->type = TEP_PRINT_INT_ARRAY; 2660 arg->type = TEP_PRINT_INT_ARRAY;
@@ -2682,7 +2682,7 @@ out:
2682} 2682}
2683 2683
2684static enum tep_event_type 2684static enum tep_event_type
2685process_dynamic_array(struct tep_event_format *event, struct tep_print_arg *arg, char **tok) 2685process_dynamic_array(struct tep_event *event, struct tep_print_arg *arg, char **tok)
2686{ 2686{
2687 struct tep_format_field *field; 2687 struct tep_format_field *field;
2688 enum tep_event_type type; 2688 enum tep_event_type type;
@@ -2746,7 +2746,7 @@ process_dynamic_array(struct tep_event_format *event, struct tep_print_arg *arg,
2746} 2746}
2747 2747
2748static enum tep_event_type 2748static enum tep_event_type
2749process_dynamic_array_len(struct tep_event_format *event, struct tep_print_arg *arg, 2749process_dynamic_array_len(struct tep_event *event, struct tep_print_arg *arg,
2750 char **tok) 2750 char **tok)
2751{ 2751{
2752 struct tep_format_field *field; 2752 struct tep_format_field *field;
@@ -2782,7 +2782,7 @@ process_dynamic_array_len(struct tep_event_format *event, struct tep_print_arg *
2782} 2782}
2783 2783
2784static enum tep_event_type 2784static enum tep_event_type
2785process_paren(struct tep_event_format *event, struct tep_print_arg *arg, char **tok) 2785process_paren(struct tep_event *event, struct tep_print_arg *arg, char **tok)
2786{ 2786{
2787 struct tep_print_arg *item_arg; 2787 struct tep_print_arg *item_arg;
2788 enum tep_event_type type; 2788 enum tep_event_type type;
@@ -2845,7 +2845,7 @@ process_paren(struct tep_event_format *event, struct tep_print_arg *arg, char **
2845 2845
2846 2846
2847static enum tep_event_type 2847static enum tep_event_type
2848process_str(struct tep_event_format *event __maybe_unused, struct tep_print_arg *arg, 2848process_str(struct tep_event *event __maybe_unused, struct tep_print_arg *arg,
2849 char **tok) 2849 char **tok)
2850{ 2850{
2851 enum tep_event_type type; 2851 enum tep_event_type type;
@@ -2874,7 +2874,7 @@ process_str(struct tep_event_format *event __maybe_unused, struct tep_print_arg
2874} 2874}
2875 2875
2876static enum tep_event_type 2876static enum tep_event_type
2877process_bitmask(struct tep_event_format *event __maybe_unused, struct tep_print_arg *arg, 2877process_bitmask(struct tep_event *event __maybe_unused, struct tep_print_arg *arg,
2878 char **tok) 2878 char **tok)
2879{ 2879{
2880 enum tep_event_type type; 2880 enum tep_event_type type;
@@ -2935,7 +2935,7 @@ static void remove_func_handler(struct tep_handle *pevent, char *func_name)
2935} 2935}
2936 2936
2937static enum tep_event_type 2937static enum tep_event_type
2938process_func_handler(struct tep_event_format *event, struct tep_function_handler *func, 2938process_func_handler(struct tep_event *event, struct tep_function_handler *func,
2939 struct tep_print_arg *arg, char **tok) 2939 struct tep_print_arg *arg, char **tok)
2940{ 2940{
2941 struct tep_print_arg **next_arg; 2941 struct tep_print_arg **next_arg;
@@ -2993,7 +2993,7 @@ err:
2993} 2993}
2994 2994
2995static enum tep_event_type 2995static enum tep_event_type
2996process_function(struct tep_event_format *event, struct tep_print_arg *arg, 2996process_function(struct tep_event *event, struct tep_print_arg *arg,
2997 char *token, char **tok) 2997 char *token, char **tok)
2998{ 2998{
2999 struct tep_function_handler *func; 2999 struct tep_function_handler *func;
@@ -3049,7 +3049,7 @@ process_function(struct tep_event_format *event, struct tep_print_arg *arg,
3049} 3049}
3050 3050
3051static enum tep_event_type 3051static enum tep_event_type
3052process_arg_token(struct tep_event_format *event, struct tep_print_arg *arg, 3052process_arg_token(struct tep_event *event, struct tep_print_arg *arg,
3053 char **tok, enum tep_event_type type) 3053 char **tok, enum tep_event_type type)
3054{ 3054{
3055 char *token; 3055 char *token;
@@ -3137,7 +3137,7 @@ process_arg_token(struct tep_event_format *event, struct tep_print_arg *arg,
3137 return type; 3137 return type;
3138} 3138}
3139 3139
3140static int event_read_print_args(struct tep_event_format *event, struct tep_print_arg **list) 3140static int event_read_print_args(struct tep_event *event, struct tep_print_arg **list)
3141{ 3141{
3142 enum tep_event_type type = TEP_EVENT_ERROR; 3142 enum tep_event_type type = TEP_EVENT_ERROR;
3143 struct tep_print_arg *arg; 3143 struct tep_print_arg *arg;
@@ -3195,7 +3195,7 @@ static int event_read_print_args(struct tep_event_format *event, struct tep_prin
3195 return args; 3195 return args;
3196} 3196}
3197 3197
3198static int event_read_print(struct tep_event_format *event) 3198static int event_read_print(struct tep_event *event)
3199{ 3199{
3200 enum tep_event_type type; 3200 enum tep_event_type type;
3201 char *token; 3201 char *token;
@@ -3261,7 +3261,7 @@ static int event_read_print(struct tep_event_format *event)
3261 * This only searchs the common fields and not all field. 3261 * This only searchs the common fields and not all field.
3262 */ 3262 */
3263struct tep_format_field * 3263struct tep_format_field *
3264tep_find_common_field(struct tep_event_format *event, const char *name) 3264tep_find_common_field(struct tep_event *event, const char *name)
3265{ 3265{
3266 struct tep_format_field *format; 3266 struct tep_format_field *format;
3267 3267
@@ -3283,7 +3283,7 @@ tep_find_common_field(struct tep_event_format *event, const char *name)
3283 * This does not search common fields. 3283 * This does not search common fields.
3284 */ 3284 */
3285struct tep_format_field * 3285struct tep_format_field *
3286tep_find_field(struct tep_event_format *event, const char *name) 3286tep_find_field(struct tep_event *event, const char *name)
3287{ 3287{
3288 struct tep_format_field *format; 3288 struct tep_format_field *format;
3289 3289
@@ -3306,7 +3306,7 @@ tep_find_field(struct tep_event_format *event, const char *name)
3306 * the non-common ones if a common one was not found. 3306 * the non-common ones if a common one was not found.
3307 */ 3307 */
3308struct tep_format_field * 3308struct tep_format_field *
3309tep_find_any_field(struct tep_event_format *event, const char *name) 3309tep_find_any_field(struct tep_event *event, const char *name)
3310{ 3310{
3311 struct tep_format_field *format; 3311 struct tep_format_field *format;
3312 3312
@@ -3375,7 +3375,7 @@ int tep_read_number_field(struct tep_format_field *field, const void *data,
3375static int get_common_info(struct tep_handle *pevent, 3375static int get_common_info(struct tep_handle *pevent,
3376 const char *type, int *offset, int *size) 3376 const char *type, int *offset, int *size)
3377{ 3377{
3378 struct tep_event_format *event; 3378 struct tep_event *event;
3379 struct tep_format_field *field; 3379 struct tep_format_field *field;
3380 3380
3381 /* 3381 /*
@@ -3462,11 +3462,11 @@ static int events_id_cmp(const void *a, const void *b);
3462 * 3462 *
3463 * Returns an event that has a given @id. 3463 * Returns an event that has a given @id.
3464 */ 3464 */
3465struct tep_event_format *tep_find_event(struct tep_handle *pevent, int id) 3465struct tep_event *tep_find_event(struct tep_handle *pevent, int id)
3466{ 3466{
3467 struct tep_event_format **eventptr; 3467 struct tep_event **eventptr;
3468 struct tep_event_format key; 3468 struct tep_event key;
3469 struct tep_event_format *pkey = &key; 3469 struct tep_event *pkey = &key;
3470 3470
3471 /* Check cache first */ 3471 /* Check cache first */
3472 if (pevent->last_event && pevent->last_event->id == id) 3472 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 * This returns an event with a given @name and under the system 3494 * This returns an event with a given @name and under the system
3495 * @sys. If @sys is NULL the first event with @name is returned. 3495 * @sys. If @sys is NULL the first event with @name is returned.
3496 */ 3496 */
3497struct tep_event_format * 3497struct tep_event *
3498tep_find_event_by_name(struct tep_handle *pevent, 3498tep_find_event_by_name(struct tep_handle *pevent,
3499 const char *sys, const char *name) 3499 const char *sys, const char *name)
3500{ 3500{
3501 struct tep_event_format *event = NULL; 3501 struct tep_event *event = NULL;
3502 int i; 3502 int i;
3503 3503
3504 if (pevent->last_event && 3504 if (pevent->last_event &&
@@ -3523,7 +3523,7 @@ tep_find_event_by_name(struct tep_handle *pevent,
3523} 3523}
3524 3524
3525static unsigned long long 3525static unsigned long long
3526eval_num_arg(void *data, int size, struct tep_event_format *event, struct tep_print_arg *arg) 3526eval_num_arg(void *data, int size, struct tep_event *event, struct tep_print_arg *arg)
3527{ 3527{
3528 struct tep_handle *pevent = event->pevent; 3528 struct tep_handle *pevent = event->pevent;
3529 unsigned long long val = 0; 3529 unsigned long long val = 0;
@@ -3863,7 +3863,7 @@ static void print_bitmask_to_seq(struct tep_handle *pevent,
3863} 3863}
3864 3864
3865static void print_str_arg(struct trace_seq *s, void *data, int size, 3865static void print_str_arg(struct trace_seq *s, void *data, int size,
3866 struct tep_event_format *event, const char *format, 3866 struct tep_event *event, const char *format,
3867 int len_arg, struct tep_print_arg *arg) 3867 int len_arg, struct tep_print_arg *arg)
3868{ 3868{
3869 struct tep_handle *pevent = event->pevent; 3869 struct tep_handle *pevent = event->pevent;
@@ -4118,7 +4118,7 @@ out_warning_field:
4118 4118
4119static unsigned long long 4119static unsigned long long
4120process_defined_func(struct trace_seq *s, void *data, int size, 4120process_defined_func(struct trace_seq *s, void *data, int size,
4121 struct tep_event_format *event, struct tep_print_arg *arg) 4121 struct tep_event *event, struct tep_print_arg *arg)
4122{ 4122{
4123 struct tep_function_handler *func_handle = arg->func.func; 4123 struct tep_function_handler *func_handle = arg->func.func;
4124 struct func_params *param; 4124 struct func_params *param;
@@ -4213,7 +4213,7 @@ static void free_args(struct tep_print_arg *args)
4213 } 4213 }
4214} 4214}
4215 4215
4216static struct tep_print_arg *make_bprint_args(char *fmt, void *data, int size, struct tep_event_format *event) 4216static struct tep_print_arg *make_bprint_args(char *fmt, void *data, int size, struct tep_event *event)
4217{ 4217{
4218 struct tep_handle *pevent = event->pevent; 4218 struct tep_handle *pevent = event->pevent;
4219 struct tep_format_field *field, *ip_field; 4219 struct tep_format_field *field, *ip_field;
@@ -4390,7 +4390,7 @@ out_free:
4390 4390
4391static char * 4391static char *
4392get_bprint_format(void *data, int size __maybe_unused, 4392get_bprint_format(void *data, int size __maybe_unused,
4393 struct tep_event_format *event) 4393 struct tep_event *event)
4394{ 4394{
4395 struct tep_handle *pevent = event->pevent; 4395 struct tep_handle *pevent = event->pevent;
4396 unsigned long long addr; 4396 unsigned long long addr;
@@ -4425,7 +4425,7 @@ get_bprint_format(void *data, int size __maybe_unused,
4425} 4425}
4426 4426
4427static void print_mac_arg(struct trace_seq *s, int mac, void *data, int size, 4427static void print_mac_arg(struct trace_seq *s, int mac, void *data, int size,
4428 struct tep_event_format *event, struct tep_print_arg *arg) 4428 struct tep_event *event, struct tep_print_arg *arg)
4429{ 4429{
4430 unsigned char *buf; 4430 unsigned char *buf;
4431 const char *fmt = "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x"; 4431 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 * %pISpc print an IP address based on sockaddr; p adds port. 4578 * %pISpc print an IP address based on sockaddr; p adds port.
4579 */ 4579 */
4580static int print_ipv4_arg(struct trace_seq *s, const char *ptr, char i, 4580static int print_ipv4_arg(struct trace_seq *s, const char *ptr, char i,
4581 void *data, int size, struct tep_event_format *event, 4581 void *data, int size, struct tep_event *event,
4582 struct tep_print_arg *arg) 4582 struct tep_print_arg *arg)
4583{ 4583{
4584 unsigned char *buf; 4584 unsigned char *buf;
@@ -4615,7 +4615,7 @@ static int print_ipv4_arg(struct trace_seq *s, const char *ptr, char i,
4615} 4615}
4616 4616
4617static int print_ipv6_arg(struct trace_seq *s, const char *ptr, char i, 4617static int print_ipv6_arg(struct trace_seq *s, const char *ptr, char i,
4618 void *data, int size, struct tep_event_format *event, 4618 void *data, int size, struct tep_event *event,
4619 struct tep_print_arg *arg) 4619 struct tep_print_arg *arg)
4620{ 4620{
4621 char have_c = 0; 4621 char have_c = 0;
@@ -4665,7 +4665,7 @@ static int print_ipv6_arg(struct trace_seq *s, const char *ptr, char i,
4665} 4665}
4666 4666
4667static int print_ipsa_arg(struct trace_seq *s, const char *ptr, char i, 4667static int print_ipsa_arg(struct trace_seq *s, const char *ptr, char i,
4668 void *data, int size, struct tep_event_format *event, 4668 void *data, int size, struct tep_event *event,
4669 struct tep_print_arg *arg) 4669 struct tep_print_arg *arg)
4670{ 4670{
4671 char have_c = 0, have_p = 0; 4671 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} 4747}
4748 4748
4749static int print_ip_arg(struct trace_seq *s, const char *ptr, 4749static int print_ip_arg(struct trace_seq *s, const char *ptr,
4750 void *data, int size, struct tep_event_format *event, 4750 void *data, int size, struct tep_event *event,
4751 struct tep_print_arg *arg) 4751 struct tep_print_arg *arg)
4752{ 4752{
4753 char i = *ptr; /* 'i' or 'I' */ 4753 char i = *ptr; /* 'i' or 'I' */
@@ -4854,7 +4854,7 @@ void tep_print_field(struct trace_seq *s, void *data,
4854} 4854}
4855 4855
4856void tep_print_fields(struct trace_seq *s, void *data, 4856void tep_print_fields(struct trace_seq *s, void *data,
4857 int size __maybe_unused, struct tep_event_format *event) 4857 int size __maybe_unused, struct tep_event *event)
4858{ 4858{
4859 struct tep_format_field *field; 4859 struct tep_format_field *field;
4860 4860
@@ -4866,7 +4866,7 @@ void tep_print_fields(struct trace_seq *s, void *data,
4866 } 4866 }
4867} 4867}
4868 4868
4869static void pretty_print(struct trace_seq *s, void *data, int size, struct tep_event_format *event) 4869static void pretty_print(struct trace_seq *s, void *data, int size, struct tep_event *event)
4870{ 4870{
4871 struct tep_handle *pevent = event->pevent; 4871 struct tep_handle *pevent = event->pevent;
4872 struct tep_print_fmt *print_fmt = &event->print_fmt; 4872 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 * 5229 *
5230 * This returns the event form a given @type; 5230 * This returns the event form a given @type;
5231 */ 5231 */
5232struct tep_event_format *tep_data_event_from_type(struct tep_handle *pevent, int type) 5232struct tep_event *tep_data_event_from_type(struct tep_handle *pevent, int type)
5233{ 5233{
5234 return tep_find_event(pevent, type); 5234 return tep_find_event(pevent, type);
5235} 5235}
@@ -5387,7 +5387,7 @@ int tep_cmdline_pid(struct tep_handle *pevent, struct cmdline *cmdline)
5387 * This parses the raw @data using the given @event information and 5387 * This parses the raw @data using the given @event information and
5388 * writes the print format into the trace_seq. 5388 * writes the print format into the trace_seq.
5389 */ 5389 */
5390void tep_event_info(struct trace_seq *s, struct tep_event_format *event, 5390void tep_event_info(struct trace_seq *s, struct tep_event *event,
5391 struct tep_record *record) 5391 struct tep_record *record)
5392{ 5392{
5393 int print_pretty = 1; 5393 int print_pretty = 1;
@@ -5428,7 +5428,7 @@ static bool is_timestamp_in_us(char *trace_clock, bool use_trace_clock)
5428 * Returns the associated event for a given record, or NULL if non is 5428 * Returns the associated event for a given record, or NULL if non is
5429 * is found. 5429 * is found.
5430 */ 5430 */
5431struct tep_event_format * 5431struct tep_event *
5432tep_find_event_by_record(struct tep_handle *pevent, struct tep_record *record) 5432tep_find_event_by_record(struct tep_handle *pevent, struct tep_record *record)
5433{ 5433{
5434 int type; 5434 int type;
@@ -5453,7 +5453,7 @@ tep_find_event_by_record(struct tep_handle *pevent, struct tep_record *record)
5453 * Writes the tasks comm, pid and CPU to @s. 5453 * Writes the tasks comm, pid and CPU to @s.
5454 */ 5454 */
5455void tep_print_event_task(struct tep_handle *pevent, struct trace_seq *s, 5455void tep_print_event_task(struct tep_handle *pevent, struct trace_seq *s,
5456 struct tep_event_format *event, 5456 struct tep_event *event,
5457 struct tep_record *record) 5457 struct tep_record *record)
5458{ 5458{
5459 void *data = record->data; 5459 void *data = record->data;
@@ -5481,7 +5481,7 @@ void tep_print_event_task(struct tep_handle *pevent, struct trace_seq *s,
5481 * Writes the timestamp of the record into @s. 5481 * Writes the timestamp of the record into @s.
5482 */ 5482 */
5483void tep_print_event_time(struct tep_handle *pevent, struct trace_seq *s, 5483void tep_print_event_time(struct tep_handle *pevent, struct trace_seq *s,
5484 struct tep_event_format *event, 5484 struct tep_event *event,
5485 struct tep_record *record, 5485 struct tep_record *record,
5486 bool use_trace_clock) 5486 bool use_trace_clock)
5487{ 5487{
@@ -5531,7 +5531,7 @@ void tep_print_event_time(struct tep_handle *pevent, struct trace_seq *s,
5531 * Writes the parsing of the record's data to @s. 5531 * Writes the parsing of the record's data to @s.
5532 */ 5532 */
5533void tep_print_event_data(struct tep_handle *pevent, struct trace_seq *s, 5533void tep_print_event_data(struct tep_handle *pevent, struct trace_seq *s,
5534 struct tep_event_format *event, 5534 struct tep_event *event,
5535 struct tep_record *record) 5535 struct tep_record *record)
5536{ 5536{
5537 static const char *spaces = " "; /* 20 spaces */ 5537 static const char *spaces = " "; /* 20 spaces */
@@ -5550,7 +5550,7 @@ void tep_print_event_data(struct tep_handle *pevent, struct trace_seq *s,
5550void tep_print_event(struct tep_handle *pevent, struct trace_seq *s, 5550void tep_print_event(struct tep_handle *pevent, struct trace_seq *s,
5551 struct tep_record *record, bool use_trace_clock) 5551 struct tep_record *record, bool use_trace_clock)
5552{ 5552{
5553 struct tep_event_format *event; 5553 struct tep_event *event;
5554 5554
5555 event = tep_find_event_by_record(pevent, record); 5555 event = tep_find_event_by_record(pevent, record);
5556 if (!event) { 5556 if (!event) {
@@ -5572,8 +5572,8 @@ void tep_print_event(struct tep_handle *pevent, struct trace_seq *s,
5572 5572
5573static int events_id_cmp(const void *a, const void *b) 5573static int events_id_cmp(const void *a, const void *b)
5574{ 5574{
5575 struct tep_event_format * const * ea = a; 5575 struct tep_event * const * ea = a;
5576 struct tep_event_format * const * eb = b; 5576 struct tep_event * const * eb = b;
5577 5577
5578 if ((*ea)->id < (*eb)->id) 5578 if ((*ea)->id < (*eb)->id)
5579 return -1; 5579 return -1;
@@ -5586,8 +5586,8 @@ static int events_id_cmp(const void *a, const void *b)
5586 5586
5587static int events_name_cmp(const void *a, const void *b) 5587static int events_name_cmp(const void *a, const void *b)
5588{ 5588{
5589 struct tep_event_format * const * ea = a; 5589 struct tep_event * const * ea = a;
5590 struct tep_event_format * const * eb = b; 5590 struct tep_event * const * eb = b;
5591 int res; 5591 int res;
5592 5592
5593 res = strcmp((*ea)->name, (*eb)->name); 5593 res = strcmp((*ea)->name, (*eb)->name);
@@ -5603,8 +5603,8 @@ static int events_name_cmp(const void *a, const void *b)
5603 5603
5604static int events_system_cmp(const void *a, const void *b) 5604static int events_system_cmp(const void *a, const void *b)
5605{ 5605{
5606 struct tep_event_format * const * ea = a; 5606 struct tep_event * const * ea = a;
5607 struct tep_event_format * const * eb = b; 5607 struct tep_event * const * eb = b;
5608 int res; 5608 int res;
5609 5609
5610 res = strcmp((*ea)->system, (*eb)->system); 5610 res = strcmp((*ea)->system, (*eb)->system);
@@ -5618,9 +5618,9 @@ static int events_system_cmp(const void *a, const void *b)
5618 return events_id_cmp(a, b); 5618 return events_id_cmp(a, b);
5619} 5619}
5620 5620
5621struct tep_event_format **tep_list_events(struct tep_handle *pevent, enum tep_event_sort_type sort_type) 5621struct tep_event **tep_list_events(struct tep_handle *pevent, enum tep_event_sort_type sort_type)
5622{ 5622{
5623 struct tep_event_format **events; 5623 struct tep_event **events;
5624 int (*sort)(const void *a, const void *b); 5624 int (*sort)(const void *a, const void *b);
5625 5625
5626 events = pevent->sort_events; 5626 events = pevent->sort_events;
@@ -5703,7 +5703,7 @@ get_event_fields(const char *type, const char *name,
5703 * Returns an allocated array of fields. The last item in the array is NULL. 5703 * Returns an allocated array of fields. The last item in the array is NULL.
5704 * The array must be freed with free(). 5704 * The array must be freed with free().
5705 */ 5705 */
5706struct tep_format_field **tep_event_common_fields(struct tep_event_format *event) 5706struct tep_format_field **tep_event_common_fields(struct tep_event *event)
5707{ 5707{
5708 return get_event_fields("common", event->name, 5708 return get_event_fields("common", event->name,
5709 event->format.nr_common, 5709 event->format.nr_common,
@@ -5717,7 +5717,7 @@ struct tep_format_field **tep_event_common_fields(struct tep_event_format *event
5717 * Returns an allocated array of fields. The last item in the array is NULL. 5717 * Returns an allocated array of fields. The last item in the array is NULL.
5718 * The array must be freed with free(). 5718 * The array must be freed with free().
5719 */ 5719 */
5720struct tep_format_field **tep_event_fields(struct tep_event_format *event) 5720struct tep_format_field **tep_event_fields(struct tep_event *event)
5721{ 5721{
5722 return get_event_fields("event", event->name, 5722 return get_event_fields("event", event->name,
5723 event->format.nr_fields, 5723 event->format.nr_fields,
@@ -5959,7 +5959,7 @@ int tep_parse_header_page(struct tep_handle *pevent, char *buf, unsigned long si
5959 return 0; 5959 return 0;
5960} 5960}
5961 5961
5962static int event_matches(struct tep_event_format *event, 5962static int event_matches(struct tep_event *event,
5963 int id, const char *sys_name, 5963 int id, const char *sys_name,
5964 const char *event_name) 5964 const char *event_name)
5965{ 5965{
@@ -5982,7 +5982,7 @@ static void free_handler(struct event_handler *handle)
5982 free(handle); 5982 free(handle);
5983} 5983}
5984 5984
5985static int find_event_handle(struct tep_handle *pevent, struct tep_event_format *event) 5985static int find_event_handle(struct tep_handle *pevent, struct tep_event *event)
5986{ 5986{
5987 struct event_handler *handle, **next; 5987 struct event_handler *handle, **next;
5988 5988
@@ -6023,11 +6023,11 @@ static int find_event_handle(struct tep_handle *pevent, struct tep_event_format
6023 * 6023 *
6024 * /sys/kernel/debug/tracing/events/.../.../format 6024 * /sys/kernel/debug/tracing/events/.../.../format
6025 */ 6025 */
6026enum tep_errno __tep_parse_format(struct tep_event_format **eventp, 6026enum tep_errno __tep_parse_format(struct tep_event **eventp,
6027 struct tep_handle *pevent, const char *buf, 6027 struct tep_handle *pevent, const char *buf,
6028 unsigned long size, const char *sys) 6028 unsigned long size, const char *sys)
6029{ 6029{
6030 struct tep_event_format *event; 6030 struct tep_event *event;
6031 int ret; 6031 int ret;
6032 6032
6033 init_input_buf(buf, size); 6033 init_input_buf(buf, size);
@@ -6132,12 +6132,12 @@ enum tep_errno __tep_parse_format(struct tep_event_format **eventp,
6132 6132
6133static enum tep_errno 6133static enum tep_errno
6134__parse_event(struct tep_handle *pevent, 6134__parse_event(struct tep_handle *pevent,
6135 struct tep_event_format **eventp, 6135 struct tep_event **eventp,
6136 const char *buf, unsigned long size, 6136 const char *buf, unsigned long size,
6137 const char *sys) 6137 const char *sys)
6138{ 6138{
6139 int ret = __tep_parse_format(eventp, pevent, buf, size, sys); 6139 int ret = __tep_parse_format(eventp, pevent, buf, size, sys);
6140 struct tep_event_format *event = *eventp; 6140 struct tep_event *event = *eventp;
6141 6141
6142 if (event == NULL) 6142 if (event == NULL)
6143 return ret; 6143 return ret;
@@ -6174,7 +6174,7 @@ event_add_failed:
6174 * /sys/kernel/debug/tracing/events/.../.../format 6174 * /sys/kernel/debug/tracing/events/.../.../format
6175 */ 6175 */
6176enum tep_errno tep_parse_format(struct tep_handle *pevent, 6176enum tep_errno tep_parse_format(struct tep_handle *pevent,
6177 struct tep_event_format **eventp, 6177 struct tep_event **eventp,
6178 const char *buf, 6178 const char *buf,
6179 unsigned long size, const char *sys) 6179 unsigned long size, const char *sys)
6180{ 6180{
@@ -6198,7 +6198,7 @@ enum tep_errno tep_parse_format(struct tep_handle *pevent,
6198enum tep_errno tep_parse_event(struct tep_handle *pevent, const char *buf, 6198enum tep_errno tep_parse_event(struct tep_handle *pevent, const char *buf,
6199 unsigned long size, const char *sys) 6199 unsigned long size, const char *sys)
6200{ 6200{
6201 struct tep_event_format *event = NULL; 6201 struct tep_event *event = NULL;
6202 return __parse_event(pevent, &event, buf, size, sys); 6202 return __parse_event(pevent, &event, buf, size, sys);
6203} 6203}
6204 6204
@@ -6235,7 +6235,7 @@ int get_field_val(struct trace_seq *s, struct tep_format_field *field,
6235 * 6235 *
6236 * On failure, it returns NULL. 6236 * On failure, it returns NULL.
6237 */ 6237 */
6238void *tep_get_field_raw(struct trace_seq *s, struct tep_event_format *event, 6238void *tep_get_field_raw(struct trace_seq *s, struct tep_event *event,
6239 const char *name, struct tep_record *record, 6239 const char *name, struct tep_record *record,
6240 int *len, int err) 6240 int *len, int err)
6241{ 6241{
@@ -6282,7 +6282,7 @@ void *tep_get_field_raw(struct trace_seq *s, struct tep_event_format *event,
6282 * 6282 *
6283 * Returns 0 on success -1 on field not found. 6283 * Returns 0 on success -1 on field not found.
6284 */ 6284 */
6285int tep_get_field_val(struct trace_seq *s, struct tep_event_format *event, 6285int tep_get_field_val(struct trace_seq *s, struct tep_event *event,
6286 const char *name, struct tep_record *record, 6286 const char *name, struct tep_record *record,
6287 unsigned long long *val, int err) 6287 unsigned long long *val, int err)
6288{ 6288{
@@ -6307,7 +6307,7 @@ int tep_get_field_val(struct trace_seq *s, struct tep_event_format *event,
6307 * 6307 *
6308 * Returns 0 on success -1 on field not found. 6308 * Returns 0 on success -1 on field not found.
6309 */ 6309 */
6310int tep_get_common_field_val(struct trace_seq *s, struct tep_event_format *event, 6310int tep_get_common_field_val(struct trace_seq *s, struct tep_event *event,
6311 const char *name, struct tep_record *record, 6311 const char *name, struct tep_record *record,
6312 unsigned long long *val, int err) 6312 unsigned long long *val, int err)
6313{ 6313{
@@ -6332,7 +6332,7 @@ int tep_get_common_field_val(struct trace_seq *s, struct tep_event_format *event
6332 * 6332 *
6333 * Returns 0 on success -1 on field not found. 6333 * Returns 0 on success -1 on field not found.
6334 */ 6334 */
6335int tep_get_any_field_val(struct trace_seq *s, struct tep_event_format *event, 6335int tep_get_any_field_val(struct trace_seq *s, struct tep_event *event,
6336 const char *name, struct tep_record *record, 6336 const char *name, struct tep_record *record,
6337 unsigned long long *val, int err) 6337 unsigned long long *val, int err)
6338{ 6338{
@@ -6358,7 +6358,7 @@ int tep_get_any_field_val(struct trace_seq *s, struct tep_event_format *event,
6358 * Returns: 0 on success, -1 field not found, or 1 if buffer is full. 6358 * Returns: 0 on success, -1 field not found, or 1 if buffer is full.
6359 */ 6359 */
6360int tep_print_num_field(struct trace_seq *s, const char *fmt, 6360int tep_print_num_field(struct trace_seq *s, const char *fmt,
6361 struct tep_event_format *event, const char *name, 6361 struct tep_event *event, const char *name,
6362 struct tep_record *record, int err) 6362 struct tep_record *record, int err)
6363{ 6363{
6364 struct tep_format_field *field = tep_find_field(event, name); 6364 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 * Returns: 0 on success, -1 field not found, or 1 if buffer is full. 6390 * Returns: 0 on success, -1 field not found, or 1 if buffer is full.
6391 */ 6391 */
6392int tep_print_func_field(struct trace_seq *s, const char *fmt, 6392int tep_print_func_field(struct trace_seq *s, const char *fmt,
6393 struct tep_event_format *event, const char *name, 6393 struct tep_event *event, const char *name,
6394 struct tep_record *record, int err) 6394 struct tep_record *record, int err)
6395{ 6395{
6396 struct tep_format_field *field = tep_find_field(event, name); 6396 struct tep_format_field *field = tep_find_field(event, name);
@@ -6550,11 +6550,11 @@ int tep_unregister_print_function(struct tep_handle *pevent,
6550 return -1; 6550 return -1;
6551} 6551}
6552 6552
6553static struct tep_event_format *search_event(struct tep_handle *pevent, int id, 6553static struct tep_event *search_event(struct tep_handle *pevent, int id,
6554 const char *sys_name, 6554 const char *sys_name,
6555 const char *event_name) 6555 const char *event_name)
6556{ 6556{
6557 struct tep_event_format *event; 6557 struct tep_event *event;
6558 6558
6559 if (id >= 0) { 6559 if (id >= 0) {
6560 /* search by id */ 6560 /* search by id */
@@ -6594,7 +6594,7 @@ int tep_register_event_handler(struct tep_handle *pevent, int id,
6594 const char *sys_name, const char *event_name, 6594 const char *sys_name, const char *event_name,
6595 tep_event_handler_func func, void *context) 6595 tep_event_handler_func func, void *context)
6596{ 6596{
6597 struct tep_event_format *event; 6597 struct tep_event *event;
6598 struct event_handler *handle; 6598 struct event_handler *handle;
6599 6599
6600 event = search_event(pevent, id, sys_name, event_name); 6600 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 const char *sys_name, const char *event_name, 6678 const char *sys_name, const char *event_name,
6679 tep_event_handler_func func, void *context) 6679 tep_event_handler_func func, void *context)
6680{ 6680{
6681 struct tep_event_format *event; 6681 struct tep_event *event;
6682 struct event_handler *handle; 6682 struct event_handler *handle;
6683 struct event_handler **next; 6683 struct event_handler **next;
6684 6684
@@ -6763,7 +6763,7 @@ static void free_formats(struct tep_format *format)
6763 free_format_fields(format->fields); 6763 free_format_fields(format->fields);
6764} 6764}
6765 6765
6766void tep_free_format(struct tep_event_format *event) 6766void tep_free_format(struct tep_event *event)
6767{ 6767{
6768 free(event->name); 6768 free(event->name);
6769 free(event->system); 6769 free(event->system);
diff --git a/tools/lib/traceevent/event-parse.h b/tools/lib/traceevent/event-parse.h
index 44ec26c72c2e..2a1a644c5ec8 100644
--- a/tools/lib/traceevent/event-parse.h
+++ b/tools/lib/traceevent/event-parse.h
@@ -57,11 +57,11 @@ struct tep_record {
57/* ----------------------- tep ----------------------- */ 57/* ----------------------- tep ----------------------- */
58 58
59struct tep_handle; 59struct tep_handle;
60struct tep_event_format; 60struct tep_event;
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 tep_event_format *event, 64 struct tep_event *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 tep_format_flags {
143 143
144struct tep_format_field { 144struct tep_format_field {
145 struct tep_format_field *next; 145 struct tep_format_field *next;
146 struct tep_event_format *event; 146 struct tep_event *event;
147 char *type; 147 char *type;
148 char *name; 148 char *name;
149 char *alias; 149 char *alias;
@@ -277,7 +277,7 @@ struct tep_print_fmt {
277 struct tep_print_arg *args; 277 struct tep_print_arg *args;
278}; 278};
279 279
280struct tep_event_format { 280struct tep_event {
281 struct tep_handle *pevent; 281 struct tep_handle *pevent;
282 char *name; 282 char *name;
283 int id; 283 int id;
@@ -454,14 +454,14 @@ int tep_register_print_string(struct tep_handle *pevent, const char *fmt,
454int tep_pid_is_registered(struct tep_handle *pevent, int pid); 454int tep_pid_is_registered(struct tep_handle *pevent, int pid);
455 455
456void tep_print_event_task(struct tep_handle *pevent, struct trace_seq *s, 456void tep_print_event_task(struct tep_handle *pevent, struct trace_seq *s,
457 struct tep_event_format *event, 457 struct tep_event *event,
458 struct tep_record *record); 458 struct tep_record *record);
459void tep_print_event_time(struct tep_handle *pevent, struct trace_seq *s, 459void tep_print_event_time(struct tep_handle *pevent, struct trace_seq *s,
460 struct tep_event_format *event, 460 struct tep_event *event,
461 struct tep_record *record, 461 struct tep_record *record,
462 bool use_trace_clock); 462 bool use_trace_clock);
463void tep_print_event_data(struct tep_handle *pevent, struct trace_seq *s, 463void tep_print_event_data(struct tep_handle *pevent, struct trace_seq *s,
464 struct tep_event_format *event, 464 struct tep_event *event,
465 struct tep_record *record); 465 struct tep_record *record);
466void tep_print_event(struct tep_handle *pevent, struct trace_seq *s, 466void tep_print_event(struct tep_handle *pevent, struct trace_seq *s,
467 struct tep_record *record, bool use_trace_clock); 467 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
472enum tep_errno tep_parse_event(struct tep_handle *pevent, const char *buf, 472enum tep_errno tep_parse_event(struct tep_handle *pevent, const char *buf,
473 unsigned long size, const char *sys); 473 unsigned long size, const char *sys);
474enum tep_errno tep_parse_format(struct tep_handle *pevent, 474enum tep_errno tep_parse_format(struct tep_handle *pevent,
475 struct tep_event_format **eventp, 475 struct tep_event **eventp,
476 const char *buf, 476 const char *buf,
477 unsigned long size, const char *sys); 477 unsigned long size, const char *sys);
478void tep_free_format(struct tep_event_format *event); 478void tep_free_format(struct tep_event *event);
479void tep_free_format_field(struct tep_format_field *field); 479void tep_free_format_field(struct tep_format_field *field);
480 480
481void *tep_get_field_raw(struct trace_seq *s, struct tep_event_format *event, 481void *tep_get_field_raw(struct trace_seq *s, struct tep_event *event,
482 const char *name, struct tep_record *record, 482 const char *name, struct tep_record *record,
483 int *len, int err); 483 int *len, int err);
484 484
485int tep_get_field_val(struct trace_seq *s, struct tep_event_format *event, 485int tep_get_field_val(struct trace_seq *s, struct tep_event *event,
486 const char *name, struct tep_record *record, 486 const char *name, struct tep_record *record,
487 unsigned long long *val, int err); 487 unsigned long long *val, int err);
488int tep_get_common_field_val(struct trace_seq *s, struct tep_event_format *event, 488int tep_get_common_field_val(struct trace_seq *s, struct tep_event *event,
489 const char *name, struct tep_record *record, 489 const char *name, struct tep_record *record,
490 unsigned long long *val, int err); 490 unsigned long long *val, int err);
491int tep_get_any_field_val(struct trace_seq *s, struct tep_event_format *event, 491int tep_get_any_field_val(struct trace_seq *s, struct tep_event *event,
492 const char *name, struct tep_record *record, 492 const char *name, struct tep_record *record,
493 unsigned long long *val, int err); 493 unsigned long long *val, int err);
494 494
495int tep_print_num_field(struct trace_seq *s, const char *fmt, 495int tep_print_num_field(struct trace_seq *s, const char *fmt,
496 struct tep_event_format *event, const char *name, 496 struct tep_event *event, const char *name,
497 struct tep_record *record, int err); 497 struct tep_record *record, int err);
498 498
499int tep_print_func_field(struct trace_seq *s, const char *fmt, 499int tep_print_func_field(struct trace_seq *s, const char *fmt,
500 struct tep_event_format *event, const char *name, 500 struct tep_event *event, const char *name,
501 struct tep_record *record, int err); 501 struct tep_record *record, int err);
502 502
503int tep_register_event_handler(struct tep_handle *pevent, int id, 503int tep_register_event_handler(struct tep_handle *pevent, int id,
@@ -513,9 +513,9 @@ int tep_register_print_function(struct tep_handle *pevent,
513int tep_unregister_print_function(struct tep_handle *pevent, 513int tep_unregister_print_function(struct tep_handle *pevent,
514 tep_func_handler func, char *name); 514 tep_func_handler func, char *name);
515 515
516struct tep_format_field *tep_find_common_field(struct tep_event_format *event, const char *name); 516struct tep_format_field *tep_find_common_field(struct tep_event *event, const char *name);
517struct tep_format_field *tep_find_field(struct tep_event_format *event, const char *name); 517struct tep_format_field *tep_find_field(struct tep_event *event, const char *name);
518struct tep_format_field *tep_find_any_field(struct tep_event_format *event, const char *name); 518struct tep_format_field *tep_find_any_field(struct tep_event *event, const char *name);
519 519
520const char *tep_find_function(struct tep_handle *pevent, unsigned long long addr); 520const char *tep_find_function(struct tep_handle *pevent, unsigned long long addr);
521unsigned long long 521unsigned long long
@@ -524,19 +524,19 @@ unsigned long long tep_read_number(struct tep_handle *pevent, const void *ptr, i
524int tep_read_number_field(struct tep_format_field *field, const void *data, 524int tep_read_number_field(struct tep_format_field *field, const void *data,
525 unsigned long long *value); 525 unsigned long long *value);
526 526
527struct tep_event_format *tep_get_first_event(struct tep_handle *tep); 527struct tep_event *tep_get_first_event(struct tep_handle *tep);
528int tep_get_events_count(struct tep_handle *tep); 528int tep_get_events_count(struct tep_handle *tep);
529struct tep_event_format *tep_find_event(struct tep_handle *pevent, int id); 529struct tep_event *tep_find_event(struct tep_handle *pevent, int id);
530 530
531struct tep_event_format * 531struct tep_event *
532tep_find_event_by_name(struct tep_handle *pevent, const char *sys, const char *name); 532tep_find_event_by_name(struct tep_handle *pevent, const char *sys, const char *name);
533struct tep_event_format * 533struct tep_event *
534tep_find_event_by_record(struct tep_handle *pevent, struct tep_record *record); 534tep_find_event_by_record(struct tep_handle *pevent, struct tep_record *record);
535 535
536void tep_data_lat_fmt(struct tep_handle *pevent, 536void tep_data_lat_fmt(struct tep_handle *pevent,
537 struct trace_seq *s, struct tep_record *record); 537 struct trace_seq *s, struct tep_record *record);
538int tep_data_type(struct tep_handle *pevent, struct tep_record *rec); 538int tep_data_type(struct tep_handle *pevent, struct tep_record *rec);
539struct tep_event_format *tep_data_event_from_type(struct tep_handle *pevent, int type); 539struct tep_event *tep_data_event_from_type(struct tep_handle *pevent, int type);
540int tep_data_pid(struct tep_handle *pevent, struct tep_record *rec); 540int tep_data_pid(struct tep_handle *pevent, struct tep_record *rec);
541int tep_data_preempt_count(struct tep_handle *pevent, struct tep_record *rec); 541int tep_data_preempt_count(struct tep_handle *pevent, struct tep_record *rec);
542int tep_data_flags(struct tep_handle *pevent, struct tep_record *rec); 542int 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);
549void tep_print_field(struct trace_seq *s, void *data, 549void tep_print_field(struct trace_seq *s, void *data,
550 struct tep_format_field *field); 550 struct tep_format_field *field);
551void tep_print_fields(struct trace_seq *s, void *data, 551void tep_print_fields(struct trace_seq *s, void *data,
552 int size __maybe_unused, struct tep_event_format *event); 552 int size __maybe_unused, struct tep_event *event);
553void tep_event_info(struct trace_seq *s, struct tep_event_format *event, 553void tep_event_info(struct trace_seq *s, struct tep_event *event,
554 struct tep_record *record); 554 struct tep_record *record);
555int tep_strerror(struct tep_handle *pevent, enum tep_errno errnum, 555int tep_strerror(struct tep_handle *pevent, enum tep_errno errnum,
556 char *buf, size_t buflen); 556 char *buf, size_t buflen);
557 557
558struct tep_event_format **tep_list_events(struct tep_handle *pevent, enum tep_event_sort_type); 558struct tep_event **tep_list_events(struct tep_handle *pevent, enum tep_event_sort_type);
559struct tep_format_field **tep_event_common_fields(struct tep_event_format *event); 559struct tep_format_field **tep_event_common_fields(struct tep_event *event);
560struct tep_format_field **tep_event_fields(struct tep_event_format *event); 560struct tep_format_field **tep_event_fields(struct tep_event *event);
561 561
562enum tep_endian { 562enum tep_endian {
563 TEP_LITTLE_ENDIAN = 0, 563 TEP_LITTLE_ENDIAN = 0,
@@ -713,7 +713,7 @@ struct tep_filter_arg {
713 713
714struct tep_filter_type { 714struct tep_filter_type {
715 int event_id; 715 int event_id;
716 struct tep_event_format *event; 716 struct tep_event *event;
717 struct tep_filter_arg *filter; 717 struct tep_filter_arg *filter;
718}; 718};
719 719
diff --git a/tools/lib/traceevent/parse-filter.c b/tools/lib/traceevent/parse-filter.c
index ed87cb56713d..cb5ce66dab6e 100644
--- a/tools/lib/traceevent/parse-filter.c
+++ b/tools/lib/traceevent/parse-filter.c
@@ -27,7 +27,7 @@ static struct tep_format_field cpu = {
27 27
28struct event_list { 28struct event_list {
29 struct event_list *next; 29 struct event_list *next;
30 struct tep_event_format *event; 30 struct tep_event *event;
31}; 31};
32 32
33static void show_error(char *error_buf, const char *fmt, ...) 33static void show_error(char *error_buf, const char *fmt, ...)
@@ -229,7 +229,7 @@ static void free_arg(struct tep_filter_arg *arg)
229} 229}
230 230
231static int add_event(struct event_list **events, 231static int add_event(struct event_list **events,
232 struct tep_event_format *event) 232 struct tep_event *event)
233{ 233{
234 struct event_list *list; 234 struct event_list *list;
235 235
@@ -243,7 +243,7 @@ static int add_event(struct event_list **events,
243 return 0; 243 return 0;
244} 244}
245 245
246static int event_match(struct tep_event_format *event, 246static int event_match(struct tep_event *event,
247 regex_t *sreg, regex_t *ereg) 247 regex_t *sreg, regex_t *ereg)
248{ 248{
249 if (sreg) { 249 if (sreg) {
@@ -259,7 +259,7 @@ static enum tep_errno
259find_event(struct tep_handle *pevent, struct event_list **events, 259find_event(struct tep_handle *pevent, struct event_list **events,
260 char *sys_name, char *event_name) 260 char *sys_name, char *event_name)
261{ 261{
262 struct tep_event_format *event; 262 struct tep_event *event;
263 regex_t ereg; 263 regex_t ereg;
264 regex_t sreg; 264 regex_t sreg;
265 int match = 0; 265 int match = 0;
@@ -334,7 +334,7 @@ static void free_events(struct event_list *events)
334} 334}
335 335
336static enum tep_errno 336static enum tep_errno
337create_arg_item(struct tep_event_format *event, const char *token, 337create_arg_item(struct tep_event *event, const char *token,
338 enum tep_event_type type, struct tep_filter_arg **parg, char *error_str) 338 enum tep_event_type type, struct tep_filter_arg **parg, char *error_str)
339{ 339{
340 struct tep_format_field *field; 340 struct tep_format_field *field;
@@ -940,7 +940,7 @@ static int collapse_tree(struct tep_filter_arg *arg,
940} 940}
941 941
942static enum tep_errno 942static enum tep_errno
943process_filter(struct tep_event_format *event, struct tep_filter_arg **parg, 943process_filter(struct tep_event *event, struct tep_filter_arg **parg,
944 char *error_str, int not) 944 char *error_str, int not)
945{ 945{
946 enum tep_event_type type; 946 enum tep_event_type type;
@@ -1180,7 +1180,7 @@ process_filter(struct tep_event_format *event, struct tep_filter_arg **parg,
1180} 1180}
1181 1181
1182static enum tep_errno 1182static enum tep_errno
1183process_event(struct tep_event_format *event, const char *filter_str, 1183process_event(struct tep_event *event, const char *filter_str,
1184 struct tep_filter_arg **parg, char *error_str) 1184 struct tep_filter_arg **parg, char *error_str)
1185{ 1185{
1186 int ret; 1186 int ret;
@@ -1205,7 +1205,7 @@ process_event(struct tep_event_format *event, const char *filter_str,
1205} 1205}
1206 1206
1207static enum tep_errno 1207static enum tep_errno
1208filter_event(struct tep_event_filter *filter, struct tep_event_format *event, 1208filter_event(struct tep_event_filter *filter, struct tep_event *event,
1209 const char *filter_str, char *error_str) 1209 const char *filter_str, char *error_str)
1210{ 1210{
1211 struct tep_filter_type *filter_type; 1211 struct tep_filter_type *filter_type;
@@ -1457,7 +1457,7 @@ static int copy_filter_type(struct tep_event_filter *filter,
1457 struct tep_filter_type *filter_type) 1457 struct tep_filter_type *filter_type)
1458{ 1458{
1459 struct tep_filter_arg *arg; 1459 struct tep_filter_arg *arg;
1460 struct tep_event_format *event; 1460 struct tep_event *event;
1461 const char *sys; 1461 const char *sys;
1462 const char *name; 1462 const char *name;
1463 char *str; 1463 char *str;
@@ -1539,7 +1539,7 @@ int tep_update_trivial(struct tep_event_filter *dest, struct tep_event_filter *s
1539{ 1539{
1540 struct tep_handle *src_pevent; 1540 struct tep_handle *src_pevent;
1541 struct tep_handle *dest_pevent; 1541 struct tep_handle *dest_pevent;
1542 struct tep_event_format *event; 1542 struct tep_event *event;
1543 struct tep_filter_type *filter_type; 1543 struct tep_filter_type *filter_type;
1544 struct tep_filter_arg *arg; 1544 struct tep_filter_arg *arg;
1545 char *str; 1545 char *str;
@@ -1683,11 +1683,11 @@ int tep_filter_event_has_trivial(struct tep_event_filter *filter,
1683 } 1683 }
1684} 1684}
1685 1685
1686static int test_filter(struct tep_event_format *event, struct tep_filter_arg *arg, 1686static int test_filter(struct tep_event *event, struct tep_filter_arg *arg,
1687 struct tep_record *record, enum tep_errno *err); 1687 struct tep_record *record, enum tep_errno *err);
1688 1688
1689static const char * 1689static const char *
1690get_comm(struct tep_event_format *event, struct tep_record *record) 1690get_comm(struct tep_event *event, struct tep_record *record)
1691{ 1691{
1692 const char *comm; 1692 const char *comm;
1693 int pid; 1693 int pid;
@@ -1698,7 +1698,7 @@ get_comm(struct tep_event_format *event, struct tep_record *record)
1698} 1698}
1699 1699
1700static unsigned long long 1700static unsigned long long
1701get_value(struct tep_event_format *event, 1701get_value(struct tep_event *event,
1702 struct tep_format_field *field, struct tep_record *record) 1702 struct tep_format_field *field, struct tep_record *record)
1703{ 1703{
1704 unsigned long long val; 1704 unsigned long long val;
@@ -1734,11 +1734,11 @@ get_value(struct tep_event_format *event,
1734} 1734}
1735 1735
1736static unsigned long long 1736static unsigned long long
1737get_arg_value(struct tep_event_format *event, struct tep_filter_arg *arg, 1737get_arg_value(struct tep_event *event, struct tep_filter_arg *arg,
1738 struct tep_record *record, enum tep_errno *err); 1738 struct tep_record *record, enum tep_errno *err);
1739 1739
1740static unsigned long long 1740static unsigned long long
1741get_exp_value(struct tep_event_format *event, struct tep_filter_arg *arg, 1741get_exp_value(struct tep_event *event, struct tep_filter_arg *arg,
1742 struct tep_record *record, enum tep_errno *err) 1742 struct tep_record *record, enum tep_errno *err)
1743{ 1743{
1744 unsigned long long lval, rval; 1744 unsigned long long lval, rval;
@@ -1793,7 +1793,7 @@ get_exp_value(struct tep_event_format *event, struct tep_filter_arg *arg,
1793} 1793}
1794 1794
1795static unsigned long long 1795static unsigned long long
1796get_arg_value(struct tep_event_format *event, struct tep_filter_arg *arg, 1796get_arg_value(struct tep_event *event, struct tep_filter_arg *arg,
1797 struct tep_record *record, enum tep_errno *err) 1797 struct tep_record *record, enum tep_errno *err)
1798{ 1798{
1799 switch (arg->type) { 1799 switch (arg->type) {
@@ -1817,7 +1817,7 @@ get_arg_value(struct tep_event_format *event, struct tep_filter_arg *arg,
1817 return 0; 1817 return 0;
1818} 1818}
1819 1819
1820static int test_num(struct tep_event_format *event, struct tep_filter_arg *arg, 1820static int test_num(struct tep_event *event, struct tep_filter_arg *arg,
1821 struct tep_record *record, enum tep_errno *err) 1821 struct tep_record *record, enum tep_errno *err)
1822{ 1822{
1823 unsigned long long lval, rval; 1823 unsigned long long lval, rval;
@@ -1860,7 +1860,7 @@ static int test_num(struct tep_event_format *event, struct tep_filter_arg *arg,
1860 1860
1861static const char *get_field_str(struct tep_filter_arg *arg, struct tep_record *record) 1861static const char *get_field_str(struct tep_filter_arg *arg, struct tep_record *record)
1862{ 1862{
1863 struct tep_event_format *event; 1863 struct tep_event *event;
1864 struct tep_handle *pevent; 1864 struct tep_handle *pevent;
1865 unsigned long long addr; 1865 unsigned long long addr;
1866 const char *val = NULL; 1866 const char *val = NULL;
@@ -1908,7 +1908,7 @@ static const char *get_field_str(struct tep_filter_arg *arg, struct tep_record *
1908 return val; 1908 return val;
1909} 1909}
1910 1910
1911static int test_str(struct tep_event_format *event, struct tep_filter_arg *arg, 1911static int test_str(struct tep_event *event, struct tep_filter_arg *arg,
1912 struct tep_record *record, enum tep_errno *err) 1912 struct tep_record *record, enum tep_errno *err)
1913{ 1913{
1914 const char *val; 1914 const char *val;
@@ -1939,7 +1939,7 @@ static int test_str(struct tep_event_format *event, struct tep_filter_arg *arg,
1939 } 1939 }
1940} 1940}
1941 1941
1942static int test_op(struct tep_event_format *event, struct tep_filter_arg *arg, 1942static int test_op(struct tep_event *event, struct tep_filter_arg *arg,
1943 struct tep_record *record, enum tep_errno *err) 1943 struct tep_record *record, enum tep_errno *err)
1944{ 1944{
1945 switch (arg->op.type) { 1945 switch (arg->op.type) {
@@ -1961,7 +1961,7 @@ static int test_op(struct tep_event_format *event, struct tep_filter_arg *arg,
1961 } 1961 }
1962} 1962}
1963 1963
1964static int test_filter(struct tep_event_format *event, struct tep_filter_arg *arg, 1964static int test_filter(struct tep_event *event, struct tep_filter_arg *arg,
1965 struct tep_record *record, enum tep_errno *err) 1965 struct tep_record *record, enum tep_errno *err)
1966{ 1966{
1967 if (*err) { 1967 if (*err) {
diff --git a/tools/lib/traceevent/plugin_function.c b/tools/lib/traceevent/plugin_function.c
index 528acc75d81a..a73eca34a8f9 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 tep_event_format *event, void *context) 127 struct tep_event *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 9aa05b4ca811..5db5e401275f 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 tep_event_format *event, void *context) 30 struct tep_event *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 tep_event_format *event, void *context) 50 struct tep_event *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 1beb4eaddfdf..0e3c601f9ed1 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 tep_event_format *event, void *context) 28 struct tep_event *event, void *context)
29{ 29{
30 struct tep_format_field *field; 30 struct tep_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 d13c22846fa9..637be7c18476 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 tep_event_format *event, const char *field) 252 struct tep_event *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 tep_event_format *event, void *context) 273 struct tep_event *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 tep_event_format *event, void *context) 296 struct tep_event *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 tep_event_format *event, void *context) 335 struct tep_event *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 tep_event_format *event, void *context) 349 struct tep_event *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 tep_event_format *event, void *context) 375 struct tep_event *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 tep_event_format *event, void *context) 422 struct tep_event *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 da3855e7b86f..e38b9477aad2 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 tep_event_format *event, 29static void print_string(struct trace_seq *s, struct tep_event *event,
30 const char *name, const void *data) 30 const char *name, const void *data)
31{ 31{
32 struct tep_format_field *f = tep_find_field(event, name); 32 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 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 tep_event_format *event, void *context) 63 struct tep_event *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 77882272672f..834c9e378ff8 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 tep_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 tep_event_format *event, void *context) 70 struct tep_event *event, void *context)
71{ 71{
72 struct tep_format_field *field; 72 struct tep_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 tep_event_format *event, void *context) 99 struct tep_event *event, void *context)
100{ 100{
101 struct tep_format_field *field; 101 struct tep_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 8e3c3f74a3a4..a57a9ae1fd4b 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -885,7 +885,7 @@ static struct syscall_fmt *syscall_fmt__find_by_alias(const char *alias)
885 * args_size: sum of the sizes of the syscall arguments, anything after that is augmented stuff: pathname for openat, etc. 885 * args_size: sum of the sizes of the syscall arguments, anything after that is augmented stuff: pathname for openat, etc.
886 */ 886 */
887struct syscall { 887struct syscall {
888 struct tep_event_format *tp_format; 888 struct tep_event *tp_format;
889 int nr_args; 889 int nr_args;
890 int args_size; 890 int args_size;
891 bool is_exit; 891 bool is_exit;
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index 3147ca76c6fc..82a289ce8b0c 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -106,7 +106,7 @@ struct perf_evsel {
106 char *name; 106 char *name;
107 double scale; 107 double scale;
108 const char *unit; 108 const char *unit;
109 struct tep_event_format *tp_format; 109 struct tep_event *tp_format;
110 off_t id_offset; 110 off_t id_offset;
111 struct perf_stat_evsel *stats; 111 struct perf_stat_evsel *stats;
112 void *priv; 112 void *priv;
@@ -216,7 +216,7 @@ static inline struct perf_evsel *perf_evsel__newtp(const char *sys, const char *
216 216
217struct perf_evsel *perf_evsel__new_cycles(bool precise); 217struct perf_evsel *perf_evsel__new_cycles(bool precise);
218 218
219struct tep_event_format *event_format__new(const char *sys, const char *name); 219struct tep_event *event_format__new(const char *sys, const char *name);
220 220
221void perf_evsel__init(struct perf_evsel *evsel, 221void perf_evsel__init(struct perf_evsel *evsel,
222 struct perf_event_attr *attr, int idx); 222 struct perf_event_attr *attr, int idx);
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index e31f52845e77..9cc81d48a908 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -3268,7 +3268,7 @@ static int read_attr(int fd, struct perf_header *ph,
3268static int perf_evsel__prepare_tracepoint_event(struct perf_evsel *evsel, 3268static int perf_evsel__prepare_tracepoint_event(struct perf_evsel *evsel,
3269 struct tep_handle *pevent) 3269 struct tep_handle *pevent)
3270{ 3270{
3271 struct tep_event_format *event; 3271 struct tep_event *event;
3272 char bf[128]; 3272 char bf[128];
3273 3273
3274 /* already prepared */ 3274 /* already prepared */
diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c
index 50150dfc0cdf..47628e85c5eb 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 tep_format_field *field; 386 struct tep_format_field *field;
387 387
388 if (!evsel->tp_format) { 388 if (!evsel->tp_format) {
389 struct tep_event_format *tp_format; 389 struct tep_event *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 tep_event_format *tp_format; 1243 struct tep_event *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 89cb887648f9..b93f36b887b5 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 tep_event_format *event, 192static void define_event_symbols(struct tep_event *event,
193 const char *ev_name, 193 const char *ev_name,
194 struct tep_print_arg *args) 194 struct tep_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 tep_event_format *event = evsel->tp_format; 341 struct tep_event *event = evsel->tp_format;
342 struct tep_format_field *field; 342 struct tep_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 tep_event_format *event = NULL; 540 struct tep_event *event = NULL;
541 struct tep_format_field *f; 541 struct tep_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 0c4b050f6fc2..87ef16a1b17e 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 tep_print_arg_type field_type,
264 Py_DECREF(t); 264 Py_DECREF(t);
265} 265}
266 266
267static void define_event_symbols(struct tep_event_format *event, 267static void define_event_symbols(struct tep_event *event,
268 const char *ev_name, 268 const char *ev_name,
269 struct tep_print_arg *args) 269 struct tep_print_arg *args)
270{ 270{
@@ -332,7 +332,7 @@ static void define_event_symbols(struct tep_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 tep_event_format *event, 335static PyObject *get_field_numeric_entry(struct tep_event *event,
336 struct tep_format_field *field, void *data) 336 struct tep_format_field *field, void *data)
337{ 337{
338 bool is_array = field->flags & TEP_FIELD_IS_ARRAY; 338 bool is_array = field->flags & TEP_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 tep_event_format *event = evsel->tp_format; 793 struct tep_event *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 tep_event_format *event = NULL; 1593 struct tep_event *event = NULL;
1594 struct tep_format_field *f; 1594 struct tep_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 32e558a65af3..ad74be1f0e42 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 tep_event_format *event; 36 struct tep_event *event;
37 struct tep_format_field *field; 37 struct tep_format_field *field;
38 38
39 if (!*size) { 39 if (!*size) {
@@ -95,7 +95,7 @@ int common_pc(struct scripting_context *context)
95} 95}
96 96
97unsigned long long 97unsigned long long
98raw_field_value(struct tep_event_format *event, const char *name, void *data) 98raw_field_value(struct tep_event *event, const char *name, void *data)
99{ 99{
100 struct tep_format_field *field; 100 struct tep_format_field *field;
101 unsigned long long val; 101 unsigned long long val;
@@ -109,12 +109,12 @@ raw_field_value(struct tep_event_format *event, const char *name, void *data)
109 return val; 109 return val;
110} 110}
111 111
112unsigned long long read_size(struct tep_event_format *event, void *ptr, int size) 112unsigned long long read_size(struct tep_event *event, void *ptr, int size)
113{ 113{
114 return tep_read_number(event->pevent, ptr, size); 114 return tep_read_number(event->pevent, ptr, size);
115} 115}
116 116
117void event_format__fprintf(struct tep_event_format *event, 117void event_format__fprintf(struct tep_event *event,
118 int cpu, void *data, int size, FILE *fp) 118 int cpu, void *data, int size, FILE *fp)
119{ 119{
120 struct tep_record record; 120 struct tep_record record;
@@ -131,7 +131,7 @@ void event_format__fprintf(struct tep_event_format *event,
131 trace_seq_destroy(&s); 131 trace_seq_destroy(&s);
132} 132}
133 133
134void event_format__print(struct tep_event_format *event, 134void event_format__print(struct tep_event *event,
135 int cpu, void *data, int size) 135 int cpu, void *data, int size)
136{ 136{
137 return event_format__fprintf(event, cpu, data, size, stdout); 137 return event_format__fprintf(event, cpu, data, size, stdout);
@@ -190,12 +190,12 @@ int parse_event_file(struct tep_handle *pevent,
190 return tep_parse_event(pevent, buf, size, sys); 190 return tep_parse_event(pevent, buf, size, sys);
191} 191}
192 192
193struct tep_event_format *trace_find_next_event(struct tep_handle *pevent, 193struct tep_event *trace_find_next_event(struct tep_handle *pevent,
194 struct tep_event_format *event) 194 struct tep_event *event)
195{ 195{
196 static int idx; 196 static int idx;
197 int events_count; 197 int events_count;
198 struct tep_event_format *all_events; 198 struct tep_event *all_events;
199 199
200 all_events = tep_get_first_event(pevent); 200 all_events = tep_get_first_event(pevent);
201 events_count = tep_get_events_count(pevent); 201 events_count = tep_get_events_count(pevent);
diff --git a/tools/perf/util/trace-event.c b/tools/perf/util/trace-event.c
index 95664b2f771e..cbe0dd758e3a 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 tep_event_format* 75static struct tep_event*
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 tep_event_format *event = NULL; 80 struct tep_event *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 tep_event_format* 105struct tep_event*
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 tep_event_format *trace_event__tp_format_id(int id) 114struct tep_event *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 f024d73bfc40..d9b0a942090a 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 tep_event_format* 25struct tep_event*
26trace_event__tp_format(const char *sys, const char *name); 26trace_event__tp_format(const char *sys, const char *name);
27 27
28struct tep_event_format *trace_event__tp_format_id(int id); 28struct tep_event *trace_event__tp_format_id(int id);
29 29
30int bigendian(void); 30int bigendian(void);
31 31
32void event_format__fprintf(struct tep_event_format *event, 32void event_format__fprintf(struct tep_event *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 tep_event_format *event, 35void event_format__print(struct tep_event *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 tep_event_format *event, const char *name, void *data); 43raw_field_value(struct tep_event *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 tep_event_format *trace_find_next_event(struct tep_handle *pevent, 51struct tep_event *trace_find_next_event(struct tep_handle *pevent,
52 struct tep_event_format *event); 52 struct tep_event *event);
53unsigned long long read_size(struct tep_event_format *event, void *ptr, int size); 53unsigned long long read_size(struct tep_event *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);