All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf record: Add doc for bpf event selection
@ 2019-02-01  3:06 Changbin Du
  2019-02-01  8:10 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 3+ messages in thread
From: Changbin Du @ 2019-02-01  3:06 UTC (permalink / raw)
  To: peterz, mingo, acme; +Cc: jolsa, namhyung, linux-kernel, Changbin Du

Add document for how to pass bpf program with perf.

Signed-off-by: Changbin Du <changbin.du@gmail.com>
---
 tools/perf/Documentation/perf-record.txt | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/tools/perf/Documentation/perf-record.txt b/tools/perf/Documentation/perf-record.txt
index d232b13ea713..0925d987cad0 100644
--- a/tools/perf/Documentation/perf-record.txt
+++ b/tools/perf/Documentation/perf-record.txt
@@ -88,6 +88,19 @@ OPTIONS
           If you want to profile write accesses in [0x1000~1008), just set
           'mem:0x1000/8:w'.
 
+        - a bpf source file or object file to select events by a bpf program.
+          The bpf program can attach to variant perf events based on section
+          names.
+
+          When passing '.c', perf searches installed LLVM to compile it into
+          object file first. Optional clang options can be pased by option
+          '--clang-opt'.
+
+          perf record --clang-opt "-DLINUX_VERSION_CODE=0x50000" \
+                      -e ./tests/bpf-script-example.c
+
+          Note: '--clang-opt' must place before '--event'.
+
 	- 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
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-02-01 13:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-01  3:06 [PATCH] perf record: Add doc for bpf event selection Changbin Du
2019-02-01  8:10 ` Arnaldo Carvalho de Melo
2019-02-01 13:44   ` Changbin Du

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.