lkml.org 
[lkml]   [2013]   [Mar]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 11/13] tracing: export syscall_nr_to_meta function
From
Date
On Mon, 2013-03-11 at 15:14 +0800, zhangwei(Jovi) wrote:
> 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 you're going to make this global, then the name needs to be changed.
Perhaps call it trace_syscall_nr_to_metadata()

Anyway, this code may be totally rewritten in the near future, so
modules beware.

-- Steve

> {
> 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,




\
 
 \ /
  Last update: 2013-03-11 16:01    [W:0.037 / U:3.796 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site