diff options
author | Phil Auld <pauld@redhat.com> | 2020-06-29 21:23:03 +0200 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2020-07-08 11:39:02 +0200 |
commit | 9d246053a69196c7c27068870e9b4b66ac536f68 (patch) | |
tree | 25cd59b9266c05a1bd7aab1792d084860f2965f6 /include/trace | |
parent | net: Restrict receive packets queuing to housekeeping CPUs (diff) | |
download | linux-9d246053a69196c7c27068870e9b4b66ac536f68.tar.xz linux-9d246053a69196c7c27068870e9b4b66ac536f68.zip |
sched: Add a tracepoint to track rq->nr_running
Add a bare tracepoint trace_sched_update_nr_running_tp which tracks
->nr_running CPU's rq. This is used to accurately trace this data and
provide a visualization of scheduler imbalances in, for example, the
form of a heat map. The tracepoint is accessed by loading an external
kernel module. An example module (forked from Qais' module and including
the pelt related tracepoints) can be found at:
https://github.com/auldp/tracepoints-helpers.git
A script to turn the trace-cmd report output into a heatmap plot can be
found at:
https://github.com/jirvoz/plot-nr-running
The tracepoints are added to add_nr_running() and sub_nr_running() which
are in kernel/sched/sched.h. In order to avoid CREATE_TRACE_POINTS in
the header a wrapper call is used and the trace/events/sched.h include
is moved before sched.h in kernel/sched/core.
Signed-off-by: Phil Auld <pauld@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20200629192303.GC120228@lorien.usersys.redhat.com
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/events/sched.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h index 04f9a4c7b0d9..0d5ff0958d48 100644 --- a/include/trace/events/sched.h +++ b/include/trace/events/sched.h @@ -642,6 +642,10 @@ DECLARE_TRACE(sched_util_est_se_tp, TP_PROTO(struct sched_entity *se), TP_ARGS(se)); +DECLARE_TRACE(sched_update_nr_running_tp, + TP_PROTO(struct rq *rq, int change), + TP_ARGS(rq, change)); + #endif /* _TRACE_SCHED_H */ /* This part must be outside protection */ |