From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751481AbcKNNkf (ORCPT ); Mon, 14 Nov 2016 08:40:35 -0500 Received: from pandora.armlinux.org.uk ([78.32.30.218]:53968 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751455AbcKNNk1 (ORCPT ); Mon, 14 Nov 2016 08:40:27 -0500 Date: Mon, 14 Nov 2016 13:40:17 +0000 From: Russell King - ARM Linux To: Rabin Vincent Cc: rostedt@goodmis.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Rabin Vincent Subject: Re: [PATCH] ARM: ftrace: fix syscall name matching Message-ID: <20161114134017.GJ1041@n2100.armlinux.org.uk> References: <1479128625-20948-1-git-send-email-rabin.vincent@axis.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1479128625-20948-1-git-send-email-rabin.vincent@axis.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 14, 2016 at 02:03:45PM +0100, Rabin Vincent wrote: > From: Rabin Vincent > > 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 > --- > 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; Is this really safe? What guarantees that we can wind forward four bytes here? If it's always safe, it needs a better comment than just two words. > + > + 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 > -- RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net.