diff options
author | Steven Rostedt <srostedt@redhat.com> | 2009-11-23 13:56:20 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2009-11-23 13:57:57 -0500 |
commit | 28c86bb67da8dc23c109f13cbf2ade4dbbda5ac8 (patch) | |
tree | 9b72c2c0dfa772cebc8ddb02b5e3d9630f06a1c7 | |
parent | 9bf0a9f94cbd83f339419e2784bd37eab812ea10 (diff) |
Print out the event files stored in a data file
Add -E option to print out the event files stored in a data file.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | trace-cmd.c | 3 | ||||
-rw-r--r-- | trace-read.c | 16 |
2 files changed, 16 insertions, 3 deletions
diff --git a/trace-cmd.c b/trace-cmd.c index 2a531bb..ca1fbfa 100644 --- a/trace-cmd.c +++ b/trace-cmd.c | |||
@@ -1154,11 +1154,12 @@ void usage(char **argv) | |||
1154 | " -o data output file [default trace.dat]\n" | 1154 | " -o data output file [default trace.dat]\n" |
1155 | " -O option to enable (or disable)\n" | 1155 | " -O option to enable (or disable)\n" |
1156 | "\n" | 1156 | "\n" |
1157 | " %s report [-i file] [--cpu cpu] [-e][-f]\n" | 1157 | " %s report [-i file] [--cpu cpu] [-e][-f][-l][-P][-E]\n" |
1158 | " -i input file [default trace.dat]\n" | 1158 | " -i input file [default trace.dat]\n" |
1159 | " -e show file endianess\n" | 1159 | " -e show file endianess\n" |
1160 | " -f show function list\n" | 1160 | " -f show function list\n" |
1161 | " -P show printk list\n" | 1161 | " -P show printk list\n" |
1162 | " -E show event files stored\n" | ||
1162 | " -l show latency format (default with latency tracers)\n" | 1163 | " -l show latency format (default with latency tracers)\n" |
1163 | "\n" | 1164 | "\n" |
1164 | " %s list [-e][-p]\n" | 1165 | " %s list [-e][-p]\n" |
diff --git a/trace-read.c b/trace-read.c index 2204b2a..ebabdde 100644 --- a/trace-read.c +++ b/trace-read.c | |||
@@ -47,6 +47,8 @@ int file_bigendian; | |||
47 | int host_bigendian; | 47 | int host_bigendian; |
48 | static int long_size; | 48 | static int long_size; |
49 | 49 | ||
50 | static int show_events = 0; | ||
51 | |||
50 | static int filter_cpu = -1; | 52 | static int filter_cpu = -1; |
51 | 53 | ||
52 | static int read_or_die(void *data, int size) | 54 | static int read_or_die(void *data, int size) |
@@ -215,8 +217,11 @@ static void read_event_file(char *system, unsigned long long size) | |||
215 | { | 217 | { |
216 | char *buf; | 218 | char *buf; |
217 | 219 | ||
218 | buf = malloc_or_die(size); | 220 | buf = malloc_or_die(size+1); |
219 | read_or_die(buf, size); | 221 | read_or_die(buf, size); |
222 | buf[size] = 0; | ||
223 | if (show_events) | ||
224 | printf("%s\n", buf); | ||
220 | parse_event_file(buf, size, system); | 225 | parse_event_file(buf, size, system); |
221 | free(buf); | 226 | free(buf); |
222 | } | 227 | } |
@@ -754,7 +759,7 @@ void trace_report (int argc, char **argv) | |||
754 | {NULL, 0, NULL, 0} | 759 | {NULL, 0, NULL, 0} |
755 | }; | 760 | }; |
756 | 761 | ||
757 | c = getopt_long (argc-1, argv+1, "+hi:fepPl", | 762 | c = getopt_long (argc-1, argv+1, "+hi:fepPlE", |
758 | long_options, &option_index); | 763 | long_options, &option_index); |
759 | if (c == -1) | 764 | if (c == -1) |
760 | break; | 765 | break; |
@@ -777,6 +782,9 @@ void trace_report (int argc, char **argv) | |||
777 | case 'p': | 782 | case 'p': |
778 | show_page_size = 1; | 783 | show_page_size = 1; |
779 | break; | 784 | break; |
785 | case 'E': | ||
786 | show_events = 1; | ||
787 | break; | ||
780 | case 'l': | 788 | case 'l': |
781 | latency_format = 1; | 789 | latency_format = 1; |
782 | break; | 790 | break; |
@@ -820,6 +828,10 @@ void trace_report (int argc, char **argv) | |||
820 | print_printk(); | 828 | print_printk(); |
821 | return; | 829 | return; |
822 | } | 830 | } |
831 | |||
832 | if (show_events) | ||
833 | return; | ||
834 | |||
823 | read_data_info(); | 835 | read_data_info(); |
824 | 836 | ||
825 | return; | 837 | return; |