summaryrefslogtreecommitdiff
path: root/tools/perf/builtin-script.c
diff options
context:
space:
mode:
authorMiquel Raynal <miquel.raynal@bootlin.com>2021-11-07 17:38:36 +0100
committerMiquel Raynal <miquel.raynal@bootlin.com>2021-11-07 17:38:36 +0100
commite269d7caf9e0dbd95fac9991991298f74930c2c0 (patch)
tree5fc1a69a0a54cdfc7f3a0be247f6658d3d7ed3c1 /tools/perf/builtin-script.c
parentbca20e6a73863f37eb5e04c505be219a65f26a38 (diff)
parentdf872ab1ffe4bd865dfb5956cae4901429004ab6 (diff)
Merge tag 'spi-nor/for-5.16' into mtd/next
SPI NOR core changes: - Add spi-nor device tree binding under SPI NOR maintainers SPI NOR manufacturer drivers changes: - Enable locking for n25q128a13 SPI NOR controller drivers changes: - Use devm_platform_ioremap_resource_byname()
Diffstat (limited to 'tools/perf/builtin-script.c')
-rw-r--r--tools/perf/builtin-script.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 0e824f7d8b19..6211d0b84b7a 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -368,16 +368,6 @@ static inline int output_type(unsigned int type)
return OUTPUT_TYPE_OTHER;
}
-static inline unsigned int attr_type(unsigned int type)
-{
- switch (type) {
- case OUTPUT_TYPE_SYNTH:
- return PERF_TYPE_SYNTH;
- default:
- return type;
- }
-}
-
static bool output_set_by_user(void)
{
int j;
@@ -556,6 +546,18 @@ static void set_print_ip_opts(struct perf_event_attr *attr)
output[type].print_ip_opts |= EVSEL__PRINT_SRCLINE;
}
+static struct evsel *find_first_output_type(struct evlist *evlist,
+ unsigned int type)
+{
+ struct evsel *evsel;
+
+ evlist__for_each_entry(evlist, evsel) {
+ if (output_type(evsel->core.attr.type) == (int)type)
+ return evsel;
+ }
+ return NULL;
+}
+
/*
* verify all user requested events exist and the samples
* have the expected data
@@ -567,7 +569,7 @@ static int perf_session__check_output_opt(struct perf_session *session)
struct evsel *evsel;
for (j = 0; j < OUTPUT_TYPE_MAX; ++j) {
- evsel = perf_session__find_first_evtype(session, attr_type(j));
+ evsel = find_first_output_type(session->evlist, j);
/*
* even if fields is set to 0 (ie., show nothing) event must