From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: Don't trace __switch_to if function graph tracer is enabled
Date: Wed, 4 Jan 2017 15:12:36 +0000 [thread overview]
Message-ID: <20170104151235.GI18193@arm.com> (raw)
In-Reply-To: <1482360288-124624-1-git-send-email-joelaf@google.com>
On Wed, Dec 21, 2016 at 02:44:46PM -0800, Joel Fernandes wrote:
> Function graph tracer shows negative time (wrap around) when tracing
> __switch_to if the nosleep-time trace option is enabled.
>
> Time compensation for nosleep-time is done by an ftrace probe on
> sched_switch. This doesn't work well for the following events (with
> letters representing timestamps):
> A - sched switch probe called for task T switch out
> B - __switch_to calltime is recorded
> C - sched_switch probe called for task T switch in
> D - __switch_to rettime is recorded
>
> If C - A > D - B, then we end up over compensating for the time spent in
> __switch_to giving rise to negative times in the trace output.
>
> On x86, __switch_to is not traced if function graph tracer is enabled.
> Do the same for arm64 as well.
>
> Cc: Todd Kjos <tkjos@google.com>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Signed-off-by: Joel Fernandes <joelaf@google.com>
> ---
> arch/arm64/kernel/process.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Thanks, queued for 4.11.
Will
WARNING: multiple messages have this Message-ID (diff)
From: Will Deacon <will.deacon@arm.com>
To: Joel Fernandes <joelaf@google.com>
Cc: linux-kernel@vger.kernel.org, Todd Kjos <tkjos@google.com>,
Steven Rostedt <rostedt@goodmis.org>,
Mark Rutland <mark.rutland@arm.com>,
Catalin Marinas <catalin.marinas@arm.com>,
James Morse <james.morse@arm.com>,
Andrew Morton <akpm@linux-foundation.org>,
Kees Cook <keescook@chromium.org>,
Jason Cooper <jason@lakedaemon.net>, Jiri Slaby <jslaby@suse.cz>,
"moderated list:ARM64 PORT (AARCH64 ARCHITECTURE)"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] arm64: Don't trace __switch_to if function graph tracer is enabled
Date: Wed, 4 Jan 2017 15:12:36 +0000 [thread overview]
Message-ID: <20170104151235.GI18193@arm.com> (raw)
In-Reply-To: <1482360288-124624-1-git-send-email-joelaf@google.com>
On Wed, Dec 21, 2016 at 02:44:46PM -0800, Joel Fernandes wrote:
> Function graph tracer shows negative time (wrap around) when tracing
> __switch_to if the nosleep-time trace option is enabled.
>
> Time compensation for nosleep-time is done by an ftrace probe on
> sched_switch. This doesn't work well for the following events (with
> letters representing timestamps):
> A - sched switch probe called for task T switch out
> B - __switch_to calltime is recorded
> C - sched_switch probe called for task T switch in
> D - __switch_to rettime is recorded
>
> If C - A > D - B, then we end up over compensating for the time spent in
> __switch_to giving rise to negative times in the trace output.
>
> On x86, __switch_to is not traced if function graph tracer is enabled.
> Do the same for arm64 as well.
>
> Cc: Todd Kjos <tkjos@google.com>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Signed-off-by: Joel Fernandes <joelaf@google.com>
> ---
> arch/arm64/kernel/process.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Thanks, queued for 4.11.
Will
next prev parent reply other threads:[~2017-01-04 15:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-21 22:44 [PATCH] arm64: Don't trace __switch_to if function graph tracer is enabled Joel Fernandes
2016-12-21 22:44 ` Joel Fernandes
2017-01-04 15:12 ` Will Deacon [this message]
2017-01-04 15:12 ` Will Deacon
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=20170104151235.GI18193@arm.com \
--to=will.deacon@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.