The biggest change here is the updates to kprobes

Back in January I posted patches to create function based events. These were
the events that you suggested I make to allow developers to easily create
events in code where no trace event exists. After posting those changes for
review, it was suggested that we implement this instead with kprobes.

The problem with kprobes is that the interface is too complex and needs to
be simplified. Masami Hiramatsu posted patches in March and I've been
playing with them a bit. There's been a bit of clean up in the kprobe code
that was inspired by the function based event patches, and a couple of
enhancements to the kprobe event interface.

 - If the arch supports it (we added support for x86), you can place a
   kprobe event at the start of a function and use $arg1, $arg2, etc
   to reference the arguments of a function. (Before you needed to know
   what register or where on the stack the argument was).

 - The second is a way to see array of events. For example, if you reference
   a mac address, you can add:

   echo 'p:mac ip_rcv perm_addr=+574($arg2):x8[6]' > kprobe_events

   And this will produce:

   mac: (ip_rcv+0x0/0x140) perm_addr={0x52,0x54,0x0,0xc0,0x76,0xec}

Other changes include

 - Exporting trace_dump_stack to modules

 - Have the stack tracer trace the entire stack (stop trying to remove
   tracing itself, as we keep removing too much).

 - Added support for SDT in uprobes
tracing: Have stack tracer trace full stack

The stack tracer traces every function call checking the current stack (in
non interrupt context), looking for the deepest stack, and saving it when it
finds a new max depth. The problem is that it calls save_stack_trace(), and
with the new ORC unwinder, it can skip too much. As it looks at the ip of
the function call in the backtrace to find where it should start, it doesn't
need to skip anything.

The stack trace selftest would fail when the kernel was complied with the
ORC UNDWINDER enabled. Without skipping functions when doing the stack
trace, it now passes again.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
1 file changed