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) <[email protected]>
> ---
>  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,


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

Reply via email to