From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: Julien Desfossez <jdesfossez@efficios.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
Thomas Gleixner <tglx@linutronix.de>,
rostedt <rostedt@goodmis.org>, Ingo Molnar <mingo@redhat.com>,
daolivei <daolivei@redhat.com>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH v2 5/5] tracing: add sched_update_prio
Date: Sat, 24 Sep 2016 13:28:51 +0000 (UTC) [thread overview]
Message-ID: <887136036.31284.1474723731191.JavaMail.zimbra@efficios.com> (raw)
In-Reply-To: <1474649375-28056-6-git-send-email-jdesfossez@efficios.com>
----- On Sep 23, 2016, at 12:49 PM, Julien Desfossez jdesfossez@efficios.com wrote:
> This tracepoint allows to keep track of all explicit priority changes of
> a task. It outputs the scheduling policy, the nice value, the
> rt_priority and the deadline-related attributes (dl_runtime, dl_deadline
> and dl_period).
>
> It is emitted in the code path of the sched_setscheduler, sched_setattr,
> sched_setparam, and nice system calls.
>
> This allows the analysis of real-time scheduling delays based on the
> configured scheduling priorities and policies, which cannot be performed
> with the current instrumentation in sched_switch. Also, instead of
> exposing the internal kernel prio field, this tracepoint only outputs
> the user-visible priority attributes.
>
> The effective priority of running threads can also be temporarily
> changed in the PI code, but a dedicated tracepoint is already in place
> to cover this case.
>
> Here are a few output examples:
> After fork of a normal task:
> sched_update_prio: comm=bash pid=2104, policy=SCHED_NORMAL, nice=0,
> rt_priority=0, dl_runtime=0, dl_deadline=0, dl_period=0
>
> renice -n 10 of a normal task:
> sched_update_prio: comm=sleep pid=2130, policy=SCHED_NORMAL, nice=10,
> rt_priority=0, dl_runtime=0, dl_deadline=0, dl_period=0
>
> SCHED_FIFO 60:
> sched_update_prio: comm=chrt pid=2105, policy=SCHED_FIFO, nice=0,
> rt_priority=60, dl_runtime=0, dl_deadline=0, dl_period=0
>
> SCHED_RR 60:
> sched_update_prio: comm=chrt pid=2109, policy=SCHED_RR, nice=0,
> rt_priority=60, dl_runtime=0, dl_deadline=0, dl_period=0
>
> SCHED_DEADLINE:
> sched_update_prio: comm=b pid=2110, policy=SCHED_DEADLINE, nice=0,
> rt_priority=0, dl_runtime=10000000, dl_deadline=30000000,
> dl_period=30000000
>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Steven Rostedt (Red Hat) <rostedt@goodmis.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
> Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
> ---
> include/trace/events/sched.h | 68 ++++++++++++++++++++++++++++++++++++++++++++
> kernel/sched/core.c | 3 ++
> 2 files changed, 71 insertions(+)
>
> diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
> index 582357d..8d3343b 100644
> --- a/include/trace/events/sched.h
> +++ b/include/trace/events/sched.h
> @@ -8,6 +8,34 @@
> #include <linux/tracepoint.h>
> #include <linux/binfmts.h>
>
> +#define SCHEDULING_POLICY \
> + EM( SCHED_NORMAL, "SCHED_NORMAL") \
> + EM( SCHED_FIFO, "SCHED_FIFO") \
> + EM( SCHED_RR, "SCHED_RR") \
> + EM( SCHED_BATCH, "SCHED_BATCH") \
> + EM( SCHED_IDLE, "SCHED_IDLE") \
> + EMe(SCHED_DEADLINE, "SCHED_DEADLINE")
> +
As spotted by the build bot, you should either move this
definition to patch 3/5 (which requires it), or reorder your
patchset to put this patch before the two that require it.
> +/*
> + * First define the enums in the above macros to be exported to userspace
> + * via TRACE_DEFINE_ENUM().
> + */
> +#undef EM
> +#undef EMe
> +#define EM(a, b) TRACE_DEFINE_ENUM(a);
> +#define EMe(a, b) TRACE_DEFINE_ENUM(a);
> +
> +SCHEDULING_POLICY
> +
> +/*
> + * Now redefine the EM() and EMe() macros to map the enums to the strings
> + * that will be printed in the output.
> + */
> +#undef EM
> +#undef EMe
> +#define EM(a, b) {a, b},
> +#define EMe(a, b) {a, b}
> +
Thanks,
Mathieu
--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
next prev parent reply other threads:[~2016-09-24 13:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-23 16:49 [RFC PATCH v2 0/5] Additional scheduling information in tracepoints Julien Desfossez
2016-09-23 16:49 ` [RFC PATCH v2 1/5] sched: get effective policy and rt_prio Julien Desfossez
2016-09-23 16:49 ` [RFC PATCH v2 2/5] tracing: add TRACE_EVENT_MAP Julien Desfossez
2016-09-23 16:49 ` [RFC PATCH v2 3/5] tracing: extend scheduling tracepoints Julien Desfossez
2016-09-23 16:49 ` [RFC PATCH v2 4/5] tracing: extend sched_pi_setprio Julien Desfossez
2016-09-23 16:49 ` [RFC PATCH v2 5/5] tracing: add sched_update_prio Julien Desfossez
2016-09-24 13:28 ` Mathieu Desnoyers [this message]
2016-09-26 12:27 ` [RFC PATCH v2 0/5] Additional scheduling information in tracepoints Peter Zijlstra
2016-09-26 19:37 ` Mathieu Desnoyers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=887136036.31284.1474723731191.JavaMail.zimbra@efficios.com \
--to=mathieu.desnoyers@efficios.com \
--cc=daolivei@redhat.com \
--cc=jdesfossez@efficios.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox