From: Changbin Du <changbin.du@gmail.com>
To: peterz@infradead.org, mingo@redhat.com, acme@kernel.org
Cc: jolsa@redhat.com, namhyung@kernel.org,
linux-kernel@vger.kernel.org, Changbin Du <changbin.du@gmail.com>
Subject: [PATCH] perf record: Add doc for bpf event selection
Date: Fri, 1 Feb 2019 03:06:41 +0000 [thread overview]
Message-ID: <20190201030641.4046-1-changbin.du@gmail.com> (raw)
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
next reply other threads:[~2019-02-01 3:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-01 3:06 Changbin Du [this message]
2019-02-01 8:10 ` Arnaldo Carvalho de Melo
2019-02-01 13:44 ` Changbin Du
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190201030641.4046-1-changbin.du@gmail.com \
--to=changbin.du@gmail.com \
--cc=acme@kernel.org \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome