aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>2018-09-19 14:56:45 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2018-09-19 16:13:15 -0400
commit2c92f9828b3ca4e82e7ceffeea76c6fba4044acc (patch)
tree7d5da2f8651e0d9ea1358d2e2bf66936bed0f279
parent4963b0f88bb91ed0122f7b08876ae89fcafb2842 (diff)
tools lib traceevent, perf tools: Rename struct format{_field} to struct tep_format{_field}
In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_". This renames struct format to struct tep_format and struct format_field to struct tep_format_field Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com> Cc: linux-trace-devel@vger.kernel.org Link: http://lkml.kernel.org/r/20180919185722.661319373@goodmis.org Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/lib/traceevent/event-parse.c82
-rw-r--r--tools/lib/traceevent/event-parse.h42
-rw-r--r--tools/lib/traceevent/parse-filter.c8
-rw-r--r--tools/lib/traceevent/plugin_kmem.c2
-rw-r--r--tools/lib/traceevent/plugin_mac80211.c2
-rw-r--r--tools/lib/traceevent/plugin_sched_switch.c6
-rw-r--r--tools/perf/builtin-trace.c14
-rw-r--r--tools/perf/tests/evsel-tp-sched.c2
-rw-r--r--tools/perf/util/data-convert-bt.c22
-rw-r--r--tools/perf/util/evsel.c8
-rw-r--r--tools/perf/util/evsel.h6
-rw-r--r--tools/perf/util/evsel_fprintf.c2
-rw-r--r--tools/perf/util/python.c4
-rw-r--r--tools/perf/util/scripting-engines/trace-event-perl.c4
-rw-r--r--tools/perf/util/scripting-engines/trace-event-python.c6
-rw-r--r--tools/perf/util/sort.c18
-rw-r--r--tools/perf/util/trace-event-parse.c4
17 files changed, 116 insertions, 116 deletions
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index bb2ebb322124..32547abb6500 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -1299,7 +1299,7 @@ static int event_read_id(void)
1299 return -1; 1299 return -1;
1300} 1300}
1301 1301
1302static int field_is_string(struct format_field *field) 1302static int field_is_string(struct tep_format_field *field)
1303{ 1303{
1304 if ((field->flags & FIELD_IS_ARRAY) && 1304 if ((field->flags & FIELD_IS_ARRAY) &&
1305 (strstr(field->type, "char") || strstr(field->type, "u8") || 1305 (strstr(field->type, "char") || strstr(field->type, "u8") ||
@@ -1309,7 +1309,7 @@ static int field_is_string(struct format_field *field)
1309 return 0; 1309 return 0;
1310} 1310}
1311 1311
1312static int field_is_dynamic(struct format_field *field) 1312static int field_is_dynamic(struct tep_format_field *field)
1313{ 1313{
1314 if (strncmp(field->type, "__data_loc", 10) == 0) 1314 if (strncmp(field->type, "__data_loc", 10) == 0)
1315 return 1; 1315 return 1;
@@ -1317,7 +1317,7 @@ static int field_is_dynamic(struct format_field *field)
1317 return 0; 1317 return 0;
1318} 1318}
1319 1319
1320static int field_is_long(struct format_field *field) 1320static int field_is_long(struct tep_format_field *field)
1321{ 1321{
1322 /* includes long long */ 1322 /* includes long long */
1323 if (strstr(field->type, "long")) 1323 if (strstr(field->type, "long"))
@@ -1354,9 +1354,9 @@ static unsigned int type_size(const char *name)
1354 return 0; 1354 return 0;
1355} 1355}
1356 1356
1357static int event_read_fields(struct tep_event_format *event, struct format_field **fields) 1357static int event_read_fields(struct tep_event_format *event, struct tep_format_field **fields)
1358{ 1358{
1359 struct format_field *field = NULL; 1359 struct tep_format_field *field = NULL;
1360 enum event_type type; 1360 enum event_type type;
1361 char *token; 1361 char *token;
1362 char *last_token; 1362 char *last_token;
@@ -2683,7 +2683,7 @@ out:
2683static enum event_type 2683static enum event_type
2684process_dynamic_array(struct tep_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 tep_format_field *field;
2687 enum event_type type; 2687 enum event_type type;
2688 char *token; 2688 char *token;
2689 2689
@@ -2748,7 +2748,7 @@ static enum event_type
2748process_dynamic_array_len(struct tep_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 tep_format_field *field;
2752 enum event_type type; 2752 enum event_type type;
2753 char *token; 2753 char *token;
2754 2754
@@ -3259,10 +3259,10 @@ static int event_read_print(struct tep_event_format *event)
3259 * Returns a common field from the event by the given @name. 3259 * Returns a common field from the event by the given @name.
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 tep_format_field *
3263tep_find_common_field(struct tep_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 tep_format_field *format;
3266 3266
3267 for (format = event->format.common_fields; 3267 for (format = event->format.common_fields;
3268 format; format = format->next) { 3268 format; format = format->next) {
@@ -3281,10 +3281,10 @@ tep_find_common_field(struct tep_event_format *event, const char *name)
3281 * Returns a non-common field by the given @name. 3281 * Returns a non-common field by the given @name.
3282 * This does not search common fields. 3282 * This does not search common fields.
3283 */ 3283 */
3284struct format_field * 3284struct tep_format_field *
3285tep_find_field(struct tep_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 tep_format_field *format;
3288 3288
3289 for (format = event->format.fields; 3289 for (format = event->format.fields;
3290 format; format = format->next) { 3290 format; format = format->next) {
@@ -3304,10 +3304,10 @@ tep_find_field(struct tep_event_format *event, const char *name)
3304 * This searchs the common field names first, then 3304 * This searchs the common field names first, then
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 tep_format_field *
3308tep_find_any_field(struct tep_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 tep_format_field *format;
3311 3311
3312 format = tep_find_common_field(event, name); 3312 format = tep_find_common_field(event, name);
3313 if (format) 3313 if (format)
@@ -3353,7 +3353,7 @@ unsigned long long tep_read_number(struct tep_handle *pevent,
3353 * 3353 *
3354 * Returns 0 on success, -1 otherwise. 3354 * Returns 0 on success, -1 otherwise.
3355 */ 3355 */
3356int tep_read_number_field(struct format_field *field, const void *data, 3356int tep_read_number_field(struct tep_format_field *field, const void *data,
3357 unsigned long long *value) 3357 unsigned long long *value)
3358{ 3358{
3359 if (!field) 3359 if (!field)
@@ -3375,7 +3375,7 @@ static 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 tep_event_format *event; 3377 struct tep_event_format *event;
3378 struct format_field *field; 3378 struct tep_format_field *field;
3379 3379
3380 /* 3380 /*
3381 * All events should have the same common elements. 3381 * All events should have the same common elements.
@@ -3867,7 +3867,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,
3867{ 3867{
3868 struct tep_handle *pevent = event->pevent; 3868 struct tep_handle *pevent = event->pevent;
3869 struct print_flag_sym *flag; 3869 struct print_flag_sym *flag;
3870 struct format_field *field; 3870 struct tep_format_field *field;
3871 struct printk_map *printk; 3871 struct printk_map *printk;
3872 long long val, fval; 3872 long long val, fval;
3873 unsigned long long addr; 3873 unsigned long long addr;
@@ -4008,7 +4008,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,
4008 4008
4009 if (arg->int_array.field->type == PRINT_DYNAMIC_ARRAY) { 4009 if (arg->int_array.field->type == PRINT_DYNAMIC_ARRAY) {
4010 unsigned long offset; 4010 unsigned long offset;
4011 struct format_field *field = 4011 struct tep_format_field *field =
4012 arg->int_array.field->dynarray.field; 4012 arg->int_array.field->dynarray.field;
4013 offset = tep_read_number(pevent, 4013 offset = tep_read_number(pevent,
4014 data + field->offset, 4014 data + field->offset,
@@ -4056,7 +4056,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,
4056 int str_offset; 4056 int str_offset;
4057 4057
4058 if (arg->string.offset == -1) { 4058 if (arg->string.offset == -1) {
4059 struct format_field *f; 4059 struct tep_format_field *f;
4060 4060
4061 f = tep_find_any_field(event, arg->string.string); 4061 f = tep_find_any_field(event, arg->string.string);
4062 arg->string.offset = f->offset; 4062 arg->string.offset = f->offset;
@@ -4074,7 +4074,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,
4074 int bitmask_size; 4074 int bitmask_size;
4075 4075
4076 if (arg->bitmask.offset == -1) { 4076 if (arg->bitmask.offset == -1) {
4077 struct format_field *f; 4077 struct tep_format_field *f;
4078 4078
4079 f = tep_find_any_field(event, arg->bitmask.bitmask); 4079 f = tep_find_any_field(event, arg->bitmask.bitmask);
4080 arg->bitmask.offset = f->offset; 4080 arg->bitmask.offset = f->offset;
@@ -4215,7 +4215,7 @@ static void free_args(struct print_arg *args)
4215static struct print_arg *make_bprint_args(char *fmt, void *data, int size, struct tep_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 tep_format_field *field, *ip_field;
4219 struct print_arg *args, *arg, **next; 4219 struct print_arg *args, *arg, **next;
4220 unsigned long long ip, val; 4220 unsigned long long ip, val;
4221 char *ptr; 4221 char *ptr;
@@ -4393,7 +4393,7 @@ get_bprint_format(void *data, int size __maybe_unused,
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;
4396 struct format_field *field; 4396 struct tep_format_field *field;
4397 struct printk_map *printk; 4397 struct printk_map *printk;
4398 char *format; 4398 char *format;
4399 4399
@@ -4788,7 +4788,7 @@ static int is_printable_array(char *p, unsigned int len)
4788} 4788}
4789 4789
4790void tep_print_field(struct trace_seq *s, void *data, 4790void tep_print_field(struct trace_seq *s, void *data,
4791 struct format_field *field) 4791 struct tep_format_field *field)
4792{ 4792{
4793 unsigned long long val; 4793 unsigned long long val;
4794 unsigned int offset, len, i; 4794 unsigned int offset, len, i;
@@ -4855,7 +4855,7 @@ void tep_print_field(struct trace_seq *s, void *data,
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 tep_event_format *event) 4856 int size __maybe_unused, struct tep_event_format *event)
4857{ 4857{
4858 struct format_field *field; 4858 struct tep_format_field *field;
4859 4859
4860 field = event->format.fields; 4860 field = event->format.fields;
4861 while (field) { 4861 while (field) {
@@ -5664,12 +5664,12 @@ struct tep_event_format **tep_list_events(struct tep_handle *pevent, enum event_
5664 return events; 5664 return events;
5665} 5665}
5666 5666
5667static struct format_field ** 5667static struct tep_format_field **
5668get_event_fields(const char *type, const char *name, 5668get_event_fields(const char *type, const char *name,
5669 int count, struct format_field *list) 5669 int count, struct tep_format_field *list)
5670{ 5670{
5671 struct format_field **fields; 5671 struct tep_format_field **fields;
5672 struct format_field *field; 5672 struct tep_format_field *field;
5673 int i = 0; 5673 int i = 0;
5674 5674
5675 fields = malloc(sizeof(*fields) * (count + 1)); 5675 fields = malloc(sizeof(*fields) * (count + 1));
@@ -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 tep_event_format *event) 5705struct tep_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 tep_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 tep_event_format *event) 5719struct tep_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,
@@ -6090,7 +6090,7 @@ enum tep_errno __tep_parse_format(struct tep_event_format **eventp,
6090 } 6090 }
6091 6091
6092 if (!ret && (event->flags & EVENT_FL_ISFTRACE)) { 6092 if (!ret && (event->flags & EVENT_FL_ISFTRACE)) {
6093 struct format_field *field; 6093 struct tep_format_field *field;
6094 struct print_arg *arg, **list; 6094 struct print_arg *arg, **list;
6095 6095
6096 /* old ftrace had no args */ 6096 /* old ftrace had no args */
@@ -6230,7 +6230,7 @@ int tep_strerror(struct tep_handle *pevent __maybe_unused,
6230 return 0; 6230 return 0;
6231} 6231}
6232 6232
6233int get_field_val(struct trace_seq *s, struct format_field *field, 6233int get_field_val(struct trace_seq *s, struct tep_format_field *field,
6234 const char *name, struct tep_record *record, 6234 const char *name, struct tep_record *record,
6235 unsigned long long *val, int err) 6235 unsigned long long *val, int err)
6236{ 6236{
@@ -6267,7 +6267,7 @@ void *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{
6270 struct format_field *field; 6270 struct tep_format_field *field;
6271 void *data = record->data; 6271 void *data = record->data;
6272 unsigned offset; 6272 unsigned offset;
6273 int dummy; 6273 int dummy;
@@ -6314,7 +6314,7 @@ int 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{
6317 struct format_field *field; 6317 struct tep_format_field *field;
6318 6318
6319 if (!event) 6319 if (!event)
6320 return -1; 6320 return -1;
@@ -6339,7 +6339,7 @@ int 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{
6342 struct format_field *field; 6342 struct tep_format_field *field;
6343 6343
6344 if (!event) 6344 if (!event)
6345 return -1; 6345 return -1;
@@ -6364,7 +6364,7 @@ int 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{
6367 struct format_field *field; 6367 struct tep_format_field *field;
6368 6368
6369 if (!event) 6369 if (!event)
6370 return -1; 6370 return -1;
@@ -6389,7 +6389,7 @@ int tep_print_num_field(struct trace_seq *s, const char *fmt,
6389 struct tep_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 tep_format_field *field = tep_find_field(event, name);
6393 unsigned long long val; 6393 unsigned long long val;
6394 6394
6395 if (!field) 6395 if (!field)
@@ -6421,7 +6421,7 @@ int tep_print_func_field(struct trace_seq *s, const char *fmt,
6421 struct tep_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 tep_format_field *field = tep_find_field(event, name);
6425 struct tep_handle *pevent = event->pevent; 6425 struct tep_handle *pevent = event->pevent;
6426 unsigned long long val; 6426 unsigned long long val;
6427 struct func_map *func; 6427 struct func_map *func;
@@ -6758,7 +6758,7 @@ void tep_ref(struct tep_handle *pevent)
6758 pevent->ref_count++; 6758 pevent->ref_count++;
6759} 6759}
6760 6760
6761void tep_free_format_field(struct format_field *field) 6761void tep_free_format_field(struct tep_format_field *field)
6762{ 6762{
6763 free(field->type); 6763 free(field->type);
6764 if (field->alias != field->name) 6764 if (field->alias != field->name)
@@ -6767,9 +6767,9 @@ void tep_free_format_field(struct format_field *field)
6767 free(field); 6767 free(field);
6768} 6768}
6769 6769
6770static void free_format_fields(struct format_field *field) 6770static void free_format_fields(struct tep_format_field *field)
6771{ 6771{
6772 struct format_field *next; 6772 struct tep_format_field *next;
6773 6773
6774 while (field) { 6774 while (field) {
6775 next = field->next; 6775 next = field->next;
@@ -6778,7 +6778,7 @@ static void free_format_fields(struct format_field *field)
6778 } 6778 }
6779} 6779}
6780 6780
6781static void free_formats(struct format *format) 6781static void free_formats(struct tep_format *format)
6782{ 6782{
6783 free_format_fields(format->common_fields); 6783 free_format_fields(format->common_fields);
6784 free_format_fields(format->fields); 6784 free_format_fields(format->fields);
diff --git a/tools/lib/traceevent/event-parse.h b/tools/lib/traceevent/event-parse.h
index 82de69c2b054..aba859056867 100644
--- a/tools/lib/traceevent/event-parse.h
+++ b/tools/lib/traceevent/event-parse.h
@@ -141,8 +141,8 @@ enum format_flags {
141 FIELD_IS_SYMBOLIC = 128, 141 FIELD_IS_SYMBOLIC = 128,
142}; 142};
143 143
144struct format_field { 144struct tep_format_field {
145 struct format_field *next; 145 struct tep_format_field *next;
146 struct tep_event_format *event; 146 struct tep_event_format *event;
147 char *type; 147 char *type;
148 char *name; 148 char *name;
@@ -154,11 +154,11 @@ struct format_field {
154 unsigned long flags; 154 unsigned long flags;
155}; 155};
156 156
157struct format { 157struct tep_format {
158 int nr_common; 158 int nr_common;
159 int nr_fields; 159 int nr_fields;
160 struct format_field *common_fields; 160 struct tep_format_field *common_fields;
161 struct format_field *fields; 161 struct tep_format_field *fields;
162}; 162};
163 163
164struct print_arg_atom { 164struct print_arg_atom {
@@ -177,7 +177,7 @@ struct print_arg_bitmask {
177 177
178struct print_arg_field { 178struct print_arg_field {
179 char *name; 179 char *name;
180 struct format_field *field; 180 struct tep_format_field *field;
181}; 181};
182 182
183struct print_flag_sym { 183struct print_flag_sym {
@@ -214,7 +214,7 @@ struct print_arg_int_array {
214}; 214};
215 215
216struct print_arg_dynarray { 216struct print_arg_dynarray {
217 struct format_field *field; 217 struct tep_format_field *field;
218 struct print_arg *index; 218 struct print_arg *index;
219}; 219};
220 220
@@ -282,7 +282,7 @@ struct tep_event_format {
282 char *name; 282 char *name;
283 int id; 283 int id;
284 int flags; 284 int flags;
285 struct format format; 285 struct tep_format format;
286 struct print_fmt print_fmt; 286 struct print_fmt print_fmt;
287 char *system; 287 char *system;
288 tep_event_handler_func handler; 288 tep_event_handler_func handler;
@@ -477,9 +477,9 @@ struct tep_handle {
477 477
478 int flags; 478 int flags;
479 479
480 struct format_field *bprint_ip_field; 480 struct tep_format_field *bprint_ip_field;
481 struct format_field *bprint_fmt_field; 481 struct tep_format_field *bprint_fmt_field;
482 struct format_field *bprint_buf_field; 482 struct tep_format_field *bprint_buf_field;
483 483
484 struct event_handler *handlers; 484 struct event_handler *handlers;
485 struct tep_function_handler *func_handlers; 485 struct tep_function_handler *func_handlers;
@@ -607,7 +607,7 @@ enum tep_errno tep_parse_format(struct tep_handle *pevent,
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 tep_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 tep_format_field *field);
611 611
612void *tep_get_field_raw(struct trace_seq *s, struct tep_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,
@@ -644,15 +644,15 @@ 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 tep_event_format *event, const char *name); 647struct tep_format_field *tep_find_common_field(struct tep_event_format *event, const char *name);
648struct format_field *tep_find_field(struct tep_event_format *event, const char *name); 648struct tep_format_field *tep_find_field(struct tep_event_format *event, const char *name);
649struct format_field *tep_find_any_field(struct tep_event_format *event, const char *name); 649struct tep_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
653tep_find_function_address(struct tep_handle *pevent, unsigned long long addr); 653tep_find_function_address(struct tep_handle *pevent, unsigned long long addr);
654unsigned long long tep_read_number(struct tep_handle *pevent, const void *ptr, int size); 654unsigned long long tep_read_number(struct tep_handle *pevent, const void *ptr, int size);
655int tep_read_number_field(struct format_field *field, const void *data, 655int tep_read_number_field(struct tep_format_field *field, const void *data,
656 unsigned long long *value); 656 unsigned long long *value);
657 657
658struct tep_event_format *tep_find_event(struct tep_handle *pevent, int id); 658struct tep_event_format *tep_find_event(struct tep_handle *pevent, int id);
@@ -677,7 +677,7 @@ struct cmdline *tep_data_pid_from_comm(struct tep_handle *pevent, const char *co
677int tep_cmdline_pid(struct tep_handle *pevent, struct cmdline *cmdline); 677int tep_cmdline_pid(struct tep_handle *pevent, struct cmdline *cmdline);
678 678
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 tep_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 tep_event_format *event); 682 int size __maybe_unused, struct tep_event_format *event);
683void tep_event_info(struct trace_seq *s, struct tep_event_format *event, 683void tep_event_info(struct trace_seq *s, struct tep_event_format *event,
@@ -686,8 +686,8 @@ int 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 tep_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 tep_event_format *event); 689struct tep_format_field **tep_event_common_fields(struct tep_event_format *event);
690struct format_field **tep_event_fields(struct tep_event_format *event); 690struct tep_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{
@@ -832,7 +832,7 @@ struct filter_arg_boolean {
832}; 832};
833 833
834struct filter_arg_field { 834struct filter_arg_field {
835 struct format_field *field; 835 struct tep_format_field *field;
836}; 836};
837 837
838struct filter_arg_value { 838struct filter_arg_value {
@@ -863,7 +863,7 @@ struct filter_arg_num {
863 863
864struct filter_arg_str { 864struct filter_arg_str {
865 enum filter_cmp_type type; 865 enum filter_cmp_type type;
866 struct format_field *field; 866 struct tep_format_field *field;
867 char *val; 867 char *val;
868 char *buffer; 868 char *buffer;
869 regex_t reg; 869 regex_t reg;
diff --git a/tools/lib/traceevent/parse-filter.c b/tools/lib/traceevent/parse-filter.c
index 5572756307ab..a0353f2c051a 100644
--- a/tools/lib/traceevent/parse-filter.c
+++ b/tools/lib/traceevent/parse-filter.c
@@ -16,11 +16,11 @@
16#define COMM "COMM" 16#define COMM "COMM"
17#define CPU "CPU" 17#define CPU "CPU"
18 18
19static struct format_field comm = { 19static struct tep_format_field comm = {
20 .name = "COMM", 20 .name = "COMM",
21}; 21};
22 22
23static struct format_field cpu = { 23static struct tep_format_field cpu = {
24 .name = "CPU", 24 .name = "CPU",
25}; 25};
26 26
@@ -336,7 +336,7 @@ static enum tep_errno
336create_arg_item(struct tep_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 tep_format_field *field;
340 struct filter_arg *arg; 340 struct filter_arg *arg;
341 341
342 arg = allocate_arg(); 342 arg = allocate_arg();
@@ -1698,7 +1698,7 @@ get_comm(struct tep_event_format *event, struct tep_record *record)
1698 1698
1699static unsigned long long 1699static unsigned long long
1700get_value(struct tep_event_format *event, 1700get_value(struct tep_event_format *event,
1701 struct format_field *field, struct tep_record *record) 1701 struct tep_format_field *field, struct tep_record *record)
1702{ 1702{
1703 unsigned long long val; 1703 unsigned long long val;
1704 1704
diff --git a/tools/lib/traceevent/plugin_kmem.c b/tools/lib/traceevent/plugin_kmem.c
index 5632aff43aba..1beb4eaddfdf 100644
--- a/tools/lib/traceevent/plugin_kmem.c
+++ b/tools/lib/traceevent/plugin_kmem.c
@@ -27,7 +27,7 @@
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_format *event, void *context)
29{ 29{
30 struct format_field *field; 30 struct tep_format_field *field;
31 unsigned long long val, addr; 31 unsigned long long val, addr;
32 void *data = record->data; 32 void *data = record->data;
33 const char *func; 33 const char *func;
diff --git a/tools/lib/traceevent/plugin_mac80211.c b/tools/lib/traceevent/plugin_mac80211.c
index c16469614690..da3855e7b86f 100644
--- a/tools/lib/traceevent/plugin_mac80211.c
+++ b/tools/lib/traceevent/plugin_mac80211.c
@@ -29,7 +29,7 @@
29static void print_string(struct trace_seq *s, struct tep_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 tep_format_field *f = tep_find_field(event, name);
33 int offset; 33 int offset;
34 int length; 34 int length;
35 35
diff --git a/tools/lib/traceevent/plugin_sched_switch.c b/tools/lib/traceevent/plugin_sched_switch.c
index a7eeb42894ae..77882272672f 100644
--- a/tools/lib/traceevent/plugin_sched_switch.c
+++ b/tools/lib/traceevent/plugin_sched_switch.c
@@ -45,7 +45,7 @@ static void write_state(struct trace_seq *s, int val)
45 trace_seq_putc(s, 'R'); 45 trace_seq_putc(s, 'R');
46} 46}
47 47
48static void write_and_save_comm(struct format_field *field, 48static void write_and_save_comm(struct tep_format_field *field,
49 struct tep_record *record, 49 struct tep_record *record,
50 struct trace_seq *s, int pid) 50 struct trace_seq *s, int pid)
51{ 51{
@@ -69,7 +69,7 @@ static 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_format *event, void *context)
71{ 71{
72 struct format_field *field; 72 struct tep_format_field *field;
73 unsigned long long val; 73 unsigned long long val;
74 74
75 if (tep_get_field_val(s, event, "pid", record, &val, 1)) 75 if (tep_get_field_val(s, event, "pid", record, &val, 1))
@@ -98,7 +98,7 @@ static 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_format *event, void *context)
100{ 100{
101 struct format_field *field; 101 struct tep_format_field *field;
102 unsigned long long val; 102 unsigned long long val;
103 103
104 if (tep_get_field_val(s, event, "prev_pid", record, &val, 1)) 104 if (tep_get_field_val(s, event, "prev_pid", record, &val, 1))
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 9f8c365dacb1..95f3c255d977 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -181,7 +181,7 @@ static int __tp_field__init_uint(struct tp_field *field, int size, int offset, b
181 return 0; 181 return 0;
182} 182}
183 183
184static int tp_field__init_uint(struct tp_field *field, struct format_field *format_field, bool needs_swap) 184static int tp_field__init_uint(struct tp_field *field, struct tep_format_field *format_field, bool needs_swap)
185{ 185{
186 return __tp_field__init_uint(field, format_field->size, format_field->offset, needs_swap); 186 return __tp_field__init_uint(field, format_field->size, format_field->offset, needs_swap);
187} 187}
@@ -198,7 +198,7 @@ static int __tp_field__init_ptr(struct tp_field *field, int offset)
198 return 0; 198 return 0;
199} 199}
200 200
201static int tp_field__init_ptr(struct tp_field *field, struct format_field *format_field) 201static int tp_field__init_ptr(struct tp_field *field, struct tep_format_field *format_field)
202{ 202{
203 return __tp_field__init_ptr(field, format_field->offset); 203 return __tp_field__init_ptr(field, format_field->offset);
204} 204}
@@ -214,7 +214,7 @@ static int perf_evsel__init_tp_uint_field(struct perf_evsel *evsel,
214 struct tp_field *field, 214 struct tp_field *field,
215 const char *name) 215 const char *name)
216{ 216{
217 struct format_field *format_field = perf_evsel__field(evsel, name); 217 struct tep_format_field *format_field = perf_evsel__field(evsel, name);
218 218
219 if (format_field == NULL) 219 if (format_field == NULL)
220 return -1; 220 return -1;
@@ -230,7 +230,7 @@ static int perf_evsel__init_tp_ptr_field(struct perf_evsel *evsel,
230 struct tp_field *field, 230 struct tp_field *field,
231 const char *name) 231 const char *name)
232{ 232{
233 struct format_field *format_field = perf_evsel__field(evsel, name); 233 struct tep_format_field *format_field = perf_evsel__field(evsel, name);
234 234
235 if (format_field == NULL) 235 if (format_field == NULL)
236 return -1; 236 return -1;
@@ -867,7 +867,7 @@ struct syscall {
867 int args_size; 867 int args_size;
868 bool is_exit; 868 bool is_exit;
869 bool is_open; 869 bool is_open;
870 struct format_field *args; 870 struct tep_format_field *args;
871 const char *name; 871 const char *name;
872 struct syscall_fmt *fmt; 872 struct syscall_fmt *fmt;
873 struct syscall_arg_fmt *arg_fmt; 873 struct syscall_arg_fmt *arg_fmt;
@@ -1279,7 +1279,7 @@ static int syscall__alloc_arg_fmts(struct syscall *sc, int nr_args)
1279 1279
1280static int syscall__set_arg_fmts(struct syscall *sc) 1280static int syscall__set_arg_fmts(struct syscall *sc)
1281{ 1281{
1282 struct format_field *field, *last_field = NULL; 1282 struct tep_format_field *field, *last_field = NULL;
1283 int idx = 0, len; 1283 int idx = 0, len;
1284 1284
1285 for (field = sc->args; field; field = field->next, ++idx) { 1285 for (field = sc->args; field; field = field->next, ++idx) {
@@ -1525,7 +1525,7 @@ static size_t syscall__scnprintf_args(struct syscall *sc, char *bf, size_t size,
1525 ttrace->ret_scnprintf = NULL; 1525 ttrace->ret_scnprintf = NULL;
1526 1526
1527 if (sc->args != NULL) { 1527 if (sc->args != NULL) {
1528 struct format_field *field; 1528 struct tep_format_field *field;
1529 1529
1530 for (field = sc->args; field; 1530 for (field = sc->args; field;
1531 field = field->next, ++arg.idx, bit <<= 1) { 1531 field = field->next, ++arg.idx, bit <<= 1) {
diff --git a/tools/perf/tests/evsel-tp-sched.c b/tools/perf/tests/evsel-tp-sched.c
index 699561fa512c..da9d3c0f8ead 100644
--- a/tools/perf/tests/evsel-tp-sched.c
+++ b/tools/perf/tests/evsel-tp-sched.c
@@ -8,7 +8,7 @@
8static int perf_evsel__test_field(struct perf_evsel *evsel, const char *name, 8static int perf_evsel__test_field(struct perf_evsel *evsel, const char *name,
9 int size, bool should_be_signed) 9 int size, bool should_be_signed)
10{ 10{
11 struct format_field *field = perf_evsel__field(evsel, name); 11 struct tep_format_field *field = perf_evsel__field(evsel, name);
12 int is_signed; 12 int is_signed;
13 int ret = 0; 13 int ret = 0;
14 14
diff --git a/tools/perf/util/data-convert-bt.c b/tools/perf/util/data-convert-bt.c
index f75d4aa612c5..1817bbcc4a62 100644
--- a/tools/perf/util/data-convert-bt.c
+++ b/tools/perf/util/data-convert-bt.c
@@ -182,7 +182,7 @@ err_put_field:
182} 182}
183 183
184static struct bt_ctf_field_type* 184static struct bt_ctf_field_type*
185get_tracepoint_field_type(struct ctf_writer *cw, struct format_field *field) 185get_tracepoint_field_type(struct ctf_writer *cw, struct tep_format_field *field)
186{ 186{
187 unsigned long flags = field->flags; 187 unsigned long flags = field->flags;
188 188
@@ -287,7 +287,7 @@ static int add_tracepoint_field_value(struct ctf_writer *cw,
287 struct bt_ctf_event_class *event_class, 287 struct bt_ctf_event_class *event_class,
288 struct bt_ctf_event *event, 288 struct bt_ctf_event *event,
289 struct perf_sample *sample, 289 struct perf_sample *sample,
290 struct format_field *fmtf) 290 struct tep_format_field *fmtf)
291{ 291{
292 struct bt_ctf_field_type *type; 292 struct bt_ctf_field_type *type;
293 struct bt_ctf_field *array_field; 293 struct bt_ctf_field *array_field;
@@ -396,10 +396,10 @@ err_put_field:
396static int add_tracepoint_fields_values(struct ctf_writer *cw, 396static int add_tracepoint_fields_values(struct ctf_writer *cw,
397 struct bt_ctf_event_class *event_class, 397 struct bt_ctf_event_class *event_class,
398 struct bt_ctf_event *event, 398 struct bt_ctf_event *event,
399 struct format_field *fields, 399 struct tep_format_field *fields,
400 struct perf_sample *sample) 400 struct perf_sample *sample)
401{ 401{
402 struct format_field *field; 402 struct tep_format_field *field;
403 int ret; 403 int ret;
404 404
405 for (field = fields; field; field = field->next) { 405 for (field = fields; field; field = field->next) {
@@ -417,8 +417,8 @@ static int add_tracepoint_values(struct ctf_writer *cw,
417 struct perf_evsel *evsel, 417 struct perf_evsel *evsel,
418 struct perf_sample *sample) 418 struct perf_sample *sample)
419{ 419{
420 struct format_field *common_fields = evsel->tp_format->format.common_fields; 420 struct tep_format_field *common_fields = evsel->tp_format->format.common_fields;
421 struct format_field *fields = evsel->tp_format->format.fields; 421 struct tep_format_field *fields = evsel->tp_format->format.fields;
422 int ret; 422 int ret;
423 423
424 ret = add_tracepoint_fields_values(cw, event_class, event, 424 ret = add_tracepoint_fields_values(cw, event_class, event,
@@ -970,7 +970,7 @@ out:
970 970
971static int event_class_add_field(struct bt_ctf_event_class *event_class, 971static int event_class_add_field(struct bt_ctf_event_class *event_class,
972 struct bt_ctf_field_type *type, 972 struct bt_ctf_field_type *type,
973 struct format_field *field) 973 struct tep_format_field *field)
974{ 974{
975 struct bt_ctf_field_type *t = NULL; 975 struct bt_ctf_field_type *t = NULL;
976 char *name; 976 char *name;
@@ -1009,10 +1009,10 @@ static int event_class_add_field(struct bt_ctf_event_class *event_class,
1009} 1009}
1010 1010
1011static int add_tracepoint_fields_types(struct ctf_writer *cw, 1011static int add_tracepoint_fields_types(struct ctf_writer *cw,
1012 struct format_field *fields, 1012 struct tep_format_field *fields,
1013 struct bt_ctf_event_class *event_class) 1013 struct bt_ctf_event_class *event_class)
1014{ 1014{
1015 struct format_field *field; 1015 struct tep_format_field *field;
1016 int ret; 1016 int ret;
1017 1017
1018 for (field = fields; field; field = field->next) { 1018 for (field = fields; field; field = field->next) {
@@ -1055,8 +1055,8 @@ static int add_tracepoint_types(struct ctf_writer *cw,
1055 struct perf_evsel *evsel, 1055 struct perf_evsel *evsel,
1056 struct bt_ctf_event_class *class) 1056 struct bt_ctf_event_class *class)
1057{ 1057{
1058 struct format_field *common_fields = evsel->tp_format->format.common_fields; 1058 struct tep_format_field *common_fields = evsel->tp_format->format.common_fields;
1059 struct format_field *fields = evsel->tp_format->format.fields; 1059 struct tep_format_field *fields = evsel->tp_format->format.fields;
1060 int ret; 1060 int ret;
1061 1061
1062 ret = add_tracepoint_fields_types(cw, common_fields, class); 1062 ret = add_tracepoint_fields_types(cw, common_fields, class);
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 4ec909d57e9c..751c98a2e336 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -2682,7 +2682,7 @@ int perf_event__synthesize_sample(union perf_event *event, u64 type,
2682 return 0; 2682 return 0;
2683} 2683}
2684 2684
2685struct format_field *perf_evsel__field(struct perf_evsel *evsel, const char *name) 2685struct tep_format_field *perf_evsel__field(struct perf_evsel *evsel, const char *name)
2686{ 2686{
2687 return tep_find_field(evsel->tp_format, name); 2687 return tep_find_field(evsel->tp_format, name);
2688} 2688}
@@ -2690,7 +2690,7 @@ struct format_field *perf_evsel__field(struct perf_evsel *evsel, const char *nam
2690void *perf_evsel__rawptr(struct perf_evsel *evsel, struct perf_sample *sample, 2690void *perf_evsel__rawptr(struct perf_evsel *evsel, struct perf_sample *sample,
2691 const char *name) 2691 const char *name)
2692{ 2692{
2693 struct format_field *field = perf_evsel__field(evsel, name); 2693 struct tep_format_field *field = perf_evsel__field(evsel, name);
2694 int offset; 2694 int offset;
2695 2695
2696 if (!field) 2696 if (!field)
@@ -2706,7 +2706,7 @@ void *perf_evsel__rawptr(struct perf_evsel *evsel, struct perf_sample *sample,
2706 return sample->raw_data + offset; 2706 return sample->raw_data + offset;
2707} 2707}
2708 2708
2709u64 format_field__intval(struct format_field *field, struct perf_sample *sample, 2709u64 format_field__intval(struct tep_format_field *field, struct perf_sample *sample,
2710 bool needs_swap) 2710 bool needs_swap)
2711{ 2711{
2712 u64 value; 2712 u64 value;
@@ -2748,7 +2748,7 @@ u64 format_field__intval(struct format_field *field, struct perf_sample *sample,
2748u64 perf_evsel__intval(struct perf_evsel *evsel, struct perf_sample *sample, 2748u64 perf_evsel__intval(struct perf_evsel *evsel, struct perf_sample *sample,
2749 const char *name) 2749 const char *name)
2750{ 2750{
2751 struct format_field *field = perf_evsel__field(evsel, name); 2751 struct tep_format_field *field = perf_evsel__field(evsel, name);
2752 2752
2753 if (!field) 2753 if (!field)
2754 return 0; 2754 return 0;
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index c0f275cf96ee..4107c39f4a54 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -296,11 +296,11 @@ static inline char *perf_evsel__strval(struct perf_evsel *evsel,
296 return perf_evsel__rawptr(evsel, sample, name); 296 return perf_evsel__rawptr(evsel, sample, name);
297} 297}
298 298
299struct format_field; 299struct tep_format_field;
300 300
301u64 format_field__intval(struct format_field *field, struct perf_sample *sample, bool needs_swap); 301u64 format_field__intval(struct tep_format_field *field, struct perf_sample *sample, bool needs_swap);
302 302
303struct format_field *perf_evsel__field(struct perf_evsel *evsel, const char *name); 303struct tep_format_field *perf_evsel__field(struct perf_evsel *evsel, const char *name);
304 304
305#define perf_evsel__match(evsel, t, c) \ 305#define perf_evsel__match(evsel, t, c) \
306 (evsel->attr.type == PERF_TYPE_##t && \ 306 (evsel->attr.type == PERF_TYPE_##t && \
diff --git a/tools/perf/util/evsel_fprintf.c b/tools/perf/util/evsel_fprintf.c
index 06dfb027879d..0d0a4c6f368b 100644
--- a/tools/perf/util/evsel_fprintf.c
+++ b/tools/perf/util/evsel_fprintf.c
@@ -73,7 +73,7 @@ int perf_evsel__fprintf(struct perf_evsel *evsel,
73 } 73 }
74 74
75 if (details->trace_fields) { 75 if (details->trace_fields) {
76 struct format_field *field; 76 struct tep_format_field *field;
77 77
78 if (evsel->attr.type != PERF_TYPE_TRACEPOINT) { 78 if (evsel->attr.type != PERF_TYPE_TRACEPOINT) {
79 printed += comma_fprintf(fp, &first, " (not a tracepoint)"); 79 printed += comma_fprintf(fp, &first, " (not a tracepoint)");
diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c
index 6714d2c517db..ebf84fe8cd29 100644
--- a/tools/perf/util/python.c
+++ b/tools/perf/util/python.c
@@ -340,7 +340,7 @@ static bool is_tracepoint(struct pyrf_event *pevent)
340} 340}
341 341
342static PyObject* 342static PyObject*
343tracepoint_field(struct pyrf_event *pe, struct format_field *field) 343tracepoint_field(struct pyrf_event *pe, struct tep_format_field *field)
344{ 344{
345 struct tep_handle *pevent = field->event->pevent; 345 struct tep_handle *pevent = field->event->pevent;
346 void *data = pe->sample.raw_data; 346 void *data = pe->sample.raw_data;
@@ -383,7 +383,7 @@ get_tracepoint_field(struct pyrf_event *pevent, PyObject *attr_name)
383{ 383{
384 const char *str = _PyUnicode_AsString(PyObject_Str(attr_name)); 384 const char *str = _PyUnicode_AsString(PyObject_Str(attr_name));
385 struct perf_evsel *evsel = pevent->evsel; 385 struct perf_evsel *evsel = pevent->evsel;
386 struct 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_format *tp_format;
diff --git a/tools/perf/util/scripting-engines/trace-event-perl.c b/tools/perf/util/scripting-engines/trace-event-perl.c
index 370cc60f0afa..1bb0b0c685b7 100644
--- a/tools/perf/util/scripting-engines/trace-event-perl.c
+++ b/tools/perf/util/scripting-engines/trace-event-perl.c
@@ -339,7 +339,7 @@ static void perl_process_tracepoint(struct perf_sample *sample,
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_format *event = evsel->tp_format;
342 struct 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;
345 unsigned long s, ns; 345 unsigned long s, ns;
@@ -538,7 +538,7 @@ static int perl_stop_script(void)
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_format *event = NULL;
541 struct 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;
544 FILE *ofp; 544 FILE *ofp;
diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c
index 9a8a7b7ff64a..dc26e58a791e 100644
--- a/tools/perf/util/scripting-engines/trace-event-python.c
+++ b/tools/perf/util/scripting-engines/trace-event-python.c
@@ -333,7 +333,7 @@ static void define_event_symbols(struct tep_event_format *event,
333} 333}
334 334
335static PyObject *get_field_numeric_entry(struct tep_event_format *event, 335static PyObject *get_field_numeric_entry(struct tep_event_format *event,
336 struct format_field *field, void *data) 336 struct tep_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;
339 PyObject *obj = NULL, *list = NULL; 339 PyObject *obj = NULL, *list = NULL;
@@ -794,7 +794,7 @@ static void python_process_tracepoint(struct perf_sample *sample,
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];
797 struct format_field *field; 797 struct tep_format_field *field;
798 unsigned long s, ns; 798 unsigned long s, ns;
799 unsigned n = 0; 799 unsigned n = 0;
800 int pid; 800 int pid;
@@ -1591,7 +1591,7 @@ static int python_stop_script(void)
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_format *event = NULL;
1594 struct 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;
1597 FILE *ofp; 1597 FILE *ofp;
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index b284276ec963..5e3179d995f9 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -1884,7 +1884,7 @@ static int __sort_dimension__add_hpp_output(struct sort_dimension *sd,
1884struct hpp_dynamic_entry { 1884struct hpp_dynamic_entry {
1885 struct perf_hpp_fmt hpp; 1885 struct perf_hpp_fmt hpp;
1886 struct perf_evsel *evsel; 1886 struct perf_evsel *evsel;
1887 struct format_field *field; 1887 struct tep_format_field *field;
1888 unsigned dynamic_len; 1888 unsigned dynamic_len;
1889 bool raw_trace; 1889 bool raw_trace;
1890}; 1890};
@@ -1915,7 +1915,7 @@ static void update_dynamic_len(struct hpp_dynamic_entry *hde,
1915 struct hist_entry *he) 1915 struct hist_entry *he)
1916{ 1916{
1917 char *str, *pos; 1917 char *str, *pos;
1918 struct format_field *field = hde->field; 1918 struct tep_format_field *field = hde->field;
1919 size_t namelen; 1919 size_t namelen;
1920 bool last = false; 1920 bool last = false;
1921 1921
@@ -2000,7 +2000,7 @@ static int __sort__hde_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp,
2000 struct hpp_dynamic_entry *hde; 2000 struct hpp_dynamic_entry *hde;
2001 size_t len = fmt->user_len; 2001 size_t len = fmt->user_len;
2002 char *str, *pos; 2002 char *str, *pos;
2003 struct format_field *field; 2003 struct tep_format_field *field;
2004 size_t namelen; 2004 size_t namelen;
2005 bool last = false; 2005 bool last = false;
2006 int ret; 2006 int ret;
@@ -2060,7 +2060,7 @@ static int64_t __sort__hde_cmp(struct perf_hpp_fmt *fmt,
2060 struct hist_entry *a, struct hist_entry *b) 2060 struct hist_entry *a, struct hist_entry *b)
2061{ 2061{
2062 struct hpp_dynamic_entry *hde; 2062 struct hpp_dynamic_entry *hde;
2063 struct format_field *field; 2063 struct tep_format_field *field;
2064 unsigned offset, size; 2064 unsigned offset, size;
2065 2065
2066 hde = container_of(fmt, struct hpp_dynamic_entry, hpp); 2066 hde = container_of(fmt, struct hpp_dynamic_entry, hpp);
@@ -2117,7 +2117,7 @@ static void hde_free(struct perf_hpp_fmt *fmt)
2117} 2117}
2118 2118
2119static struct hpp_dynamic_entry * 2119static struct hpp_dynamic_entry *
2120__alloc_dynamic_entry(struct perf_evsel *evsel, struct format_field *field, 2120__alloc_dynamic_entry(struct perf_evsel *evsel, struct tep_format_field *field,
2121 int level) 2121 int level)
2122{ 2122{
2123 struct hpp_dynamic_entry *hde; 2123 struct hpp_dynamic_entry *hde;
@@ -2252,7 +2252,7 @@ static struct perf_evsel *find_evsel(struct perf_evlist *evlist, char *event_nam
2252} 2252}
2253 2253
2254static int __dynamic_dimension__add(struct perf_evsel *evsel, 2254static int __dynamic_dimension__add(struct perf_evsel *evsel,
2255 struct format_field *field, 2255 struct tep_format_field *field,
2256 bool raw_trace, int level) 2256 bool raw_trace, int level)
2257{ 2257{
2258 struct hpp_dynamic_entry *hde; 2258 struct hpp_dynamic_entry *hde;
@@ -2270,7 +2270,7 @@ static int __dynamic_dimension__add(struct perf_evsel *evsel,
2270static int add_evsel_fields(struct perf_evsel *evsel, bool raw_trace, int level) 2270static int add_evsel_fields(struct perf_evsel *evsel, bool raw_trace, int level)
2271{ 2271{
2272 int ret; 2272 int ret;
2273 struct format_field *field; 2273 struct tep_format_field *field;
2274 2274
2275 field = evsel->tp_format->format.fields; 2275 field = evsel->tp_format->format.fields;
2276 while (field) { 2276 while (field) {
@@ -2305,7 +2305,7 @@ static int add_all_matching_fields(struct perf_evlist *evlist,
2305{ 2305{
2306 int ret = -ESRCH; 2306 int ret = -ESRCH;
2307 struct perf_evsel *evsel; 2307 struct perf_evsel *evsel;
2308 struct format_field *field; 2308 struct tep_format_field *field;
2309 2309
2310 evlist__for_each_entry(evlist, evsel) { 2310 evlist__for_each_entry(evlist, evsel) {
2311 if (evsel->attr.type != PERF_TYPE_TRACEPOINT) 2311 if (evsel->attr.type != PERF_TYPE_TRACEPOINT)
@@ -2327,7 +2327,7 @@ static int add_dynamic_entry(struct perf_evlist *evlist, const char *tok,
2327{ 2327{
2328 char *str, *event_name, *field_name, *opt_name; 2328 char *str, *event_name, *field_name, *opt_name;
2329 struct perf_evsel *evsel; 2329 struct perf_evsel *evsel;
2330 struct format_field *field; 2330 struct tep_format_field *field;
2331 bool raw_trace = symbol_conf.raw_trace; 2331 bool raw_trace = symbol_conf.raw_trace;
2332 int ret = 0; 2332 int ret = 0;
2333 2333
diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c
index 643cf28e1345..a4d7de1c96d1 100644
--- a/tools/perf/util/trace-event-parse.c
+++ b/tools/perf/util/trace-event-parse.c
@@ -34,7 +34,7 @@ static int get_common_field(struct scripting_context *context,
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_format *event;
37 struct format_field *field; 37 struct tep_format_field *field;
38 38
39 if (!*size) { 39 if (!*size) {
40 if (!pevent->events) 40 if (!pevent->events)
@@ -96,7 +96,7 @@ int common_pc(struct scripting_context *context)
96unsigned long long 96unsigned long long
97raw_field_value(struct tep_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 tep_format_field *field;
100 unsigned long long val; 100 unsigned long long val;
101 101
102 field = tep_find_any_field(event, name); 102 field = tep_find_any_field(event, name);