blob: 3741572696af4446c08a2c3b60ac674496323de6 [file] [log] [blame]
Steven Rostedt538bafb2009-08-17 16:18:06 +02001/*
2 * Copyright (C) 2009, Steven Rostedt <srostedt@redhat.com>
3 *
4 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License (not later!)
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 */
Xiao Guangrongf887f302010-02-04 16:46:42 +080021#define _FILE_OFFSET_BITS 64
Steven Rostedt538bafb2009-08-17 16:18:06 +020022
23#include <dirent.h>
24#include <stdio.h>
25#include <stdlib.h>
26#include <string.h>
27#include <getopt.h>
28#include <stdarg.h>
29#include <sys/types.h>
30#include <sys/stat.h>
31#include <sys/wait.h>
32#include <sys/mman.h>
33#include <pthread.h>
34#include <fcntl.h>
35#include <unistd.h>
Steven Rostedt538bafb2009-08-17 16:18:06 +020036#include <errno.h>
37
Frederic Weisbecker1ef2ed12009-08-28 03:09:58 +020038#include "../perf.h"
Steven Rostedt538bafb2009-08-17 16:18:06 +020039#include "util.h"
40#include "trace-event.h"
41
42static int input_fd;
43
44static int read_page;
45
46int file_bigendian;
47int host_bigendian;
48static int long_size;
49
Tom Zanussi92155452010-04-01 23:59:21 -050050static ssize_t calc_data_size;
Tom Zanussi454c4072010-05-01 01:41:20 -050051static bool repipe;
Tom Zanussi92155452010-04-01 23:59:21 -050052
Steven Rostedtaaf045f2012-04-06 00:47:56 +020053static void *malloc_or_die(int size)
54{
55 void *ret;
56
57 ret = malloc(size);
58 if (!ret)
59 die("malloc");
60 return ret;
61}
62
Tom Zanussi92155452010-04-01 23:59:21 -050063static int do_read(int fd, void *buf, int size)
64{
65 int rsize = size;
66
67 while (size) {
68 int ret = read(fd, buf, size);
69
70 if (ret <= 0)
71 return -1;
72
Tom Zanussi454c4072010-05-01 01:41:20 -050073 if (repipe) {
74 int retw = write(STDOUT_FILENO, buf, ret);
75
76 if (retw <= 0 || retw != ret)
77 die("repiping input file");
78 }
79
Tom Zanussi92155452010-04-01 23:59:21 -050080 size -= ret;
81 buf += ret;
82 }
83
84 return rsize;
85}
86
Steven Rostedt538bafb2009-08-17 16:18:06 +020087static int read_or_die(void *data, int size)
88{
89 int r;
90
Tom Zanussi92155452010-04-01 23:59:21 -050091 r = do_read(input_fd, data, size);
92 if (r <= 0)
Steven Rostedt538bafb2009-08-17 16:18:06 +020093 die("reading input file (size expected=%d received=%d)",
94 size, r);
Tom Zanussi92155452010-04-01 23:59:21 -050095
96 if (calc_data_size)
97 calc_data_size += r;
98
Steven Rostedt538bafb2009-08-17 16:18:06 +020099 return r;
100}
101
Tom Zanussicbb5cf72010-05-04 23:02:10 -0500102/* If it fails, the next read will report it */
103static void skip(int size)
104{
105 char buf[BUFSIZ];
106 int r;
107
108 while (size) {
109 r = size > BUFSIZ ? BUFSIZ : size;
110 read_or_die(buf, r);
111 size -= r;
112 };
113}
114
Arnaldo Carvalho de Meloda378962012-06-27 13:08:42 -0300115static unsigned int read4(struct pevent *pevent)
Steven Rostedt538bafb2009-08-17 16:18:06 +0200116{
117 unsigned int data;
118
119 read_or_die(&data, 4);
Arnaldo Carvalho de Meloda378962012-06-27 13:08:42 -0300120 return __data2host4(pevent, data);
Steven Rostedt538bafb2009-08-17 16:18:06 +0200121}
122
Arnaldo Carvalho de Meloda378962012-06-27 13:08:42 -0300123static unsigned long long read8(struct pevent *pevent)
Steven Rostedt538bafb2009-08-17 16:18:06 +0200124{
125 unsigned long long data;
126
127 read_or_die(&data, 8);
Arnaldo Carvalho de Meloda378962012-06-27 13:08:42 -0300128 return __data2host8(pevent, data);
Steven Rostedt538bafb2009-08-17 16:18:06 +0200129}
130
131static char *read_string(void)
132{
133 char buf[BUFSIZ];
134 char *str = NULL;
135 int size = 0;
Xiao Guangrongf887f302010-02-04 16:46:42 +0800136 off_t r;
Tom Zanussi92155452010-04-01 23:59:21 -0500137 char c;
Steven Rostedt538bafb2009-08-17 16:18:06 +0200138
139 for (;;) {
Tom Zanussi92155452010-04-01 23:59:21 -0500140 r = read(input_fd, &c, 1);
Steven Rostedt538bafb2009-08-17 16:18:06 +0200141 if (r < 0)
142 die("reading input file");
143
144 if (!r)
145 die("no data");
146
Tom Zanussi454c4072010-05-01 01:41:20 -0500147 if (repipe) {
148 int retw = write(STDOUT_FILENO, &c, 1);
149
150 if (retw <= 0 || retw != r)
151 die("repiping input file string");
152 }
153
Tom Zanussi92155452010-04-01 23:59:21 -0500154 buf[size++] = c;
155
156 if (!c)
Steven Rostedt538bafb2009-08-17 16:18:06 +0200157 break;
Steven Rostedt538bafb2009-08-17 16:18:06 +0200158 }
159
Tom Zanussi92155452010-04-01 23:59:21 -0500160 if (calc_data_size)
161 calc_data_size += size;
Ingo Molnar6f4596d2009-09-03 16:22:45 +0200162
Tom Zanussi92155452010-04-01 23:59:21 -0500163 str = malloc_or_die(size);
164 memcpy(str, buf, size);
Steven Rostedt538bafb2009-08-17 16:18:06 +0200165
166 return str;
167}
168
Arnaldo Carvalho de Meloda378962012-06-27 13:08:42 -0300169static void read_proc_kallsyms(struct pevent *pevent)
Steven Rostedt538bafb2009-08-17 16:18:06 +0200170{
171 unsigned int size;
172 char *buf;
173
Arnaldo Carvalho de Meloda378962012-06-27 13:08:42 -0300174 size = read4(pevent);
Steven Rostedt538bafb2009-08-17 16:18:06 +0200175 if (!size)
176 return;
177
OGAWA Hirofumi7691b1e2009-12-06 20:10:49 +0900178 buf = malloc_or_die(size + 1);
Steven Rostedt538bafb2009-08-17 16:18:06 +0200179 read_or_die(buf, size);
OGAWA Hirofumi7691b1e2009-12-06 20:10:49 +0900180 buf[size] = '\0';
Steven Rostedt538bafb2009-08-17 16:18:06 +0200181
Arnaldo Carvalho de Meloda378962012-06-27 13:08:42 -0300182 parse_proc_kallsyms(pevent, buf, size);
Steven Rostedt538bafb2009-08-17 16:18:06 +0200183
184 free(buf);
185}
186
Arnaldo Carvalho de Meloda378962012-06-27 13:08:42 -0300187static void read_ftrace_printk(struct pevent *pevent)
Steven Rostedt538bafb2009-08-17 16:18:06 +0200188{
189 unsigned int size;
190 char *buf;
191
Arnaldo Carvalho de Meloda378962012-06-27 13:08:42 -0300192 size = read4(pevent);
Steven Rostedt538bafb2009-08-17 16:18:06 +0200193 if (!size)
194 return;
195
196 buf = malloc_or_die(size);
197 read_or_die(buf, size);
198
Arnaldo Carvalho de Meloda378962012-06-27 13:08:42 -0300199 parse_ftrace_printk(pevent, buf, size);
Steven Rostedt538bafb2009-08-17 16:18:06 +0200200
201 free(buf);
202}
203
Arnaldo Carvalho de Meloda378962012-06-27 13:08:42 -0300204static void read_header_files(struct pevent *pevent)
Steven Rostedt538bafb2009-08-17 16:18:06 +0200205{
206 unsigned long long size;
Steven Rostedt538bafb2009-08-17 16:18:06 +0200207 char *header_event;
208 char buf[BUFSIZ];
209
210 read_or_die(buf, 12);
211
212 if (memcmp(buf, "header_page", 12) != 0)
213 die("did not read header page");
214
Arnaldo Carvalho de Meloda378962012-06-27 13:08:42 -0300215 size = read8(pevent);
Frederic Weisbeckerd00a47c2010-05-01 03:08:46 +0200216 skip(size);
Steven Rostedt538bafb2009-08-17 16:18:06 +0200217
218 /*
219 * The size field in the page is of type long,
220 * use that instead, since it represents the kernel.
221 */
222 long_size = header_page_size_size;
223
224 read_or_die(buf, 13);
225 if (memcmp(buf, "header_event", 13) != 0)
226 die("did not read header event");
227
Arnaldo Carvalho de Meloda378962012-06-27 13:08:42 -0300228 size = read8(pevent);
Steven Rostedt538bafb2009-08-17 16:18:06 +0200229 header_event = malloc_or_die(size);
230 read_or_die(header_event, size);
231 free(header_event);
232}
233
Arnaldo Carvalho de Meloda378962012-06-27 13:08:42 -0300234static void read_ftrace_file(struct pevent *pevent, unsigned long long size)
Steven Rostedt538bafb2009-08-17 16:18:06 +0200235{
236 char *buf;
237
238 buf = malloc_or_die(size);
239 read_or_die(buf, size);
Arnaldo Carvalho de Meloda378962012-06-27 13:08:42 -0300240 parse_ftrace_file(pevent, buf, size);
Steven Rostedt538bafb2009-08-17 16:18:06 +0200241 free(buf);
242}
243
Arnaldo Carvalho de Meloda378962012-06-27 13:08:42 -0300244static void read_event_file(struct pevent *pevent, char *sys,
245 unsigned long long size)
Steven Rostedt538bafb2009-08-17 16:18:06 +0200246{
247 char *buf;
248
249 buf = malloc_or_die(size);
250 read_or_die(buf, size);
Arnaldo Carvalho de Meloda378962012-06-27 13:08:42 -0300251 parse_event_file(pevent, buf, size, sys);
Steven Rostedt538bafb2009-08-17 16:18:06 +0200252 free(buf);
253}
254
Arnaldo Carvalho de Meloda378962012-06-27 13:08:42 -0300255static void read_ftrace_files(struct pevent *pevent)
Steven Rostedt538bafb2009-08-17 16:18:06 +0200256{
257 unsigned long long size;
258 int count;
259 int i;
260
Arnaldo Carvalho de Meloda378962012-06-27 13:08:42 -0300261 count = read4(pevent);
Steven Rostedt538bafb2009-08-17 16:18:06 +0200262
263 for (i = 0; i < count; i++) {
Arnaldo Carvalho de Meloda378962012-06-27 13:08:42 -0300264 size = read8(pevent);
265 read_ftrace_file(pevent, size);
Steven Rostedt538bafb2009-08-17 16:18:06 +0200266 }
267}
268
Arnaldo Carvalho de Meloda378962012-06-27 13:08:42 -0300269static void read_event_files(struct pevent *pevent)
Steven Rostedt538bafb2009-08-17 16:18:06 +0200270{
271 unsigned long long size;
272 char *sys;
273 int systems;
274 int count;
275 int i,x;
276
Arnaldo Carvalho de Meloda378962012-06-27 13:08:42 -0300277 systems = read4(pevent);
Steven Rostedt538bafb2009-08-17 16:18:06 +0200278
279 for (i = 0; i < systems; i++) {
280 sys = read_string();
281
Arnaldo Carvalho de Meloda378962012-06-27 13:08:42 -0300282 count = read4(pevent);
Steven Rostedt538bafb2009-08-17 16:18:06 +0200283 for (x=0; x < count; x++) {
Arnaldo Carvalho de Meloda378962012-06-27 13:08:42 -0300284 size = read8(pevent);
285 read_event_file(pevent, sys, size);
Steven Rostedt538bafb2009-08-17 16:18:06 +0200286 }
287 }
288}
289
290struct cpu_data {
291 unsigned long long offset;
292 unsigned long long size;
293 unsigned long long timestamp;
Steven Rostedt1c698182012-04-06 00:48:06 +0200294 struct pevent_record *next;
Steven Rostedt538bafb2009-08-17 16:18:06 +0200295 char *page;
296 int cpu;
297 int index;
298 int page_size;
299};
300
301static struct cpu_data *cpu_data;
302
303static void update_cpu_data_index(int cpu)
304{
305 cpu_data[cpu].offset += page_size;
306 cpu_data[cpu].size -= page_size;
307 cpu_data[cpu].index = 0;
308}
309
310static void get_next_page(int cpu)
311{
Xiao Guangrongf887f302010-02-04 16:46:42 +0800312 off_t save_seek;
313 off_t ret;
Steven Rostedt538bafb2009-08-17 16:18:06 +0200314
315 if (!cpu_data[cpu].page)
316 return;
317
318 if (read_page) {
319 if (cpu_data[cpu].size <= page_size) {
320 free(cpu_data[cpu].page);
321 cpu_data[cpu].page = NULL;
322 return;
323 }
324
325 update_cpu_data_index(cpu);
326
327 /* other parts of the code may expect the pointer to not move */
Xiao Guangrongf887f302010-02-04 16:46:42 +0800328 save_seek = lseek(input_fd, 0, SEEK_CUR);
Steven Rostedt538bafb2009-08-17 16:18:06 +0200329
Xiao Guangrongf887f302010-02-04 16:46:42 +0800330 ret = lseek(input_fd, cpu_data[cpu].offset, SEEK_SET);
331 if (ret == (off_t)-1)
Steven Rostedt538bafb2009-08-17 16:18:06 +0200332 die("failed to lseek");
333 ret = read(input_fd, cpu_data[cpu].page, page_size);
334 if (ret < 0)
335 die("failed to read page");
336
337 /* reset the file pointer back */
Xiao Guangrongf887f302010-02-04 16:46:42 +0800338 lseek(input_fd, save_seek, SEEK_SET);
Steven Rostedt538bafb2009-08-17 16:18:06 +0200339
340 return;
341 }
342
343 munmap(cpu_data[cpu].page, page_size);
344 cpu_data[cpu].page = NULL;
345
346 if (cpu_data[cpu].size <= page_size)
347 return;
348
349 update_cpu_data_index(cpu);
350
351 cpu_data[cpu].page = mmap(NULL, page_size, PROT_READ, MAP_PRIVATE,
352 input_fd, cpu_data[cpu].offset);
353 if (cpu_data[cpu].page == MAP_FAILED)
354 die("failed to mmap cpu %d at offset 0x%llx",
355 cpu, cpu_data[cpu].offset);
356}
357
358static unsigned int type_len4host(unsigned int type_len_ts)
359{
360 if (file_bigendian)
361 return (type_len_ts >> 27) & ((1 << 5) - 1);
362 else
363 return type_len_ts & ((1 << 5) - 1);
364}
365
366static unsigned int ts4host(unsigned int type_len_ts)
367{
368 if (file_bigendian)
369 return type_len_ts & ((1 << 27) - 1);
370 else
371 return type_len_ts >> 5;
372}
373
374static int calc_index(void *ptr, int cpu)
375{
376 return (unsigned long)ptr - (unsigned long)cpu_data[cpu].page;
377}
378
Arnaldo Carvalho de Meloda378962012-06-27 13:08:42 -0300379struct pevent_record *trace_peek_data(struct pevent *pevent, int cpu)
Steven Rostedt538bafb2009-08-17 16:18:06 +0200380{
Steven Rostedt1c698182012-04-06 00:48:06 +0200381 struct pevent_record *data;
Steven Rostedt538bafb2009-08-17 16:18:06 +0200382 void *page = cpu_data[cpu].page;
383 int idx = cpu_data[cpu].index;
384 void *ptr = page + idx;
385 unsigned long long extend;
386 unsigned int type_len_ts;
387 unsigned int type_len;
388 unsigned int delta;
389 unsigned int length = 0;
390
391 if (cpu_data[cpu].next)
392 return cpu_data[cpu].next;
393
394 if (!page)
395 return NULL;
396
397 if (!idx) {
398 /* FIXME: handle header page */
399 if (header_page_ts_size != 8)
400 die("expected a long long type for timestamp");
Arnaldo Carvalho de Meloda378962012-06-27 13:08:42 -0300401 cpu_data[cpu].timestamp = data2host8(pevent, ptr);
Steven Rostedt538bafb2009-08-17 16:18:06 +0200402 ptr += 8;
403 switch (header_page_size_size) {
404 case 4:
Arnaldo Carvalho de Meloda378962012-06-27 13:08:42 -0300405 cpu_data[cpu].page_size = data2host4(pevent, ptr);
Steven Rostedt538bafb2009-08-17 16:18:06 +0200406 ptr += 4;
407 break;
408 case 8:
Arnaldo Carvalho de Meloda378962012-06-27 13:08:42 -0300409 cpu_data[cpu].page_size = data2host8(pevent, ptr);
Steven Rostedt538bafb2009-08-17 16:18:06 +0200410 ptr += 8;
411 break;
412 default:
413 die("bad long size");
414 }
415 ptr = cpu_data[cpu].page + header_page_data_offset;
416 }
417
418read_again:
419 idx = calc_index(ptr, cpu);
420
421 if (idx >= cpu_data[cpu].page_size) {
422 get_next_page(cpu);
Arnaldo Carvalho de Meloda378962012-06-27 13:08:42 -0300423 return trace_peek_data(pevent, cpu);
Steven Rostedt538bafb2009-08-17 16:18:06 +0200424 }
425
Arnaldo Carvalho de Meloda378962012-06-27 13:08:42 -0300426 type_len_ts = data2host4(pevent, ptr);
Steven Rostedt538bafb2009-08-17 16:18:06 +0200427 ptr += 4;
428
429 type_len = type_len4host(type_len_ts);
430 delta = ts4host(type_len_ts);
431
432 switch (type_len) {
433 case RINGBUF_TYPE_PADDING:
434 if (!delta)
435 die("error, hit unexpected end of page");
Arnaldo Carvalho de Meloda378962012-06-27 13:08:42 -0300436 length = data2host4(pevent, ptr);
Steven Rostedt538bafb2009-08-17 16:18:06 +0200437 ptr += 4;
438 length *= 4;
439 ptr += length;
440 goto read_again;
441
442 case RINGBUF_TYPE_TIME_EXTEND:
Arnaldo Carvalho de Meloda378962012-06-27 13:08:42 -0300443 extend = data2host4(pevent, ptr);
Steven Rostedt538bafb2009-08-17 16:18:06 +0200444 ptr += 4;
445 extend <<= TS_SHIFT;
446 extend += delta;
447 cpu_data[cpu].timestamp += extend;
448 goto read_again;
449
450 case RINGBUF_TYPE_TIME_STAMP:
451 ptr += 12;
452 break;
453 case 0:
Arnaldo Carvalho de Meloda378962012-06-27 13:08:42 -0300454 length = data2host4(pevent, ptr);
Steven Rostedt538bafb2009-08-17 16:18:06 +0200455 ptr += 4;
456 die("here! length=%d", length);
457 break;
458 default:
459 length = type_len * 4;
460 break;
461 }
462
463 cpu_data[cpu].timestamp += delta;
464
465 data = malloc_or_die(sizeof(*data));
466 memset(data, 0, sizeof(*data));
467
468 data->ts = cpu_data[cpu].timestamp;
469 data->size = length;
470 data->data = ptr;
471 ptr += length;
472
473 cpu_data[cpu].index = calc_index(ptr, cpu);
474 cpu_data[cpu].next = data;
475
476 return data;
477}
478
Arnaldo Carvalho de Meloda378962012-06-27 13:08:42 -0300479struct pevent_record *trace_read_data(struct pevent *pevent, int cpu)
Steven Rostedt538bafb2009-08-17 16:18:06 +0200480{
Steven Rostedt1c698182012-04-06 00:48:06 +0200481 struct pevent_record *data;
Steven Rostedt538bafb2009-08-17 16:18:06 +0200482
Arnaldo Carvalho de Meloda378962012-06-27 13:08:42 -0300483 data = trace_peek_data(pevent, cpu);
Steven Rostedt538bafb2009-08-17 16:18:06 +0200484 cpu_data[cpu].next = NULL;
485
486 return data;
487}
488
Arnaldo Carvalho de Meloda378962012-06-27 13:08:42 -0300489ssize_t trace_report(int fd, struct pevent **ppevent, bool __repipe)
Steven Rostedt538bafb2009-08-17 16:18:06 +0200490{
Steven Rostedt538bafb2009-08-17 16:18:06 +0200491 char buf[BUFSIZ];
492 char test[] = { 23, 8, 68 };
493 char *version;
Ingo Molnard9340c12009-09-12 10:08:34 +0200494 int show_version = 0;
Steven Rostedt538bafb2009-08-17 16:18:06 +0200495 int show_funcs = 0;
496 int show_printk = 0;
Tom Zanussi92155452010-04-01 23:59:21 -0500497 ssize_t size;
498
499 calc_data_size = 1;
Tom Zanussi454c4072010-05-01 01:41:20 -0500500 repipe = __repipe;
Steven Rostedt538bafb2009-08-17 16:18:06 +0200501
Frederic Weisbecker03456a12009-10-06 23:36:47 +0200502 input_fd = fd;
Steven Rostedt538bafb2009-08-17 16:18:06 +0200503
504 read_or_die(buf, 3);
505 if (memcmp(buf, test, 3) != 0)
Arnaldo Carvalho de Meloe2561362009-11-21 14:31:26 -0200506 die("no trace data in the file");
Steven Rostedt538bafb2009-08-17 16:18:06 +0200507
508 read_or_die(buf, 7);
509 if (memcmp(buf, "tracing", 7) != 0)
Arnaldo Carvalho de Meloe2561362009-11-21 14:31:26 -0200510 die("not a trace file (missing 'tracing' tag)");
Steven Rostedt538bafb2009-08-17 16:18:06 +0200511
512 version = read_string();
Ingo Molnard9340c12009-09-12 10:08:34 +0200513 if (show_version)
514 printf("version = %s\n", version);
Steven Rostedt538bafb2009-08-17 16:18:06 +0200515 free(version);
516
517 read_or_die(buf, 1);
518 file_bigendian = buf[0];
519 host_bigendian = bigendian();
520
Arnaldo Carvalho de Meloda378962012-06-27 13:08:42 -0300521 *ppevent = read_trace_init(file_bigendian, host_bigendian);
522 if (*ppevent == NULL)
523 die("read_trace_init failed");
Steven Rostedtaaf045f2012-04-06 00:47:56 +0200524
Steven Rostedt538bafb2009-08-17 16:18:06 +0200525 read_or_die(buf, 1);
526 long_size = buf[0];
527
Arnaldo Carvalho de Meloda378962012-06-27 13:08:42 -0300528 page_size = read4(*ppevent);
Steven Rostedt538bafb2009-08-17 16:18:06 +0200529
Arnaldo Carvalho de Meloda378962012-06-27 13:08:42 -0300530 read_header_files(*ppevent);
Steven Rostedt538bafb2009-08-17 16:18:06 +0200531
Arnaldo Carvalho de Meloda378962012-06-27 13:08:42 -0300532 read_ftrace_files(*ppevent);
533 read_event_files(*ppevent);
534 read_proc_kallsyms(*ppevent);
535 read_ftrace_printk(*ppevent);
Steven Rostedt538bafb2009-08-17 16:18:06 +0200536
Tom Zanussi92155452010-04-01 23:59:21 -0500537 size = calc_data_size - 1;
538 calc_data_size = 0;
Tom Zanussi454c4072010-05-01 01:41:20 -0500539 repipe = false;
Tom Zanussi92155452010-04-01 23:59:21 -0500540
Steven Rostedt538bafb2009-08-17 16:18:06 +0200541 if (show_funcs) {
Arnaldo Carvalho de Meloda378962012-06-27 13:08:42 -0300542 pevent_print_funcs(*ppevent);
Tom Zanussi92155452010-04-01 23:59:21 -0500543 return size;
Steven Rostedt538bafb2009-08-17 16:18:06 +0200544 }
545 if (show_printk) {
Arnaldo Carvalho de Meloda378962012-06-27 13:08:42 -0300546 pevent_print_printk(*ppevent);
Tom Zanussi92155452010-04-01 23:59:21 -0500547 return size;
Steven Rostedt538bafb2009-08-17 16:18:06 +0200548 }
549
Tom Zanussi92155452010-04-01 23:59:21 -0500550 return size;
Steven Rostedt538bafb2009-08-17 16:18:06 +0200551}