Re: [PATCH 08/12] add trace events for each syscall entry/exit

Ingo Molnar
2009-08-11T13:53:54Z

* Frederic Weisbecker <fweisbec@gmail.com> wrote:

> > +struct trace_event event_syscall_enter = {
> > + .trace = print_syscall_enter,
> > + .type = TRACE_SYSCALL_ENTER
> > +};
> > +
> > +struct trace_event event_syscall_exit = {
> > + .trace = print_syscall_exit,
> > + .type = TRACE_SYSCALL_EXIT
> > +};
> > --
> > 1.6.2.5
> >
>
> Nice.
>
> It's a bit too bad that enter and exit must be that separated
> whereas their callbacks are pretty the same.
>
> But I guess if we want to nicely decouple both, we don't have the
> choice.

Yeah - and enter and exit are different, in terms of state.

One thing that would be nice in the future (as an add-on - this
patch-set looks useful already) is to allow the sampling of user
register state as well via these tracepoints. That way we'd have a
much faster (and completely transparent) implementation of strace in
essence, with unique features such as system-wide or per cpu
strace-ing.

Ingo