Re: [PATCH] tracing: Create generic syscall TRACE_EVENTs

From: Li Zefan
Date: Tue Aug 18 2009 - 21:33:57 EST


Josh Stone wrote:
> This converts the syscall_enter/exit tracepoints into TRACE_EVENTs, so
> you can have generic ftrace events that capture all system calls with
> arguments and return values.
>
> The existing event_syscall_enter/exit trace_event structs are renamed to
> event_sys_enter/exit, so they don't conflict with the names generated
> automatically by ftrace.
>

It would be much better to see a sample output of these TRACE_EVENTs,

...

> +TRACE_EVENT_WITH_CALLBACK(syscall_enter,
> +
> + TP_PROTO(struct pt_regs *regs, long id),
> +
> + TP_ARGS(regs, id),
> +
> + TP_STRUCT__entry(
> + __field( long, id )
> + __array( long, args, 6 )
> + ),
> +
> + TP_fast_assign(
> + __entry->id = id;
> + syscall_get_arguments(current, regs, 0, 6, __entry->args);
> + ),
> +
> + TP_printk("NR %ld (%ld, %ld, %ld, %ld, %ld, %ld)",
> + __entry->id,
> + __entry->args[0], __entry->args[1], __entry->args[2],
> + __entry->args[3], __entry->args[4], __entry->args[5]),
> +

so we'll see the what's the output if a syscall has less than 6 args.

And I guess it should be "(%lx, %lx, ..., %lx)"? Otherwise I think we'll
see some negative values.

> + syscall_regfunc, syscall_unregfunc
> +);


--
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/