perf: Use event__process_task from perf sched
authorFrederic Weisbecker <[email protected]>
Mon, 31 May 2010 22:03:40 +0000 (00:03 +0200)
committerFrederic Weisbecker <[email protected]>
Mon, 31 May 2010 22:10:32 +0000 (00:10 +0200)
perf sched uses event__process_comm(), which means it can resolve
comms from:

- tasks that have exec'ed (kernel comm events)
- tasks that were running when perf record started the actual
  recording (synthetized comm events)

But perf sched can't resolve the pids of tasks that were created
after the recording started.

To solve this, we need to inherit the comms on fork events using
event__process_task().

This fixes various unresolved pids in perf sched, easily visible
with:
perf sched record perf bench sched messaging

Signed-off-by: Frederic Weisbecker <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Tom Zanussi <[email protected]>
Cc: Stephane Eranian <[email protected]>
tools/perf/builtin-sched.c

index f67bce2a83b4e090d86a0ecc2dd5a1240521db0a..55f3b5dcc731417198a2e5fd29ac8eefd96e1a5e 100644 (file)
@@ -1645,6 +1645,7 @@ static struct perf_event_ops event_ops = {
        .sample                 = process_sample_event,
        .comm                   = event__process_comm,
        .lost                   = event__process_lost,
+       .fork                   = event__process_task,
        .ordered_samples        = true,
 };