diff options
Diffstat (limited to 'tools/perf/util/trace-event-info.c')
-rw-r--r-- | tools/perf/util/trace-event-info.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tools/perf/util/trace-event-info.c b/tools/perf/util/trace-event-info.c index 6c9302a7274c..af4b0573b37f 100644 --- a/tools/perf/util/trace-event-info.c +++ b/tools/perf/util/trace-event-info.c | |||
@@ -458,7 +458,7 @@ static void read_proc_kallsyms(void) | |||
458 | static void read_ftrace_printk(void) | 458 | static void read_ftrace_printk(void) |
459 | { | 459 | { |
460 | unsigned int size, check_size; | 460 | unsigned int size, check_size; |
461 | const char *path; | 461 | char *path; |
462 | struct stat st; | 462 | struct stat st; |
463 | int ret; | 463 | int ret; |
464 | 464 | ||
@@ -468,23 +468,24 @@ static void read_ftrace_printk(void) | |||
468 | /* not found */ | 468 | /* not found */ |
469 | size = 0; | 469 | size = 0; |
470 | write_or_die(&size, 4); | 470 | write_or_die(&size, 4); |
471 | return; | 471 | goto out; |
472 | } | 472 | } |
473 | size = get_size(path); | 473 | size = get_size(path); |
474 | write_or_die(&size, 4); | 474 | write_or_die(&size, 4); |
475 | check_size = copy_file(path); | 475 | check_size = copy_file(path); |
476 | if (size != check_size) | 476 | if (size != check_size) |
477 | die("error in size of file '%s'", path); | 477 | die("error in size of file '%s'", path); |
478 | 478 | out: | |
479 | put_tracing_file(path); | ||
479 | } | 480 | } |
480 | 481 | ||
481 | static struct tracepoint_path * | 482 | static struct tracepoint_path * |
482 | get_tracepoints_path(struct perf_counter_attr *pattrs, int nb_counters) | 483 | get_tracepoints_path(struct perf_event_attr *pattrs, int nb_events) |
483 | { | 484 | { |
484 | struct tracepoint_path path, *ppath = &path; | 485 | struct tracepoint_path path, *ppath = &path; |
485 | int i; | 486 | int i; |
486 | 487 | ||
487 | for (i = 0; i < nb_counters; i++) { | 488 | for (i = 0; i < nb_events; i++) { |
488 | if (pattrs[i].type != PERF_TYPE_TRACEPOINT) | 489 | if (pattrs[i].type != PERF_TYPE_TRACEPOINT) |
489 | continue; | 490 | continue; |
490 | ppath->next = tracepoint_id_to_path(pattrs[i].config); | 491 | ppath->next = tracepoint_id_to_path(pattrs[i].config); |
@@ -495,7 +496,7 @@ get_tracepoints_path(struct perf_counter_attr *pattrs, int nb_counters) | |||
495 | 496 | ||
496 | return path.next; | 497 | return path.next; |
497 | } | 498 | } |
498 | void read_tracing_data(struct perf_counter_attr *pattrs, int nb_counters) | 499 | void read_tracing_data(struct perf_event_attr *pattrs, int nb_events) |
499 | { | 500 | { |
500 | char buf[BUFSIZ]; | 501 | char buf[BUFSIZ]; |
501 | struct tracepoint_path *tps; | 502 | struct tracepoint_path *tps; |
@@ -529,7 +530,7 @@ void read_tracing_data(struct perf_counter_attr *pattrs, int nb_counters) | |||
529 | page_size = getpagesize(); | 530 | page_size = getpagesize(); |
530 | write_or_die(&page_size, 4); | 531 | write_or_die(&page_size, 4); |
531 | 532 | ||
532 | tps = get_tracepoints_path(pattrs, nb_counters); | 533 | tps = get_tracepoints_path(pattrs, nb_events); |
533 | 534 | ||
534 | read_header_files(); | 535 | read_header_files(); |
535 | read_ftrace_files(tps); | 536 | read_ftrace_files(tps); |