linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ftrace: makes ops_references_rec() inline
@ 2022-08-22  2:31 Kuninori Morimoto
  2022-08-22  7:28 ` Song Liu
  0 siblings, 1 reply; 4+ messages in thread
From: Kuninori Morimoto @ 2022-08-22  2:31 UTC (permalink / raw)
  To: Steven Rostedt, Ingo Molnar, Daniel Borkmann, Song Liu; +Cc: linux-kernel

commit 53cd885bc5c3e ("ftrace: Allow IPMODIFY and DIRECT ops on the
same function") changed ops_references_rec() inline to function,
thus we will get below error if .config doesn't have CONFIG_MODULES.

  CC      kernel/trace/ftrace.o
${linux}/kernel/trace/ftrace.c:3149:1: error: 'ops_references_rec' \
defined but not used [-Werror=unused-function]
 3149 | ops_references_rec(struct ftrace_ops *ops, struct dyn_ftrace *rec)
      | ^~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [${linux}/scripts/Makefile.build:249: kernel/trace/ftrace.o] error 1
make[1]: *** [${linux}/scripts/Makefile.build:466: kernel/trace] error 2
make: *** [/opt/disk_cd/morimoto/linux/Makefile:1843: kernel] error 2

This patch makes it to inline again, and fixes the issue.

Fixes:  53cd885bc5c3e ("ftrace: Allow IPMODIFY and DIRECT ops on the same function")
CC: Song Liu <song@kernel.org>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
This is for v6.0-rc2

 kernel/trace/ftrace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index bc921a3f7ea8..b52782857f97 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -3145,7 +3145,7 @@ ops_references_ip(struct ftrace_ops *ops, unsigned long ip)
  * If the ops does not trace the current record function, skip it.
  * If the ops ignores the function via notrace filter, skip it.
  */
-static bool
+static inline bool
 ops_references_rec(struct ftrace_ops *ops, struct dyn_ftrace *rec)
 {
 	return ops_references_ip(ops, rec->ip);
-- 
2.25.1


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

* Re: [PATCH] ftrace: makes ops_references_rec() inline
  2022-08-22  2:31 [PATCH] ftrace: makes ops_references_rec() inline Kuninori Morimoto
@ 2022-08-22  7:28 ` Song Liu
  2022-08-22 13:35   ` Steven Rostedt
  0 siblings, 1 reply; 4+ messages in thread
From: Song Liu @ 2022-08-22  7:28 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Steven Rostedt, Ingo Molnar, Daniel Borkmann, open list

On Sun, Aug 21, 2022 at 7:31 PM Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
>
> commit 53cd885bc5c3e ("ftrace: Allow IPMODIFY and DIRECT ops on the
> same function") changed ops_references_rec() inline to function,
> thus we will get below error if .config doesn't have CONFIG_MODULES.
>
>   CC      kernel/trace/ftrace.o
> ${linux}/kernel/trace/ftrace.c:3149:1: error: 'ops_references_rec' \
> defined but not used [-Werror=unused-function]
>  3149 | ops_references_rec(struct ftrace_ops *ops, struct dyn_ftrace *rec)
>       | ^~~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors
> make[2]: *** [${linux}/scripts/Makefile.build:249: kernel/trace/ftrace.o] error 1
> make[1]: *** [${linux}/scripts/Makefile.build:466: kernel/trace] error 2
> make: *** [/opt/disk_cd/morimoto/linux/Makefile:1843: kernel] error 2
>
> This patch makes it to inline again, and fixes the issue.
>
> Fixes:  53cd885bc5c3e ("ftrace: Allow IPMODIFY and DIRECT ops on the same function")
> CC: Song Liu <song@kernel.org>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Acked-by: Song Liu <song@kernel.org>

Thanks for the fix!

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

* Re: [PATCH] ftrace: makes ops_references_rec() inline
  2022-08-22  7:28 ` Song Liu
@ 2022-08-22 13:35   ` Steven Rostedt
  0 siblings, 0 replies; 4+ messages in thread
From: Steven Rostedt @ 2022-08-22 13:35 UTC (permalink / raw)
  To: Song Liu; +Cc: Kuninori Morimoto, Ingo Molnar, Daniel Borkmann, open list

On Mon, 22 Aug 2022 00:28:58 -0700
Song Liu <song@kernel.org> wrote:

> On Sun, Aug 21, 2022 at 7:31 PM Kuninori Morimoto
> <kuninori.morimoto.gx@renesas.com> wrote:
> >
> > commit 53cd885bc5c3e ("ftrace: Allow IPMODIFY and DIRECT ops on the
> > same function") changed ops_references_rec() inline to function,
> > thus we will get below error if .config doesn't have CONFIG_MODULES.
> >
> >   CC      kernel/trace/ftrace.o
> > ${linux}/kernel/trace/ftrace.c:3149:1: error: 'ops_references_rec' \
> > defined but not used [-Werror=unused-function]
> >  3149 | ops_references_rec(struct ftrace_ops *ops, struct dyn_ftrace *rec)
> >       | ^~~~~~~~~~~~~~~~~~
> > cc1: all warnings being treated as errors
> > make[2]: *** [${linux}/scripts/Makefile.build:249: kernel/trace/ftrace.o] error 1
> > make[1]: *** [${linux}/scripts/Makefile.build:466: kernel/trace] error 2
> > make: *** [/opt/disk_cd/morimoto/linux/Makefile:1843: kernel] error 2
> >
> > This patch makes it to inline again, and fixes the issue.
> >
> > Fixes:  53cd885bc5c3e ("ftrace: Allow IPMODIFY and DIRECT ops on the same function")
> > CC: Song Liu <song@kernel.org>
> > Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>  
> 
> Acked-by: Song Liu <song@kernel.org>
> 
> Thanks for the fix!

Wrong fix.

The correct fix is here[1], and because the breakage went through the BPF
tree, I could not apply it. Now that both the BPF and my tree is in Linus's
tree, I can apply it and now will do so.

-- Steve

[1] https://lore.kernel.org/all/20220801084745.1187987-1-wangjingjin1@huawei.com/

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

* [PATCH] ftrace: makes ops_references_rec() inline
@ 2022-08-09 23:56 Kuninori Morimoto
  0 siblings, 0 replies; 4+ messages in thread
From: Kuninori Morimoto @ 2022-08-09 23:56 UTC (permalink / raw)
  To: Steven Rostedt, Ingo Molnar, Song Liu, Daniel Borkmann; +Cc: linux-kernel


commit 53cd885bc5c3e ("ftrace: Allow IPMODIFY and DIRECT ops on the
same function") removes "inline" from ops_references_rec(),
thus we will get below error if .config doesn't have CONFIG_MODULES.

  CC      kernel/trace/ftrace.o
${linux}/kernel/trace/ftrace.c:3149:1: error: 'ops_references_rec' \
defined but not used [-Werror=unused-function]
 3149 | ops_references_rec(struct ftrace_ops *ops, struct dyn_ftrace *rec)
      | ^~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [${linux}/scripts/Makefile.build:249: kernel/trace/ftrace.o] error 1
make[1]: *** [${linux}/scripts/Makefile.build:466: kernel/trace] error 2
make: *** [/opt/disk_cd/morimoto/linux/Makefile:1843: kernel] error 2

This patch adds "inline" again, and fixes the issue.

Fixes:  53cd885bc5c3e ("ftrace: Allow IPMODIFY and DIRECT ops on the same function")
CC: Song Liu <song@kernel.org>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 kernel/trace/ftrace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index bc921a3f7ea8..b52782857f97 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -3145,7 +3145,7 @@ ops_references_ip(struct ftrace_ops *ops, unsigned long ip)
  * If the ops does not trace the current record function, skip it.
  * If the ops ignores the function via notrace filter, skip it.
  */
-static bool
+static inline bool
 ops_references_rec(struct ftrace_ops *ops, struct dyn_ftrace *rec)
 {
 	return ops_references_ip(ops, rec->ip);
-- 
2.25.1


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

end of thread, other threads:[~2022-08-22 13:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-22  2:31 [PATCH] ftrace: makes ops_references_rec() inline Kuninori Morimoto
2022-08-22  7:28 ` Song Liu
2022-08-22 13:35   ` Steven Rostedt
  -- strict thread matches above, loose matches on Subject: below --
2022-08-09 23:56 Kuninori Morimoto

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