Skip to contentSkip to conversation

ftrace: makes ops_references_rec() inline

PATCH In review Kuninori Morimoto 3 participants 3 messages Aug 22, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ftrace: makes ops_references_rec() inline

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 <[email protected]>

---
This is for v6.0-rc2

 kernel/trace/ftrace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/trace/ftrace.c +1 -1
index bc921a3f7ea8..b52782857f97 100644
@@ -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);
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw
Quoted 15 lines · Kuninori Morimoto

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

Quoted 5 lines

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 <[email protected]>

Thanks for the fix!

maintainer
#2 lore raw
Quoted 19 lines · On Mon, 22 Aug 2022 00:28:58 -0700 Song Liu <[email protected]> wrote:
Quoted 17 lines · Kuninori Morimoto

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.

Quoted 7 lines
Quoted 3 lines
Fixes 53cd885bc5c3e ("ftrace: Allow IPMODIFY and DIRECT ops on the same function")
CC Song Liu <[email protected]>

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/[email protected]/