funccount: Generalize for uprobes, tracepoints, and USDT
authorSasha Goldshtein <goldshtn@gmail.com>
Sat, 8 Oct 2016 14:01:21 +0000 (07:01 -0700)
committerSasha Goldshtein <goldshtn@gmail.com>
Wed, 19 Oct 2016 07:57:13 +0000 (00:57 -0700)
commitff3b9f37ad66f483363541e4e5ef52f311bf0270
tree6efcfbadb480b0816a8fcd0998cb18f4eaf90a3b
parente84febdfc917f4b9e003511efa03be5a012efd9d
funccount: Generalize for uprobes, tracepoints, and USDT

This commit updates `funccount` to support attaching to a set of
user functions, kernel tracepoints, or USDT probes using familiar
syntax. Along the way, the implementation has been updated to use
a separate BPF function for each target function, because using
the instruction pointer to determine the function name doesn't
work for anything other than kprobes. Even though the BPF program
can now be potentially larger, testing with 40-50 attach points
shows no significant overhead compared to the previous version.

Examples of what's now possible:

```
funccount t:block:*
funccount u:node:gc*
funccount -r 'c:(read|write)$'
funccount -p 142 u:ruby:object__create
```
man/man8/funccount.8
tools/funccount.py
tools/funccount_example.txt