lkml.org 
[lkml]   [2009]   [Mar]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH 1/2] tracing/ftrace: syscall tracing infrastructure
On Sun, Mar 08, 2009 at 05:24:44PM +0100, Ingo Molnar wrote:
>
> * Frederic Weisbecker <fweisbec@gmail.com> wrote:
>
> > +static const struct syscall_trace_entry syscall_trace_entries[] = {
> > + /* For open, the first argument is a string, hence the given mask */
> > + [SYSCALL_TRACE_OPEN] = SYS_TRACE_ENTRY(open, 3, 0x1),
> > + [SYSCALL_TRACE_CLOSE] = SYS_TRACE_ENTRY(close, 1, 0),
> > + [SYSCALL_TRACE_READ] = SYS_TRACE_ENTRY(read, 3, 0),
> > + [SYSCALL_TRACE_WRITE] = SYS_TRACE_ENTRY(read, 3, 0),
> > +};
>
> s/read/write in the last entry i guess.
>
> But i think the whole concept of duplicating the syscall table
> is the wrong way around.
>
> Note that we dont have to build this information at all - in
> 2.6.29-rc1 all syscalls got wrapper macros:
>
> SYSCALL_DEFINE1(nice, int, increment)
> SYSCALL_DEFINE2(sched_setparam, pid_t, pid, struct sched_param __user *, param)
> SYSCALL_DEFINE3(sched_setaffinity, pid_t, pid, unsigned int, len,
> unsigned long __user *, user_mask_ptr)
>
> We also have the syscall table itself.
>
> So what we can do: by changing the SYSCALL_DEFINEX() macros we
> can emit the following information into a table:
>
> (syscall_fn_address, syscall_name_string, #of arguments, array
> of argument names and type sizeof()s)
>
> then during bootup we can match up the sys_call_table[] to the
> secondary table we built, so that we can order the secondary
> table based on syscall NR. 99% of the syscalls will match up
> just fine.
>
> Ingo

Yes, I didn't know the SYSCALL_DEFINEx() macro until Peter told me.
That's indeed a much better way to proceed, I will look at all that.


Thanks!



\
 
 \ /
  Last update: 2009-03-09 21:43    [W:0.108 / U:28.864 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site