Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Tzvetomir Stoyanov (VMware) and committed by
Arnaldo Carvalho de Melo
2c92f982 4963b0f8

+116 -116
+41 -41
tools/lib/traceevent/event-parse.c
··· 1299 1299 return -1; 1300 1300 } 1301 1301 1302 - static int field_is_string(struct format_field *field) 1302 + static int field_is_string(struct tep_format_field *field) 1303 1303 { 1304 1304 if ((field->flags & FIELD_IS_ARRAY) && 1305 1305 (strstr(field->type, "char") || strstr(field->type, "u8") || ··· 1309 1309 return 0; 1310 1310 } 1311 1311 1312 - static int field_is_dynamic(struct format_field *field) 1312 + static int field_is_dynamic(struct tep_format_field *field) 1313 1313 { 1314 1314 if (strncmp(field->type, "__data_loc", 10) == 0) 1315 1315 return 1; ··· 1317 1317 return 0; 1318 1318 } 1319 1319 1320 - static int field_is_long(struct format_field *field) 1320 + static int field_is_long(struct tep_format_field *field) 1321 1321 { 1322 1322 /* includes long long */ 1323 1323 if (strstr(field->type, "long")) ··· 1354 1354 return 0; 1355 1355 } 1356 1356 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) 1358 1358 { 1359 - struct format_field *field = NULL; 1359 + struct tep_format_field *field = NULL; 1360 1360 enum event_type type; 1361 1361 char *token; 1362 1362 char *last_token; ··· 2683 2683 static enum event_type 2684 2684 process_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 2687 enum event_type type; 2688 2688 char *token; 2689 2689 ··· 2748 2748 process_dynamic_array_len(struct tep_event_format *event, struct print_arg *arg, 2749 2749 char **tok) 2750 2750 { 2751 - struct format_field *field; 2751 + struct tep_format_field *field; 2752 2752 enum event_type type; 2753 2753 char *token; 2754 2754 ··· 3259 3259 * Returns a common field from the event by the given @name. 3260 3260 * This only searchs the common fields and not all field. 3261 3261 */ 3262 - struct format_field * 3262 + struct tep_format_field * 3263 3263 tep_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 3267 for (format = event->format.common_fields; 3268 3268 format; format = format->next) { ··· 3281 3281 * Returns a non-common field by the given @name. 3282 3282 * This does not search common fields. 3283 3283 */ 3284 - struct format_field * 3284 + struct tep_format_field * 3285 3285 tep_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 3289 for (format = event->format.fields; 3290 3290 format; format = format->next) { ··· 3304 3304 * This searchs the common field names first, then 3305 3305 * the non-common ones if a common one was not found. 3306 3306 */ 3307 - struct format_field * 3307 + struct tep_format_field * 3308 3308 tep_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 3312 format = tep_find_common_field(event, name); 3313 3313 if (format) ··· 3353 3353 * 3354 3354 * Returns 0 on success, -1 otherwise. 3355 3355 */ 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, 3357 3357 unsigned long long *value) 3358 3358 { 3359 3359 if (!field) ··· 3375 3375 const char *type, int *offset, int *size) 3376 3376 { 3377 3377 struct tep_event_format *event; 3378 - struct format_field *field; 3378 + struct tep_format_field *field; 3379 3379 3380 3380 /* 3381 3381 * All events should have the same common elements. ··· 3867 3867 { 3868 3868 struct tep_handle *pevent = event->pevent; 3869 3869 struct print_flag_sym *flag; 3870 - struct format_field *field; 3870 + struct tep_format_field *field; 3871 3871 struct printk_map *printk; 3872 3872 long long val, fval; 3873 3873 unsigned long long addr; ··· 4008 4008 4009 4009 if (arg->int_array.field->type == PRINT_DYNAMIC_ARRAY) { 4010 4010 unsigned long offset; 4011 - struct format_field *field = 4011 + struct tep_format_field *field = 4012 4012 arg->int_array.field->dynarray.field; 4013 4013 offset = tep_read_number(pevent, 4014 4014 data + field->offset, ··· 4056 4056 int str_offset; 4057 4057 4058 4058 if (arg->string.offset == -1) { 4059 - struct format_field *f; 4059 + struct tep_format_field *f; 4060 4060 4061 4061 f = tep_find_any_field(event, arg->string.string); 4062 4062 arg->string.offset = f->offset; ··· 4074 4074 int bitmask_size; 4075 4075 4076 4076 if (arg->bitmask.offset == -1) { 4077 - struct format_field *f; 4077 + struct tep_format_field *f; 4078 4078 4079 4079 f = tep_find_any_field(event, arg->bitmask.bitmask); 4080 4080 arg->bitmask.offset = f->offset; ··· 4215 4215 static struct print_arg *make_bprint_args(char *fmt, void *data, int size, struct tep_event_format *event) 4216 4216 { 4217 4217 struct tep_handle *pevent = event->pevent; 4218 - struct format_field *field, *ip_field; 4218 + struct tep_format_field *field, *ip_field; 4219 4219 struct print_arg *args, *arg, **next; 4220 4220 unsigned long long ip, val; 4221 4221 char *ptr; ··· 4393 4393 { 4394 4394 struct tep_handle *pevent = event->pevent; 4395 4395 unsigned long long addr; 4396 - struct format_field *field; 4396 + struct tep_format_field *field; 4397 4397 struct printk_map *printk; 4398 4398 char *format; 4399 4399 ··· 4788 4788 } 4789 4789 4790 4790 void tep_print_field(struct trace_seq *s, void *data, 4791 - struct format_field *field) 4791 + struct tep_format_field *field) 4792 4792 { 4793 4793 unsigned long long val; 4794 4794 unsigned int offset, len, i; ··· 4855 4855 void tep_print_fields(struct trace_seq *s, void *data, 4856 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 4860 field = event->format.fields; 4861 4861 while (field) { ··· 5664 5664 return events; 5665 5665 } 5666 5666 5667 - static struct format_field ** 5667 + static struct tep_format_field ** 5668 5668 get_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; 5672 - struct format_field *field; 5671 + struct tep_format_field **fields; 5672 + struct tep_format_field *field; 5673 5673 int i = 0; 5674 5674 5675 5675 fields = malloc(sizeof(*fields) * (count + 1)); ··· 5702 5702 * Returns an allocated array of fields. The last item in the array is NULL. 5703 5703 * The array must be freed with free(). 5704 5704 */ 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) 5706 5706 { 5707 5707 return get_event_fields("common", event->name, 5708 5708 event->format.nr_common, ··· 5716 5716 * Returns an allocated array of fields. The last item in the array is NULL. 5717 5717 * The array must be freed with free(). 5718 5718 */ 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) 5720 5720 { 5721 5721 return get_event_fields("event", event->name, 5722 5722 event->format.nr_fields, ··· 6090 6090 } 6091 6091 6092 6092 if (!ret && (event->flags & EVENT_FL_ISFTRACE)) { 6093 - struct format_field *field; 6093 + struct tep_format_field *field; 6094 6094 struct print_arg *arg, **list; 6095 6095 6096 6096 /* old ftrace had no args */ ··· 6230 6230 return 0; 6231 6231 } 6232 6232 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, 6234 6234 const char *name, struct tep_record *record, 6235 6235 unsigned long long *val, int err) 6236 6236 { ··· 6267 6267 const char *name, struct tep_record *record, 6268 6268 int *len, int err) 6269 6269 { 6270 - struct format_field *field; 6270 + struct tep_format_field *field; 6271 6271 void *data = record->data; 6272 6272 unsigned offset; 6273 6273 int dummy; ··· 6314 6314 const char *name, struct tep_record *record, 6315 6315 unsigned long long *val, int err) 6316 6316 { 6317 - struct format_field *field; 6317 + struct tep_format_field *field; 6318 6318 6319 6319 if (!event) 6320 6320 return -1; ··· 6339 6339 const char *name, struct tep_record *record, 6340 6340 unsigned long long *val, int err) 6341 6341 { 6342 - struct format_field *field; 6342 + struct tep_format_field *field; 6343 6343 6344 6344 if (!event) 6345 6345 return -1; ··· 6364 6364 const char *name, struct tep_record *record, 6365 6365 unsigned long long *val, int err) 6366 6366 { 6367 - struct format_field *field; 6367 + struct tep_format_field *field; 6368 6368 6369 6369 if (!event) 6370 6370 return -1; ··· 6389 6389 struct tep_event_format *event, const char *name, 6390 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 6393 unsigned long long val; 6394 6394 6395 6395 if (!field) ··· 6421 6421 struct tep_event_format *event, const char *name, 6422 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 6425 struct tep_handle *pevent = event->pevent; 6426 6426 unsigned long long val; 6427 6427 struct func_map *func; ··· 6758 6758 pevent->ref_count++; 6759 6759 } 6760 6760 6761 - void tep_free_format_field(struct format_field *field) 6761 + void tep_free_format_field(struct tep_format_field *field) 6762 6762 { 6763 6763 free(field->type); 6764 6764 if (field->alias != field->name) ··· 6767 6767 free(field); 6768 6768 } 6769 6769 6770 - static void free_format_fields(struct format_field *field) 6770 + static 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 6774 while (field) { 6775 6775 next = field->next; ··· 6778 6778 } 6779 6779 } 6780 6780 6781 - static void free_formats(struct format *format) 6781 + static void free_formats(struct tep_format *format) 6782 6782 { 6783 6783 free_format_fields(format->common_fields); 6784 6784 free_format_fields(format->fields);
+21 -21
tools/lib/traceevent/event-parse.h
··· 141 141 FIELD_IS_SYMBOLIC = 128, 142 142 }; 143 143 144 - struct format_field { 145 - struct format_field *next; 144 + struct tep_format_field { 145 + struct tep_format_field *next; 146 146 struct tep_event_format *event; 147 147 char *type; 148 148 char *name; ··· 154 154 unsigned long flags; 155 155 }; 156 156 157 - struct format { 157 + struct tep_format { 158 158 int nr_common; 159 159 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; 162 162 }; 163 163 164 164 struct print_arg_atom { ··· 177 177 178 178 struct print_arg_field { 179 179 char *name; 180 - struct format_field *field; 180 + struct tep_format_field *field; 181 181 }; 182 182 183 183 struct print_flag_sym { ··· 214 214 }; 215 215 216 216 struct print_arg_dynarray { 217 - struct format_field *field; 217 + struct tep_format_field *field; 218 218 struct print_arg *index; 219 219 }; 220 220 ··· 282 282 char *name; 283 283 int id; 284 284 int flags; 285 - struct format format; 285 + struct tep_format format; 286 286 struct print_fmt print_fmt; 287 287 char *system; 288 288 tep_event_handler_func handler; ··· 477 477 478 478 int flags; 479 479 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; 483 483 484 484 struct event_handler *handlers; 485 485 struct tep_function_handler *func_handlers; ··· 607 607 const char *buf, 608 608 unsigned long size, const char *sys); 609 609 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); 611 611 612 612 void *tep_get_field_raw(struct trace_seq *s, struct tep_event_format *event, 613 613 const char *name, struct tep_record *record, ··· 644 644 int tep_unregister_print_function(struct tep_handle *pevent, 645 645 tep_func_handler func, char *name); 646 646 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); 650 650 651 651 const char *tep_find_function(struct tep_handle *pevent, unsigned long long addr); 652 652 unsigned long long 653 653 tep_find_function_address(struct tep_handle *pevent, unsigned long long addr); 654 654 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, 656 656 unsigned long long *value); 657 657 658 658 struct tep_event_format *tep_find_event(struct tep_handle *pevent, int id); ··· 677 677 int tep_cmdline_pid(struct tep_handle *pevent, struct cmdline *cmdline); 678 678 679 679 void tep_print_field(struct trace_seq *s, void *data, 680 - struct format_field *field); 680 + struct tep_format_field *field); 681 681 void tep_print_fields(struct trace_seq *s, void *data, 682 682 int size __maybe_unused, struct tep_event_format *event); 683 683 void tep_event_info(struct trace_seq *s, struct tep_event_format *event, ··· 686 686 char *buf, size_t buflen); 687 687 688 688 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); 691 691 692 692 static inline int tep_get_cpus(struct tep_handle *pevent) 693 693 { ··· 832 832 }; 833 833 834 834 struct filter_arg_field { 835 - struct format_field *field; 835 + struct tep_format_field *field; 836 836 }; 837 837 838 838 struct filter_arg_value { ··· 863 863 864 864 struct filter_arg_str { 865 865 enum filter_cmp_type type; 866 - struct format_field *field; 866 + struct tep_format_field *field; 867 867 char *val; 868 868 char *buffer; 869 869 regex_t reg;
+4 -4
tools/lib/traceevent/parse-filter.c
··· 16 16 #define COMM "COMM" 17 17 #define CPU "CPU" 18 18 19 - static struct format_field comm = { 19 + static struct tep_format_field comm = { 20 20 .name = "COMM", 21 21 }; 22 22 23 - static struct format_field cpu = { 23 + static struct tep_format_field cpu = { 24 24 .name = "CPU", 25 25 }; 26 26 ··· 336 336 create_arg_item(struct tep_event_format *event, const char *token, 337 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 340 struct filter_arg *arg; 341 341 342 342 arg = allocate_arg(); ··· 1698 1698 1699 1699 static unsigned long long 1700 1700 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) 1702 1702 { 1703 1703 unsigned long long val; 1704 1704
+1 -1
tools/lib/traceevent/plugin_kmem.c
··· 27 27 static int call_site_handler(struct trace_seq *s, struct tep_record *record, 28 28 struct tep_event_format *event, void *context) 29 29 { 30 - struct format_field *field; 30 + struct tep_format_field *field; 31 31 unsigned long long val, addr; 32 32 void *data = record->data; 33 33 const char *func;
+1 -1
tools/lib/traceevent/plugin_mac80211.c
··· 29 29 static void print_string(struct trace_seq *s, struct tep_event_format *event, 30 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 33 int offset; 34 34 int length; 35 35
+3 -3
tools/lib/traceevent/plugin_sched_switch.c
··· 45 45 trace_seq_putc(s, 'R'); 46 46 } 47 47 48 - static void write_and_save_comm(struct format_field *field, 48 + static void write_and_save_comm(struct tep_format_field *field, 49 49 struct tep_record *record, 50 50 struct trace_seq *s, int pid) 51 51 { ··· 69 69 struct tep_record *record, 70 70 struct tep_event_format *event, void *context) 71 71 { 72 - struct format_field *field; 72 + struct tep_format_field *field; 73 73 unsigned long long val; 74 74 75 75 if (tep_get_field_val(s, event, "pid", record, &val, 1)) ··· 98 98 struct tep_record *record, 99 99 struct tep_event_format *event, void *context) 100 100 { 101 - struct format_field *field; 101 + struct tep_format_field *field; 102 102 unsigned long long val; 103 103 104 104 if (tep_get_field_val(s, event, "prev_pid", record, &val, 1))
+7 -7
tools/perf/builtin-trace.c
··· 181 181 return 0; 182 182 } 183 183 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) 185 185 { 186 186 return __tp_field__init_uint(field, format_field->size, format_field->offset, needs_swap); 187 187 } ··· 198 198 return 0; 199 199 } 200 200 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) 202 202 { 203 203 return __tp_field__init_ptr(field, format_field->offset); 204 204 } ··· 214 214 struct tp_field *field, 215 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 219 if (format_field == NULL) 220 220 return -1; ··· 230 230 struct tp_field *field, 231 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 235 if (format_field == NULL) 236 236 return -1; ··· 867 867 int args_size; 868 868 bool is_exit; 869 869 bool is_open; 870 - struct format_field *args; 870 + struct tep_format_field *args; 871 871 const char *name; 872 872 struct syscall_fmt *fmt; 873 873 struct syscall_arg_fmt *arg_fmt; ··· 1279 1279 1280 1280 static 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 1283 int idx = 0, len; 1284 1284 1285 1285 for (field = sc->args; field; field = field->next, ++idx) { ··· 1525 1525 ttrace->ret_scnprintf = NULL; 1526 1526 1527 1527 if (sc->args != NULL) { 1528 - struct format_field *field; 1528 + struct tep_format_field *field; 1529 1529 1530 1530 for (field = sc->args; field; 1531 1531 field = field->next, ++arg.idx, bit <<= 1) {
+1 -1
tools/perf/tests/evsel-tp-sched.c
··· 8 8 static int perf_evsel__test_field(struct perf_evsel *evsel, const char *name, 9 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 12 int is_signed; 13 13 int ret = 0; 14 14
+11 -11
tools/perf/util/data-convert-bt.c
··· 182 182 } 183 183 184 184 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) 186 186 { 187 187 unsigned long flags = field->flags; 188 188 ··· 287 287 struct bt_ctf_event_class *event_class, 288 288 struct bt_ctf_event *event, 289 289 struct perf_sample *sample, 290 - struct format_field *fmtf) 290 + struct tep_format_field *fmtf) 291 291 { 292 292 struct bt_ctf_field_type *type; 293 293 struct bt_ctf_field *array_field; ··· 396 396 static int add_tracepoint_fields_values(struct ctf_writer *cw, 397 397 struct bt_ctf_event_class *event_class, 398 398 struct bt_ctf_event *event, 399 - struct format_field *fields, 399 + struct tep_format_field *fields, 400 400 struct perf_sample *sample) 401 401 { 402 - struct format_field *field; 402 + struct tep_format_field *field; 403 403 int ret; 404 404 405 405 for (field = fields; field; field = field->next) { ··· 417 417 struct perf_evsel *evsel, 418 418 struct perf_sample *sample) 419 419 { 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; 422 422 int ret; 423 423 424 424 ret = add_tracepoint_fields_values(cw, event_class, event, ··· 970 970 971 971 static int event_class_add_field(struct bt_ctf_event_class *event_class, 972 972 struct bt_ctf_field_type *type, 973 - struct format_field *field) 973 + struct tep_format_field *field) 974 974 { 975 975 struct bt_ctf_field_type *t = NULL; 976 976 char *name; ··· 1009 1009 } 1010 1010 1011 1011 static int add_tracepoint_fields_types(struct ctf_writer *cw, 1012 - struct format_field *fields, 1012 + struct tep_format_field *fields, 1013 1013 struct bt_ctf_event_class *event_class) 1014 1014 { 1015 - struct format_field *field; 1015 + struct tep_format_field *field; 1016 1016 int ret; 1017 1017 1018 1018 for (field = fields; field; field = field->next) { ··· 1055 1055 struct perf_evsel *evsel, 1056 1056 struct bt_ctf_event_class *class) 1057 1057 { 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; 1060 1060 int ret; 1061 1061 1062 1062 ret = add_tracepoint_fields_types(cw, common_fields, class);
+4 -4
tools/perf/util/evsel.c
··· 2682 2682 return 0; 2683 2683 } 2684 2684 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) 2686 2686 { 2687 2687 return tep_find_field(evsel->tp_format, name); 2688 2688 } ··· 2690 2690 void *perf_evsel__rawptr(struct perf_evsel *evsel, struct perf_sample *sample, 2691 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 2694 int offset; 2695 2695 2696 2696 if (!field) ··· 2706 2706 return sample->raw_data + offset; 2707 2707 } 2708 2708 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, 2710 2710 bool needs_swap) 2711 2711 { 2712 2712 u64 value; ··· 2748 2748 u64 perf_evsel__intval(struct perf_evsel *evsel, struct perf_sample *sample, 2749 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 2753 if (!field) 2754 2754 return 0;
+3 -3
tools/perf/util/evsel.h
··· 296 296 return perf_evsel__rawptr(evsel, sample, name); 297 297 } 298 298 299 - struct format_field; 299 + struct tep_format_field; 300 300 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); 302 302 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); 304 304 305 305 #define perf_evsel__match(evsel, t, c) \ 306 306 (evsel->attr.type == PERF_TYPE_##t && \
+1 -1
tools/perf/util/evsel_fprintf.c
··· 73 73 } 74 74 75 75 if (details->trace_fields) { 76 - struct format_field *field; 76 + struct tep_format_field *field; 77 77 78 78 if (evsel->attr.type != PERF_TYPE_TRACEPOINT) { 79 79 printed += comma_fprintf(fp, &first, " (not a tracepoint)");
+2 -2
tools/perf/util/python.c
··· 340 340 } 341 341 342 342 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) 344 344 { 345 345 struct tep_handle *pevent = field->event->pevent; 346 346 void *data = pe->sample.raw_data; ··· 383 383 { 384 384 const char *str = _PyUnicode_AsString(PyObject_Str(attr_name)); 385 385 struct perf_evsel *evsel = pevent->evsel; 386 - struct format_field *field; 386 + struct tep_format_field *field; 387 387 388 388 if (!evsel->tp_format) { 389 389 struct tep_event_format *tp_format;
+2 -2
tools/perf/util/scripting-engines/trace-event-perl.c
··· 339 339 { 340 340 struct thread *thread = al->thread; 341 341 struct tep_event_format *event = evsel->tp_format; 342 - struct format_field *field; 342 + struct tep_format_field *field; 343 343 static char handler[256]; 344 344 unsigned long long val; 345 345 unsigned long s, ns; ··· 538 538 static int perl_generate_script(struct tep_handle *pevent, const char *outfile) 539 539 { 540 540 struct tep_event_format *event = NULL; 541 - struct format_field *f; 541 + struct tep_format_field *f; 542 542 char fname[PATH_MAX]; 543 543 int not_first, count; 544 544 FILE *ofp;
+3 -3
tools/perf/util/scripting-engines/trace-event-python.c
··· 333 333 } 334 334 335 335 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) 337 337 { 338 338 bool is_array = field->flags & FIELD_IS_ARRAY; 339 339 PyObject *obj = NULL, *list = NULL; ··· 794 794 PyObject *handler, *context, *t, *obj = NULL, *callchain; 795 795 PyObject *dict = NULL, *all_entries_dict = NULL; 796 796 static char handler_name[256]; 797 - struct format_field *field; 797 + struct tep_format_field *field; 798 798 unsigned long s, ns; 799 799 unsigned n = 0; 800 800 int pid; ··· 1591 1591 static int python_generate_script(struct tep_handle *pevent, const char *outfile) 1592 1592 { 1593 1593 struct tep_event_format *event = NULL; 1594 - struct format_field *f; 1594 + struct tep_format_field *f; 1595 1595 char fname[PATH_MAX]; 1596 1596 int not_first, count; 1597 1597 FILE *ofp;
+9 -9
tools/perf/util/sort.c
··· 1884 1884 struct hpp_dynamic_entry { 1885 1885 struct perf_hpp_fmt hpp; 1886 1886 struct perf_evsel *evsel; 1887 - struct format_field *field; 1887 + struct tep_format_field *field; 1888 1888 unsigned dynamic_len; 1889 1889 bool raw_trace; 1890 1890 }; ··· 1915 1915 struct hist_entry *he) 1916 1916 { 1917 1917 char *str, *pos; 1918 - struct format_field *field = hde->field; 1918 + struct tep_format_field *field = hde->field; 1919 1919 size_t namelen; 1920 1920 bool last = false; 1921 1921 ··· 2000 2000 struct hpp_dynamic_entry *hde; 2001 2001 size_t len = fmt->user_len; 2002 2002 char *str, *pos; 2003 - struct format_field *field; 2003 + struct tep_format_field *field; 2004 2004 size_t namelen; 2005 2005 bool last = false; 2006 2006 int ret; ··· 2060 2060 struct hist_entry *a, struct hist_entry *b) 2061 2061 { 2062 2062 struct hpp_dynamic_entry *hde; 2063 - struct format_field *field; 2063 + struct tep_format_field *field; 2064 2064 unsigned offset, size; 2065 2065 2066 2066 hde = container_of(fmt, struct hpp_dynamic_entry, hpp); ··· 2117 2117 } 2118 2118 2119 2119 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, 2121 2121 int level) 2122 2122 { 2123 2123 struct hpp_dynamic_entry *hde; ··· 2252 2252 } 2253 2253 2254 2254 static int __dynamic_dimension__add(struct perf_evsel *evsel, 2255 - struct format_field *field, 2255 + struct tep_format_field *field, 2256 2256 bool raw_trace, int level) 2257 2257 { 2258 2258 struct hpp_dynamic_entry *hde; ··· 2270 2270 static int add_evsel_fields(struct perf_evsel *evsel, bool raw_trace, int level) 2271 2271 { 2272 2272 int ret; 2273 - struct format_field *field; 2273 + struct tep_format_field *field; 2274 2274 2275 2275 field = evsel->tp_format->format.fields; 2276 2276 while (field) { ··· 2305 2305 { 2306 2306 int ret = -ESRCH; 2307 2307 struct perf_evsel *evsel; 2308 - struct format_field *field; 2308 + struct tep_format_field *field; 2309 2309 2310 2310 evlist__for_each_entry(evlist, evsel) { 2311 2311 if (evsel->attr.type != PERF_TYPE_TRACEPOINT) ··· 2327 2327 { 2328 2328 char *str, *event_name, *field_name, *opt_name; 2329 2329 struct perf_evsel *evsel; 2330 - struct format_field *field; 2330 + struct tep_format_field *field; 2331 2331 bool raw_trace = symbol_conf.raw_trace; 2332 2332 int ret = 0; 2333 2333
+2 -2
tools/perf/util/trace-event-parse.c
··· 34 34 { 35 35 struct tep_handle *pevent = context->pevent; 36 36 struct tep_event_format *event; 37 - struct format_field *field; 37 + struct tep_format_field *field; 38 38 39 39 if (!*size) { 40 40 if (!pevent->events) ··· 96 96 unsigned long long 97 97 raw_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 100 unsigned long long val; 101 101 102 102 field = tep_find_any_field(event, name);