[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <31dbae6c-4cbe-d7e2-bc78-beed959cbddc@amd.com>
Date: Tue, 2 May 2023 15:57:00 +0530
From: Ravi Bangoria <ravi.bangoria@....com>
To: Ian Rogers <irogers@...gle.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Kan Liang <kan.liang@...ux.intel.com>,
Ahmad Yasin <ahmad.yasin@...el.com>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Stephane Eranian <eranian@...gle.com>,
Andi Kleen <ak@...ux.intel.com>,
Perry Taylor <perry.taylor@...el.com>,
Samantha Alt <samantha.alt@...el.com>,
Caleb Biggers <caleb.biggers@...el.com>,
Weilin Wang <weilin.wang@...el.com>,
Edward Baker <edward.baker@...el.com>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Adrian Hunter <adrian.hunter@...el.com>,
Florian Fischer <florian.fischer@...q.space>,
Rob Herring <robh@...nel.org>,
Zhengjun Xing <zhengjun.xing@...ux.intel.com>,
John Garry <john.g.garry@...cle.com>,
Kajol Jain <kjain@...ux.ibm.com>,
Sumanth Korikkar <sumanthk@...ux.ibm.com>,
Thomas Richter <tmricht@...ux.ibm.com>,
Tiezhu Yang <yangtiezhu@...ngson.cn>,
Leo Yan <leo.yan@...aro.org>,
Yang Jihong <yangjihong1@...wei.com>,
James Clark <james.clark@....com>,
Suzuki Poulouse <suzuki.poulose@....com>,
Kang Minchul <tegongkang@...il.com>,
Athira Rajeev <atrajeev@...ux.vnet.ibm.com>,
linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
Ravi Bangoria <ravi.bangoria@....com>
Subject: Re: [PATCH v3 12/46] perf test: Test more sysfs events
> @@ -2225,74 +2226,82 @@ static int test_pmu(void)
>
> static int test__pmu_events(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
> {
> - struct stat st;
> - char path[PATH_MAX];
> - struct dirent *ent;
> - DIR *dir;
> - int ret;
> + struct perf_pmu *pmu;
> + int ret = TEST_OK;
>
> - if (!test_pmu())
> - return TEST_SKIP;
> + perf_pmus__for_each_pmu(pmu) {
'pmus' list might be empty and, if so, we need to fill it first with:
if (list_empty(&pmus))
perf_pmu__scan(NULL);
before iterating over it. Other option is to add this code to
perf_pmus__for_each_pmu() macro itself.
With that, the test fails for me:
$ sudo ./perf test 6
6: Parse event definition strings :
6.1: Test event parsing : Ok
6.2: Test parsing of "hybrid" CPU events : Skip (not hybrid)
6.3: Parsing of all PMU events from sysfs : FAILED!
> + struct stat st;
> + char path[PATH_MAX];
> + struct dirent *ent;
> + DIR *dir;
> + int err;
>
> - snprintf(path, PATH_MAX, "%s/bus/event_source/devices/cpu/events/",
> - sysfs__mountpoint());
> + snprintf(path, PATH_MAX, "%s/bus/event_source/devices/%s/events/",
> + sysfs__mountpoint(), pmu->name);
>
> - ret = stat(path, &st);
> - if (ret) {
> - pr_debug("omitting PMU cpu events tests: %s\n", path);
> - return TEST_OK;
> - }
> + err = stat(path, &st);
> + if (err) {
> + pr_debug("skipping PMU %s events tests: %s\n", pmu->name, path);
> + ret = combine_test_results(ret, TEST_SKIP);
combine_test_results(ret, TEST_OK); probably? Since many pmus don't expose
events via sysfs.
Powered by blists - more mailing lists