From: Jiri Olsa <jolsa@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Andy Lutomirski <luto@kernel.org>,
Dominik Brodowski <linux@dominikbrodowski.net>,
lkml <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@kernel.org>
Subject: [PATCH] ftrace/x86: Fix arch_syscall_match_sym_name for x86_64
Date: Tue, 24 Apr 2018 12:17:38 +0200 [thread overview]
Message-ID: <20180424101738.30015-1-jolsa@kernel.org> (raw)
Recent commit changed the name prefix of syscalls
for x86_64 (check the 'Fixes:' for commit number).
The names switch from "sys_" prefix to ""__x64_sys_",
which made the default matching function always fail.
Consequently the ftrace syscall __init code could not
match any syscall metadata so the "syscall" events
vanished. This fix returns them back.
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Fixes: d5a00528b58c ("syscalls/core, syscalls/x86: Rename struct pt_regs-based sys_*() to __x64_sys_*()")
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
arch/x86/include/asm/ftrace.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/arch/x86/include/asm/ftrace.h b/arch/x86/include/asm/ftrace.h
index 09ad88572746..7b131ad39ee2 100644
--- a/arch/x86/include/asm/ftrace.h
+++ b/arch/x86/include/asm/ftrace.h
@@ -67,6 +67,18 @@ static inline bool arch_trace_is_compat_syscall(struct pt_regs *regs)
return false;
}
#endif /* CONFIG_FTRACE_SYSCALLS && CONFIG_IA32_EMULATION */
+
+#ifdef CONFIG_X86_64
+#define ARCH_HAS_SYSCALL_MATCH_SYM_NAME 1
+static inline bool arch_syscall_match_sym_name(const char *sym, const char *name)
+{
+ /*
+ * Skip the __x64_sys_ prefix and compare the
+ * syscall name only.
+ */
+ return !strcmp(sym + 9, name + 3);
+}
+#endif /* CONFIG_X86_64 */
#endif /* !__ASSEMBLY__ && !COMPILE_OFFSETS */
#endif /* _ASM_X86_FTRACE_H */
--
2.13.6
next reply other threads:[~2018-04-24 10:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-24 10:17 Jiri Olsa [this message]
2018-04-24 14:33 ` [PATCH] ftrace/x86: Fix arch_syscall_match_sym_name for x86_64 Steven Rostedt
2018-04-24 15:08 ` Jiri Olsa
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=20180424101738.30015-1-jolsa@kernel.org \
--to=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@dominikbrodowski.net \
--cc=luto@kernel.org \
--cc=mingo@kernel.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