lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <158894308863.8414.5208704375127898287.tip-bot2@tip-bot2>
Date:   Fri, 08 May 2020 13:04:48 -0000
From:   "tip-bot2 for Stephane Eranian" <tip-bot2@...utronix.de>
To:     linux-tip-commits@...r.kernel.org
Cc:     Stephane Eranian <eranian@...gle.com>,
        Ian Rogers <irogers@...gle.com>, Jiri Olsa <jolsa@...hat.com>,
        Adrian Hunter <adrian.hunter@...el.com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Alexei Starovoitov <ast@...nel.org>,
        Alexey Budankov <alexey.budankov@...ux.intel.com>,
        Andi Kleen <ak@...ux.intel.com>,
        Andrii Nakryiko <andriin@...com>,
        Daniel Borkmann <daniel@...earbox.net>,
        Florian Fainelli <f.fainelli@...il.com>,
        "Greg Kroah-Hartman" <gregkh@...uxfoundation.org>,
        Igor Lubashev <ilubashe@...mai.com>,
        Jin Yao <yao.jin@...ux.intel.com>,
        Jiwei Sun <jiwei.sun@...driver.com>,
        John Garry <john.garry@...wei.com>,
        Kan Liang <kan.liang@...ux.intel.com>,
        Leo Yan <leo.yan@...aro.org>,
        Mark Rutland <mark.rutland@....com>,
        Martin KaFai Lau <kafai@...com>,
        Namhyung Kim <namhyung@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Yonghong Song <yhs@...com>, bpf@...r.kernel.org,
        netdev@...r.kernel.org, yuzhoujian <yuzhoujian@...ichuxing.com>,
        Arnaldo Carvalho de Melo <acme@...hat.com>,
        x86 <x86@...nel.org>, LKML <linux-kernel@...r.kernel.org>
Subject: [tip: perf/core] perf pmu: Add perf_pmu__find_by_type helper

The following commit has been merged into the perf/core branch of tip:

Commit-ID:     3a50dc76058d7cd8315f9c712b793d81a7ff4541
Gitweb:        https://git.kernel.org/tip/3a50dc76058d7cd8315f9c712b793d81a7ff4541
Author:        Stephane Eranian <eranian@...gle.com>
AuthorDate:    Wed, 29 Apr 2020 16:14:42 -07:00
Committer:     Arnaldo Carvalho de Melo <acme@...hat.com>
CommitterDate: Tue, 05 May 2020 16:35:31 -03:00

perf pmu: Add perf_pmu__find_by_type helper

This is used by libpfm4 during event parsing to locate the pmu for an
event.

Signed-off-by: Stephane Eranian <eranian@...gle.com>
Reviewed-by: Ian Rogers <irogers@...gle.com>
Acked-by: Jiri Olsa <jolsa@...hat.com>
Cc: Adrian Hunter <adrian.hunter@...el.com>
Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: Alexei Starovoitov <ast@...nel.org>
Cc: Alexey Budankov <alexey.budankov@...ux.intel.com>
Cc: Andi Kleen <ak@...ux.intel.com>
Cc: Andrii Nakryiko <andriin@...com>
Cc: Daniel Borkmann <daniel@...earbox.net>
Cc: Florian Fainelli <f.fainelli@...il.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Igor Lubashev <ilubashe@...mai.com>
Cc: Jin Yao <yao.jin@...ux.intel.com>
Cc: Jiwei Sun <jiwei.sun@...driver.com>
Cc: John Garry <john.garry@...wei.com>
Cc: Kan Liang <kan.liang@...ux.intel.com>
Cc: Leo Yan <leo.yan@...aro.org>
Cc: Mark Rutland <mark.rutland@....com>
Cc: Martin KaFai Lau <kafai@...com>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Yonghong Song <yhs@...com>
Cc: bpf@...r.kernel.org
Cc: netdev@...r.kernel.org
Cc: yuzhoujian <yuzhoujian@...ichuxing.com>
Link: http://lore.kernel.org/lkml/20200429231443.207201-4-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
 tools/perf/util/pmu.c | 11 +++++++++++
 tools/perf/util/pmu.h |  1 +
 2 files changed, 12 insertions(+)

diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index 5642de7..92bd7fa 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -871,6 +871,17 @@ static struct perf_pmu *pmu_find(const char *name)
 	return NULL;
 }
 
+struct perf_pmu *perf_pmu__find_by_type(unsigned int type)
+{
+	struct perf_pmu *pmu;
+
+	list_for_each_entry(pmu, &pmus, list)
+		if (pmu->type == type)
+			return pmu;
+
+	return NULL;
+}
+
 struct perf_pmu *perf_pmu__scan(struct perf_pmu *pmu)
 {
 	/*
diff --git a/tools/perf/util/pmu.h b/tools/perf/util/pmu.h
index 1edd214..cb6fbec 100644
--- a/tools/perf/util/pmu.h
+++ b/tools/perf/util/pmu.h
@@ -72,6 +72,7 @@ struct perf_pmu_alias {
 };
 
 struct perf_pmu *perf_pmu__find(const char *name);
+struct perf_pmu *perf_pmu__find_by_type(unsigned int type);
 int perf_pmu__config(struct perf_pmu *pmu, struct perf_event_attr *attr,
 		     struct list_head *head_terms,
 		     struct parse_events_error *error);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ