Skip to content

Commit 71184c6

Browse files
liu-song-6acmel
authored andcommitted
perf record: Replace option --bpf-event with --no-bpf-event
Currently, monitoring of BPF programs through bpf_event is off by default for 'perf record'. To turn it on, the user need to use option "--bpf-event". As BPF gets wider adoption in different subsystems, this option becomes inconvenient. This patch makes bpf_event on by default, and adds option "--no-bpf-event" to turn it off. Since option --bpf-event is not released yet, it is safe to remove it. Signed-off-by: Song Liu <[email protected]> Reviewed-by: Jiri Olsa <[email protected]> Cc: Alexei Starovoitov <[email protected]> Cc: Daniel Borkmann <[email protected]> Cc: [email protected] Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Stanislav Fomichev <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent d982b33 commit 71184c6

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

tools/perf/builtin-record.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1891,7 +1891,7 @@ static struct option __record_options[] = {
18911891
OPT_BOOLEAN(0, "tail-synthesize", &record.opts.tail_synthesize,
18921892
"synthesize non-sample events at the end of output"),
18931893
OPT_BOOLEAN(0, "overwrite", &record.opts.overwrite, "use overwrite mode"),
1894-
OPT_BOOLEAN(0, "bpf-event", &record.opts.bpf_event, "record bpf events"),
1894+
OPT_BOOLEAN(0, "no-bpf-event", &record.opts.no_bpf_event, "record bpf events"),
18951895
OPT_BOOLEAN(0, "strict-freq", &record.opts.strict_freq,
18961896
"Fail if the specified frequency can't be used"),
18971897
OPT_CALLBACK('F', "freq", &record.opts, "freq or 'max'",

tools/perf/perf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ struct record_opts {
6666
bool ignore_missing_thread;
6767
bool strict_freq;
6868
bool sample_id;
69-
bool bpf_event;
69+
bool no_bpf_event;
7070
unsigned int freq;
7171
unsigned int mmap_pages;
7272
unsigned int auxtrace_mmap_pages;

tools/perf/util/bpf-event.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ static int perf_event__synthesize_one_bpf_prog(struct perf_tool *tool,
187187
}
188188

189189
/* Synthesize PERF_RECORD_BPF_EVENT */
190-
if (opts->bpf_event) {
190+
if (!opts->no_bpf_event) {
191191
*bpf_event = (struct bpf_event){
192192
.header = {
193193
.type = PERF_RECORD_BPF_EVENT,

tools/perf/util/evsel.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,7 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts,
10361036
attr->mmap2 = track && !perf_missing_features.mmap2;
10371037
attr->comm = track;
10381038
attr->ksymbol = track && !perf_missing_features.ksymbol;
1039-
attr->bpf_event = track && opts->bpf_event &&
1039+
attr->bpf_event = track && !opts->no_bpf_event &&
10401040
!perf_missing_features.bpf_event;
10411041

10421042
if (opts->record_namespaces)

0 commit comments

Comments
 (0)