OSDN Git Service

ANDROID: sched/events: Introduce sched_entity load tracking trace event
authorDietmar Eggemann <dietmar.eggemann@arm.com>
Mon, 20 Mar 2017 17:26:47 +0000 (17:26 +0000)
committerChris Redpath <chris.redpath@arm.com>
Tue, 19 Dec 2017 16:50:55 +0000 (16:50 +0000)
commitacfe25da35512f922915f11a3e7b5ad270baae50
tree6e033572ca76fbd048f7aac8ffd6aab3f888a5c2
parent15f5eaa7e356e6d1854722403ce099905698361e
ANDROID: sched/events: Introduce sched_entity load tracking trace event

The trace event keys load and util (utilization) are mapped to:

 (1) load : se->avg.load_avg

 (2) util : se->avg.util_avg

To let this trace event work for configurations w/ and w/o group
scheduling support for cfs (CONFIG_FAIR_GROUP_SCHED) the following
special handling is necessary for non-existent key=value pairs:

 path = "(null)" : In case of !CONFIG_FAIR_GROUP_SCHED or the
                   sched_entity represents a task.

 comm = "(null)" : In case sched_entity represents a task_group.

 pid = -1        : In case sched_entity represents a task_group.

The following list shows examples of the key=value pairs in different
configurations for:

 (1) a task:

     cpu=0 path=(null) comm=sshd pid=2206 load=102 util=102

 (2) a taskgroup:

     cpu=1 path=/tg1/tg11/tg111 comm=(null) pid=-1 load=882 util=510

 (3) an autogroup:

     cpu=0 path=/autogroup-13 comm=(null) pid=-1 load=49 util=48

 (4) w/o CONFIG_FAIR_GROUP_SCHED:

     cpu=0 path=(null) comm=sshd pid=2211 load=301 util=265

The trace event is only defined for CONFIG_SMP.

The helper functions __trace_sched_cpu(), __trace_sched_path() and
__trace_sched_id() are extended to deal with sched_entities as well.

Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Change-Id: Ia628795d7f0fd54e22a1daeb6e3d37b30ab85583
Signed-off-by: Chris Redpath <chris.redpath@arm.com>
include/trace/events/sched.h
kernel/sched/fair.c