[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tip-dg6yavctt0hzl2tsgfb43qsr@git.kernel.org>
Date: Wed, 13 Apr 2016 00:25:54 -0700
From: tip-bot for Arnaldo Carvalho de Melo <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: namhyung@...nel.org, jolsa@...nel.org, tglx@...utronix.de,
milian.wolff@...b.com, hpa@...or.com, wangnan0@...wei.com,
linux-kernel@...r.kernel.org, adrian.hunter@...el.com,
dsahern@...il.com, mingo@...nel.org, acme@...hat.com
Subject: [tip:perf/core] perf evlist: Add (reset,set)_sample_bit methods
Commit-ID: 22c8a376b55f327f7a25a318e87ba9202ba284bf
Gitweb: http://git.kernel.org/tip/22c8a376b55f327f7a25a318e87ba9202ba284bf
Author: Arnaldo Carvalho de Melo <acme@...hat.com>
AuthorDate: Mon, 11 Apr 2016 18:37:45 -0300
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Mon, 11 Apr 2016 22:18:21 -0300
perf evlist: Add (reset,set)_sample_bit methods
For fiddling with sample_type fields in all evsels in an evlist.
Cc: Adrian Hunter <adrian.hunter@...el.com>
Cc: David Ahern <dsahern@...il.com>
Cc: Jiri Olsa <jolsa@...nel.org>
Cc: Milian Wolff <milian.wolff@...b.com>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Wang Nan <wangnan0@...wei.com>
Link: http://lkml.kernel.org/n/tip-dg6yavctt0hzl2tsgfb43qsr@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/util/evlist.c | 18 ++++++++++++++++++
tools/perf/util/evlist.h | 11 +++++++++++
2 files changed, 29 insertions(+)
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index 86a0383..4c9f510 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -1192,6 +1192,24 @@ void perf_evlist__set_maps(struct perf_evlist *evlist, struct cpu_map *cpus,
perf_evlist__propagate_maps(evlist);
}
+void __perf_evlist__set_sample_bit(struct perf_evlist *evlist,
+ enum perf_event_sample_format bit)
+{
+ struct perf_evsel *evsel;
+
+ evlist__for_each(evlist, evsel)
+ __perf_evsel__set_sample_bit(evsel, bit);
+}
+
+void __perf_evlist__reset_sample_bit(struct perf_evlist *evlist,
+ enum perf_event_sample_format bit)
+{
+ struct perf_evsel *evsel;
+
+ evlist__for_each(evlist, evsel)
+ __perf_evsel__reset_sample_bit(evsel, bit);
+}
+
int perf_evlist__apply_filters(struct perf_evlist *evlist, struct perf_evsel **err_evsel)
{
struct perf_evsel *evsel;
diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h
index 8db9228..da46423 100644
--- a/tools/perf/util/evlist.h
+++ b/tools/perf/util/evlist.h
@@ -87,6 +87,17 @@ int perf_evlist__add_dummy(struct perf_evlist *evlist);
int perf_evlist__add_newtp(struct perf_evlist *evlist,
const char *sys, const char *name, void *handler);
+void __perf_evlist__set_sample_bit(struct perf_evlist *evlist,
+ enum perf_event_sample_format bit);
+void __perf_evlist__reset_sample_bit(struct perf_evlist *evlist,
+ enum perf_event_sample_format bit);
+
+#define perf_evlist__set_sample_bit(evlist, bit) \
+ __perf_evlist__set_sample_bit(evlist, PERF_SAMPLE_##bit)
+
+#define perf_evlist__reset_sample_bit(evlist, bit) \
+ __perf_evlist__reset_sample_bit(evlist, PERF_SAMPLE_##bit)
+
int perf_evlist__set_filter(struct perf_evlist *evlist, const char *filter);
int perf_evlist__set_filter_pid(struct perf_evlist *evlist, pid_t pid);
int perf_evlist__set_filter_pids(struct perf_evlist *evlist, size_t npids, pid_t *pids);
Powered by blists - more mailing lists