[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1522c39e-5658-d030-2e1e-f6e5d849d29b@linux.intel.com>
Date: Tue, 20 Jul 2021 13:56:49 +0800
From: "Jin, Yao" <yao.jin@...ux.intel.com>
To: John Garry <john.garry@...wei.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Jiri Olsa <jolsa@...nel.org>,
Kan Liang <kan.liang@...ux.intel.com>
Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-perf-users@...r.kernel.org" <linux-perf-users@...r.kernel.org>,
Zhangshaokun <zhangshaokun@...ilicon.com>,
"liuqi (BA)" <liuqi115@...wei.com>,
Andi Kleen <ak@...ux.intel.com>, "Jin, Yao" <yao.jin@...el.com>
Subject: Re: [bug report] Patch "perf tools: Fix pattern matching for same
substring in different pmu type" broken
Hi John, Hi Arnaldo,
On 7/19/2021 10:13 PM, John Garry wrote:
> Hi guys,
>
> The named patch has broken PMU alias matching on my arm64 system.
>
> Specifically it is broken for when multiple tokens are used in the alias. For example, alias
> "hisi_sccl,l3c" would previously match for PMU "hisi_sccl3_l3c7", but that no longer works.
>
> In my example, in looking at the code, the callchain pmu_uncore_alias_match("hisi_sccl,l3c",
> "hisi_sccl3_l3c7") -> per_pmu__valid_suffix("hisi_sccl3_l3c7", "hisi_sccl") fails in the following
> check:
>
> static bool perf_pmu__valid_suffix(char *pmu_name, char *tok)
> {
> char *p;
> ...
> p = pmu_name + strlen(tok);
> ...
> if (*p != '_') //here
> return false;
> }
>
> This check assumes the first token must be followed by a '_', but it is possibly a numeric.
>
It looks that the PMU alias format on arm64 has big difference than the format on x86. My new idea
is we create a x86 specific perf_pmu__valid_suffix, and for other arch, the weak function always
returns true. That will not change original behavior.
What do you think?
> Please let me know how this should work. Previously it would match on the tokens, ignoring numerics
> and '_'.
>
> As an aside, I'll look at why our testcases don't cover this scenario and look to add a test if
> necessary.
>
> Thanks,
> john
>
> Ps, please cc linux-perf-users@...r.kernel.org as in the MAINTAINERS file in future, as not all
> subscribe to the open kernel list (and so cannot easily reply directly).
>
Sorry about that! I will remember that, cc linux-perf-users@...r.kernel.org in next patch.
Thanks
Jin Yao
Powered by blists - more mailing lists