perf sched timehist: Split is_idle_sample()
authorNamhyung Kim <namhyung@kernel.org>
Thu, 8 Dec 2016 14:47:50 +0000 (23:47 +0900)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 15 Dec 2016 19:25:44 +0000 (16:25 -0300)
commit96039c7c52e03b7d6dd773664e74b79e3ae9856a
tree03b1b662e987349e6c9267b3fa0bb6756066d807
parentaeafd623f866c429307e3a4a39998f5f06b4f00e
perf sched timehist: Split is_idle_sample()

The is_idle_sample() function actually does more than determining
whether sample come from idle task.  Split the callchain part into
save_task_callchain() to make it clearer.

Also checking prev_pid from trace data looks preferred than just
checking sample->pid since it's possible, although rare, to have invalid
0 pid/tid on scheduling an exiting task.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: David Ahern <dsahern@gmail.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20161208144755.16673-2-namhyung@kernel.org
[ Remove some needless () in some return statements ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-sched.c