[PATCH 11/13] tracing: export syscall_nr_to_meta function

From: zhangwei(Jovi)
Date: Mon Mar 11 2013 - 03:15:00 EST


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@xxxxxxxxxx>
---
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


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/