diff options
Diffstat (limited to 'trace-read.c')
-rw-r--r-- | trace-read.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/trace-read.c b/trace-read.c index 76f5b7b..ca6661e 100644 --- a/trace-read.c +++ b/trace-read.c | |||
@@ -51,7 +51,8 @@ static struct event_filter *event_filter_out; | |||
51 | 51 | ||
52 | static unsigned int page_size; | 52 | static unsigned int page_size; |
53 | static int input_fd; | 53 | static int input_fd; |
54 | const char *input_file = "trace.dat"; | 54 | const char *default_input_file = "trace.dat"; |
55 | const char *input_file; | ||
55 | 56 | ||
56 | static int filter_cpu = -1; | 57 | static int filter_cpu = -1; |
57 | 58 | ||
@@ -632,6 +633,15 @@ void trace_report (int argc, char **argv) | |||
632 | } | 633 | } |
633 | } | 634 | } |
634 | 635 | ||
636 | if ((argc - optind) >= 2) { | ||
637 | if (input_file) | ||
638 | usage(argv); | ||
639 | input_file = argv[optind + 1]; | ||
640 | } | ||
641 | |||
642 | if (!input_file) | ||
643 | input_file = default_input_file; | ||
644 | |||
635 | handle = read_trace_header(); | 645 | handle = read_trace_header(); |
636 | if (!handle) | 646 | if (!handle) |
637 | die("error reading header"); | 647 | die("error reading header"); |