diff mbox series

[v1,2/9] perf auxtrace: Remove unused 'pmu' pointer from struct auxtrace_record

Message ID 20240806204130.720977-3-leo.yan@arm.com (mailing list archive)
State New, archived
Headers show
Series perf auxtrace: Refactor with evsel__is_aux_event() | expand

Commit Message

Leo Yan Aug. 6, 2024, 8:41 p.m. UTC
The 'pmu' pointer in the auxtrace_record structure is not used after
support multiple AUX events, remove it.

Signed-off-by: Leo Yan <leo.yan@arm.com>
---
 tools/perf/arch/arm/util/cs-etm.c     | 1 -
 tools/perf/arch/arm64/util/arm-spe.c  | 1 -
 tools/perf/arch/arm64/util/hisi-ptt.c | 1 -
 tools/perf/arch/x86/util/intel-bts.c  | 1 -
 tools/perf/arch/x86/util/intel-pt.c   | 1 -
 tools/perf/util/auxtrace.h            | 1 -
 6 files changed, 6 deletions(-)

Comments

Adrian Hunter Aug. 9, 2024, 8:02 a.m. UTC | #1
On 6/08/24 23:41, Leo Yan wrote:
> The 'pmu' pointer in the auxtrace_record structure is not used after
> support multiple AUX events, remove it.
> 
> Signed-off-by: Leo Yan <leo.yan@arm.com>

Reviewed-by: Adrian Hunter <adrian.hunter@intel.com>

> ---
>  tools/perf/arch/arm/util/cs-etm.c     | 1 -
>  tools/perf/arch/arm64/util/arm-spe.c  | 1 -
>  tools/perf/arch/arm64/util/hisi-ptt.c | 1 -
>  tools/perf/arch/x86/util/intel-bts.c  | 1 -
>  tools/perf/arch/x86/util/intel-pt.c   | 1 -
>  tools/perf/util/auxtrace.h            | 1 -
>  6 files changed, 6 deletions(-)
> 
> diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c
> index da6231367993..96aeb7cdbee1 100644
> --- a/tools/perf/arch/arm/util/cs-etm.c
> +++ b/tools/perf/arch/arm/util/cs-etm.c
> @@ -888,7 +888,6 @@ struct auxtrace_record *cs_etm_record_init(int *err)
>  	}
>  
>  	ptr->cs_etm_pmu			= cs_etm_pmu;
> -	ptr->itr.pmu			= cs_etm_pmu;
>  	ptr->itr.parse_snapshot_options	= cs_etm_parse_snapshot_options;
>  	ptr->itr.recording_options	= cs_etm_recording_options;
>  	ptr->itr.info_priv_size		= cs_etm_info_priv_size;
> diff --git a/tools/perf/arch/arm64/util/arm-spe.c b/tools/perf/arch/arm64/util/arm-spe.c
> index d59f6ca499f2..2be99fdf997d 100644
> --- a/tools/perf/arch/arm64/util/arm-spe.c
> +++ b/tools/perf/arch/arm64/util/arm-spe.c
> @@ -514,7 +514,6 @@ struct auxtrace_record *arm_spe_recording_init(int *err,
>  	}
>  
>  	sper->arm_spe_pmu = arm_spe_pmu;
> -	sper->itr.pmu = arm_spe_pmu;
>  	sper->itr.snapshot_start = arm_spe_snapshot_start;
>  	sper->itr.snapshot_finish = arm_spe_snapshot_finish;
>  	sper->itr.find_snapshot = arm_spe_find_snapshot;
> diff --git a/tools/perf/arch/arm64/util/hisi-ptt.c b/tools/perf/arch/arm64/util/hisi-ptt.c
> index ba97c8a562a0..eac9739c87e6 100644
> --- a/tools/perf/arch/arm64/util/hisi-ptt.c
> +++ b/tools/perf/arch/arm64/util/hisi-ptt.c
> @@ -174,7 +174,6 @@ struct auxtrace_record *hisi_ptt_recording_init(int *err,
>  	}
>  
>  	pttr->hisi_ptt_pmu = hisi_ptt_pmu;
> -	pttr->itr.pmu = hisi_ptt_pmu;
>  	pttr->itr.recording_options = hisi_ptt_recording_options;
>  	pttr->itr.info_priv_size = hisi_ptt_info_priv_size;
>  	pttr->itr.info_fill = hisi_ptt_info_fill;
> diff --git a/tools/perf/arch/x86/util/intel-bts.c b/tools/perf/arch/x86/util/intel-bts.c
> index 34696f3d3d5d..85c8186300c8 100644
> --- a/tools/perf/arch/x86/util/intel-bts.c
> +++ b/tools/perf/arch/x86/util/intel-bts.c
> @@ -434,7 +434,6 @@ struct auxtrace_record *intel_bts_recording_init(int *err)
>  	}
>  
>  	btsr->intel_bts_pmu = intel_bts_pmu;
> -	btsr->itr.pmu = intel_bts_pmu;
>  	btsr->itr.recording_options = intel_bts_recording_options;
>  	btsr->itr.info_priv_size = intel_bts_info_priv_size;
>  	btsr->itr.info_fill = intel_bts_info_fill;
> diff --git a/tools/perf/arch/x86/util/intel-pt.c b/tools/perf/arch/x86/util/intel-pt.c
> index 4b710e875953..ea510a7486b1 100644
> --- a/tools/perf/arch/x86/util/intel-pt.c
> +++ b/tools/perf/arch/x86/util/intel-pt.c
> @@ -1197,7 +1197,6 @@ struct auxtrace_record *intel_pt_recording_init(int *err)
>  	}
>  
>  	ptr->intel_pt_pmu = intel_pt_pmu;
> -	ptr->itr.pmu = intel_pt_pmu;
>  	ptr->itr.recording_options = intel_pt_recording_options;
>  	ptr->itr.info_priv_size = intel_pt_info_priv_size;
>  	ptr->itr.info_fill = intel_pt_info_fill;
> diff --git a/tools/perf/util/auxtrace.h b/tools/perf/util/auxtrace.h
> index 8a6ec9565835..95304368103b 100644
> --- a/tools/perf/util/auxtrace.h
> +++ b/tools/perf/util/auxtrace.h
> @@ -411,7 +411,6 @@ struct auxtrace_record {
>  	int (*read_finish)(struct auxtrace_record *itr, int idx);
>  	unsigned int alignment;
>  	unsigned int default_aux_sample_size;
> -	struct perf_pmu *pmu;
>  	struct evlist *evlist;
>  };
>
Arnaldo Carvalho de Melo Aug. 28, 2024, 9:16 p.m. UTC | #2
On Fri, Aug 09, 2024 at 11:02:16AM +0300, Adrian Hunter wrote:
> On 6/08/24 23:41, Leo Yan wrote:
> > The 'pmu' pointer in the auxtrace_record structure is not used after
> > support multiple AUX events, remove it.
> > 
> > Signed-off-by: Leo Yan <leo.yan@arm.com>
> 
> Reviewed-by: Adrian Hunter <adrian.hunter@intel.com>

Applied the first reviewed two patches.

- Arnaldo

> > ---
> >  tools/perf/arch/arm/util/cs-etm.c     | 1 -
> >  tools/perf/arch/arm64/util/arm-spe.c  | 1 -
> >  tools/perf/arch/arm64/util/hisi-ptt.c | 1 -
> >  tools/perf/arch/x86/util/intel-bts.c  | 1 -
> >  tools/perf/arch/x86/util/intel-pt.c   | 1 -
> >  tools/perf/util/auxtrace.h            | 1 -
> >  6 files changed, 6 deletions(-)
> > 
> > diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c
> > index da6231367993..96aeb7cdbee1 100644
> > --- a/tools/perf/arch/arm/util/cs-etm.c
> > +++ b/tools/perf/arch/arm/util/cs-etm.c
> > @@ -888,7 +888,6 @@ struct auxtrace_record *cs_etm_record_init(int *err)
> >  	}
> >  
> >  	ptr->cs_etm_pmu			= cs_etm_pmu;
> > -	ptr->itr.pmu			= cs_etm_pmu;
> >  	ptr->itr.parse_snapshot_options	= cs_etm_parse_snapshot_options;
> >  	ptr->itr.recording_options	= cs_etm_recording_options;
> >  	ptr->itr.info_priv_size		= cs_etm_info_priv_size;
> > diff --git a/tools/perf/arch/arm64/util/arm-spe.c b/tools/perf/arch/arm64/util/arm-spe.c
> > index d59f6ca499f2..2be99fdf997d 100644
> > --- a/tools/perf/arch/arm64/util/arm-spe.c
> > +++ b/tools/perf/arch/arm64/util/arm-spe.c
> > @@ -514,7 +514,6 @@ struct auxtrace_record *arm_spe_recording_init(int *err,
> >  	}
> >  
> >  	sper->arm_spe_pmu = arm_spe_pmu;
> > -	sper->itr.pmu = arm_spe_pmu;
> >  	sper->itr.snapshot_start = arm_spe_snapshot_start;
> >  	sper->itr.snapshot_finish = arm_spe_snapshot_finish;
> >  	sper->itr.find_snapshot = arm_spe_find_snapshot;
> > diff --git a/tools/perf/arch/arm64/util/hisi-ptt.c b/tools/perf/arch/arm64/util/hisi-ptt.c
> > index ba97c8a562a0..eac9739c87e6 100644
> > --- a/tools/perf/arch/arm64/util/hisi-ptt.c
> > +++ b/tools/perf/arch/arm64/util/hisi-ptt.c
> > @@ -174,7 +174,6 @@ struct auxtrace_record *hisi_ptt_recording_init(int *err,
> >  	}
> >  
> >  	pttr->hisi_ptt_pmu = hisi_ptt_pmu;
> > -	pttr->itr.pmu = hisi_ptt_pmu;
> >  	pttr->itr.recording_options = hisi_ptt_recording_options;
> >  	pttr->itr.info_priv_size = hisi_ptt_info_priv_size;
> >  	pttr->itr.info_fill = hisi_ptt_info_fill;
> > diff --git a/tools/perf/arch/x86/util/intel-bts.c b/tools/perf/arch/x86/util/intel-bts.c
> > index 34696f3d3d5d..85c8186300c8 100644
> > --- a/tools/perf/arch/x86/util/intel-bts.c
> > +++ b/tools/perf/arch/x86/util/intel-bts.c
> > @@ -434,7 +434,6 @@ struct auxtrace_record *intel_bts_recording_init(int *err)
> >  	}
> >  
> >  	btsr->intel_bts_pmu = intel_bts_pmu;
> > -	btsr->itr.pmu = intel_bts_pmu;
> >  	btsr->itr.recording_options = intel_bts_recording_options;
> >  	btsr->itr.info_priv_size = intel_bts_info_priv_size;
> >  	btsr->itr.info_fill = intel_bts_info_fill;
> > diff --git a/tools/perf/arch/x86/util/intel-pt.c b/tools/perf/arch/x86/util/intel-pt.c
> > index 4b710e875953..ea510a7486b1 100644
> > --- a/tools/perf/arch/x86/util/intel-pt.c
> > +++ b/tools/perf/arch/x86/util/intel-pt.c
> > @@ -1197,7 +1197,6 @@ struct auxtrace_record *intel_pt_recording_init(int *err)
> >  	}
> >  
> >  	ptr->intel_pt_pmu = intel_pt_pmu;
> > -	ptr->itr.pmu = intel_pt_pmu;
> >  	ptr->itr.recording_options = intel_pt_recording_options;
> >  	ptr->itr.info_priv_size = intel_pt_info_priv_size;
> >  	ptr->itr.info_fill = intel_pt_info_fill;
> > diff --git a/tools/perf/util/auxtrace.h b/tools/perf/util/auxtrace.h
> > index 8a6ec9565835..95304368103b 100644
> > --- a/tools/perf/util/auxtrace.h
> > +++ b/tools/perf/util/auxtrace.h
> > @@ -411,7 +411,6 @@ struct auxtrace_record {
> >  	int (*read_finish)(struct auxtrace_record *itr, int idx);
> >  	unsigned int alignment;
> >  	unsigned int default_aux_sample_size;
> > -	struct perf_pmu *pmu;
> >  	struct evlist *evlist;
> >  };
> >
Leo Yan Aug. 30, 2024, 7:32 a.m. UTC | #3
Hi Arnaldo,

On 8/28/24 22:16, Arnaldo Carvalho de Melo wrote:
> On Fri, Aug 09, 2024 at 11:02:16AM +0300, Adrian Hunter wrote:
>> On 6/08/24 23:41, Leo Yan wrote:
>>> The 'pmu' pointer in the auxtrace_record structure is not used after
>>> support multiple AUX events, remove it.
>>>
>>> Signed-off-by: Leo Yan <leo.yan@arm.com>
>>
>> Reviewed-by: Adrian Hunter <adrian.hunter@intel.com>
> 
> Applied the first reviewed two patches.

I confirmed it is fine to picking up these two patches.

Just note, I combined these two patches into the multiple AUX event series [1].
Once I receive response for that series, I will drop the picked two patches and
send new series.

Thanks,
Leo

[1] https://lore.kernel.org/linux-perf-users/20240823113306.2310957-2-leo.yan@arm.com/
diff mbox series

Patch

diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c
index da6231367993..96aeb7cdbee1 100644
--- a/tools/perf/arch/arm/util/cs-etm.c
+++ b/tools/perf/arch/arm/util/cs-etm.c
@@ -888,7 +888,6 @@  struct auxtrace_record *cs_etm_record_init(int *err)
 	}
 
 	ptr->cs_etm_pmu			= cs_etm_pmu;
-	ptr->itr.pmu			= cs_etm_pmu;
 	ptr->itr.parse_snapshot_options	= cs_etm_parse_snapshot_options;
 	ptr->itr.recording_options	= cs_etm_recording_options;
 	ptr->itr.info_priv_size		= cs_etm_info_priv_size;
diff --git a/tools/perf/arch/arm64/util/arm-spe.c b/tools/perf/arch/arm64/util/arm-spe.c
index d59f6ca499f2..2be99fdf997d 100644
--- a/tools/perf/arch/arm64/util/arm-spe.c
+++ b/tools/perf/arch/arm64/util/arm-spe.c
@@ -514,7 +514,6 @@  struct auxtrace_record *arm_spe_recording_init(int *err,
 	}
 
 	sper->arm_spe_pmu = arm_spe_pmu;
-	sper->itr.pmu = arm_spe_pmu;
 	sper->itr.snapshot_start = arm_spe_snapshot_start;
 	sper->itr.snapshot_finish = arm_spe_snapshot_finish;
 	sper->itr.find_snapshot = arm_spe_find_snapshot;
diff --git a/tools/perf/arch/arm64/util/hisi-ptt.c b/tools/perf/arch/arm64/util/hisi-ptt.c
index ba97c8a562a0..eac9739c87e6 100644
--- a/tools/perf/arch/arm64/util/hisi-ptt.c
+++ b/tools/perf/arch/arm64/util/hisi-ptt.c
@@ -174,7 +174,6 @@  struct auxtrace_record *hisi_ptt_recording_init(int *err,
 	}
 
 	pttr->hisi_ptt_pmu = hisi_ptt_pmu;
-	pttr->itr.pmu = hisi_ptt_pmu;
 	pttr->itr.recording_options = hisi_ptt_recording_options;
 	pttr->itr.info_priv_size = hisi_ptt_info_priv_size;
 	pttr->itr.info_fill = hisi_ptt_info_fill;
diff --git a/tools/perf/arch/x86/util/intel-bts.c b/tools/perf/arch/x86/util/intel-bts.c
index 34696f3d3d5d..85c8186300c8 100644
--- a/tools/perf/arch/x86/util/intel-bts.c
+++ b/tools/perf/arch/x86/util/intel-bts.c
@@ -434,7 +434,6 @@  struct auxtrace_record *intel_bts_recording_init(int *err)
 	}
 
 	btsr->intel_bts_pmu = intel_bts_pmu;
-	btsr->itr.pmu = intel_bts_pmu;
 	btsr->itr.recording_options = intel_bts_recording_options;
 	btsr->itr.info_priv_size = intel_bts_info_priv_size;
 	btsr->itr.info_fill = intel_bts_info_fill;
diff --git a/tools/perf/arch/x86/util/intel-pt.c b/tools/perf/arch/x86/util/intel-pt.c
index 4b710e875953..ea510a7486b1 100644
--- a/tools/perf/arch/x86/util/intel-pt.c
+++ b/tools/perf/arch/x86/util/intel-pt.c
@@ -1197,7 +1197,6 @@  struct auxtrace_record *intel_pt_recording_init(int *err)
 	}
 
 	ptr->intel_pt_pmu = intel_pt_pmu;
-	ptr->itr.pmu = intel_pt_pmu;
 	ptr->itr.recording_options = intel_pt_recording_options;
 	ptr->itr.info_priv_size = intel_pt_info_priv_size;
 	ptr->itr.info_fill = intel_pt_info_fill;
diff --git a/tools/perf/util/auxtrace.h b/tools/perf/util/auxtrace.h
index 8a6ec9565835..95304368103b 100644
--- a/tools/perf/util/auxtrace.h
+++ b/tools/perf/util/auxtrace.h
@@ -411,7 +411,6 @@  struct auxtrace_record {
 	int (*read_finish)(struct auxtrace_record *itr, int idx);
 	unsigned int alignment;
 	unsigned int default_aux_sample_size;
-	struct perf_pmu *pmu;
 	struct evlist *evlist;
 };