From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759855AbdADPVe (ORCPT ); Wed, 4 Jan 2017 10:21:34 -0500 Received: from foss.arm.com ([217.140.101.70]:53236 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967224AbdADPVB (ORCPT ); Wed, 4 Jan 2017 10:21:01 -0500 Date: Wed, 4 Jan 2017 15:12:36 +0000 From: Will Deacon To: Joel Fernandes Cc: linux-kernel@vger.kernel.org, Todd Kjos , Steven Rostedt , Mark Rutland , Catalin Marinas , James Morse , Andrew Morton , Kees Cook , Jason Cooper , Jiri Slaby , "moderated list:ARM64 PORT (AARCH64 ARCHITECTURE)" Subject: Re: [PATCH] arm64: Don't trace __switch_to if function graph tracer is enabled Message-ID: <20170104151235.GI18193@arm.com> References: <1482360288-124624-1-git-send-email-joelaf@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1482360288-124624-1-git-send-email-joelaf@google.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Cc: Steven Rostedt > Cc: Will Deacon > Cc: Mark Rutland > Signed-off-by: Joel Fernandes > --- > arch/arm64/kernel/process.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Thanks, queued for 4.11. Will From mboxrd@z Thu Jan 1 00:00:00 1970 From: will.deacon@arm.com (Will Deacon) Date: Wed, 4 Jan 2017 15:12:36 +0000 Subject: [PATCH] arm64: Don't trace __switch_to if function graph tracer is enabled In-Reply-To: <1482360288-124624-1-git-send-email-joelaf@google.com> References: <1482360288-124624-1-git-send-email-joelaf@google.com> Message-ID: <20170104151235.GI18193@arm.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org 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 > Cc: Steven Rostedt > Cc: Will Deacon > Cc: Mark Rutland > Signed-off-by: Joel Fernandes > --- > arch/arm64/kernel/process.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Thanks, queued for 4.11. Will