perf evsel: Separate bpf_counter_list and bpf_filters, can be used at the same time
Changes
2 files changed · +3 −4
| File | Status | Add | Del | Content |
|---|---|---|---|---|
| tools/perf/util/evsel.c | modified | +1 | −0 | View file |
| tools/perf/util/evsel.h | modified | +2 | −4 | View file |
tools/perf/util/evsel.c
View filediff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 2f5910b..c2dbb56 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -282,6 +282,7 @@ void evsel__init(struct evsel *evsel,
evsel->bpf_fd = -1;
INIT_LIST_HEAD(&evsel->config_terms);
INIT_LIST_HEAD(&evsel->bpf_counter_list);
+ INIT_LIST_HEAD(&evsel->bpf_filters);
perf_evsel__object.init(evsel);
evsel->sample_size = __evsel__sample_size(attr->sample_type);
evsel__calc_id_pos(evsel);
tools/perf/util/evsel.h
View filediff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index df89287..0f54f28 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -151,10 +151,8 @@ struct evsel {
*/
struct bpf_counter_ops *bpf_counter_ops;
- union {
- struct list_head bpf_counter_list; /* for perf-stat -b */
- struct list_head bpf_filters; /* for perf-record --filter */
- };
+ struct list_head bpf_counter_list; /* for perf-stat -b */
+ struct list_head bpf_filters; /* for perf-record --filter */
/* for perf-stat --use-bpf */
int bperf_leader_prog_fd;