diff options
| author | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-12-06 12:00:33 -0500 |
|---|---|---|
| committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-12-06 12:00:33 -0500 |
| commit | 3d14b5beba35250c548d3851a2b84fce742d8311 (patch) | |
| tree | 065e3d93c3fcbc5ee4c44fa78662393cddbdf6de /tools/perf/util/trace-event-read.c | |
| parent | 0719dc341389882cc834ed18fc9b7fc6006b2b85 (diff) | |
| parent | 1bf8e6219552d5dd27012d567ec8c4bb9c2d86b4 (diff) | |
Merge branch 'sa1100' into devel
Diffstat (limited to 'tools/perf/util/trace-event-read.c')
| -rw-r--r-- | tools/perf/util/trace-event-read.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/tools/perf/util/trace-event-read.c b/tools/perf/util/trace-event-read.c index 1b5c847d2c22..342dfdd43f87 100644 --- a/tools/perf/util/trace-event-read.c +++ b/tools/perf/util/trace-event-read.c | |||
| @@ -458,9 +458,8 @@ struct record *trace_read_data(int cpu) | |||
| 458 | return data; | 458 | return data; |
| 459 | } | 459 | } |
| 460 | 460 | ||
| 461 | void trace_report(void) | 461 | void trace_report(int fd) |
| 462 | { | 462 | { |
| 463 | const char *input_file = "trace.info"; | ||
| 464 | char buf[BUFSIZ]; | 463 | char buf[BUFSIZ]; |
| 465 | char test[] = { 23, 8, 68 }; | 464 | char test[] = { 23, 8, 68 }; |
| 466 | char *version; | 465 | char *version; |
| @@ -468,17 +467,15 @@ void trace_report(void) | |||
| 468 | int show_funcs = 0; | 467 | int show_funcs = 0; |
| 469 | int show_printk = 0; | 468 | int show_printk = 0; |
| 470 | 469 | ||
| 471 | input_fd = open(input_file, O_RDONLY); | 470 | input_fd = fd; |
| 472 | if (input_fd < 0) | ||
| 473 | die("opening '%s'\n", input_file); | ||
| 474 | 471 | ||
| 475 | read_or_die(buf, 3); | 472 | read_or_die(buf, 3); |
| 476 | if (memcmp(buf, test, 3) != 0) | 473 | if (memcmp(buf, test, 3) != 0) |
| 477 | die("not an trace data file"); | 474 | die("no trace data in the file"); |
| 478 | 475 | ||
| 479 | read_or_die(buf, 7); | 476 | read_or_die(buf, 7); |
| 480 | if (memcmp(buf, "tracing", 7) != 0) | 477 | if (memcmp(buf, "tracing", 7) != 0) |
| 481 | die("not a trace file (missing tracing)"); | 478 | die("not a trace file (missing 'tracing' tag)"); |
| 482 | 479 | ||
| 483 | version = read_string(); | 480 | version = read_string(); |
| 484 | if (show_version) | 481 | if (show_version) |
