lkml.org 
[lkml]   [2021]   [Aug]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH v1 18/37] perf evsel: add evsel__prepare_open function
Date
This function will prepare the evsel and disable the missing features.
It will be used in one of the following patches.

Signed-off-by: Riccardo Mancini <rickyman7@gmail.com>
---
tools/perf/util/evsel.c | 14 ++++++++++++++
tools/perf/util/evsel.h | 2 ++
2 files changed, 16 insertions(+)

diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index f0bc89f743915800..4e9a3e62075305f1 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 1c0057e80d080f2f..58aa998e1814ac9e 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -286,6 +286,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;

--
2.31.1
\
 
 \ /
  Last update: 2021-08-21 11:22    [W:0.382 / U:0.356 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site