[PATCH v2 1/3] perf vendor events arm64: Fill up Desc field for Hisi hip08 hha pmu

Junhao He posted 3 patches 8 months ago
[PATCH v2 1/3] perf vendor events arm64: Fill up Desc field for Hisi hip08 hha pmu
Posted by Junhao He 8 months ago
In the same PMU, when some JSON events have the "BriefDescription" field
populated while others do not, the cmp_sevent() function will split these
two types of events into separate groups. As a result, when using perf
list to display events, the two types of events cannot be grouped together
in the output.

before patch:
 $ perf list pmu
 ...
 uncore hha:
   hisi_sccl1_hha2/sdir-hit/
   hisi_sccl1_hha2/sdir-lookup/
 ...
 uncore hha:
   edir-hit
      [Count of The number of HHA E-Dir hit operations. Unit: hisi_sccl1_hha2]
 ...

after patch:
 $ perf list pmu
 ...
 uncore hha:
   edir-hit
      [Count of The number of HHA E-Dir hit operations. Unit: hisi_sccl1_hha2]
   sdir-hit
      [Count of The number of HHA S-Dir hit operations. Unit: hisi_sccl1_hha2]
   sdir-lookup
      [Count of the number of HHA S-Dir lookup operations. Unit: hisi_sccl1_hha2]
 ...

Signed-off-by: Junhao He <hejunhao3@huawei.com>
Reviewed-by: James Clark <james.clark@linaro.org>
---
 .../arch/arm64/hisilicon/hip08/uncore-hha.json   | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/tools/perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-hha.json b/tools/perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-hha.json
index 9a7ec7af2060..b52f056d0255 100644
--- a/tools/perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-hha.json
+++ b/tools/perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-hha.json
@@ -30,15 +30,18 @@
    {
 	    "ConfigCode": "0x4",
 	    "EventName": "rx_wbi",
+	    "BriefDescription": "Count of the number of WriteBackI operations that HHA has received",
 	    "Unit": "hisi_sccl,hha"
    },
    {
 	    "ConfigCode": "0x5",
 	    "EventName": "rx_wbip",
+	    "BriefDescription": "Count of the number of WriteBackIPtl operations that HHA has received",
 	    "Unit": "hisi_sccl,hha"
    },
    {
 	    "ConfigCode": "0x11",
+	    "BriefDescription": "Count of the number of WriteThruIStash operations that HHA has received",
 	    "EventName": "rx_wtistash",
 	    "Unit": "hisi_sccl,hha"
    },
@@ -87,66 +90,79 @@
    {
 	    "ConfigCode": "0x23",
 	    "EventName": "bi_num",
+	    "BriefDescription": "Count of the number of HHA BackInvalid operations",
 	    "Unit": "hisi_sccl,hha"
    },
    {
 	    "ConfigCode": "0x32",
 	    "EventName": "mediated_num",
+	    "BriefDescription": "Count of the number of Mediated operations that the HHA has forwarded",
 	    "Unit": "hisi_sccl,hha"
    },
    {
 	    "ConfigCode": "0x33",
 	    "EventName": "tx_snp_num",
+	    "BriefDescription": "Count of the number of Snoop operations that the HHA has sent",
 	    "Unit": "hisi_sccl,hha"
    },
    {
 	    "ConfigCode": "0x34",
 	    "EventName": "tx_snp_outer",
+	    "BriefDescription": "Count of the number of Snoop operations that the HHA has sent to another socket",
 	    "Unit": "hisi_sccl,hha"
    },
    {
 	    "ConfigCode": "0x35",
 	    "EventName": "tx_snp_ccix",
+	    "BriefDescription": "Count of the number of Snoop operations that the HHA has sent to CCIX",
 	    "Unit": "hisi_sccl,hha"
    },
    {
 	    "ConfigCode": "0x38",
 	    "EventName": "rx_snprspdata",
+	    "BriefDescription": "Count of the number of SnprspData flit operations that HHA has received",
 	    "Unit": "hisi_sccl,hha"
    },
    {
 	    "ConfigCode": "0x3c",
 	    "EventName": "rx_snprsp_outer",
+	    "BriefDescription": "Count of the number of SnprspData operations that HHA has received from another socket",
 	    "Unit": "hisi_sccl,hha"
    },
    {
 	    "ConfigCode": "0x40",
 	    "EventName": "sdir-lookup",
+	    "BriefDescription": "Count of the number of HHA S-Dir lookup operations",
 	    "Unit": "hisi_sccl,hha"
    },
    {
 	    "ConfigCode": "0x41",
 	    "EventName": "edir-lookup",
+	    "BriefDescription": "Count of the number of HHA E-Dir lookup operations",
 	    "Unit": "hisi_sccl,hha"
    },
    {
 	    "ConfigCode": "0x42",
 	    "EventName": "sdir-hit",
+	    "BriefDescription": "Count of the number of HHA S-Dir hit operations",
 	    "Unit": "hisi_sccl,hha"
    },
    {
 	    "ConfigCode": "0x43",
 	    "EventName": "edir-hit",
+	    "BriefDescription": "Count of the number of HHA E-Dir hit operations",
 	    "Unit": "hisi_sccl,hha"
    },
    {
 	    "ConfigCode": "0x4c",
 	    "EventName": "sdir-home-migrate",
+	    "BriefDescription": "Count of the number of HHA S-Dir read home migrate operations",
 	    "Unit": "hisi_sccl,hha"
    },
    {
 	    "ConfigCode": "0x4d",
 	    "EventName": "edir-home-migrate",
+	    "BriefDescription": "Count of the number of HHA E-Dir read home migrate operations",
 	    "Unit": "hisi_sccl,hha"
    }
 ]
-- 
2.33.0
Re: [PATCH v2 1/3] perf vendor events arm64: Fill up Desc field for Hisi hip08 hha pmu
Posted by Jonathan Cameron 7 months, 3 weeks ago
On Fri, 18 Apr 2025 15:08:10 +0800
Junhao He <hejunhao3@huawei.com> wrote:

> In the same PMU, when some JSON events have the "BriefDescription" field
> populated while others do not, the cmp_sevent() function will split these
> two types of events into separate groups. As a result, when using perf
> list to display events, the two types of events cannot be grouped together
> in the output.
> 
> before patch:
>  $ perf list pmu
>  ...
>  uncore hha:
>    hisi_sccl1_hha2/sdir-hit/
>    hisi_sccl1_hha2/sdir-lookup/
>  ...
>  uncore hha:
>    edir-hit
>       [Count of The number of HHA E-Dir hit operations. Unit: hisi_sccl1_hha2]
>  ...
> 
> after patch:
>  $ perf list pmu
>  ...
>  uncore hha:
>    edir-hit
>       [Count of The number of HHA E-Dir hit operations. Unit: hisi_sccl1_hha2]
>    sdir-hit
>       [Count of The number of HHA S-Dir hit operations. Unit: hisi_sccl1_hha2]
>    sdir-lookup
>       [Count of the number of HHA S-Dir lookup operations. Unit: hisi_sccl1_hha2]
>  ...
> 
> Signed-off-by: Junhao He <hejunhao3@huawei.com>
> Reviewed-by: James Clark <james.clark@linaro.org>
One trivial comment inline that might be good to tidy up.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

>     {
>  	    "ConfigCode": "0x38",
>  	    "EventName": "rx_snprspdata",
> +	    "BriefDescription": "Count of the number of SnprspData flit operations that HHA has received",

Not SnpRspData?  For Snoop Response Data flit ?


>  	    "Unit": "hisi_sccl,hha"
>     },
>     {
>  	    "ConfigCode": "0x3c",
>  	    "EventName": "rx_snprsp_outer",
> +	    "BriefDescription": "Count of the number of SnprspData operations that HHA has received from another socket",

Similar on the capitalization.

>  	    "Unit": "hisi_sccl,hha"
>     },
Re: [PATCH v2 1/3] perf vendor events arm64: Fill up Desc field for Hisi hip08 hha pmu
Posted by Arnaldo Carvalho de Melo 7 months, 3 weeks ago
On Fri, Apr 25, 2025 at 12:06:54PM +0100, Jonathan Cameron wrote:
> On Fri, 18 Apr 2025 15:08:10 +0800
> Junhao He <hejunhao3@huawei.com> wrote:
> 
> > In the same PMU, when some JSON events have the "BriefDescription" field
> > populated while others do not, the cmp_sevent() function will split these
> > two types of events into separate groups. As a result, when using perf
> > list to display events, the two types of events cannot be grouped together
> > in the output.
> > 
> > before patch:
> >  $ perf list pmu
> >  ...
> >  uncore hha:
> >    hisi_sccl1_hha2/sdir-hit/
> >    hisi_sccl1_hha2/sdir-lookup/
> >  ...
> >  uncore hha:
> >    edir-hit
> >       [Count of The number of HHA E-Dir hit operations. Unit: hisi_sccl1_hha2]
> >  ...
> > 
> > after patch:
> >  $ perf list pmu
> >  ...
> >  uncore hha:
> >    edir-hit
> >       [Count of The number of HHA E-Dir hit operations. Unit: hisi_sccl1_hha2]
> >    sdir-hit
> >       [Count of The number of HHA S-Dir hit operations. Unit: hisi_sccl1_hha2]
> >    sdir-lookup
> >       [Count of the number of HHA S-Dir lookup operations. Unit: hisi_sccl1_hha2]
> >  ...
> > 
> > Signed-off-by: Junhao He <hejunhao3@huawei.com>
> > Reviewed-by: James Clark <james.clark@linaro.org>
> One trivial comment inline that might be good to tidy up.

These can come as a follow up patch, I think.

> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Applied.

- Arnaldo
Re: [PATCH v2 1/3] perf vendor events arm64: Fill up Desc field for Hisi hip08 hha pmu
Posted by Yicong Yang 7 months, 3 weeks ago
On 2025/4/18 15:08, Junhao He wrote:
> In the same PMU, when some JSON events have the "BriefDescription" field
> populated while others do not, the cmp_sevent() function will split these
> two types of events into separate groups. As a result, when using perf
> list to display events, the two types of events cannot be grouped together
> in the output.
> 
> before patch:
>  $ perf list pmu
>  ...
>  uncore hha:
>    hisi_sccl1_hha2/sdir-hit/
>    hisi_sccl1_hha2/sdir-lookup/
>  ...
>  uncore hha:
>    edir-hit
>       [Count of The number of HHA E-Dir hit operations. Unit: hisi_sccl1_hha2]
>  ...
> 
> after patch:
>  $ perf list pmu
>  ...
>  uncore hha:
>    edir-hit
>       [Count of The number of HHA E-Dir hit operations. Unit: hisi_sccl1_hha2]
>    sdir-hit
>       [Count of The number of HHA S-Dir hit operations. Unit: hisi_sccl1_hha2]
>    sdir-lookup
>       [Count of the number of HHA S-Dir lookup operations. Unit: hisi_sccl1_hha2]
>  ...
> 
> Signed-off-by: Junhao He <hejunhao3@huawei.com>
> Reviewed-by: James Clark <james.clark@linaro.org>

Reviewed-by: Yicong Yang <yangyicong@hisilicon.com>

> ---
>  .../arch/arm64/hisilicon/hip08/uncore-hha.json   | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/tools/perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-hha.json b/tools/perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-hha.json
> index 9a7ec7af2060..b52f056d0255 100644
> --- a/tools/perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-hha.json
> +++ b/tools/perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-hha.json
> @@ -30,15 +30,18 @@
>     {
>  	    "ConfigCode": "0x4",
>  	    "EventName": "rx_wbi",
> +	    "BriefDescription": "Count of the number of WriteBackI operations that HHA has received",
>  	    "Unit": "hisi_sccl,hha"
>     },
>     {
>  	    "ConfigCode": "0x5",
>  	    "EventName": "rx_wbip",
> +	    "BriefDescription": "Count of the number of WriteBackIPtl operations that HHA has received",
>  	    "Unit": "hisi_sccl,hha"
>     },
>     {
>  	    "ConfigCode": "0x11",
> +	    "BriefDescription": "Count of the number of WriteThruIStash operations that HHA has received",
>  	    "EventName": "rx_wtistash",
>  	    "Unit": "hisi_sccl,hha"
>     },
> @@ -87,66 +90,79 @@
>     {
>  	    "ConfigCode": "0x23",
>  	    "EventName": "bi_num",
> +	    "BriefDescription": "Count of the number of HHA BackInvalid operations",
>  	    "Unit": "hisi_sccl,hha"
>     },
>     {
>  	    "ConfigCode": "0x32",
>  	    "EventName": "mediated_num",
> +	    "BriefDescription": "Count of the number of Mediated operations that the HHA has forwarded",
>  	    "Unit": "hisi_sccl,hha"
>     },
>     {
>  	    "ConfigCode": "0x33",
>  	    "EventName": "tx_snp_num",
> +	    "BriefDescription": "Count of the number of Snoop operations that the HHA has sent",
>  	    "Unit": "hisi_sccl,hha"
>     },
>     {
>  	    "ConfigCode": "0x34",
>  	    "EventName": "tx_snp_outer",
> +	    "BriefDescription": "Count of the number of Snoop operations that the HHA has sent to another socket",
>  	    "Unit": "hisi_sccl,hha"
>     },
>     {
>  	    "ConfigCode": "0x35",
>  	    "EventName": "tx_snp_ccix",
> +	    "BriefDescription": "Count of the number of Snoop operations that the HHA has sent to CCIX",
>  	    "Unit": "hisi_sccl,hha"
>     },
>     {
>  	    "ConfigCode": "0x38",
>  	    "EventName": "rx_snprspdata",
> +	    "BriefDescription": "Count of the number of SnprspData flit operations that HHA has received",
>  	    "Unit": "hisi_sccl,hha"
>     },
>     {
>  	    "ConfigCode": "0x3c",
>  	    "EventName": "rx_snprsp_outer",
> +	    "BriefDescription": "Count of the number of SnprspData operations that HHA has received from another socket",
>  	    "Unit": "hisi_sccl,hha"
>     },
>     {
>  	    "ConfigCode": "0x40",
>  	    "EventName": "sdir-lookup",
> +	    "BriefDescription": "Count of the number of HHA S-Dir lookup operations",
>  	    "Unit": "hisi_sccl,hha"
>     },
>     {
>  	    "ConfigCode": "0x41",
>  	    "EventName": "edir-lookup",
> +	    "BriefDescription": "Count of the number of HHA E-Dir lookup operations",
>  	    "Unit": "hisi_sccl,hha"
>     },
>     {
>  	    "ConfigCode": "0x42",
>  	    "EventName": "sdir-hit",
> +	    "BriefDescription": "Count of the number of HHA S-Dir hit operations",
>  	    "Unit": "hisi_sccl,hha"
>     },
>     {
>  	    "ConfigCode": "0x43",
>  	    "EventName": "edir-hit",
> +	    "BriefDescription": "Count of the number of HHA E-Dir hit operations",
>  	    "Unit": "hisi_sccl,hha"
>     },
>     {
>  	    "ConfigCode": "0x4c",
>  	    "EventName": "sdir-home-migrate",
> +	    "BriefDescription": "Count of the number of HHA S-Dir read home migrate operations",
>  	    "Unit": "hisi_sccl,hha"
>     },
>     {
>  	    "ConfigCode": "0x4d",
>  	    "EventName": "edir-home-migrate",
> +	    "BriefDescription": "Count of the number of HHA E-Dir read home migrate operations",
>  	    "Unit": "hisi_sccl,hha"
>     }
>  ]
>