perf/core: Store context switch out type in PERF_RECORD_SWITCH[_CPU_WIDE]
authorAlexey Budankov <[email protected]>
Mon, 9 Apr 2018 07:25:32 +0000 (10:25 +0300)
committerArnaldo Carvalho de Melo <[email protected]>
Tue, 17 Apr 2018 12:47:39 +0000 (09:47 -0300)
commit101592b4904ecf6b8ed2a4784d41d180319d95a1
treef8e1c8fefe00c62600474711085692adfad8971d
parente2f73a1828e9ffd2765ce1726b9a9c6e022e3cd6
perf/core: Store context switch out type in PERF_RECORD_SWITCH[_CPU_WIDE]

Store preempting context switch out event into Perf trace as a part of
PERF_RECORD_SWITCH[_CPU_WIDE] record.

Percentage of preempting and non-preempting context switches help
understanding the nature of workloads (CPU or IO bound) that are running
on a machine;

The event is treated as preemption one when task->state value of the
thread being switched out is TASK_RUNNING. Event type encoding is
implemented using PERF_RECORD_MISC_SWITCH_OUT_PREEMPT bit;

Signed-off-by: Alexey Budankov <[email protected]>
Acked-by: Peter Zijlstra <[email protected]>
Tested-by: Arnaldo Carvalho de Melo <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Andi Kleen <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Namhyung Kim <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
include/uapi/linux/perf_event.h
kernel/events/core.c
tools/include/uapi/linux/perf_event.h