public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "zhangwei(Jovi)" <jovi.zhangwei@huawei.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Ingo Molnar <mingo@redhat.com>
Subject: [PATCH 11/13] tracing: export syscall_nr_to_meta function
Date: Mon, 11 Mar 2013 15:14:17 +0800	[thread overview]
Message-ID: <513D8449.4090003@huawei.com> (raw)

Currently syscall meta table is important for kernel
syscall tracing, even mandatory, external modules may need this
meta info when perform syscall tracing(like ktap), so export it.

Instead of export variable syscalls_metadata, export function
syscall_nr_to_meta is more safe.

Signed-off-by: zhangwei(Jovi) <jovi.zhangwei@huawei.com>
---
 include/trace/syscall.h       |    2 ++
 kernel/trace/trace_syscalls.c |    3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/trace/syscall.h b/include/trace/syscall.h
index 84bc419..3d88f63 100644
--- a/include/trace/syscall.h
+++ b/include/trace/syscall.h
@@ -31,4 +31,6 @@ struct syscall_metadata {
 	struct ftrace_event_call *exit_event;
 };

+struct syscall_metadata *syscall_nr_to_meta(int nr);
+
 #endif /* _TRACE_SYSCALL_H */
diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c
index d24a84c..63433f9 100644
--- a/kernel/trace/trace_syscalls.c
+++ b/kernel/trace/trace_syscalls.c
@@ -102,13 +102,14 @@ find_syscall_meta(unsigned long syscall)
 	return NULL;
 }

-static struct syscall_metadata *syscall_nr_to_meta(int nr)
+struct syscall_metadata *syscall_nr_to_meta(int nr)
 {
 	if (!syscalls_metadata || nr >= NR_syscalls || nr < 0)
 		return NULL;

 	return syscalls_metadata[nr];
 }
+EXPORT_SYMBOL_GPL(syscall_nr_to_meta);

 static enum print_line_t
 print_syscall_enter(struct trace_iterator *iter, int flags,
-- 
1.7.9.7



             reply	other threads:[~2013-03-11  7:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-11  7:14 zhangwei(Jovi) [this message]
2013-03-11 14:17 ` [PATCH 11/13] tracing: export syscall_nr_to_meta function Steven Rostedt

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=513D8449.4090003@huawei.com \
    --to=jovi.zhangwei@huawei.com \
    --cc=fweisbec@gmail.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