[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e3a87977-02a1-eb34-593e-844adc6669b7@amd.com>
Date: Tue, 2 May 2023 16:14:22 +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 14/46] perf test: Mask config then test
> @@ -87,7 +92,7 @@ static int test__checkevent_raw(struct evlist *evlist)
>
> TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries);
> TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type);
> - TEST_ASSERT_VAL("wrong config", 0x1a == evsel->core.attr.config);
> + TEST_ASSERT_VAL("wrong config", test_config(evsel, 0x1a));
Extended 'type' via 'config' is applicable only to HW and HW_CACHE types.
I think we should not apply test_config() for other types. Even if they
are ineffective in these tests (because we are not setting upper bits),
they are semantically wrong IMO.
In fact, AMD EventSelect is 12 bits and upper 4 bits are located at 35:32
in PerfEvtSel register. So for RAW events, upper bits MUST NOT be ignored.
> @@ -139,8 +142,7 @@ static int test__checkevent_symbolic_alias(struct evlist *evlist)
>
> TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries);
> TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE == evsel->core.attr.type);
> - TEST_ASSERT_VAL("wrong config",
> - PERF_COUNT_SW_PAGE_FAULTS == evsel->core.attr.config);
> + TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_SW_PAGE_FAULTS));
Ditto for PERF_TYPE_SOFTWARE. We should not use test_config().
> @@ -160,7 +162,7 @@ static int test__checkevent_breakpoint(struct evlist *evlist)
>
> TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries);
> TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->core.attr.type);
> - TEST_ASSERT_VAL("wrong config", 0 == evsel->core.attr.config);
> + TEST_ASSERT_VAL("wrong config", test_config(evsel, 0));
Ditto for PERF_TYPE_BREAKPOINT.
Powered by blists - more mailing lists