linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf/core: allow ftrace for functions in kernel/event/core.c
@ 2021-10-06 21:07 Song Liu
  2021-10-12 12:42 ` Peter Zijlstra
  2021-10-15  9:31 ` [tip: perf/core] perf/core: Allow " tip-bot2 for Song Liu
  0 siblings, 2 replies; 8+ messages in thread
From: Song Liu @ 2021-10-06 21:07 UTC (permalink / raw)
  To: linux-kernel
  Cc: kernel-team, acme, peterz, mingo, Song Liu, Steven Rostedt,
	Andrii Nakryiko, KP Singh

It is useful to trace functions in kernel/event/core.c. Allow ftrace for
them by removing $(CC_FLAGS_FTRACE) from Makefile.

---
We had some discussions about this last year [1]. Seems that enabling
ftrace in kernel/events won't really cause fatal recursion in the tests.
Shall we give it another try?

[1] https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg2174018.html

Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: KP Singh <kpsingh@kernel.org>
Signed-off-by: Song Liu <songliubraving@fb.com>
---
 kernel/events/Makefile | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/kernel/events/Makefile b/kernel/events/Makefile
index 3c022e33c1091..8591c180b52b3 100644
--- a/kernel/events/Makefile
+++ b/kernel/events/Makefile
@@ -1,10 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0
-ifdef CONFIG_FUNCTION_TRACER
-CFLAGS_REMOVE_core.o = $(CC_FLAGS_FTRACE)
-endif
-
 obj-y := core.o ring_buffer.o callchain.o
 
 obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o
 obj-$(CONFIG_UPROBES) += uprobes.o
-
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] perf/core: allow ftrace for functions in kernel/event/core.c
  2021-10-06 21:07 [PATCH] perf/core: allow ftrace for functions in kernel/event/core.c Song Liu
@ 2021-10-12 12:42 ` Peter Zijlstra
  2021-10-13 15:46   ` Song Liu
  2021-10-13 16:47   ` Steven Rostedt
  2021-10-15  9:31 ` [tip: perf/core] perf/core: Allow " tip-bot2 for Song Liu
  1 sibling, 2 replies; 8+ messages in thread
From: Peter Zijlstra @ 2021-10-12 12:42 UTC (permalink / raw)
  To: Song Liu
  Cc: linux-kernel, kernel-team, acme, mingo, Steven Rostedt,
	Andrii Nakryiko, KP Singh

On Wed, Oct 06, 2021 at 02:07:32PM -0700, Song Liu wrote:
> It is useful to trace functions in kernel/event/core.c. Allow ftrace for
> them by removing $(CC_FLAGS_FTRACE) from Makefile.
> 
> ---
> We had some discussions about this last year [1]. Seems that enabling
> ftrace in kernel/events won't really cause fatal recursion in the tests.
> Shall we give it another try?

I suppose we can give it a go..

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] perf/core: allow ftrace for functions in kernel/event/core.c
  2021-10-12 12:42 ` Peter Zijlstra
@ 2021-10-13 15:46   ` Song Liu
  2021-10-13 16:33     ` KP Singh
  2021-10-13 16:47   ` Steven Rostedt
  1 sibling, 1 reply; 8+ messages in thread
From: Song Liu @ 2021-10-13 15:46 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: linux-kernel, Kernel Team, acme, mingo, Steven Rostedt,
	Andrii Nakryiko, KP Singh



> On Oct 12, 2021, at 5:42 AM, Peter Zijlstra <peterz@infradead.org> wrote:
> 
> On Wed, Oct 06, 2021 at 02:07:32PM -0700, Song Liu wrote:
>> It is useful to trace functions in kernel/event/core.c. Allow ftrace for
>> them by removing $(CC_FLAGS_FTRACE) from Makefile.
>> 
>> ---
>> We had some discussions about this last year [1]. Seems that enabling
>> ftrace in kernel/events won't really cause fatal recursion in the tests.
>> Shall we give it another try?
> 
> I suppose we can give it a go..

Yes, please. :-) Shall we ship it with 5.16?

Thanks,
Song



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] perf/core: allow ftrace for functions in kernel/event/core.c
  2021-10-13 15:46   ` Song Liu
@ 2021-10-13 16:33     ` KP Singh
  0 siblings, 0 replies; 8+ messages in thread
From: KP Singh @ 2021-10-13 16:33 UTC (permalink / raw)
  To: Song Liu
  Cc: Peter Zijlstra, linux-kernel, Kernel Team, acme, mingo,
	Steven Rostedt, Andrii Nakryiko

On Wed, Oct 13, 2021 at 5:47 PM Song Liu <songliubraving@fb.com> wrote:
>
>
>
> > On Oct 12, 2021, at 5:42 AM, Peter Zijlstra <peterz@infradead.org> wrote:
> >
> > On Wed, Oct 06, 2021 at 02:07:32PM -0700, Song Liu wrote:
> >> It is useful to trace functions in kernel/event/core.c. Allow ftrace for
> >> them by removing $(CC_FLAGS_FTRACE) from Makefile.
> >>
> >> ---
> >> We had some discussions about this last year [1]. Seems that enabling
> >> ftrace in kernel/events won't really cause fatal recursion in the tests.
> >> Shall we give it another try?
> >
> > I suppose we can give it a go..
>
> Yes, please. :-) Shall we ship it with 5.16?

This would be super useful for us, perf_event_* functions are very nicely placed
for tracing events like mmap.

>
> Thanks,
> Song
>
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] perf/core: allow ftrace for functions in kernel/event/core.c
  2021-10-12 12:42 ` Peter Zijlstra
  2021-10-13 15:46   ` Song Liu
@ 2021-10-13 16:47   ` Steven Rostedt
  2021-10-15 13:27     ` Peter Zijlstra
  1 sibling, 1 reply; 8+ messages in thread
From: Steven Rostedt @ 2021-10-13 16:47 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Song Liu, linux-kernel, kernel-team, acme, mingo,
	Andrii Nakryiko, KP Singh

On Tue, 12 Oct 2021 14:42:21 +0200
Peter Zijlstra <peterz@infradead.org> wrote:

> On Wed, Oct 06, 2021 at 02:07:32PM -0700, Song Liu wrote:
> > It is useful to trace functions in kernel/event/core.c. Allow ftrace for
> > them by removing $(CC_FLAGS_FTRACE) from Makefile.
> > 
> > ---
> > We had some discussions about this last year [1]. Seems that enabling
> > ftrace in kernel/events won't really cause fatal recursion in the tests.
> > Shall we give it another try?  
> 
> I suppose we can give it a go..

Did you want me to pull this into my tree? My tests usually stress perf
along with ftrace.

-- Steve

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [tip: perf/core] perf/core: Allow ftrace for functions in kernel/event/core.c
  2021-10-06 21:07 [PATCH] perf/core: allow ftrace for functions in kernel/event/core.c Song Liu
  2021-10-12 12:42 ` Peter Zijlstra
@ 2021-10-15  9:31 ` tip-bot2 for Song Liu
  1 sibling, 0 replies; 8+ messages in thread
From: tip-bot2 for Song Liu @ 2021-10-15  9:31 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Song Liu, Peter Zijlstra (Intel), x86, linux-kernel

The following commit has been merged into the perf/core branch of tip:

Commit-ID:     79df45731da68772d2285265864a52c900b8c65f
Gitweb:        https://git.kernel.org/tip/79df45731da68772d2285265864a52c900b8c65f
Author:        Song Liu <songliubraving@fb.com>
AuthorDate:    Wed, 06 Oct 2021 14:07:32 -07:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Fri, 15 Oct 2021 11:25:31 +02:00

perf/core: Allow ftrace for functions in kernel/event/core.c

It is useful to trace functions in kernel/event/core.c. Allow ftrace for
them by removing $(CC_FLAGS_FTRACE) from Makefile.

Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20211006210732.2826289-1-songliubraving@fb.com
---
 kernel/events/Makefile | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/kernel/events/Makefile b/kernel/events/Makefile
index 3c022e3..8591c18 100644
--- a/kernel/events/Makefile
+++ b/kernel/events/Makefile
@@ -1,10 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0
-ifdef CONFIG_FUNCTION_TRACER
-CFLAGS_REMOVE_core.o = $(CC_FLAGS_FTRACE)
-endif
-
 obj-y := core.o ring_buffer.o callchain.o
 
 obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o
 obj-$(CONFIG_UPROBES) += uprobes.o
-

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] perf/core: allow ftrace for functions in kernel/event/core.c
  2021-10-13 16:47   ` Steven Rostedt
@ 2021-10-15 13:27     ` Peter Zijlstra
  2021-10-15 14:06       ` Steven Rostedt
  0 siblings, 1 reply; 8+ messages in thread
From: Peter Zijlstra @ 2021-10-15 13:27 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Song Liu, linux-kernel, kernel-team, acme, mingo,
	Andrii Nakryiko, KP Singh

On Wed, Oct 13, 2021 at 12:47:31PM -0400, Steven Rostedt wrote:
> On Tue, 12 Oct 2021 14:42:21 +0200
> Peter Zijlstra <peterz@infradead.org> wrote:
> 
> > On Wed, Oct 06, 2021 at 02:07:32PM -0700, Song Liu wrote:
> > > It is useful to trace functions in kernel/event/core.c. Allow ftrace for
> > > them by removing $(CC_FLAGS_FTRACE) from Makefile.
> > > 
> > > ---
> > > We had some discussions about this last year [1]. Seems that enabling
> > > ftrace in kernel/events won't really cause fatal recursion in the tests.
> > > Shall we give it another try?  
> > 
> > I suppose we can give it a go..
> 
> Did you want me to pull this into my tree? My tests usually stress perf
> along with ftrace.

Hurmph, I just pushed it out, but sure, throw it in.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] perf/core: allow ftrace for functions in kernel/event/core.c
  2021-10-15 13:27     ` Peter Zijlstra
@ 2021-10-15 14:06       ` Steven Rostedt
  0 siblings, 0 replies; 8+ messages in thread
From: Steven Rostedt @ 2021-10-15 14:06 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Song Liu, linux-kernel, kernel-team, acme, mingo,
	Andrii Nakryiko, KP Singh

On Fri, 15 Oct 2021 15:27:15 +0200
Peter Zijlstra <peterz@infradead.org> wrote:

> > 
> > Did you want me to pull this into my tree? My tests usually stress perf
> > along with ftrace.  
> 
> Hurmph, I just pushed it out, but sure, throw it in.

Keep it in your tree then. I'll just run it through tests locally, and see
if it spits any crumbs out.

-- Steve

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-10-15 14:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-06 21:07 [PATCH] perf/core: allow ftrace for functions in kernel/event/core.c Song Liu
2021-10-12 12:42 ` Peter Zijlstra
2021-10-13 15:46   ` Song Liu
2021-10-13 16:33     ` KP Singh
2021-10-13 16:47   ` Steven Rostedt
2021-10-15 13:27     ` Peter Zijlstra
2021-10-15 14:06       ` Steven Rostedt
2021-10-15  9:31 ` [tip: perf/core] perf/core: Allow " tip-bot2 for Song Liu

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).