perf tools: Fix tracing info recording
authorJiri Olsa <jolsa@redhat.com>
Thu, 20 Oct 2011 13:59:43 +0000 (15:59 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 20 Oct 2011 14:41:42 +0000 (12:41 -0200)
commit29208e573a9409ee56599cc0157f31b42c7a0235
treed3fab38970ba13235c630f4ab4f70edc217ac628
parentcc02c921a01794f85ad53b396133f11d4ddd17ff
perf tools: Fix tracing info recording

Fixing the way the tracing information is stored within record command.
The current implementation is causing issues for pipe output.

Following commands fail currently:
perf script syscall-counts ls
perf record -e syscalls:sys_exit_read ls | ./perf report -i -

The tracing information is part of the perf data file. It contains
several files from within the tracing debugfs and procs directories.

Beside some static header files, for each tracing event the format
file is added. The /proc/kallsyms file is also added.

The tracing data are stored with preceeding size. This is causing some
dificulties for pipe output, since there's no way to tell debugfs/proc
file size before reading it. So, for pipe output, all the debugfs files
were read twice. Once to get the overall size and once to store the
content itself. This can cause problem in case any of these file
changed, within the storage time.

To fix this behaviour and ensure the integrity of the tracing data, we:
    - read debugfs/proc file into the temp file
    - get temp file size and dump it to the pipe
    - dump the temp file contents to the pipe

Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Neil Horman <nhorman@tuxdriver.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/20111020135943.GD2092@jolsa.brq.redhat.com
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/header.c
tools/perf/util/trace-event-info.c
tools/perf/util/trace-event.h
This page took 0.026596 seconds and 5 git commands to generate.