diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index f0bc89f7439158007042590f93280355dc5ea6d2..45d778f063d473b7cacf31137d67755dacd56773 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -1827,6 +1827,20 @@ static void evsel__disable_missing_features(struct evsel *evsel) evsel->core.attr.sample_id_all = 0; } +int evsel__prepare_open(struct evsel *evsel, struct perf_cpu_map *cpus, + struct perf_thread_map *threads) +{ + int err; + + err = __evsel__prepare_open(evsel, cpus, threads); + if (err) + return err; + + evsel__disable_missing_features(evsel); + + return err; +} + static int evsel__open_cpu(struct evsel *evsel, struct perf_cpu_map *cpus, struct perf_thread_map *threads, int start_cpu, int end_cpu) diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index 76efcfa3e14d093edfe0f2fbf420e6423c407ebb..b173700db8af6858c95e262bc394d4a6f3402576 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -287,6 +287,8 @@ int evsel__open_per_thread(struct evsel *evsel, struct perf_thread_map *threads) int evsel__open(struct evsel *evsel, struct perf_cpu_map *cpus, struct perf_thread_map *threads); void evsel__close(struct evsel *evsel); +int evsel__prepare_open(struct evsel *evsel, struct perf_cpu_map *cpus, + struct perf_thread_map *threads); struct perf_sample;