diff options
Diffstat (limited to 'tools/lib/traceevent')
-rw-r--r-- | tools/lib/traceevent/event-parse.c | 42 | ||||
-rw-r--r-- | tools/lib/traceevent/event-parse.h | 28 | ||||
-rw-r--r-- | tools/lib/traceevent/plugin_function.c | 4 | ||||
-rw-r--r-- | tools/lib/traceevent/plugin_kvm.c | 28 | ||||
-rw-r--r-- | tools/lib/traceevent/plugin_sched_switch.c | 18 |
5 files changed, 60 insertions, 60 deletions
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index 4f924bf42b92..652b8ef6f4c7 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c | |||
@@ -6166,7 +6166,7 @@ __pevent_parse_event(struct tep_handle *pevent, | |||
6166 | return 0; | 6166 | return 0; |
6167 | 6167 | ||
6168 | event_add_failed: | 6168 | event_add_failed: |
6169 | pevent_free_format(event); | 6169 | tep_free_format(event); |
6170 | return ret; | 6170 | return ret; |
6171 | } | 6171 | } |
6172 | 6172 | ||
@@ -6263,7 +6263,7 @@ int get_field_val(struct trace_seq *s, struct format_field *field, | |||
6263 | } | 6263 | } |
6264 | 6264 | ||
6265 | /** | 6265 | /** |
6266 | * pevent_get_field_raw - return the raw pointer into the data field | 6266 | * tep_get_field_raw - return the raw pointer into the data field |
6267 | * @s: The seq to print to on error | 6267 | * @s: The seq to print to on error |
6268 | * @event: the event that the field is for | 6268 | * @event: the event that the field is for |
6269 | * @name: The name of the field | 6269 | * @name: The name of the field |
@@ -6276,9 +6276,9 @@ int get_field_val(struct trace_seq *s, struct format_field *field, | |||
6276 | * | 6276 | * |
6277 | * On failure, it returns NULL. | 6277 | * On failure, it returns NULL. |
6278 | */ | 6278 | */ |
6279 | void *pevent_get_field_raw(struct trace_seq *s, struct event_format *event, | 6279 | void *tep_get_field_raw(struct trace_seq *s, struct event_format *event, |
6280 | const char *name, struct tep_record *record, | 6280 | const char *name, struct tep_record *record, |
6281 | int *len, int err) | 6281 | int *len, int err) |
6282 | { | 6282 | { |
6283 | struct format_field *field; | 6283 | struct format_field *field; |
6284 | void *data = record->data; | 6284 | void *data = record->data; |
@@ -6313,7 +6313,7 @@ void *pevent_get_field_raw(struct trace_seq *s, struct event_format *event, | |||
6313 | } | 6313 | } |
6314 | 6314 | ||
6315 | /** | 6315 | /** |
6316 | * pevent_get_field_val - find a field and return its value | 6316 | * tep_get_field_val - find a field and return its value |
6317 | * @s: The seq to print to on error | 6317 | * @s: The seq to print to on error |
6318 | * @event: the event that the field is for | 6318 | * @event: the event that the field is for |
6319 | * @name: The name of the field | 6319 | * @name: The name of the field |
@@ -6323,9 +6323,9 @@ void *pevent_get_field_raw(struct trace_seq *s, struct event_format *event, | |||
6323 | * | 6323 | * |
6324 | * Returns 0 on success -1 on field not found. | 6324 | * Returns 0 on success -1 on field not found. |
6325 | */ | 6325 | */ |
6326 | int pevent_get_field_val(struct trace_seq *s, struct event_format *event, | 6326 | int tep_get_field_val(struct trace_seq *s, struct event_format *event, |
6327 | const char *name, struct tep_record *record, | 6327 | const char *name, struct tep_record *record, |
6328 | unsigned long long *val, int err) | 6328 | unsigned long long *val, int err) |
6329 | { | 6329 | { |
6330 | struct format_field *field; | 6330 | struct format_field *field; |
6331 | 6331 | ||
@@ -6338,7 +6338,7 @@ int pevent_get_field_val(struct trace_seq *s, struct event_format *event, | |||
6338 | } | 6338 | } |
6339 | 6339 | ||
6340 | /** | 6340 | /** |
6341 | * pevent_get_common_field_val - find a common field and return its value | 6341 | * tep_get_common_field_val - find a common field and return its value |
6342 | * @s: The seq to print to on error | 6342 | * @s: The seq to print to on error |
6343 | * @event: the event that the field is for | 6343 | * @event: the event that the field is for |
6344 | * @name: The name of the field | 6344 | * @name: The name of the field |
@@ -6348,9 +6348,9 @@ int pevent_get_field_val(struct trace_seq *s, struct event_format *event, | |||
6348 | * | 6348 | * |
6349 | * Returns 0 on success -1 on field not found. | 6349 | * Returns 0 on success -1 on field not found. |
6350 | */ | 6350 | */ |
6351 | int pevent_get_common_field_val(struct trace_seq *s, struct event_format *event, | 6351 | int tep_get_common_field_val(struct trace_seq *s, struct event_format *event, |
6352 | const char *name, struct tep_record *record, | 6352 | const char *name, struct tep_record *record, |
6353 | unsigned long long *val, int err) | 6353 | unsigned long long *val, int err) |
6354 | { | 6354 | { |
6355 | struct format_field *field; | 6355 | struct format_field *field; |
6356 | 6356 | ||
@@ -6363,7 +6363,7 @@ int pevent_get_common_field_val(struct trace_seq *s, struct event_format *event, | |||
6363 | } | 6363 | } |
6364 | 6364 | ||
6365 | /** | 6365 | /** |
6366 | * pevent_get_any_field_val - find a any field and return its value | 6366 | * tep_get_any_field_val - find a any field and return its value |
6367 | * @s: The seq to print to on error | 6367 | * @s: The seq to print to on error |
6368 | * @event: the event that the field is for | 6368 | * @event: the event that the field is for |
6369 | * @name: The name of the field | 6369 | * @name: The name of the field |
@@ -6373,9 +6373,9 @@ int pevent_get_common_field_val(struct trace_seq *s, struct event_format *event, | |||
6373 | * | 6373 | * |
6374 | * Returns 0 on success -1 on field not found. | 6374 | * Returns 0 on success -1 on field not found. |
6375 | */ | 6375 | */ |
6376 | int pevent_get_any_field_val(struct trace_seq *s, struct event_format *event, | 6376 | int tep_get_any_field_val(struct trace_seq *s, struct event_format *event, |
6377 | const char *name, struct tep_record *record, | 6377 | const char *name, struct tep_record *record, |
6378 | unsigned long long *val, int err) | 6378 | unsigned long long *val, int err) |
6379 | { | 6379 | { |
6380 | struct format_field *field; | 6380 | struct format_field *field; |
6381 | 6381 | ||
@@ -6771,7 +6771,7 @@ void pevent_ref(struct tep_handle *pevent) | |||
6771 | pevent->ref_count++; | 6771 | pevent->ref_count++; |
6772 | } | 6772 | } |
6773 | 6773 | ||
6774 | void pevent_free_format_field(struct format_field *field) | 6774 | void tep_free_format_field(struct format_field *field) |
6775 | { | 6775 | { |
6776 | free(field->type); | 6776 | free(field->type); |
6777 | if (field->alias != field->name) | 6777 | if (field->alias != field->name) |
@@ -6786,7 +6786,7 @@ static void free_format_fields(struct format_field *field) | |||
6786 | 6786 | ||
6787 | while (field) { | 6787 | while (field) { |
6788 | next = field->next; | 6788 | next = field->next; |
6789 | pevent_free_format_field(field); | 6789 | tep_free_format_field(field); |
6790 | field = next; | 6790 | field = next; |
6791 | } | 6791 | } |
6792 | } | 6792 | } |
@@ -6797,7 +6797,7 @@ static void free_formats(struct format *format) | |||
6797 | free_format_fields(format->fields); | 6797 | free_format_fields(format->fields); |
6798 | } | 6798 | } |
6799 | 6799 | ||
6800 | void pevent_free_format(struct event_format *event) | 6800 | void tep_free_format(struct event_format *event) |
6801 | { | 6801 | { |
6802 | free(event->name); | 6802 | free(event->name); |
6803 | free(event->system); | 6803 | free(event->system); |
@@ -6883,7 +6883,7 @@ void tep_free(struct tep_handle *pevent) | |||
6883 | } | 6883 | } |
6884 | 6884 | ||
6885 | for (i = 0; i < pevent->nr_events; i++) | 6885 | for (i = 0; i < pevent->nr_events; i++) |
6886 | pevent_free_format(pevent->events[i]); | 6886 | tep_free_format(pevent->events[i]); |
6887 | 6887 | ||
6888 | while (pevent->handlers) { | 6888 | while (pevent->handlers) { |
6889 | handle = pevent->handlers; | 6889 | handle = pevent->handlers; |
diff --git a/tools/lib/traceevent/event-parse.h b/tools/lib/traceevent/event-parse.h index 2c4da2f1d4ed..04ffc6e508cf 100644 --- a/tools/lib/traceevent/event-parse.h +++ b/tools/lib/traceevent/event-parse.h | |||
@@ -648,22 +648,22 @@ enum tep_errno tep_parse_format(struct tep_handle *pevent, | |||
648 | struct event_format **eventp, | 648 | struct event_format **eventp, |
649 | const char *buf, | 649 | const char *buf, |
650 | unsigned long size, const char *sys); | 650 | unsigned long size, const char *sys); |
651 | void pevent_free_format(struct event_format *event); | 651 | void tep_free_format(struct event_format *event); |
652 | void pevent_free_format_field(struct format_field *field); | 652 | void tep_free_format_field(struct format_field *field); |
653 | 653 | ||
654 | void *pevent_get_field_raw(struct trace_seq *s, struct event_format *event, | 654 | void *tep_get_field_raw(struct trace_seq *s, struct event_format *event, |
655 | const char *name, struct tep_record *record, | 655 | const char *name, struct tep_record *record, |
656 | int *len, int err); | 656 | int *len, int err); |
657 | 657 | ||
658 | int pevent_get_field_val(struct trace_seq *s, struct event_format *event, | 658 | int tep_get_field_val(struct trace_seq *s, struct event_format *event, |
659 | const char *name, struct tep_record *record, | 659 | const char *name, struct tep_record *record, |
660 | unsigned long long *val, int err); | 660 | unsigned long long *val, int err); |
661 | int pevent_get_common_field_val(struct trace_seq *s, struct event_format *event, | 661 | int tep_get_common_field_val(struct trace_seq *s, struct event_format *event, |
662 | const char *name, struct tep_record *record, | ||
663 | unsigned long long *val, int err); | ||
664 | int pevent_get_any_field_val(struct trace_seq *s, struct event_format *event, | ||
665 | const char *name, struct tep_record *record, | 662 | const char *name, struct tep_record *record, |
666 | unsigned long long *val, int err); | 663 | unsigned long long *val, int err); |
664 | int tep_get_any_field_val(struct trace_seq *s, struct event_format *event, | ||
665 | const char *name, struct tep_record *record, | ||
666 | unsigned long long *val, int err); | ||
667 | 667 | ||
668 | int tep_print_num_field(struct trace_seq *s, const char *fmt, | 668 | int tep_print_num_field(struct trace_seq *s, const char *fmt, |
669 | struct event_format *event, const char *name, | 669 | struct event_format *event, const char *name, |
diff --git a/tools/lib/traceevent/plugin_function.c b/tools/lib/traceevent/plugin_function.c index 50cc356124f6..0962120960eb 100644 --- a/tools/lib/traceevent/plugin_function.c +++ b/tools/lib/traceevent/plugin_function.c | |||
@@ -132,12 +132,12 @@ static int function_handler(struct trace_seq *s, struct tep_record *record, | |||
132 | const char *parent; | 132 | const char *parent; |
133 | int index = 0; | 133 | int index = 0; |
134 | 134 | ||
135 | if (pevent_get_field_val(s, event, "ip", record, &function, 1)) | 135 | if (tep_get_field_val(s, event, "ip", record, &function, 1)) |
136 | return trace_seq_putc(s, '!'); | 136 | return trace_seq_putc(s, '!'); |
137 | 137 | ||
138 | func = pevent_find_function(pevent, function); | 138 | func = pevent_find_function(pevent, function); |
139 | 139 | ||
140 | if (pevent_get_field_val(s, event, "parent_ip", record, &pfunction, 1)) | 140 | if (tep_get_field_val(s, event, "parent_ip", record, &pfunction, 1)) |
141 | return trace_seq_putc(s, '!'); | 141 | return trace_seq_putc(s, '!'); |
142 | 142 | ||
143 | parent = pevent_find_function(pevent, pfunction); | 143 | parent = pevent_find_function(pevent, pfunction); |
diff --git a/tools/lib/traceevent/plugin_kvm.c b/tools/lib/traceevent/plugin_kvm.c index 4b3433763340..7ebe82bf19ce 100644 --- a/tools/lib/traceevent/plugin_kvm.c +++ b/tools/lib/traceevent/plugin_kvm.c | |||
@@ -254,10 +254,10 @@ static int print_exit_reason(struct trace_seq *s, struct tep_record *record, | |||
254 | unsigned long long val; | 254 | unsigned long long val; |
255 | const char *reason; | 255 | const char *reason; |
256 | 256 | ||
257 | if (pevent_get_field_val(s, event, field, record, &val, 1) < 0) | 257 | if (tep_get_field_val(s, event, field, record, &val, 1) < 0) |
258 | return -1; | 258 | return -1; |
259 | 259 | ||
260 | if (pevent_get_field_val(s, event, "isa", record, &isa, 0) < 0) | 260 | if (tep_get_field_val(s, event, "isa", record, &isa, 0) < 0) |
261 | isa = 1; | 261 | isa = 1; |
262 | 262 | ||
263 | reason = find_exit_reason(isa, val); | 263 | reason = find_exit_reason(isa, val); |
@@ -278,8 +278,8 @@ static int kvm_exit_handler(struct trace_seq *s, struct tep_record *record, | |||
278 | 278 | ||
279 | tep_print_num_field(s, " rip 0x%lx", event, "guest_rip", record, 1); | 279 | tep_print_num_field(s, " rip 0x%lx", event, "guest_rip", record, 1); |
280 | 280 | ||
281 | if (pevent_get_field_val(s, event, "info1", record, &info1, 0) >= 0 | 281 | if (tep_get_field_val(s, event, "info1", record, &info1, 0) >= 0 |
282 | && pevent_get_field_val(s, event, "info2", record, &info2, 0) >= 0) | 282 | && tep_get_field_val(s, event, "info2", record, &info2, 0) >= 0) |
283 | trace_seq_printf(s, " info %llx %llx", info1, info2); | 283 | trace_seq_printf(s, " info %llx %llx", info1, info2); |
284 | 284 | ||
285 | return 0; | 285 | return 0; |
@@ -299,22 +299,22 @@ static int kvm_emulate_insn_handler(struct trace_seq *s, | |||
299 | uint8_t *insn; | 299 | uint8_t *insn; |
300 | const char *disasm; | 300 | const char *disasm; |
301 | 301 | ||
302 | if (pevent_get_field_val(s, event, "rip", record, &rip, 1) < 0) | 302 | if (tep_get_field_val(s, event, "rip", record, &rip, 1) < 0) |
303 | return -1; | 303 | return -1; |
304 | 304 | ||
305 | if (pevent_get_field_val(s, event, "csbase", record, &csbase, 1) < 0) | 305 | if (tep_get_field_val(s, event, "csbase", record, &csbase, 1) < 0) |
306 | return -1; | 306 | return -1; |
307 | 307 | ||
308 | if (pevent_get_field_val(s, event, "len", record, &len, 1) < 0) | 308 | if (tep_get_field_val(s, event, "len", record, &len, 1) < 0) |
309 | return -1; | 309 | return -1; |
310 | 310 | ||
311 | if (pevent_get_field_val(s, event, "flags", record, &flags, 1) < 0) | 311 | if (tep_get_field_val(s, event, "flags", record, &flags, 1) < 0) |
312 | return -1; | 312 | return -1; |
313 | 313 | ||
314 | if (pevent_get_field_val(s, event, "failed", record, &failed, 1) < 0) | 314 | if (tep_get_field_val(s, event, "failed", record, &failed, 1) < 0) |
315 | return -1; | 315 | return -1; |
316 | 316 | ||
317 | insn = pevent_get_field_raw(s, event, "insn", record, &llen, 1); | 317 | insn = tep_get_field_raw(s, event, "insn", record, &llen, 1); |
318 | if (!insn) | 318 | if (!insn) |
319 | return -1; | 319 | return -1; |
320 | 320 | ||
@@ -379,7 +379,7 @@ static int kvm_mmu_print_role(struct trace_seq *s, struct tep_record *record, | |||
379 | }; | 379 | }; |
380 | union kvm_mmu_page_role role; | 380 | union kvm_mmu_page_role role; |
381 | 381 | ||
382 | if (pevent_get_field_val(s, event, "role", record, &val, 1) < 0) | 382 | if (tep_get_field_val(s, event, "role", record, &val, 1) < 0) |
383 | return -1; | 383 | return -1; |
384 | 384 | ||
385 | role.word = (int)val; | 385 | role.word = (int)val; |
@@ -409,7 +409,7 @@ static int kvm_mmu_print_role(struct trace_seq *s, struct tep_record *record, | |||
409 | tep_print_num_field(s, " root %u ", event, | 409 | tep_print_num_field(s, " root %u ", event, |
410 | "root_count", record, 1); | 410 | "root_count", record, 1); |
411 | 411 | ||
412 | if (pevent_get_field_val(s, event, "unsync", record, &val, 1) < 0) | 412 | if (tep_get_field_val(s, event, "unsync", record, &val, 1) < 0) |
413 | return -1; | 413 | return -1; |
414 | 414 | ||
415 | trace_seq_printf(s, "%s%c", val ? "unsync" : "sync", 0); | 415 | trace_seq_printf(s, "%s%c", val ? "unsync" : "sync", 0); |
@@ -422,12 +422,12 @@ static int kvm_mmu_get_page_handler(struct trace_seq *s, | |||
422 | { | 422 | { |
423 | unsigned long long val; | 423 | unsigned long long val; |
424 | 424 | ||
425 | if (pevent_get_field_val(s, event, "created", record, &val, 1) < 0) | 425 | if (tep_get_field_val(s, event, "created", record, &val, 1) < 0) |
426 | return -1; | 426 | return -1; |
427 | 427 | ||
428 | trace_seq_printf(s, "%s ", val ? "new" : "existing"); | 428 | trace_seq_printf(s, "%s ", val ? "new" : "existing"); |
429 | 429 | ||
430 | if (pevent_get_field_val(s, event, "gfn", record, &val, 1) < 0) | 430 | if (tep_get_field_val(s, event, "gfn", record, &val, 1) < 0) |
431 | return -1; | 431 | return -1; |
432 | 432 | ||
433 | trace_seq_printf(s, "sp gfn %llx ", val); | 433 | trace_seq_printf(s, "sp gfn %llx ", val); |
diff --git a/tools/lib/traceevent/plugin_sched_switch.c b/tools/lib/traceevent/plugin_sched_switch.c index 3f3a89c3d041..eecb4bd95c11 100644 --- a/tools/lib/traceevent/plugin_sched_switch.c +++ b/tools/lib/traceevent/plugin_sched_switch.c | |||
@@ -71,7 +71,7 @@ static int sched_wakeup_handler(struct trace_seq *s, | |||
71 | struct format_field *field; | 71 | struct format_field *field; |
72 | unsigned long long val; | 72 | unsigned long long val; |
73 | 73 | ||
74 | if (pevent_get_field_val(s, event, "pid", record, &val, 1)) | 74 | if (tep_get_field_val(s, event, "pid", record, &val, 1)) |
75 | return trace_seq_putc(s, '!'); | 75 | return trace_seq_putc(s, '!'); |
76 | 76 | ||
77 | field = tep_find_any_field(event, "comm"); | 77 | field = tep_find_any_field(event, "comm"); |
@@ -81,13 +81,13 @@ static int sched_wakeup_handler(struct trace_seq *s, | |||
81 | } | 81 | } |
82 | trace_seq_printf(s, "%lld", val); | 82 | trace_seq_printf(s, "%lld", val); |
83 | 83 | ||
84 | if (pevent_get_field_val(s, event, "prio", record, &val, 0) == 0) | 84 | if (tep_get_field_val(s, event, "prio", record, &val, 0) == 0) |
85 | trace_seq_printf(s, " [%lld]", val); | 85 | trace_seq_printf(s, " [%lld]", val); |
86 | 86 | ||
87 | if (pevent_get_field_val(s, event, "success", record, &val, 1) == 0) | 87 | if (tep_get_field_val(s, event, "success", record, &val, 1) == 0) |
88 | trace_seq_printf(s, " success=%lld", val); | 88 | trace_seq_printf(s, " success=%lld", val); |
89 | 89 | ||
90 | if (pevent_get_field_val(s, event, "target_cpu", record, &val, 0) == 0) | 90 | if (tep_get_field_val(s, event, "target_cpu", record, &val, 0) == 0) |
91 | trace_seq_printf(s, " CPU:%03llu", val); | 91 | trace_seq_printf(s, " CPU:%03llu", val); |
92 | 92 | ||
93 | return 0; | 93 | return 0; |
@@ -100,7 +100,7 @@ static int sched_switch_handler(struct trace_seq *s, | |||
100 | struct format_field *field; | 100 | struct format_field *field; |
101 | unsigned long long val; | 101 | unsigned long long val; |
102 | 102 | ||
103 | if (pevent_get_field_val(s, event, "prev_pid", record, &val, 1)) | 103 | if (tep_get_field_val(s, event, "prev_pid", record, &val, 1)) |
104 | return trace_seq_putc(s, '!'); | 104 | return trace_seq_putc(s, '!'); |
105 | 105 | ||
106 | field = tep_find_any_field(event, "prev_comm"); | 106 | field = tep_find_any_field(event, "prev_comm"); |
@@ -110,15 +110,15 @@ static int sched_switch_handler(struct trace_seq *s, | |||
110 | } | 110 | } |
111 | trace_seq_printf(s, "%lld ", val); | 111 | trace_seq_printf(s, "%lld ", val); |
112 | 112 | ||
113 | if (pevent_get_field_val(s, event, "prev_prio", record, &val, 0) == 0) | 113 | if (tep_get_field_val(s, event, "prev_prio", record, &val, 0) == 0) |
114 | trace_seq_printf(s, "[%d] ", (int) val); | 114 | trace_seq_printf(s, "[%d] ", (int) val); |
115 | 115 | ||
116 | if (pevent_get_field_val(s, event, "prev_state", record, &val, 0) == 0) | 116 | if (tep_get_field_val(s, event, "prev_state", record, &val, 0) == 0) |
117 | write_state(s, val); | 117 | write_state(s, val); |
118 | 118 | ||
119 | trace_seq_puts(s, " ==> "); | 119 | trace_seq_puts(s, " ==> "); |
120 | 120 | ||
121 | if (pevent_get_field_val(s, event, "next_pid", record, &val, 1)) | 121 | if (tep_get_field_val(s, event, "next_pid", record, &val, 1)) |
122 | return trace_seq_putc(s, '!'); | 122 | return trace_seq_putc(s, '!'); |
123 | 123 | ||
124 | field = tep_find_any_field(event, "next_comm"); | 124 | field = tep_find_any_field(event, "next_comm"); |
@@ -128,7 +128,7 @@ static int sched_switch_handler(struct trace_seq *s, | |||
128 | } | 128 | } |
129 | trace_seq_printf(s, "%lld", val); | 129 | trace_seq_printf(s, "%lld", val); |
130 | 130 | ||
131 | if (pevent_get_field_val(s, event, "next_prio", record, &val, 0) == 0) | 131 | if (tep_get_field_val(s, event, "next_prio", record, &val, 0) == 0) |
132 | trace_seq_printf(s, " [%d]", (int) val); | 132 | trace_seq_printf(s, " [%d]", (int) val); |
133 | 133 | ||
134 | return 0; | 134 | return 0; |