Skip to content

Commit fdc63ff

Browse files
koct9iKAGA-KOKO
authored andcommitted
ftrace/x86: Fix trace event registration for syscalls without arguments
The refactoring of SYSCALL_DEFINE0() macros removed the ABI stubs and simply defines __abi_sys_$NAME as alias of __do_sys_$NAME. As a result kallsyms_lookup() returns "__do_sys_$NAME" which does not match with the declared trace event name. See also commit 1c758a2 ("tracing/x86: Update syscall trace events to handle new prefixed syscall func names"). Add __do_sys_ to the valid prefixes which are checked in arch_syscall_match_sym_name(). Fixes: d2b5de4 ("x86/entry: Refactor SYSCALL_DEFINE0 macros") Signed-off-by: Konstantin Khlebnikov <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Steven Rostedt (VMware) <[email protected]> Link: https://lkml.kernel.org/r/158636958997.7900.16485049455470033557.stgit@buzz
1 parent ab51301 commit fdc63ff

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

arch/x86/include/asm/ftrace.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,12 @@ static inline bool arch_syscall_match_sym_name(const char *sym, const char *name
6161
{
6262
/*
6363
* Compare the symbol name with the system call name. Skip the
64-
* "__x64_sys", "__ia32_sys" or simple "sys" prefix.
64+
* "__x64_sys", "__ia32_sys", "__do_sys" or simple "sys" prefix.
6565
*/
6666
return !strcmp(sym + 3, name + 3) ||
6767
(!strncmp(sym, "__x64_", 6) && !strcmp(sym + 9, name + 3)) ||
68-
(!strncmp(sym, "__ia32_", 7) && !strcmp(sym + 10, name + 3));
68+
(!strncmp(sym, "__ia32_", 7) && !strcmp(sym + 10, name + 3)) ||
69+
(!strncmp(sym, "__do_sys", 8) && !strcmp(sym + 8, name + 3));
6970
}
7071

7172
#ifndef COMPILE_OFFSETS

0 commit comments

Comments
 (0)