From: Steven Rostedt <rostedt@goodmis.org>
To: Arun Sharma <asharma@fb.com>
Cc: linux-kernel@vger.kernel.org,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Arnaldo Carvalho de Melo <acme@infradead.org>,
Andrew Vagin <avagin@openvz.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH 2/2] tracing, sched: Add a new tracepoint for sleeptime
Date: Tue, 20 Dec 2011 13:16:35 -0500 [thread overview]
Message-ID: <1324404995.5916.66.camel@gandalf.stny.rr.com> (raw)
In-Reply-To: <1324404558-353-3-git-send-email-asharma@fb.com>
On Tue, 2011-12-20 at 10:09 -0800, Arun Sharma wrote:
> If CONFIG_SCHEDSTATS is defined, the kernel maintains
> information about how long the task was sleeping or
> in the case of iowait, blocking in the kernel before
> getting woken up.
>
> Note: this information is only provided for sched_fair.
> Other scheduling classes may choose to provide this in
> the future.
>
> Note: the delay includes the time spent on the runqueue
> as well.
>
> Signed-off-by: Arun Sharma <asharma@fb.com>
> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
> Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
> Cc: Andrew Vagin <avagin@openvz.org>
> Cc: Frederic Weisbecker <fweisbec@gmail.com>
> Cc: Ingo Molnar <mingo@elte.hu>
> Cc: linux-kernel@vger.kernel.org
> ---
> include/trace/events/sched.h | 48 ++++++++++++++++++++++++++++++++++++++++++
> kernel/sched/core.c | 1 +
> 2 files changed, 49 insertions(+), 0 deletions(-)
>
> diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
> index 959ff18..5189220 100644
> --- a/include/trace/events/sched.h
> +++ b/include/trace/events/sched.h
> @@ -363,6 +363,54 @@ TRACE_EVENT(sched_stat_runtime,
> (unsigned long long)__entry->vruntime)
> );
>
> +#ifdef CREATE_TRACE_POINTS
Why the #ifdef? a static inline is fine to keep in the open. If nothing
uses it, then it just wont be used or defined.
-- Steve
> +static inline u64 trace_get_sleeptime(struct task_struct *tsk)
> +{
> +#ifdef CONFIG_SCHEDSTATS
> + u64 block, sleep;
> +
> + block = tsk->se.statistics.block_start;
> + sleep = tsk->se.statistics.sleep_start;
> +
> + return block ? block : sleep ? sleep : 0;
> +#else
> + return 0;
> +#endif
> +}
> +#endif
> +
> +
next prev parent reply other threads:[~2011-12-20 18:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-20 18:09 [PATCH 0/2] Sleep Profiling v2 Arun Sharma
2011-12-20 18:09 ` [PATCH 1/2] sched: Retain sleep/block information Arun Sharma
2011-12-20 18:09 ` [PATCH 2/2] tracing, sched: Add a new tracepoint for sleeptime Arun Sharma
2011-12-20 18:16 ` Steven Rostedt [this message]
2011-12-20 18:22 ` Arun Sharma
2011-12-20 19:19 ` Steven Rostedt
2011-12-21 10:43 ` Andrey Vagin
2011-12-22 0:18 ` Arun Sharma
2012-01-19 22:30 ` Arun Sharma
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=1324404995.5916.66.camel@gandalf.stny.rr.com \
--to=rostedt@goodmis.org \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@infradead.org \
--cc=asharma@fb.com \
--cc=avagin@openvz.org \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mingo@elte.hu \
/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
all inboxes | Powered by JetHome®