diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2013-09-11 16:18:24 +0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-11-04 11:57:06 -0300 |
commit | 162f0befda3becc2cc9f44075fccc030e55baec1 (patch) | |
tree | 5f8ea7a9a2fcb28d1ab742e73a56497c078a33f9 /tools/perf/builtin-trace.c | |
parent | b9c5143a012a543c4ee872498d6dbae5c10beb2e (diff) | |
download | linux-162f0befda3becc2cc9f44075fccc030e55baec1.tar.gz linux-162f0befda3becc2cc9f44075fccc030e55baec1.tar.bz2 linux-162f0befda3becc2cc9f44075fccc030e55baec1.zip |
perf tools: Add time argument on COMM setting
This way we can later delimit a lifecycle for the COMM and map a hist to
a precise COMM:timeslice couple.
PERF_RECORD_COMM and PERF_RECORD_FORK events that don't have
PERF_SAMPLE_TIME samples can only send 0 value as a timestamp and thus
should overwrite any previous COMM on a given thread because there is no
sensible way to keep track of all the comms lifecycles in a thread
without time informations.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Tested-by: Jiri Olsa <jolsa@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-6tyow99vgmmtt9qwr2u2lqd7@git.kernel.org
[ Made it cope with PERF_RECORD_MMAP2 ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-trace.c')
-rw-r--r-- | tools/perf/builtin-trace.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index dc3da654ff12..95d639212d98 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -1122,7 +1122,7 @@ static size_t trace__fprintf_entry_head(struct trace *trace, struct thread *thre } static int trace__process_event(struct trace *trace, struct machine *machine, - union perf_event *event) + union perf_event *event, struct perf_sample *sample) { int ret = 0; @@ -1130,9 +1130,9 @@ static int trace__process_event(struct trace *trace, struct machine *machine, case PERF_RECORD_LOST: color_fprintf(trace->output, PERF_COLOR_RED, "LOST %" PRIu64 " events!\n", event->lost.lost); - ret = machine__process_lost_event(machine, event); + ret = machine__process_lost_event(machine, event, sample); default: - ret = machine__process_event(machine, event); + ret = machine__process_event(machine, event, sample); break; } @@ -1141,11 +1141,11 @@ static int trace__process_event(struct trace *trace, struct machine *machine, static int trace__tool_process(struct perf_tool *tool, union perf_event *event, - struct perf_sample *sample __maybe_unused, + struct perf_sample *sample, struct machine *machine) { struct trace *trace = container_of(tool, struct trace, tool); - return trace__process_event(trace, machine, event); + return trace__process_event(trace, machine, event, sample); } static int trace__symbols_init(struct trace *trace, struct perf_evlist *evlist) @@ -1751,7 +1751,7 @@ again: trace->base_time = sample.time; if (type != PERF_RECORD_SAMPLE) { - trace__process_event(trace, trace->host, event); + trace__process_event(trace, trace->host, event, &sample); continue; } |