Event group test checks group creation for combinations of
hw, sw and uncore PMU events. Some of the uncore pmus may
require additional permission to access the counters.
For example, in case of hv_24x7, partition need to have
permissions to access hv_24x7 pmu counters. If not, event_open
will fail. Hence add a sanity check to see if event_open
succeeds before proceeding with the test.
Fixes: b20d9215a35f ("perf test: Add event group test for events in multiple PMUs")
Signed-off-by: Athira Rajeev <redacted>
---
Note: The patch is based on tmp.perf/core branch
of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git
tools/perf/tests/event_groups.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
@@ -51,7 +51,7 @@ static int event_open(int type, unsigned long config, int group_fd)staticintsetup_uncore_event(void){structperf_pmu*pmu;-inti;+inti,fd;if(list_empty(&pmus))perf_pmu__scan(NULL);
@@ -62,6 +62,18 @@ static int setup_uncore_event(void)pr_debug("Using %s for uncore pmu event\n",pmu->name);types[2]=pmu->type;configs[2]=uncore_pmus[i].config;+/*+*Checkifthechosenuncorepmueventcanbe+*usedinthetest.Forexample,incaseofaccessing+*hv_24x7pmucounters,partitionshouldhave+*additionalpermissions.Ifnot,eventopenwill+*fail.Socheckiftheeventopensucceeds+*beforeproceeding.+*/+fd=event_open(types[2],configs[2],-1);+if(fd<0)+return-1;+close(fd);return0;}}
From: Ravi Bangoria <hidden> Date: 2022-12-08 04:20:06
On 07-Dec-22 10:28 PM, Athira Rajeev wrote:
Event group test checks group creation for combinations of
hw, sw and uncore PMU events. Some of the uncore pmus may
require additional permission to access the counters.
For example, in case of hv_24x7, partition need to have
permissions to access hv_24x7 pmu counters. If not, event_open
will fail. Hence add a sanity check to see if event_open
succeeds before proceeding with the test.
Fixes: b20d9215a35f ("perf test: Add event group test for events in multiple PMUs")
Signed-off-by: Athira Rajeev <redacted>
On 08-Dec-2022, at 9:48 AM, Ravi Bangoria [off-list ref] wrote:
On 07-Dec-22 10:28 PM, Athira Rajeev wrote:
quoted
Event group test checks group creation for combinations of
hw, sw and uncore PMU events. Some of the uncore pmus may
require additional permission to access the counters.
For example, in case of hv_24x7, partition need to have
permissions to access hv_24x7 pmu counters. If not, event_open
will fail. Hence add a sanity check to see if event_open
succeeds before proceeding with the test.
Fixes: b20d9215a35f ("perf test: Add event group test for events in multiple PMUs")
Signed-off-by: Athira Rajeev <redacted>
From: Arnaldo Carvalho de Melo <acme@kernel.org> Date: 2022-12-12 15:40:34
Em Fri, Dec 09, 2022 at 12:57:34PM +0530, Athira Rajeev escreveu:
quoted
On 08-Dec-2022, at 9:48 AM, Ravi Bangoria [off-list ref] wrote:
On 07-Dec-22 10:28 PM, Athira Rajeev wrote:
quoted
Event group test checks group creation for combinations of
hw, sw and uncore PMU events. Some of the uncore pmus may
require additional permission to access the counters.
For example, in case of hv_24x7, partition need to have
permissions to access hv_24x7 pmu counters. If not, event_open
will fail. Hence add a sanity check to see if event_open
succeeds before proceeding with the test.
Fixes: b20d9215a35f ("perf test: Add event group test for events in multiple PMUs")
Signed-off-by: Athira Rajeev <redacted>