All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: ftrace: fix syscall name matching
@ 2016-11-14 13:03 ` Rabin Vincent
  0 siblings, 0 replies; 12+ messages in thread
From: Rabin Vincent @ 2016-11-14 13:03 UTC (permalink / raw)
  To: linux; +Cc: rostedt, linux-arm-kernel, linux-kernel, Rabin Vincent

From: Rabin Vincent <rabinv@axis.com>

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>
---
 arch/arm/include/asm/ftrace.h | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/arch/arm/include/asm/ftrace.h b/arch/arm/include/asm/ftrace.h
index bfe2a2f..8467909 100644
--- a/arch/arm/include/asm/ftrace.h
+++ b/arch/arm/include/asm/ftrace.h
@@ -54,6 +54,27 @@ static inline void *return_address(unsigned int level)
 
 #define ftrace_return_address(n) return_address(n)
 
+#define ARCH_HAS_SYSCALL_MATCH_SYM_NAME
+
+static inline bool arch_syscall_match_sym_name(const char *sym,
+					       const char *name)
+{
+	/* Skip sys_ */
+	sym += 4;
+	name += 4;
+
+	if (!strcmp(sym, "mmap2"))
+		sym = "mmap_pgoff";
+	else if (!strcmp(sym, "statfs64_wrapper"))
+		sym = "statfs64";
+	else if (!strcmp(sym, "fstatfs64_wrapper"))
+		sym = "fstatfs64";
+	else if (!strcmp(sym, "arm_fadvise64_64"))
+		sym = "fadvise64_64";
+
+	return !strcmp(sym, name);
+}
+
 #endif /* ifndef __ASSEMBLY__ */
 
 #endif /* _ASM_ARM_FTRACE */
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-11-15 15:18 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-14 13:03 [PATCH] ARM: ftrace: fix syscall name matching Rabin Vincent
2016-11-14 13:03 ` Rabin Vincent
2016-11-14 13:40 ` Russell King - ARM Linux
2016-11-14 13:40   ` Russell King - ARM Linux
2016-11-14 15:40   ` Steven Rostedt
2016-11-14 15:40     ` Steven Rostedt
2016-11-14 15:44     ` Steven Rostedt
2016-11-14 15:44       ` Steven Rostedt
2016-11-15 15:18     ` Rabin Vincent
2016-11-15 15:18       ` Rabin Vincent
2016-11-15 10:17 ` [PATCHv2] " Rabin Vincent
2016-11-15 10:17   ` Rabin Vincent

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.