linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Mark Rutland <mark.rutland@arm.com>,
	Florent Revest <revest@chromium.org>,
	Naveen N Rao <naveen@kernel.org>,
	Nicholas Piggin <npiggin@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [RFC PATCH 6/9] powerpc/ftrace: Update and move function profile instructions out-of-line
Date: Thu, 21 Dec 2023 15:20:14 +0000	[thread overview]
Message-ID: <107a3da4-def6-4e66-a09d-67592ae056c7@csgroup.eu> (raw)
In-Reply-To: <20231221092545.1b696eb6@gandalf.local.home>



Le 21/12/2023 à 15:25, Steven Rostedt a écrit :
> On Thu, 21 Dec 2023 10:46:08 +0000
> Christophe Leroy <christophe.leroy@csgroup.eu> wrote:
> 
>>> To enable ftrace, the nop at function entry is changed to an
>>> unconditional branch to 'tramp'. The call to ftrace_caller() may be
>>> updated to ftrace_regs_caller() depending on the registered ftrace ops.
>>> On 64-bit powerpc, we additionally change the instruction at 'tramp' to
>>> 'mflr r0' from an unconditional branch back to func+4. This is so that
>>> functions entered through the GEP can skip the function profile sequence
>>> unless ftrace is enabled.
>>>
>>> With the context_switch microbenchmark on a P9 machine, there is a
>>> performance improvement of ~6% with this patch applied, going from 650k
>>> context switches to 690k context switches without ftrace enabled. With
>>> ftrace enabled, the performance was similar at 86k context switches.
>>
>> Wondering how significant that context_switch micorbenchmark is.
>>
>> I ran it on both mpc885 and mpc8321 and I'm a bit puzzled by some of the
>> results:
>> # ./context_switch --no-fp
>> Using threads with yield on cpus 0/0 touching FP:no altivec:no vector:no
>> vdso:no
>>
>> On 885, I get the following results before and after your patch.
>>
>> CONFIG_FTRACE not selected : 44,9k
>> CONFIG_FTRACE selected, before : 32,8k
>> CONFIG_FTRACE selected, after : 33,6k
>>
>> All this is with CONFIG_INIT_STACK_ALL_ZERO which is the default. But
>> when I select CONFIG_INIT_STACK_NONE, the CONFIG_FTRACE not selected
>> result is only 34,4.
>>
>> On 8321:
>>
>> CONFIG_FTRACE not selected : 100,3k
>> CONFIG_FTRACE selected, before : 72,5k
>> CONFIG_FTRACE selected, after : 116k
>>
>> So the results look odd to me.
> 
> 
> BTW, CONFIG_FTRACE just enables the tracing system (I would like to change
> that to CONFIG_TRACING, but not sure if I can without breaking .configs all
> over the place).
> 
> The nops for ftrace is enabled with CONFIG_FUNCTION_TRACER.

Yes I selected both CONFIG_FTRACE and CONFIG_FUNCTION_TRACER

Christophe

  reply	other threads:[~2023-12-21 15:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-08 16:30 [RFC PATCH 0/9] powerpc: ftrace updates Naveen N Rao
2023-12-08 16:30 ` [RFC PATCH 1/9] powerpc/ftrace: Fix indentation in ftrace.h Naveen N Rao
2023-12-08 16:30 ` [RFC PATCH 2/9] powerpc/ftrace: Unify 32-bit and 64-bit ftrace entry code Naveen N Rao
2023-12-08 16:30 ` [RFC PATCH 3/9] powerpc/ftrace: Remove nops after the call to ftrace_stub Naveen N Rao
2023-12-08 16:30 ` [RFC PATCH 4/9] powerpc/Kconfig: Select FUNCTION_ALIGNMENT_4B Naveen N Rao
2023-12-08 16:30 ` [RFC PATCH 5/9] powerpc/kprobes: Use ftrace to determine if a probe is at function entry Naveen N Rao
2023-12-11  5:39   ` Masami Hiramatsu
2023-12-08 16:30 ` [RFC PATCH 6/9] powerpc/ftrace: Update and move function profile instructions out-of-line Naveen N Rao
2023-12-21 10:46   ` Christophe Leroy
2023-12-21 14:25     ` Steven Rostedt
2023-12-21 15:20       ` Christophe Leroy [this message]
2023-12-22 15:01     ` Naveen N Rao
2023-12-08 16:30 ` [RFC PATCH 7/9] powerpc/ftrace: Add support for DYNAMIC_FTRACE_WITH_CALL_OPS Naveen N Rao
2023-12-08 16:30 ` [RFC PATCH 8/9] powerpc/ftrace: Add support for DYNAMIC_FTRACE_WITH_DIRECT_CALLS Naveen N Rao
2023-12-08 16:30 ` [RFC PATCH 9/9] samples/ftrace: Add support for ftrace direct samples on powerpc Naveen N Rao
2023-12-21 10:38 ` (subset) [RFC PATCH 0/9] powerpc: ftrace updates Michael Ellerman

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=107a3da4-def6-4e66-a09d-67592ae056c7@csgroup.eu \
    --to=christophe.leroy@csgroup.eu \
    --cc=aneesh.kumar@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mark.rutland@arm.com \
    --cc=mhiramat@kernel.org \
    --cc=naveen@kernel.org \
    --cc=npiggin@gmail.com \
    --cc=revest@chromium.org \
    --cc=rostedt@goodmis.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).