All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>,
	LKML <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org
Subject: Re: [PATCH v2] tracing/x86: Update syscall trace events to handle new x86 syscall func names
Date: Tue, 17 Apr 2018 17:41:28 -0400	[thread overview]
Message-ID: <20180417174128.0f3457f0@gandalf.local.home> (raw)
In-Reply-To: <20180417181304.GA2895@kernel.org>

On Tue, 17 Apr 2018 15:13:04 -0300
Arnaldo Carvalho de Melo <acme@kernel.org> wrote:

> Em Tue, Apr 17, 2018 at 03:04:30PM -0300, Arnaldo Carvalho de Melo escreveu:
> > Em Tue, Apr 17, 2018 at 07:22:36PM +0200, Dominik Brodowski escreveu:  
> > > >   Added back original compare to not miss 32bit kernel syscalls  
> > > 
> > > s/32bit/32bit and 0-parameter syscalls.  
> > 
> > So this should have covered 0-parameter syscalls, ok, I'm double
> > checking that the last patch is the one I have running... Because
> > 0-parameter syscalls are not working for me, i.e. no
> > syscalls:sys_enter_getppid, for instance.  
> 
> Yeah, failing:
> 
> [root@jouet ~]# strace -e openat -e file perf test -F -v "mmap interface" |& grep syscalls
> openat(AT_FDCWD, "/sys/kernel/debug/tracing/events/syscalls/sys_enter_getsid/format", O_RDONLY) = 3
> openat(AT_FDCWD, "/sys/kernel/debug/tracing/events/syscalls/sys_enter_getppid/format", O_RDONLY) = -1 ENOENT (No such file or directory)
> [root@jouet ~]# 
> 
> [root@jouet ~]# ls -la /sys/kernel/debug/tracing/events/syscalls/sys_enter_getppid/format
> ls: cannot access '/sys/kernel/debug/tracing/events/syscalls/sys_enter_getppid/format': No such file or directory
> [root@jouet ~]#
> 
> With:
> 
> +#define ARCH_HAS_SYSCALL_MATCH_SYM_NAME
> +static inline bool arch_syscall_match_sym_name(const char *sym, const char *name)
> +{
> +       /*
> +        * Compare the symbol name with the system call name. Skip the
> +        * "__x64_sys" prefix.
> +        */
> +       return !strcmp(sym + 9, name + 3) || !strcmp(sym + 3, name + 3);
> +}
> 
> in place.

It doesn't have to do with the number of parameters, not everything has
"__x64" on it.

Try this patch:

-- Steve

diff --git a/arch/x86/include/asm/ftrace.h b/arch/x86/include/asm/ftrace.h
index 09ad88572746..15582648887f 100644
--- a/arch/x86/include/asm/ftrace.h
+++ b/arch/x86/include/asm/ftrace.h
@@ -31,6 +31,19 @@ static inline unsigned long ftrace_call_adjust(unsigned long addr)
 	return addr;
 }
 
+#define ARCH_HAS_SYSCALL_MATCH_SYM_NAME
+static inline bool arch_syscall_match_sym_name(const char *sym, const char *name)
+{
+	/*
+	 * Compare the symbol name with the system call name. Skip the
+	 * "__x64_sys", "__ia32_sys" or simple "sys" prefix.
+	 */
+	return !strcmp(sym + 3, name + 3) ||
+		(!strncmp(sym, "__x64_", 6) && !strcmp(sym + 9, name + 3)) ||
+		(!strncmp(sym, "__ia32_", 7) && !strcmp(sym + 10, name + 3));
+
+}
+
 #ifdef CONFIG_DYNAMIC_FTRACE
 
 struct dyn_arch_ftrace {

  parent reply	other threads:[~2018-04-17 21:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-17 17:07 [PATCH v2] tracing/x86: Update syscall trace events to handle new x86 syscall func names Steven Rostedt
2018-04-17 17:22 ` Dominik Brodowski
2018-04-17 18:04   ` Arnaldo Carvalho de Melo
2018-04-17 18:13     ` Arnaldo Carvalho de Melo
2018-04-17 18:16       ` Steven Rostedt
2018-04-17 21:41       ` Steven Rostedt [this message]
2018-04-18 12:53         ` Arnaldo Carvalho de Melo
2018-04-18 14:36           ` Steven Rostedt
2018-04-18 15:02             ` Arnaldo Carvalho de Melo
2018-04-18 15:17               ` Arnaldo Carvalho de Melo
2018-04-18 15:20                 ` Steven Rostedt
2018-04-18 15:25                   ` Arnaldo Carvalho de Melo
2018-04-18 15:30                     ` Steven Rostedt
2018-04-18 15:45   ` Steven Rostedt
2018-04-17 17:29 ` Arnaldo Carvalho de Melo
2018-04-17 17:56   ` Arnaldo Carvalho de Melo

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=20180417174128.0f3457f0@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=acme@kernel.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@dominikbrodowski.net \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.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 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.