mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
To: <linux-kernel@vger.kernel.org>
Cc: Marcin Nowakowski <marcin.nowakowski@imgtec.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ingo Molnar <mingo@redhat.com>
Subject: [PATCH v2 04/11] syscall/tracing: allow arch to override syscall_get_nr for ftrace
Date: Fri, 16 Sep 2016 09:11:20 +0200	[thread overview]
Message-ID: <1474009887-7225-5-git-send-email-marcin.nowakowski@imgtec.com> (raw)
In-Reply-To: <1474009887-7225-1-git-send-email-marcin.nowakowski@imgtec.com>

Some architectures modify syscall numbers to indicate ABI used
and as a result syscall number as returned by syscall_get_nr
does not correspond to the syscall number used inside the kernel.
Allow an arch to provide a separate implementation for ftrace
that returns the 'real' syscall number from the regs provided.

This will be used by x86 in a follow-up change.

Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@redhat.com>
---
 kernel/trace/trace_syscalls.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c
index 8dd0fbf..bb1e901 100644
--- a/kernel/trace/trace_syscalls.c
+++ b/kernel/trace/trace_syscalls.c
@@ -74,7 +74,11 @@ static inline bool trace_is_compat_syscall(struct pt_regs *regs)
 static inline int
 trace_get_syscall_nr(struct task_struct *task, struct pt_regs *regs)
 {
+#ifdef arch_trace_syscall_get_nr
+	return arch_trace_syscall_get_nr(task, regs);
+#else
 	return syscall_get_nr(task, regs);
+#endif
 }
 
 
-- 
2.7.4

  parent reply	other threads:[~2016-09-16  7:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-16  7:11 [PATCH v2 00/11] syscall/tracing: compat syscall support Marcin Nowakowski
2016-09-16  7:11 ` [PATCH v2 01/11] tracing/syscalls: remove syscall_nr from syscall metadata Marcin Nowakowski
2016-09-16  7:11 ` [PATCH v2 02/11] tracing/syscalls: add handling for compat tasks Marcin Nowakowski
2016-09-16  7:11 ` [PATCH v2 03/11] tracing/syscalls: add compat syscall metadata Marcin Nowakowski
2016-09-16  7:11 ` Marcin Nowakowski [this message]
2016-09-16  7:11 ` [PATCH v2 05/11] x86/tracing: fix compat syscall handling Marcin Nowakowski
2016-09-16  7:11 ` [PATCH v2 06/11] s390/tracing: " Marcin Nowakowski
2016-09-16  7:11 ` [PATCH v2 07/11] arm64/tracing: " Marcin Nowakowski
2016-09-16  7:11 ` [PATCH v2 08/11] powerpc/tracing: " Marcin Nowakowski
2016-09-16  7:11 ` [PATCH v2 09/11] tile/tracing: " Marcin Nowakowski
2016-09-16 10:42   ` kbuild test robot
2016-09-20 18:49   ` Chris Metcalf
2016-09-16  7:11 ` [PATCH v2 10/11] sparc/tracing: " Marcin Nowakowski
2016-09-16  7:11 ` [PATCH v2 11/11] parisc/tracing: " Marcin Nowakowski

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=1474009887-7225-5-git-send-email-marcin.nowakowski@imgtec.com \
    --to=marcin.nowakowski@imgtec.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®