From 01678fbce3dd2e3042077cf71b68157e733614a0 Mon Sep 17 00:00:00 2001 From: Song Shuai Date: Mon, 30 Jan 2023 16:59:54 +0800 Subject: samples: ftrace: Include the nospec-branch.h only for x86 When other architectures without the nospec functionality write their direct-call functions of samples/ftrace/*.c, the including of asm/nospec-branch.h must be taken care to fix the no header file found error in building process. This commit (ee3e2469b346 "x86/ftrace: Make it call depth tracking aware") file-globally includes asm/nospec-branch.h providing CALL_DEPTH_ACCOUNT for only x86 direct-call functions. It seems better to move the including to `#ifdef CONFIG_X86_64`. Link: https://lore.kernel.org/linux-trace-kernel/20230130085954.647845-1-suagrfillet@gmail.com Signed-off-by: Song Shuai Reviewed-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) --- samples/ftrace/ftrace-direct.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'samples/ftrace/ftrace-direct.c') diff --git a/samples/ftrace/ftrace-direct.c b/samples/ftrace/ftrace-direct.c index 1f769d0db20f..1d3d307ca33d 100644 --- a/samples/ftrace/ftrace-direct.c +++ b/samples/ftrace/ftrace-direct.c @@ -4,7 +4,6 @@ #include /* for wake_up_process() */ #include #include -#include extern void my_direct_func(struct task_struct *p); @@ -18,6 +17,7 @@ extern void my_tramp(void *); #ifdef CONFIG_X86_64 #include +#include asm ( " .pushsection .text, \"ax\", @progbits\n" -- cgit v1.2.3-59-g8ed1b