trace: Allow function signatures in uprobes and kprobes
authorSasha Goldshtein <goldshtn@gmail.com>
Tue, 17 Jan 2017 08:49:36 +0000 (08:49 +0000)
committerSasha Goldshtein <goldshtn@gmail.com>
Tue, 17 Jan 2017 08:49:36 +0000 (08:49 +0000)
commit23e72b89c9018a653f3628ec87f1dfc8d507863c
tree1a097059f94bb3f94276d15f48fb0802336c42b5
parent7e78f3a6a69e0c6cb6e2acc88386c4a9ffa253b6
trace: Allow function signatures in uprobes and kprobes

§`trace` now allows uprobes and kprobes to have function signatures,
which means function parameters can be named and typed, rather than
relying on the positional arg1, arg2, etc. arguments. This also
enables structure field access, which is impossible with the unnamed
arguments due to rewriter limitations.

The example requested by @brendangregg, which now works, is the
following:

§Â```
PID    TID    COMM         FUNC             -
777    785    automount    SyS_nanosleep    sleep for 500000000 ns
777    785    automount    SyS_nanosleep    sleep for 500000000 ns
777    785    automount    SyS_nanosleep    sleep for 500000000 ns
777    785    automount    SyS_nanosleep    sleep for 500000000 ns
^C
```
man/man8/trace.8
tools/trace.py
tools/trace_example.txt