All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ftrace/x86: Fix arch_syscall_match_sym_name for x86_64
@ 2018-04-24 10:17 Jiri Olsa
  2018-04-24 14:33 ` Steven Rostedt
  0 siblings, 1 reply; 3+ messages in thread
From: Jiri Olsa @ 2018-04-24 10:17 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: Andy Lutomirski, Dominik Brodowski, lkml, Ingo Molnar

Recent commit changed the name prefix of syscalls
for x86_64 (check the 'Fixes:' for commit number).

The names switch from "sys_" prefix to ""__x64_sys_",
which made the default matching function always fail.

Consequently the ftrace syscall __init code could not
match any syscall metadata so the "syscall" events
vanished. This fix returns them back.

Cc: Andy Lutomirski <luto@kernel.org>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Fixes: d5a00528b58c ("syscalls/core, syscalls/x86: Rename struct pt_regs-based sys_*() to __x64_sys_*()")
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 arch/x86/include/asm/ftrace.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/x86/include/asm/ftrace.h b/arch/x86/include/asm/ftrace.h
index 09ad88572746..7b131ad39ee2 100644
--- a/arch/x86/include/asm/ftrace.h
+++ b/arch/x86/include/asm/ftrace.h
@@ -67,6 +67,18 @@ static inline bool arch_trace_is_compat_syscall(struct pt_regs *regs)
 	return false;
 }
 #endif /* CONFIG_FTRACE_SYSCALLS && CONFIG_IA32_EMULATION */
+
+#ifdef CONFIG_X86_64
+#define ARCH_HAS_SYSCALL_MATCH_SYM_NAME 1
+static inline bool arch_syscall_match_sym_name(const char *sym, const char *name)
+{
+	/*
+	 * Skip the __x64_sys_ prefix and compare the
+	 * syscall name only.
+	 */
+	return !strcmp(sym + 9, name + 3);
+}
+#endif /* CONFIG_X86_64 */
 #endif /* !__ASSEMBLY__  && !COMPILE_OFFSETS */
 
 #endif /* _ASM_X86_FTRACE_H */
-- 
2.13.6

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

* Re: [PATCH] ftrace/x86: Fix arch_syscall_match_sym_name for x86_64
  2018-04-24 10:17 [PATCH] ftrace/x86: Fix arch_syscall_match_sym_name for x86_64 Jiri Olsa
@ 2018-04-24 14:33 ` Steven Rostedt
  2018-04-24 15:08   ` Jiri Olsa
  0 siblings, 1 reply; 3+ messages in thread
From: Steven Rostedt @ 2018-04-24 14:33 UTC (permalink / raw)
  To: Jiri Olsa; +Cc: Andy Lutomirski, Dominik Brodowski, lkml, Ingo Molnar

On Tue, 24 Apr 2018 12:17:38 +0200
Jiri Olsa <jolsa@kernel.org> wrote:

> Recent commit changed the name prefix of syscalls
> for x86_64 (check the 'Fixes:' for commit number).
> 
> The names switch from "sys_" prefix to ""__x64_sys_",
> which made the default matching function always fail.
> 
> Consequently the ftrace syscall __init code could not
> match any syscall metadata so the "syscall" events
> vanished. This fix returns them back.
> 

Hi Jiri,

I already fixed it and it's queued it my tree. I'm waiting for some
other patches that are waiting for review so I can start testing and
push to Linus.

Also, this was half the fix, the total fix is here:

  http://lkml.kernel.org/r/20180418114509.5a76847d@gandalf.local.home

I think I'm done waiting, I'll start testing and get my queue out. If
the other patches don't get the proper acks, I'm not taking them.

Thanks,

-- Steve

> Cc: Andy Lutomirski <luto@kernel.org>
> Cc: Dominik Brodowski <linux@dominikbrodowski.net>
> Fixes: d5a00528b58c ("syscalls/core, syscalls/x86: Rename struct pt_regs-based sys_*() to __x64_sys_*()")
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> ---
>  arch/x86/include/asm/ftrace.h | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/arch/x86/include/asm/ftrace.h b/arch/x86/include/asm/ftrace.h
> index 09ad88572746..7b131ad39ee2 100644
> --- a/arch/x86/include/asm/ftrace.h
> +++ b/arch/x86/include/asm/ftrace.h
> @@ -67,6 +67,18 @@ static inline bool arch_trace_is_compat_syscall(struct pt_regs *regs)
>  	return false;
>  }
>  #endif /* CONFIG_FTRACE_SYSCALLS && CONFIG_IA32_EMULATION */
> +
> +#ifdef CONFIG_X86_64
> +#define ARCH_HAS_SYSCALL_MATCH_SYM_NAME 1
> +static inline bool arch_syscall_match_sym_name(const char *sym, const char *name)
> +{
> +	/*
> +	 * Skip the __x64_sys_ prefix and compare the
> +	 * syscall name only.
> +	 */
> +	return !strcmp(sym + 9, name + 3);
> +}
> +#endif /* CONFIG_X86_64 */
>  #endif /* !__ASSEMBLY__  && !COMPILE_OFFSETS */
>  
>  #endif /* _ASM_X86_FTRACE_H */

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

* Re: [PATCH] ftrace/x86: Fix arch_syscall_match_sym_name for x86_64
  2018-04-24 14:33 ` Steven Rostedt
@ 2018-04-24 15:08   ` Jiri Olsa
  0 siblings, 0 replies; 3+ messages in thread
From: Jiri Olsa @ 2018-04-24 15:08 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Jiri Olsa, Andy Lutomirski, Dominik Brodowski, lkml, Ingo Molnar

On Tue, Apr 24, 2018 at 10:33:58AM -0400, Steven Rostedt wrote:
> On Tue, 24 Apr 2018 12:17:38 +0200
> Jiri Olsa <jolsa@kernel.org> wrote:
> 
> > Recent commit changed the name prefix of syscalls
> > for x86_64 (check the 'Fixes:' for commit number).
> > 
> > The names switch from "sys_" prefix to ""__x64_sys_",
> > which made the default matching function always fail.
> > 
> > Consequently the ftrace syscall __init code could not
> > match any syscall metadata so the "syscall" events
> > vanished. This fix returns them back.
> > 
> 
> Hi Jiri,
> 
> I already fixed it and it's queued it my tree. I'm waiting for some
> other patches that are waiting for review so I can start testing and
> push to Linus.
> 
> Also, this was half the fix, the total fix is here:

yep, that's why I enclosed it to CONFIG_X86_64 ;-)

> 
>   http://lkml.kernel.org/r/20180418114509.5a76847d@gandalf.local.home

after long time I needed 'syscalls' events and couldn't believe my eyes ;-)

> 
> I think I'm done waiting, I'll start testing and get my queue out. If
> the other patches don't get the proper acks, I'm not taking them.

cool, I'll stick with my change for now and rebase when it's in

thanks,
jirka

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

end of thread, other threads:[~2018-04-24 15:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-24 10:17 [PATCH] ftrace/x86: Fix arch_syscall_match_sym_name for x86_64 Jiri Olsa
2018-04-24 14:33 ` Steven Rostedt
2018-04-24 15:08   ` Jiri Olsa

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.