diff options
author | Changbin Du <changbin.du@gmail.com> | 2019-02-01 21:46:51 +0800 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-02-06 10:00:40 -0300 |
commit | 55fa8b8c0a37618c94df38d50d6871cb3e755ad2 (patch) | |
tree | 3f055e963047d038cd98a79d2c04a57f53219f4c /tools/perf/Documentation/perf-record.txt | |
parent | dbd2a1d57f4ee6b909c94072ae9484199308acbd (diff) | |
download | blackbird-op-linux-55fa8b8c0a37618c94df38d50d6871cb3e755ad2.tar.gz blackbird-op-linux-55fa8b8c0a37618c94df38d50d6871cb3e755ad2.zip |
perf tools: Add documentation for BPF event selection
Add documentation for how to pass a BPF program as a perf event.
Signed-off-by: Changbin Du <changbin.du@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20190201134651.12373-1-changbin.du@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/Documentation/perf-record.txt')
-rw-r--r-- | tools/perf/Documentation/perf-record.txt | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/perf/Documentation/perf-record.txt b/tools/perf/Documentation/perf-record.txt index d232b13ea713..02b4aa2621e7 100644 --- a/tools/perf/Documentation/perf-record.txt +++ b/tools/perf/Documentation/perf-record.txt @@ -88,6 +88,20 @@ OPTIONS If you want to profile write accesses in [0x1000~1008), just set 'mem:0x1000/8:w'. + - a BPF source file (ending in .c) or a precompiled object file (ending + in .o) selects one or more BPF events. + The BPF program can attach to various perf events based on the ELF section + names. + + When processing a '.c' file, perf searches an installed LLVM to compile it + into an object file first. Optional clang options can be passed via the + '--clang-opt' command line option, e.g.: + + perf record --clang-opt "-DLINUX_VERSION_CODE=0x50000" \ + -e tests/bpf-script-example.c + + Note: '--clang-opt' must be placed before '--event/-e'. + - a group of events surrounded by a pair of brace ("{event1,event2,...}"). Each event is separated by commas and the group should be quoted to prevent the shell interpretation. You also need to use --group on |