aboutsummaryrefslogtreecommitdiffstats
path: root/trace-read.c
diff options
context:
space:
mode:
Diffstat (limited to 'trace-read.c')
-rw-r--r--trace-read.c12
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
52static unsigned int page_size; 52static unsigned int page_size;
53static int input_fd; 53static int input_fd;
54const char *input_file = "trace.dat"; 54const char *default_input_file = "trace.dat";
55const char *input_file;
55 56
56static int filter_cpu = -1; 57static 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");