[PATCH 1/9] drivers/perf: hisi: Extend struct hisi_pmu_dev_info

Yicong Yang posted 9 patches 10 months ago
There is a newer version of this series
[PATCH 1/9] drivers/perf: hisi: Extend struct hisi_pmu_dev_info
Posted by Yicong Yang 10 months ago
From: Junhao He <hejunhao3@huawei.com>

The counter bits and event range may differ from versions of a
certain uncore PMU. Make this device specific information into
struct hisi_pmu_dev_info. This will help to simplify the
initialization process by using a list of struct hisi_pmu_dev_info
rather than checking the version.

Signed-off-by: Junhao He <hejunhao3@huawei.com>
Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
---
 drivers/perf/hisilicon/hisi_uncore_pmu.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/perf/hisilicon/hisi_uncore_pmu.h b/drivers/perf/hisilicon/hisi_uncore_pmu.h
index f4fed2544877..777675838b80 100644
--- a/drivers/perf/hisilicon/hisi_uncore_pmu.h
+++ b/drivers/perf/hisilicon/hisi_uncore_pmu.h
@@ -72,6 +72,8 @@ struct hisi_uncore_ops {
 struct hisi_pmu_dev_info {
 	const char *name;
 	const struct attribute_group **attr_groups;
+	u32 counter_bits;
+	u32 check_event;
 	void *private;
 };
 
-- 
2.24.0
Re: [PATCH 1/9] drivers/perf: hisi: Extend struct hisi_pmu_dev_info
Posted by Will Deacon 9 months, 3 weeks ago
On Tue, Feb 18, 2025 at 05:19:52PM +0800, Yicong Yang wrote:
> From: Junhao He <hejunhao3@huawei.com>
> 
> The counter bits and event range may differ from versions of a
> certain uncore PMU. Make this device specific information into
> struct hisi_pmu_dev_info. This will help to simplify the
> initialization process by using a list of struct hisi_pmu_dev_info
> rather than checking the version.
> 
> Signed-off-by: Junhao He <hejunhao3@huawei.com>
> Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
> ---
>  drivers/perf/hisilicon/hisi_uncore_pmu.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/perf/hisilicon/hisi_uncore_pmu.h b/drivers/perf/hisilicon/hisi_uncore_pmu.h
> index f4fed2544877..777675838b80 100644
> --- a/drivers/perf/hisilicon/hisi_uncore_pmu.h
> +++ b/drivers/perf/hisilicon/hisi_uncore_pmu.h
> @@ -72,6 +72,8 @@ struct hisi_uncore_ops {
>  struct hisi_pmu_dev_info {
>  	const char *name;
>  	const struct attribute_group **attr_groups;
> +	u32 counter_bits;
> +	u32 check_event;
>  	void *private;
>  };

This doesn't really do anything on its own; please just fold it into the
patch where the new fields are used.

Will
Re: [PATCH 1/9] drivers/perf: hisi: Extend struct hisi_pmu_dev_info
Posted by Yicong Yang 9 months, 2 weeks ago
On 2025/3/1 14:23, Will Deacon wrote:
> On Tue, Feb 18, 2025 at 05:19:52PM +0800, Yicong Yang wrote:
>> From: Junhao He <hejunhao3@huawei.com>
>>
>> The counter bits and event range may differ from versions of a
>> certain uncore PMU. Make this device specific information into
>> struct hisi_pmu_dev_info. This will help to simplify the
>> initialization process by using a list of struct hisi_pmu_dev_info
>> rather than checking the version.
>>
>> Signed-off-by: Junhao He <hejunhao3@huawei.com>
>> Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
>> ---
>>  drivers/perf/hisilicon/hisi_uncore_pmu.h | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/perf/hisilicon/hisi_uncore_pmu.h b/drivers/perf/hisilicon/hisi_uncore_pmu.h
>> index f4fed2544877..777675838b80 100644
>> --- a/drivers/perf/hisilicon/hisi_uncore_pmu.h
>> +++ b/drivers/perf/hisilicon/hisi_uncore_pmu.h
>> @@ -72,6 +72,8 @@ struct hisi_uncore_ops {
>>  struct hisi_pmu_dev_info {
>>  	const char *name;
>>  	const struct attribute_group **attr_groups;
>> +	u32 counter_bits;
>> +	u32 check_event;
>>  	void *private;
>>  };
> 
> This doesn't really do anything on its own; please just fold it into the
> patch where the new fields are used.
> 

sure, will make this into the following patch.

Thanks.
Re: [PATCH 1/9] drivers/perf: hisi: Extend struct hisi_pmu_dev_info
Posted by Jonathan Cameron 9 months, 2 weeks ago
On Mon, 3 Mar 2025 22:43:35 +0800
Yicong Yang <yangyicong@huawei.com> wrote:

> On 2025/3/1 14:23, Will Deacon wrote:
> > On Tue, Feb 18, 2025 at 05:19:52PM +0800, Yicong Yang wrote:  
> >> From: Junhao He <hejunhao3@huawei.com>
> >>
> >> The counter bits and event range may differ from versions of a
> >> certain uncore PMU. Make this device specific information into
> >> struct hisi_pmu_dev_info. This will help to simplify the
> >> initialization process by using a list of struct hisi_pmu_dev_info
> >> rather than checking the version.
> >>
> >> Signed-off-by: Junhao He <hejunhao3@huawei.com>
> >> Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
> >> ---
> >>  drivers/perf/hisilicon/hisi_uncore_pmu.h | 2 ++
> >>  1 file changed, 2 insertions(+)
> >>
> >> diff --git a/drivers/perf/hisilicon/hisi_uncore_pmu.h b/drivers/perf/hisilicon/hisi_uncore_pmu.h
> >> index f4fed2544877..777675838b80 100644
> >> --- a/drivers/perf/hisilicon/hisi_uncore_pmu.h
> >> +++ b/drivers/perf/hisilicon/hisi_uncore_pmu.h
> >> @@ -72,6 +72,8 @@ struct hisi_uncore_ops {
> >>  struct hisi_pmu_dev_info {
> >>  	const char *name;
> >>  	const struct attribute_group **attr_groups;
> >> +	u32 counter_bits;
> >> +	u32 check_event;
This name is a little confusing.  Maybe nr_events or similar?


> >>  	void *private;
> >>  };  
> > 
> > This doesn't really do anything on its own; please just fold it into the
> > patch where the new fields are used.
> >   
> 
> sure, will make this into the following patch.
> 
> Thanks.
>