History

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

Tzvetomir Stoyanov (VMware) committed 8 years ago

Commit 2c92f981 parent 4963b0f17 files · +116 −116Browse files

Unified · Split

17 files
  1. tools/lib/traceevent/event-parse.c +41 −41
  2. tools/lib/traceevent/event-parse.h +21 −21
  3. tools/lib/traceevent/parse-filter.c +4 −4
  4. tools/lib/traceevent/plugin_kmem.c +1 −1
  5. tools/lib/traceevent/plugin_mac80211.c +1 −1
  6. tools/lib/traceevent/plugin_sched_switch.c +3 −3
  7. tools/perf/builtin-trace.c +7 −7
  8. tools/perf/tests/evsel-tp-sched.c +1 −1
  9. tools/perf/util/data-convert-bt.c +11 −11
  10. tools/perf/util/evsel.c +4 −4
  11. tools/perf/util/evsel.h +3 −3
  12. tools/perf/util/evsel_fprintf.c +1 −1
  13. tools/perf/util/python.c +2 −2
  14. tools/perf/util/scripting-engines/trace-event-perl.c +2 −2
  15. tools/perf/util/scripting-engines/trace-event-python.c +3 −3
  16. tools/perf/util/sort.c +9 −9
  17. tools/perf/util/trace-event-parse.c +2 −2
tools/lib/traceevent/event-parse.c+41−41
@@ -1299,7 +1299,7 @@ static int event_read_id(void) · 1298 unmodified lines
12991299 return -1;
13001300 }
13011301
1302−static int field_is_string(struct format_field *field)
1302+static int field_is_string(struct tep_format_field *field)
13031303 {
13041304 if ((field->flags & FIELD_IS_ARRAY) &&
13051305 (strstr(field->type, "char") || strstr(field->type, "u8") ||
@@ -1309,7 +1309,7 @@ static int field_is_string(struct format_field *field) · 3 unmodified lines
13091309 return 0;
13101310 }
13111311
1312−static int field_is_dynamic(struct format_field *field)
1312+static int field_is_dynamic(struct tep_format_field *field)
13131313 {
13141314 if (strncmp(field->type, "__data_loc", 10) == 0)
13151315 return 1;
@@ -1317,7 +1317,7 @@ static int field_is_dynamic(struct format_field *field) · 1 unmodified line
13171317 return 0;
13181318 }
13191319
1320−static int field_is_long(struct format_field *field)
1320+static int field_is_long(struct tep_format_field *field)
13211321 {
13221322 /* includes long long */
13231323 if (strstr(field->type, "long"))
@@ -1354,9 +1354,9 @@ static unsigned int type_size(const char *name) · 30 unmodified lines
13541354 return 0;
13551355 }
13561356
1357−static int event_read_fields(struct tep_event_format *event, struct format_field **fields)
1357+static int event_read_fields(struct tep_event_format *event, struct tep_format_field **fields)
13581358 {
1359− struct format_field *field = NULL;
1359+ struct tep_format_field *field = NULL;
13601360 enum event_type type;
13611361 char *token;
13621362 char *last_token;
@@ -2683,7 +2683,7 @@ out: · 1320 unmodified lines
26832683 static enum event_type
26842684 process_dynamic_array(struct tep_event_format *event, struct print_arg *arg, char **tok)
26852685 {
2686− struct format_field *field;
2686+ struct tep_format_field *field;
26872687 enum event_type type;
26882688 char *token;
26892689
@@ -2748,7 +2748,7 @@ static enum event_type · 58 unmodified lines
27482748 process_dynamic_array_len(struct tep_event_format *event, struct print_arg *arg,
27492749 char **tok)
27502750 {
2751− struct format_field *field;
2751+ struct tep_format_field *field;
27522752 enum event_type type;
27532753 char *token;
27542754
@@ -3259,10 +3259,10 @@ static int event_read_print(struct tep_event_format *event) · 504 unmodified lines
32593259 * Returns a common field from the event by the given @name.
32603260 * This only searchs the common fields and not all field.
32613261 */
3262−struct format_field *
3262+struct tep_format_field *
32633263 tep_find_common_field(struct tep_event_format *event, const char *name)
32643264 {
3265− struct format_field *format;
3265+ struct tep_format_field *format;
32663266
32673267 for (format = event->format.common_fields;
32683268 format; format = format->next) {
@@ -3281,10 +3281,10 @@ tep_find_common_field(struct tep_event_format *event, const char *name) · 12 unmodified lines
32813281 * Returns a non-common field by the given @name.
32823282 * This does not search common fields.
32833283 */
3284−struct format_field *
3284+struct tep_format_field *
32853285 tep_find_field(struct tep_event_format *event, const char *name)
32863286 {
3287− struct format_field *format;
3287+ struct tep_format_field *format;
32883288
32893289 for (format = event->format.fields;
32903290 format; format = format->next) {
@@ -3304,10 +3304,10 @@ tep_find_field(struct tep_event_format *event, const char *name) · 13 unmodified lines
33043304 * This searchs the common field names first, then
33053305 * the non-common ones if a common one was not found.
33063306 */
3307−struct format_field *
3307+struct tep_format_field *
33083308 tep_find_any_field(struct tep_event_format *event, const char *name)
33093309 {
3310− struct format_field *format;
3310+ struct tep_format_field *format;
33113311
33123312 format = tep_find_common_field(event, name);
33133313 if (format)
@@ -3353,7 +3353,7 @@ unsigned long long tep_read_number(struct tep_handle *pevent, · 39 unmodified lines
33533353 *
33543354 * Returns 0 on success, -1 otherwise.
33553355 */
3356−int tep_read_number_field(struct format_field *field, const void *data,
3356+int tep_read_number_field(struct tep_format_field *field, const void *data,
33573357 unsigned long long *value)
33583358 {
33593359 if (!field)
@@ -3375,7 +3375,7 @@ static int get_common_info(struct tep_handle *pevent, · 15 unmodified lines
33753375 const char *type, int *offset, int *size)
33763376 {
33773377 struct tep_event_format *event;
3378− struct format_field *field;
3378+ struct tep_format_field *field;
33793379
33803380 /*
33813381 * 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, · 485 unmodified lines
38673867 {
38683868 struct tep_handle *pevent = event->pevent;
38693869 struct print_flag_sym *flag;
3870− struct format_field *field;
3870+ struct tep_format_field *field;
38713871 struct printk_map *printk;
38723872 long long val, fval;
38733873 unsigned long long addr;
@@ -4008,7 +4008,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size, · 134 unmodified lines
40084008
40094009 if (arg->int_array.field->type == PRINT_DYNAMIC_ARRAY) {
40104010 unsigned long offset;
4011− struct format_field *field =
4011+ struct tep_format_field *field =
40124012 arg->int_array.field->dynarray.field;
40134013 offset = tep_read_number(pevent,
40144014 data + field->offset,
@@ -4056,7 +4056,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size, · 41 unmodified lines
40564056 int str_offset;
40574057
40584058 if (arg->string.offset == -1) {
4059− struct format_field *f;
4059+ struct tep_format_field *f;
40604060
40614061 f = tep_find_any_field(event, arg->string.string);
40624062 arg->string.offset = f->offset;
@@ -4074,7 +4074,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size, · 11 unmodified lines
40744074 int bitmask_size;
40754075
40764076 if (arg->bitmask.offset == -1) {
4077− struct format_field *f;
4077+ struct tep_format_field *f;
40784078
40794079 f = tep_find_any_field(event, arg->bitmask.bitmask);
40804080 arg->bitmask.offset = f->offset;
@@ -4215,7 +4215,7 @@ static void free_args(struct print_arg *args) · 134 unmodified lines
42154215 static struct print_arg *make_bprint_args(char *fmt, void *data, int size, struct tep_event_format *event)
42164216 {
42174217 struct tep_handle *pevent = event->pevent;
4218− struct format_field *field, *ip_field;
4218+ struct tep_format_field *field, *ip_field;
42194219 struct print_arg *args, *arg, **next;
42204220 unsigned long long ip, val;
42214221 char *ptr;
@@ -4393,7 +4393,7 @@ get_bprint_format(void *data, int size __maybe_unused, · 171 unmodified lines
43934393 {
43944394 struct tep_handle *pevent = event->pevent;
43954395 unsigned long long addr;
4396− struct format_field *field;
4396+ struct tep_format_field *field;
43974397 struct printk_map *printk;
43984398 char *format;
43994399
@@ -4788,7 +4788,7 @@ static int is_printable_array(char *p, unsigned int len) · 388 unmodified lines
47884788 }
47894789
47904790 void tep_print_field(struct trace_seq *s, void *data,
4791− struct format_field *field)
4791+ struct tep_format_field *field)
47924792 {
47934793 unsigned long long val;
47944794 unsigned int offset, len, i;
@@ -4855,7 +4855,7 @@ void tep_print_field(struct trace_seq *s, void *data, · 60 unmodified lines
48554855 void tep_print_fields(struct trace_seq *s, void *data,
48564856 int size __maybe_unused, struct tep_event_format *event)
48574857 {
4858− struct format_field *field;
4858+ struct tep_format_field *field;
48594859
48604860 field = event->format.fields;
48614861 while (field) {
@@ -5664,12 +5664,12 @@ struct tep_event_format **tep_list_events(struct tep_handle *pevent, enum event_ · 802 unmodified lines
56645664 return events;
56655665 }
56665666
5667−static struct format_field **
5667+static struct tep_format_field **
56685668 get_event_fields(const char *type, const char *name,
5669− int count, struct format_field *list)
5669+ int count, struct tep_format_field *list)
56705670 {
5671− struct format_field **fields;
5672− struct format_field *field;
5671+ struct tep_format_field **fields;
5672+ struct tep_format_field *field;
56735673 int i = 0;
56745674
56755675 fields = malloc(sizeof(*fields) * (count + 1));
@@ -5702,7 +5702,7 @@ get_event_fields(const char *type, const char *name, · 26 unmodified lines
57025702 * Returns an allocated array of fields. The last item in the array is NULL.
57035703 * The array must be freed with free().
57045704 */
5705−struct format_field **tep_event_common_fields(struct tep_event_format *event)
5705+struct tep_format_field **tep_event_common_fields(struct tep_event_format *event)
57065706 {
57075707 return get_event_fields("common", event->name,
57085708 event->format.nr_common,
@@ -5716,7 +5716,7 @@ struct format_field **tep_event_common_fields(struct tep_event_format *event) · 7 unmodified lines
57165716 * Returns an allocated array of fields. The last item in the array is NULL.
57175717 * The array must be freed with free().
57185718 */
5719−struct format_field **tep_event_fields(struct tep_event_format *event)
5719+struct tep_format_field **tep_event_fields(struct tep_event_format *event)
57205720 {
57215721 return get_event_fields("event", event->name,
57225722 event->format.nr_fields,
@@ -6090,7 +6090,7 @@ enum tep_errno __tep_parse_format(struct tep_event_format **eventp, · 367 unmodified lines
60906090 }
60916091
60926092 if (!ret && (event->flags & EVENT_FL_ISFTRACE)) {
6093− struct format_field *field;
6093+ struct tep_format_field *field;
60946094 struct print_arg *arg, **list;
60956095
60966096 /* old ftrace had no args */
@@ -6230,7 +6230,7 @@ int tep_strerror(struct tep_handle *pevent __maybe_unused, · 133 unmodified lines
62306230 return 0;
62316231 }
62326232
6233−int get_field_val(struct trace_seq *s, struct format_field *field,
6233+int get_field_val(struct trace_seq *s, struct tep_format_field *field,
62346234 const char *name, struct tep_record *record,
62356235 unsigned long long *val, int err)
62366236 {
@@ -6267,7 +6267,7 @@ void *tep_get_field_raw(struct trace_seq *s, struct tep_event_format *event, · 30 unmodified lines
62676267 const char *name, struct tep_record *record,
62686268 int *len, int err)
62696269 {
6270− struct format_field *field;
6270+ struct tep_format_field *field;
62716271 void *data = record->data;
62726272 unsigned offset;
62736273 int dummy;
@@ -6314,7 +6314,7 @@ int tep_get_field_val(struct trace_seq *s, struct tep_event_format *event, · 40 unmodified lines
63146314 const char *name, struct tep_record *record,
63156315 unsigned long long *val, int err)
63166316 {
6317− struct format_field *field;
6317+ struct tep_format_field *field;
63186318
63196319 if (!event)
63206320 return -1;
@@ -6339,7 +6339,7 @@ int tep_get_common_field_val(struct trace_seq *s, struct tep_event_format *event · 18 unmodified lines
63396339 const char *name, struct tep_record *record,
63406340 unsigned long long *val, int err)
63416341 {
6342− struct format_field *field;
6342+ struct tep_format_field *field;
63436343
63446344 if (!event)
63456345 return -1;
@@ -6364,7 +6364,7 @@ int tep_get_any_field_val(struct trace_seq *s, struct tep_event_format *event, · 18 unmodified lines
63646364 const char *name, struct tep_record *record,
63656365 unsigned long long *val, int err)
63666366 {
6367− struct format_field *field;
6367+ struct tep_format_field *field;
63686368
63696369 if (!event)
63706370 return -1;
@@ -6389,7 +6389,7 @@ int tep_print_num_field(struct trace_seq *s, const char *fmt, · 18 unmodified lines
63896389 struct tep_event_format *event, const char *name,
63906390 struct tep_record *record, int err)
63916391 {
6392− struct format_field *field = tep_find_field(event, name);
6392+ struct tep_format_field *field = tep_find_field(event, name);
63936393 unsigned long long val;
63946394
63956395 if (!field)
@@ -6421,7 +6421,7 @@ int tep_print_func_field(struct trace_seq *s, const char *fmt, · 25 unmodified lines
64216421 struct tep_event_format *event, const char *name,
64226422 struct tep_record *record, int err)
64236423 {
6424− struct format_field *field = tep_find_field(event, name);
6424+ struct tep_format_field *field = tep_find_field(event, name);
64256425 struct tep_handle *pevent = event->pevent;
64266426 unsigned long long val;
64276427 struct func_map *func;
@@ -6758,7 +6758,7 @@ void tep_ref(struct tep_handle *pevent) · 330 unmodified lines
67586758 pevent->ref_count++;
67596759 }
67606760
6761−void tep_free_format_field(struct format_field *field)
6761+void tep_free_format_field(struct tep_format_field *field)
67626762 {
67636763 free(field->type);
67646764 if (field->alias != field->name)
@@ -6767,9 +6767,9 @@ void tep_free_format_field(struct format_field *field) · 2 unmodified lines
67676767 free(field);
67686768 }
67696769
6770−static void free_format_fields(struct format_field *field)
6770+static void free_format_fields(struct tep_format_field *field)
67716771 {
6772− struct format_field *next;
6772+ struct tep_format_field *next;
67736773
67746774 while (field) {
67756775 next = field->next;
@@ -6778,7 +6778,7 @@ static void free_format_fields(struct format_field *field) · 2 unmodified lines
67786778 }
67796779 }
67806780
6781−static void free_formats(struct format *format)
6781+static void free_formats(struct tep_format *format)
67826782 {
67836783 free_format_fields(format->common_fields);
67846784 free_format_fields(format->fields);
tools/lib/traceevent/event-parse.h+21−21
@@ -141,8 +141,8 @@ enum format_flags { · 140 unmodified lines
141141 FIELD_IS_SYMBOLIC = 128,
142142 };
143143
144−struct format_field {
145− struct format_field *next;
144+struct tep_format_field {
145+ struct tep_format_field *next;
146146 struct tep_event_format *event;
147147 char *type;
148148 char *name;
@@ -154,11 +154,11 @@ struct format_field { · 5 unmodified lines
154154 unsigned long flags;
155155 };
156156
157−struct format {
157+struct tep_format {
158158 int nr_common;
159159 int nr_fields;
160− struct format_field *common_fields;
161− struct format_field *fields;
160+ struct tep_format_field *common_fields;
161+ struct tep_format_field *fields;
162162 };
163163
164164 struct print_arg_atom {
@@ -177,7 +177,7 @@ struct print_arg_bitmask { · 12 unmodified lines
177177
178178 struct print_arg_field {
179179 char *name;
180− struct format_field *field;
180+ struct tep_format_field *field;
181181 };
182182
183183 struct print_flag_sym {
@@ -214,7 +214,7 @@ struct print_arg_int_array { · 30 unmodified lines
214214 };
215215
216216 struct print_arg_dynarray {
217− struct format_field *field;
217+ struct tep_format_field *field;
218218 struct print_arg *index;
219219 };
220220
@@ -282,7 +282,7 @@ struct tep_event_format { · 61 unmodified lines
282282 char *name;
283283 int id;
284284 int flags;
285− struct format format;
285+ struct tep_format format;
286286 struct print_fmt print_fmt;
287287 char *system;
288288 tep_event_handler_func handler;
@@ -477,9 +477,9 @@ struct tep_handle { · 188 unmodified lines
477477
478478 int flags;
479479
480− struct format_field *bprint_ip_field;
481− struct format_field *bprint_fmt_field;
482− struct format_field *bprint_buf_field;
480+ struct tep_format_field *bprint_ip_field;
481+ struct tep_format_field *bprint_fmt_field;
482+ struct tep_format_field *bprint_buf_field;
483483
484484 struct event_handler *handlers;
485485 struct tep_function_handler *func_handlers;
@@ -607,7 +607,7 @@ enum tep_errno tep_parse_format(struct tep_handle *pevent, · 121 unmodified lines
607607 const char *buf,
608608 unsigned long size, const char *sys);
609609 void tep_free_format(struct tep_event_format *event);
610−void tep_free_format_field(struct format_field *field);
610+void tep_free_format_field(struct tep_format_field *field);
611611
612612 void *tep_get_field_raw(struct trace_seq *s, struct tep_event_format *event,
613613 const char *name, struct tep_record *record,
@@ -644,15 +644,15 @@ int tep_register_print_function(struct tep_handle *pevent, · 30 unmodified lines
644644 int tep_unregister_print_function(struct tep_handle *pevent,
645645 tep_func_handler func, char *name);
646646
647−struct format_field *tep_find_common_field(struct tep_event_format *event, const char *name);
648−struct format_field *tep_find_field(struct tep_event_format *event, const char *name);
649−struct format_field *tep_find_any_field(struct tep_event_format *event, const char *name);
647+struct tep_format_field *tep_find_common_field(struct tep_event_format *event, const char *name);
648+struct tep_format_field *tep_find_field(struct tep_event_format *event, const char *name);
649+struct tep_format_field *tep_find_any_field(struct tep_event_format *event, const char *name);
650650
651651 const char *tep_find_function(struct tep_handle *pevent, unsigned long long addr);
652652 unsigned long long
653653 tep_find_function_address(struct tep_handle *pevent, unsigned long long addr);
654654 unsigned long long tep_read_number(struct tep_handle *pevent, const void *ptr, int size);
655−int tep_read_number_field(struct format_field *field, const void *data,
655+int tep_read_number_field(struct tep_format_field *field, const void *data,
656656 unsigned long long *value);
657657
658658 struct 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 · 18 unmodified lines
677677 int tep_cmdline_pid(struct tep_handle *pevent, struct cmdline *cmdline);
678678
679679 void tep_print_field(struct trace_seq *s, void *data,
680− struct format_field *field);
680+ struct tep_format_field *field);
681681 void tep_print_fields(struct trace_seq *s, void *data,
682682 int size __maybe_unused, struct tep_event_format *event);
683683 void 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, · 2 unmodified lines
686686 char *buf, size_t buflen);
687687
688688 struct tep_event_format **tep_list_events(struct tep_handle *pevent, enum event_sort_type);
689−struct format_field **tep_event_common_fields(struct tep_event_format *event);
690−struct format_field **tep_event_fields(struct tep_event_format *event);
689+struct tep_format_field **tep_event_common_fields(struct tep_event_format *event);
690+struct tep_format_field **tep_event_fields(struct tep_event_format *event);
691691
692692 static inline int tep_get_cpus(struct tep_handle *pevent)
693693 {
@@ -832,7 +832,7 @@ struct filter_arg_boolean { · 138 unmodified lines
832832 };
833833
834834 struct filter_arg_field {
835− struct format_field *field;
835+ struct tep_format_field *field;
836836 };
837837
838838 struct filter_arg_value {
@@ -863,7 +863,7 @@ struct filter_arg_num { · 24 unmodified lines
863863
864864 struct filter_arg_str {
865865 enum filter_cmp_type type;
866− struct format_field *field;
866+ struct tep_format_field *field;
867867 char *val;
868868 char *buffer;
869869 regex_t reg;
tools/lib/traceevent/parse-filter.c+4−4
@@ -16,11 +16,11 @@ · 15 unmodified lines
1616 #define COMM "COMM"
1717 #define CPU "CPU"
1818
19−static struct format_field comm = {
19+static struct tep_format_field comm = {
2020 .name = "COMM",
2121 };
2222
23−static struct format_field cpu = {
23+static struct tep_format_field cpu = {
2424 .name = "CPU",
2525 };
2626
@@ -336,7 +336,7 @@ static enum tep_errno · 309 unmodified lines
336336 create_arg_item(struct tep_event_format *event, const char *token,
337337 enum event_type type, struct filter_arg **parg, char *error_str)
338338 {
339− struct format_field *field;
339+ struct tep_format_field *field;
340340 struct filter_arg *arg;
341341
342342 arg = allocate_arg();
@@ -1698,7 +1698,7 @@ get_comm(struct tep_event_format *event, struct tep_record *record) · 1355 unmodified lines
16981698
16991699 static unsigned long long
17001700 get_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)
17021702 {
17031703 unsigned long long val;
17041704
tools/lib/traceevent/plugin_kmem.c+1−1
@@ -27,7 +27,7 @@ · 26 unmodified lines
2727 static int call_site_handler(struct trace_seq *s, struct tep_record *record,
2828 struct tep_event_format *event, void *context)
2929 {
30− struct format_field *field;
30+ struct tep_format_field *field;
3131 unsigned long long val, addr;
3232 void *data = record->data;
3333 const char *func;
tools/lib/traceevent/plugin_mac80211.c+1−1
@@ -29,7 +29,7 @@ · 28 unmodified lines
2929 static void print_string(struct trace_seq *s, struct tep_event_format *event,
3030 const char *name, const void *data)
3131 {
32− struct format_field *f = tep_find_field(event, name);
32+ struct tep_format_field *f = tep_find_field(event, name);
3333 int offset;
3434 int length;
3535
tools/lib/traceevent/plugin_sched_switch.c+3−3
@@ -45,7 +45,7 @@ static void write_state(struct trace_seq *s, int val) · 44 unmodified lines
4545 trace_seq_putc(s, 'R');
4646 }
4747
48−static void write_and_save_comm(struct format_field *field,
48+static void write_and_save_comm(struct tep_format_field *field,
4949 struct tep_record *record,
5050 struct trace_seq *s, int pid)
5151 {
@@ -69,7 +69,7 @@ static int sched_wakeup_handler(struct trace_seq *s, · 17 unmodified lines
6969 struct tep_record *record,
7070 struct tep_event_format *event, void *context)
7171 {
72− struct format_field *field;
72+ struct tep_format_field *field;
7373 unsigned long long val;
7474
7575 if (tep_get_field_val(s, event, "pid", record, &val, 1))
@@ -98,7 +98,7 @@ static int sched_switch_handler(struct trace_seq *s, · 22 unmodified lines
9898 struct tep_record *record,
9999 struct tep_event_format *event, void *context)
100100 {
101− struct format_field *field;
101+ struct tep_format_field *field;
102102 unsigned long long val;
103103
104104 if (tep_get_field_val(s, event, "prev_pid", record, &val, 1))
tools/perf/builtin-trace.c+7−7
@@ -181,7 +181,7 @@ static int __tp_field__init_uint(struct tp_field *field, int size, int offset, b · 180 unmodified lines
181181 return 0;
182182 }
183183
184−static int tp_field__init_uint(struct tp_field *field, struct format_field *format_field, bool needs_swap)
184+static int tp_field__init_uint(struct tp_field *field, struct tep_format_field *format_field, bool needs_swap)
185185 {
186186 return __tp_field__init_uint(field, format_field->size, format_field->offset, needs_swap);
187187 }
@@ -198,7 +198,7 @@ static int __tp_field__init_ptr(struct tp_field *field, int offset) · 10 unmodified lines
198198 return 0;
199199 }
200200
201−static int tp_field__init_ptr(struct tp_field *field, struct format_field *format_field)
201+static int tp_field__init_ptr(struct tp_field *field, struct tep_format_field *format_field)
202202 {
203203 return __tp_field__init_ptr(field, format_field->offset);
204204 }
@@ -214,7 +214,7 @@ static int perf_evsel__init_tp_uint_field(struct perf_evsel *evsel, · 9 unmodified lines
214214 struct tp_field *field,
215215 const char *name)
216216 {
217− struct format_field *format_field = perf_evsel__field(evsel, name);
217+ struct tep_format_field *format_field = perf_evsel__field(evsel, name);
218218
219219 if (format_field == NULL)
220220 return -1;
@@ -230,7 +230,7 @@ static int perf_evsel__init_tp_ptr_field(struct perf_evsel *evsel, · 9 unmodified lines
230230 struct tp_field *field,
231231 const char *name)
232232 {
233− struct format_field *format_field = perf_evsel__field(evsel, name);
233+ struct tep_format_field *format_field = perf_evsel__field(evsel, name);
234234
235235 if (format_field == NULL)
236236 return -1;
@@ -867,7 +867,7 @@ struct syscall { · 630 unmodified lines
867867 int args_size;
868868 bool is_exit;
869869 bool is_open;
870− struct format_field *args;
870+ struct tep_format_field *args;
871871 const char *name;
872872 struct syscall_fmt *fmt;
873873 struct syscall_arg_fmt *arg_fmt;
@@ -1279,7 +1279,7 @@ static int syscall__alloc_arg_fmts(struct syscall *sc, int nr_args) · 405 unmodified lines
12791279
12801280 static int syscall__set_arg_fmts(struct syscall *sc)
12811281 {
1282− struct format_field *field, *last_field = NULL;
1282+ struct tep_format_field *field, *last_field = NULL;
12831283 int idx = 0, len;
12841284
12851285 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, · 239 unmodified lines
15251525 ttrace->ret_scnprintf = NULL;
15261526
15271527 if (sc->args != NULL) {
1528− struct format_field *field;
1528+ struct tep_format_field *field;
15291529
15301530 for (field = sc->args; field;
15311531 field = field->next, ++arg.idx, bit <<= 1) {
tools/perf/tests/evsel-tp-sched.c+1−1
@@ -8,7 +8,7 @@ · 7 unmodified lines
88 static int perf_evsel__test_field(struct perf_evsel *evsel, const char *name,
99 int size, bool should_be_signed)
1010 {
11− struct format_field *field = perf_evsel__field(evsel, name);
11+ struct tep_format_field *field = perf_evsel__field(evsel, name);
1212 int is_signed;
1313 int ret = 0;
1414
tools/perf/util/data-convert-bt.c+11−11
@@ -182,7 +182,7 @@ err_put_field: · 181 unmodified lines
182182 }
183183
184184 static struct bt_ctf_field_type*
185−get_tracepoint_field_type(struct ctf_writer *cw, struct format_field *field)
185+get_tracepoint_field_type(struct ctf_writer *cw, struct tep_format_field *field)
186186 {
187187 unsigned long flags = field->flags;
188188
@@ -287,7 +287,7 @@ static int add_tracepoint_field_value(struct ctf_writer *cw, · 98 unmodified lines
287287 struct bt_ctf_event_class *event_class,
288288 struct bt_ctf_event *event,
289289 struct perf_sample *sample,
290− struct format_field *fmtf)
290+ struct tep_format_field *fmtf)
291291 {
292292 struct bt_ctf_field_type *type;
293293 struct bt_ctf_field *array_field;
@@ -396,10 +396,10 @@ err_put_field: · 102 unmodified lines
396396 static int add_tracepoint_fields_values(struct ctf_writer *cw,
397397 struct bt_ctf_event_class *event_class,
398398 struct bt_ctf_event *event,
399− struct format_field *fields,
399+ struct tep_format_field *fields,
400400 struct perf_sample *sample)
401401 {
402− struct format_field *field;
402+ struct tep_format_field *field;
403403 int ret;
404404
405405 for (field = fields; field; field = field->next) {
@@ -417,8 +417,8 @@ static int add_tracepoint_values(struct ctf_writer *cw, · 11 unmodified lines
417417 struct perf_evsel *evsel,
418418 struct perf_sample *sample)
419419 {
420− struct format_field *common_fields = evsel->tp_format->format.common_fields;
421− struct format_field *fields = evsel->tp_format->format.fields;
420+ struct tep_format_field *common_fields = evsel->tp_format->format.common_fields;
421+ struct tep_format_field *fields = evsel->tp_format->format.fields;
422422 int ret;
423423
424424 ret = add_tracepoint_fields_values(cw, event_class, event,
@@ -970,7 +970,7 @@ out: · 545 unmodified lines
970970
971971 static int event_class_add_field(struct bt_ctf_event_class *event_class,
972972 struct bt_ctf_field_type *type,
973− struct format_field *field)
973+ struct tep_format_field *field)
974974 {
975975 struct bt_ctf_field_type *t = NULL;
976976 char *name;
@@ -1009,10 +1009,10 @@ static int event_class_add_field(struct bt_ctf_event_class *event_class, · 32 unmodified lines
10091009 }
10101010
10111011 static int add_tracepoint_fields_types(struct ctf_writer *cw,
1012− struct format_field *fields,
1012+ struct tep_format_field *fields,
10131013 struct bt_ctf_event_class *event_class)
10141014 {
1015− struct format_field *field;
1015+ struct tep_format_field *field;
10161016 int ret;
10171017
10181018 for (field = fields; field; field = field->next) {
@@ -1055,8 +1055,8 @@ static int add_tracepoint_types(struct ctf_writer *cw, · 36 unmodified lines
10551055 struct perf_evsel *evsel,
10561056 struct bt_ctf_event_class *class)
10571057 {
1058− struct format_field *common_fields = evsel->tp_format->format.common_fields;
1059− struct format_field *fields = evsel->tp_format->format.fields;
1058+ struct tep_format_field *common_fields = evsel->tp_format->format.common_fields;
1059+ struct tep_format_field *fields = evsel->tp_format->format.fields;
10601060 int ret;
10611061
10621062 ret = add_tracepoint_fields_types(cw, common_fields, class);
tools/perf/util/evsel.c+4−4
@@ -2682,7 +2682,7 @@ int perf_event__synthesize_sample(union perf_event *event, u64 type, · 2681 unmodified lines
26822682 return 0;
26832683 }
26842684
2685−struct format_field *perf_evsel__field(struct perf_evsel *evsel, const char *name)
2685+struct tep_format_field *perf_evsel__field(struct perf_evsel *evsel, const char *name)
26862686 {
26872687 return tep_find_field(evsel->tp_format, name);
26882688 }
@@ -2690,7 +2690,7 @@ struct format_field *perf_evsel__field(struct perf_evsel *evsel, const char *nam · 1 unmodified line
26902690 void *perf_evsel__rawptr(struct perf_evsel *evsel, struct perf_sample *sample,
26912691 const char *name)
26922692 {
2693− struct format_field *field = perf_evsel__field(evsel, name);
2693+ struct tep_format_field *field = perf_evsel__field(evsel, name);
26942694 int offset;
26952695
26962696 if (!field)
@@ -2706,7 +2706,7 @@ void *perf_evsel__rawptr(struct perf_evsel *evsel, struct perf_sample *sample, · 9 unmodified lines
27062706 return sample->raw_data + offset;
27072707 }
27082708
2709−u64 format_field__intval(struct format_field *field, struct perf_sample *sample,
2709+u64 format_field__intval(struct tep_format_field *field, struct perf_sample *sample,
27102710 bool needs_swap)
27112711 {
27122712 u64 value;
@@ -2748,7 +2748,7 @@ u64 format_field__intval(struct format_field *field, struct perf_sample *sample, · 35 unmodified lines
27482748 u64 perf_evsel__intval(struct perf_evsel *evsel, struct perf_sample *sample,
27492749 const char *name)
27502750 {
2751− struct format_field *field = perf_evsel__field(evsel, name);
2751+ struct tep_format_field *field = perf_evsel__field(evsel, name);
27522752
27532753 if (!field)
27542754 return 0;
tools/perf/util/evsel.h+3−3
@@ -296,11 +296,11 @@ static inline char *perf_evsel__strval(struct perf_evsel *evsel, · 295 unmodified lines
296296 return perf_evsel__rawptr(evsel, sample, name);
297297 }
298298
299−struct format_field;
299+struct tep_format_field;
300300
301−u64 format_field__intval(struct format_field *field, struct perf_sample *sample, bool needs_swap);
301+u64 format_field__intval(struct tep_format_field *field, struct perf_sample *sample, bool needs_swap);
302302
303−struct format_field *perf_evsel__field(struct perf_evsel *evsel, const char *name);
303+struct tep_format_field *perf_evsel__field(struct perf_evsel *evsel, const char *name);
304304
305305 #define perf_evsel__match(evsel, t, c) \
306306 (evsel->attr.type == PERF_TYPE_##t && \
tools/perf/util/evsel_fprintf.c+1−1
@@ -73,7 +73,7 @@ int perf_evsel__fprintf(struct perf_evsel *evsel, · 72 unmodified lines
7373 }
7474
7575 if (details->trace_fields) {
76− struct format_field *field;
76+ struct tep_format_field *field;
7777
7878 if (evsel->attr.type != PERF_TYPE_TRACEPOINT) {
7979 printed += comma_fprintf(fp, &first, " (not a tracepoint)");
tools/perf/util/python.c+2−2
@@ -340,7 +340,7 @@ static bool is_tracepoint(struct pyrf_event *pevent) · 339 unmodified lines
340340 }
341341
342342 static PyObject*
343−tracepoint_field(struct pyrf_event *pe, struct format_field *field)
343+tracepoint_field(struct pyrf_event *pe, struct tep_format_field *field)
344344 {
345345 struct tep_handle *pevent = field->event->pevent;
346346 void *data = pe->sample.raw_data;
@@ -383,7 +383,7 @@ get_tracepoint_field(struct pyrf_event *pevent, PyObject *attr_name) · 36 unmodified lines
383383 {
384384 const char *str = _PyUnicode_AsString(PyObject_Str(attr_name));
385385 struct perf_evsel *evsel = pevent->evsel;
386− struct format_field *field;
386+ struct tep_format_field *field;
387387
388388 if (!evsel->tp_format) {
389389 struct tep_event_format *tp_format;
tools/perf/util/scripting-engines/trace-event-perl.c+2−2
@@ -339,7 +339,7 @@ static void perl_process_tracepoint(struct perf_sample *sample, · 338 unmodified lines
339339 {
340340 struct thread *thread = al->thread;
341341 struct tep_event_format *event = evsel->tp_format;
342− struct format_field *field;
342+ struct tep_format_field *field;
343343 static char handler[256];
344344 unsigned long long val;
345345 unsigned long s, ns;
@@ -538,7 +538,7 @@ static int perl_stop_script(void) · 192 unmodified lines
538538 static int perl_generate_script(struct tep_handle *pevent, const char *outfile)
539539 {
540540 struct tep_event_format *event = NULL;
541− struct format_field *f;
541+ struct tep_format_field *f;
542542 char fname[PATH_MAX];
543543 int not_first, count;
544544 FILE *ofp;
tools/perf/util/scripting-engines/trace-event-python.c+3−3
@@ -333,7 +333,7 @@ static void define_event_symbols(struct tep_event_format *event, · 332 unmodified lines
333333 }
334334
335335 static 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)
337337 {
338338 bool is_array = field->flags & FIELD_IS_ARRAY;
339339 PyObject *obj = NULL, *list = NULL;
@@ -794,7 +794,7 @@ static void python_process_tracepoint(struct perf_sample *sample, · 454 unmodified lines
794794 PyObject *handler, *context, *t, *obj = NULL, *callchain;
795795 PyObject *dict = NULL, *all_entries_dict = NULL;
796796 static char handler_name[256];
797− struct format_field *field;
797+ struct tep_format_field *field;
798798 unsigned long s, ns;
799799 unsigned n = 0;
800800 int pid;
@@ -1591,7 +1591,7 @@ static int python_stop_script(void) · 790 unmodified lines
15911591 static int python_generate_script(struct tep_handle *pevent, const char *outfile)
15921592 {
15931593 struct tep_event_format *event = NULL;
1594− struct format_field *f;
1594+ struct tep_format_field *f;
15951595 char fname[PATH_MAX];
15961596 int not_first, count;
15971597 FILE *ofp;
tools/perf/util/sort.c+9−9
@@ -1884,7 +1884,7 @@ static int __sort_dimension__add_hpp_output(struct sort_dimension *sd, · 1883 unmodified lines
18841884 struct hpp_dynamic_entry {
18851885 struct perf_hpp_fmt hpp;
18861886 struct perf_evsel *evsel;
1887− struct format_field *field;
1887+ struct tep_format_field *field;
18881888 unsigned dynamic_len;
18891889 bool raw_trace;
18901890 };
@@ -1915,7 +1915,7 @@ static void update_dynamic_len(struct hpp_dynamic_entry *hde, · 24 unmodified lines
19151915 struct hist_entry *he)
19161916 {
19171917 char *str, *pos;
1918− struct format_field *field = hde->field;
1918+ struct tep_format_field *field = hde->field;
19191919 size_t namelen;
19201920 bool last = false;
19211921
@@ -2000,7 +2000,7 @@ static int __sort__hde_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, · 78 unmodified lines
20002000 struct hpp_dynamic_entry *hde;
20012001 size_t len = fmt->user_len;
20022002 char *str, *pos;
2003− struct format_field *field;
2003+ struct tep_format_field *field;
20042004 size_t namelen;
20052005 bool last = false;
20062006 int ret;
@@ -2060,7 +2060,7 @@ static int64_t __sort__hde_cmp(struct perf_hpp_fmt *fmt, · 53 unmodified lines
20602060 struct hist_entry *a, struct hist_entry *b)
20612061 {
20622062 struct hpp_dynamic_entry *hde;
2063− struct format_field *field;
2063+ struct tep_format_field *field;
20642064 unsigned offset, size;
20652065
20662066 hde = container_of(fmt, struct hpp_dynamic_entry, hpp);
@@ -2117,7 +2117,7 @@ static void hde_free(struct perf_hpp_fmt *fmt) · 50 unmodified lines
21172117 }
21182118
21192119 static 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,
21212121 int level)
21222122 {
21232123 struct hpp_dynamic_entry *hde;
@@ -2252,7 +2252,7 @@ static struct perf_evsel *find_evsel(struct perf_evlist *evlist, char *event_nam · 128 unmodified lines
22522252 }
22532253
22542254 static int __dynamic_dimension__add(struct perf_evsel *evsel,
2255− struct format_field *field,
2255+ struct tep_format_field *field,
22562256 bool raw_trace, int level)
22572257 {
22582258 struct hpp_dynamic_entry *hde;
@@ -2270,7 +2270,7 @@ static int __dynamic_dimension__add(struct perf_evsel *evsel, · 11 unmodified lines
22702270 static int add_evsel_fields(struct perf_evsel *evsel, bool raw_trace, int level)
22712271 {
22722272 int ret;
2273− struct format_field *field;
2273+ struct tep_format_field *field;
22742274
22752275 field = evsel->tp_format->format.fields;
22762276 while (field) {
@@ -2305,7 +2305,7 @@ static int add_all_matching_fields(struct perf_evlist *evlist, · 28 unmodified lines
23052305 {
23062306 int ret = -ESRCH;
23072307 struct perf_evsel *evsel;
2308− struct format_field *field;
2308+ struct tep_format_field *field;
23092309
23102310 evlist__for_each_entry(evlist, evsel) {
23112311 if (evsel->attr.type != PERF_TYPE_TRACEPOINT)
@@ -2327,7 +2327,7 @@ static int add_dynamic_entry(struct perf_evlist *evlist, const char *tok, · 15 unmodified lines
23272327 {
23282328 char *str, *event_name, *field_name, *opt_name;
23292329 struct perf_evsel *evsel;
2330− struct format_field *field;
2330+ struct tep_format_field *field;
23312331 bool raw_trace = symbol_conf.raw_trace;
23322332 int ret = 0;
23332333
tools/perf/util/trace-event-parse.c+2−2
@@ -34,7 +34,7 @@ static int get_common_field(struct scripting_context *context, · 33 unmodified lines
3434 {
3535 struct tep_handle *pevent = context->pevent;
3636 struct tep_event_format *event;
37− struct format_field *field;
37+ struct tep_format_field *field;
3838
3939 if (!*size) {
4040 if (!pevent->events)
@@ -96,7 +96,7 @@ int common_pc(struct scripting_context *context) · 55 unmodified lines
9696 unsigned long long
9797 raw_field_value(struct tep_event_format *event, const char *name, void *data)
9898 {
99− struct format_field *field;
99+ struct tep_format_field *field;
100100 unsigned long long val;
101101
102102 field = tep_find_any_field(event, name);