diff options
Diffstat (limited to 'trace-read.c')
-rw-r--r-- | trace-read.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/trace-read.c b/trace-read.c index 280f6d3..862200f 100644 --- a/trace-read.c +++ b/trace-read.c | |||
@@ -48,13 +48,16 @@ static int filter_cpu = -1; | |||
48 | 48 | ||
49 | static void show_data(struct tracecmd_handle *handle, int cpu) | 49 | static void show_data(struct tracecmd_handle *handle, int cpu) |
50 | { | 50 | { |
51 | struct pevent *pevent; | ||
51 | struct record *record; | 52 | struct record *record; |
52 | struct trace_seq s; | 53 | struct trace_seq s; |
53 | 54 | ||
55 | pevent = tracecmd_get_pevent(handle); | ||
56 | |||
54 | record = tracecmd_read_data(handle, cpu); | 57 | record = tracecmd_read_data(handle, cpu); |
55 | 58 | ||
56 | trace_seq_init(&s); | 59 | trace_seq_init(&s); |
57 | pevent_print_event(&s, cpu, record->data, record->size, record->ts); | 60 | pevent_print_event(pevent, &s, cpu, record->data, record->size, record->ts); |
58 | trace_seq_do_printf(&s); | 61 | trace_seq_do_printf(&s); |
59 | printf("\n"); | 62 | printf("\n"); |
60 | 63 | ||
@@ -132,10 +135,12 @@ struct tracecmd_handle *read_trace_header(void) | |||
132 | void trace_report (int argc, char **argv) | 135 | void trace_report (int argc, char **argv) |
133 | { | 136 | { |
134 | struct tracecmd_handle *handle; | 137 | struct tracecmd_handle *handle; |
138 | struct pevent *pevent; | ||
135 | int show_funcs = 0; | 139 | int show_funcs = 0; |
136 | int show_endian = 0; | 140 | int show_endian = 0; |
137 | int show_page_size = 0; | 141 | int show_page_size = 0; |
138 | int show_printk = 0; | 142 | int show_printk = 0; |
143 | int latency_format; | ||
139 | int c; | 144 | int c; |
140 | 145 | ||
141 | if (argc < 2) | 146 | if (argc < 2) |
@@ -208,10 +213,12 @@ void trace_report (int argc, char **argv) | |||
208 | return; | 213 | return; |
209 | } | 214 | } |
210 | 215 | ||
216 | pevent = tracecmd_get_pevent(handle); | ||
217 | |||
211 | if (show_endian) { | 218 | if (show_endian) { |
212 | printf("file is %s endian and host is %s endian\n", | 219 | printf("file is %s endian and host is %s endian\n", |
213 | file_bigendian ? "big" : "little", | 220 | pevent_is_file_bigendian(pevent) ? "big" : "little", |
214 | host_bigendian ? "big" : "little"); | 221 | pevent_is_host_bigendian(pevent) ? "big" : "little"); |
215 | return; | 222 | return; |
216 | } | 223 | } |
217 | 224 | ||
@@ -219,11 +226,11 @@ void trace_report (int argc, char **argv) | |||
219 | return; | 226 | return; |
220 | 227 | ||
221 | if (show_funcs) { | 228 | if (show_funcs) { |
222 | pevent_print_funcs(); | 229 | pevent_print_funcs(pevent); |
223 | return; | 230 | return; |
224 | } | 231 | } |
225 | if (show_printk) { | 232 | if (show_printk) { |
226 | pevent_print_printk(); | 233 | pevent_print_printk(pevent); |
227 | return; | 234 | return; |
228 | } | 235 | } |
229 | 236 | ||
@@ -232,7 +239,7 @@ void trace_report (int argc, char **argv) | |||
232 | struct event *event; | 239 | struct event *event; |
233 | int i; | 240 | int i; |
234 | 241 | ||
235 | events = pevent_list_events(EVENT_SORT_SYSTEM); | 242 | events = pevent_list_events(pevent, EVENT_SORT_SYSTEM); |
236 | for (i = 0; events[i]; i++) { | 243 | for (i = 0; events[i]; i++) { |
237 | event = events[i]; | 244 | event = events[i]; |
238 | if (event->system) | 245 | if (event->system) |
@@ -242,6 +249,9 @@ void trace_report (int argc, char **argv) | |||
242 | return; | 249 | return; |
243 | } | 250 | } |
244 | 251 | ||
252 | if (latency_format) | ||
253 | pevent_set_latency_format(pevent, latency_format); | ||
254 | |||
245 | read_data_info(handle); | 255 | read_data_info(handle); |
246 | 256 | ||
247 | return; | 257 | return; |