Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: 8632/1: ftrace: fix syscall name matching

ARM has a few system calls (most notably mmap) for which the names of
the functions which are referenced in the syscall table do not match the
names of the syscall tracepoints. As a consequence of this, these
tracepoints are not made available. Implement
arch_syscall_match_sym_name to fix this and allow tracing even these
system calls.

Signed-off-by: Rabin Vincent <rabinv@axis.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by

Rabin Vincent and committed by
Russell King
270c8cf1 7ce7d89f

+18
+18
arch/arm/include/asm/ftrace.h
··· 54 54 55 55 #define ftrace_return_address(n) return_address(n) 56 56 57 + #define ARCH_HAS_SYSCALL_MATCH_SYM_NAME 58 + 59 + static inline bool arch_syscall_match_sym_name(const char *sym, 60 + const char *name) 61 + { 62 + if (!strcmp(sym, "sys_mmap2")) 63 + sym = "sys_mmap_pgoff"; 64 + else if (!strcmp(sym, "sys_statfs64_wrapper")) 65 + sym = "sys_statfs64"; 66 + else if (!strcmp(sym, "sys_fstatfs64_wrapper")) 67 + sym = "sys_fstatfs64"; 68 + else if (!strcmp(sym, "sys_arm_fadvise64_64")) 69 + sym = "sys_fadvise64_64"; 70 + 71 + /* Ignore case since sym may start with "SyS" instead of "sys" */ 72 + return !strcasecmp(sym, name); 73 + } 74 + 57 75 #endif /* ifndef __ASSEMBLY__ */ 58 76 59 77 #endif /* _ASM_ARM_FTRACE */