From: Frederic Weisbecker <fweisbec@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@elte.hu>,
linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Peter Zijlstra <peterz@infradead.org>,
Thomas Gleixner <tglx@linutronix.de>,
Steven Rostedt <srostedt@redhat.com>
Subject: Re: [PATCH][GIT PULL] function-graph: add option for include sleep times
Date: Tue, 24 Mar 2009 20:59:40 +0100 [thread overview]
Message-ID: <20090324195939.GA5975@nowhere> (raw)
In-Reply-To: <alpine.DEB.2.00.0903241127290.22830@gandalf.stny.rr.com>
On Tue, Mar 24, 2009 at 11:28:09AM -0400, Steven Rostedt wrote:
>
> Ingo,
>
> Please pull the latest tip/tracing/ftrace tree, which can be found at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
> tip/tracing/ftrace
>
>
> Steven Rostedt (1):
> function-graph: add option for include sleep times
>
> ----
> kernel/trace/ftrace.c | 7 +++++++
> kernel/trace/trace.c | 3 ++-
> kernel/trace/trace.h | 1 +
> 3 files changed, 10 insertions(+), 1 deletions(-)
> ---------------------------
> commit be6f164a02f394675e2ac2077dd354cebef5b4c0
> Author: Steven Rostedt <srostedt@redhat.com>
> Date: Tue Mar 24 11:06:24 2009 -0400
>
> function-graph: add option for include sleep times
>
> Impact: give user a choice to show times spent while sleeping
>
> The user may want to see the time a function spent sleeping.
> This patch adds the trace option "sleep-time" to allow that.
> The "sleep-time" option is default on.
>
> echo sleep-time > /debug/tracing/trace_options
Yeah, I thinks it's better to let it be chosen.
Thanks for this series!
Frederic.
> produces:
>
> ------------------------------------------
> 2) avahi-d-3428 => <idle>-0
> ------------------------------------------
>
> 2) | finish_task_switch() {
> 2) 0.621 us | _spin_unlock_irq();
> 2) 2.202 us | }
> 2) ! 1002.197 us | }
> 2) ! 1003.521 us | }
>
> where as,
>
> echo nosleep-time > /debug/tracing/trace_options
>
> produces:
>
> 0) <idle>-0 => yum-upd-3416
> ------------------------------------------
>
> 0) | finish_task_switch() {
> 0) 0.643 us | _spin_unlock_irq();
> 0) 2.342 us | }
> 0) + 41.302 us | }
> 0) + 42.453 us | }
>
> Signed-off-by: Steven Rostedt <srostedt@redhat.com>
>
> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> index 0b90364..02d2de9 100644
> --- a/kernel/trace/ftrace.c
> +++ b/kernel/trace/ftrace.c
> @@ -2599,6 +2599,13 @@ ftrace_graph_probe_sched_switch(struct rq *__rq, struct task_struct *prev,
> unsigned long long timestamp;
> int index;
>
> + /*
> + * Does the user want to count the time a function was asleep.
> + * If so, do not update the time stamps.
> + */
> + if (trace_flags & TRACE_ITER_SLEEP_TIME)
> + return;
> +
> timestamp = trace_clock_local();
>
> prev->ftrace_timestamp = timestamp;
> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> index f0e1337..67c6a21 100644
> --- a/kernel/trace/trace.c
> +++ b/kernel/trace/trace.c
> @@ -255,7 +255,7 @@ static DECLARE_WAIT_QUEUE_HEAD(trace_wait);
>
> /* trace_flags holds trace_options default values */
> unsigned long trace_flags = TRACE_ITER_PRINT_PARENT | TRACE_ITER_PRINTK |
> - TRACE_ITER_ANNOTATE | TRACE_ITER_CONTEXT_INFO;
> + TRACE_ITER_ANNOTATE | TRACE_ITER_CONTEXT_INFO | TRACE_ITER_SLEEP_TIME;
>
> /**
> * trace_wake_up - wake up tasks waiting for trace input
> @@ -316,6 +316,7 @@ static const char *trace_options[] = {
> "context-info",
> "latency-format",
> "global-clock",
> + "sleep-time",
> NULL
> };
>
> diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
> index 7cfb741..d7410bb 100644
> --- a/kernel/trace/trace.h
> +++ b/kernel/trace/trace.h
> @@ -683,6 +683,7 @@ enum trace_iterator_flags {
> TRACE_ITER_CONTEXT_INFO = 0x20000, /* Print pid/cpu/time */
> TRACE_ITER_LATENCY_FMT = 0x40000,
> TRACE_ITER_GLOBAL_CLK = 0x80000,
> + TRACE_ITER_SLEEP_TIME = 0x100000,
> };
>
> /*
>
>
prev parent reply other threads:[~2009-03-24 19:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-24 13:54 [PATCH 0/3] [GIT PULL] updates for tip/tracing/ftrace Steven Rostedt
2009-03-24 13:54 ` [PATCH 1/3] function-graph: moved the timestamp from arch to generic code Steven Rostedt
2009-03-24 13:54 ` [PATCH 2/3] function-graph: prevent more than one tracer registering Steven Rostedt
2009-03-24 13:54 ` [PATCH 3/3] function-graph: ignore times across schedule Steven Rostedt
2009-03-24 13:58 ` Ingo Molnar
2009-03-24 15:27 ` Steven Rostedt
2009-03-24 15:28 ` [PATCH][GIT PULL] function-graph: add option for include sleep times Steven Rostedt
2009-03-24 15:38 ` Ingo Molnar
2009-03-24 19:59 ` Frederic Weisbecker [this message]
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=20090324195939.GA5975@nowhere \
--to=fweisbec@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=srostedt@redhat.com \
--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