* [PATCH] perf jevents: fix no member named 'entries' issue
@ 2023-09-19 8:09 Xu Yang
2023-09-19 15:52 ` Ian Rogers
0 siblings, 1 reply; 5+ messages in thread
From: Xu Yang @ 2023-09-19 8:09 UTC (permalink / raw)
To: peterz, mingo, acme, mark.rutland, alexander.shishkin, jolsa,
namhyung, irogers, adrian.hunter
Cc: linux-perf-users, linux-kernel, xu.yang_2
The struct "pmu_events_table" has been changed after commit
2e255b4f9f41 (perf jevents: Group events by PMU, 2023-08-23).
So there doesn't exist 'entries' in pmu_events_table anymore.
This will align the members with that commit. Othewise, below
errors will be printed when run jevent.py:
pmu-events/pmu-events.c:5485:26: error: ‘struct pmu_metrics_table’ has no member named ‘entries’
5485 | .entries = pmu_metrics__freescale_imx8dxl_sys,
Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
---
tools/perf/pmu-events/jevents.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/perf/pmu-events/jevents.py b/tools/perf/pmu-events/jevents.py
index a7e88332276d..af15fa2cadbd 100755
--- a/tools/perf/pmu-events/jevents.py
+++ b/tools/perf/pmu-events/jevents.py
@@ -764,8 +764,8 @@ static const struct pmu_sys_events pmu_sys_event_tables[] = {
continue
_args.output_file.write(f"""\t{{
\t\t.metric_table = {{
-\t\t\t.entries = {tblname},
-\t\t\t.length = ARRAY_SIZE({tblname})
+\t\t\t.pmus = {tblname},
+\t\t\t.num_pmus = ARRAY_SIZE({tblname})
\t\t}},
\t\t.name = \"{tblname}\",
\t}},
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] perf jevents: fix no member named 'entries' issue
2023-09-19 8:09 [PATCH] perf jevents: fix no member named 'entries' issue Xu Yang
@ 2023-09-19 15:52 ` Ian Rogers
2023-09-20 2:07 ` [EXT] " Xu Yang
0 siblings, 1 reply; 5+ messages in thread
From: Ian Rogers @ 2023-09-19 15:52 UTC (permalink / raw)
To: Xu Yang
Cc: peterz, mingo, acme, mark.rutland, alexander.shishkin, jolsa,
namhyung, adrian.hunter, linux-perf-users, linux-kernel
On Tue, Sep 19, 2023 at 1:04 AM Xu Yang <xu.yang_2@nxp.com> wrote:
>
> The struct "pmu_events_table" has been changed after commit
> 2e255b4f9f41 (perf jevents: Group events by PMU, 2023-08-23).
> So there doesn't exist 'entries' in pmu_events_table anymore.
> This will align the members with that commit. Othewise, below
> errors will be printed when run jevent.py:
>
> pmu-events/pmu-events.c:5485:26: error: ‘struct pmu_metrics_table’ has no member named ‘entries’
> 5485 | .entries = pmu_metrics__freescale_imx8dxl_sys,
>
> Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
Reviewed-by: Ian Rogers <irogers@google.com>
Thanks Xu! I wasn't able to repeat the failure but the fix looks good
to me. Is the failure caused by adding new imx8dxl metrics? I'd like
to make sure we have testing coverage so this doesn't happen again.
I'm trying:
$ make -C tools/perf O=/tmp/perf JEVENTS_ARCH=all
Could you confirm that this make command was broken without your fix
plus the metric changes you've done?
Thanks,
Ian
> ---
> tools/perf/pmu-events/jevents.py | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/perf/pmu-events/jevents.py b/tools/perf/pmu-events/jevents.py
> index a7e88332276d..af15fa2cadbd 100755
> --- a/tools/perf/pmu-events/jevents.py
> +++ b/tools/perf/pmu-events/jevents.py
> @@ -764,8 +764,8 @@ static const struct pmu_sys_events pmu_sys_event_tables[] = {
> continue
> _args.output_file.write(f"""\t{{
> \t\t.metric_table = {{
> -\t\t\t.entries = {tblname},
> -\t\t\t.length = ARRAY_SIZE({tblname})
> +\t\t\t.pmus = {tblname},
> +\t\t\t.num_pmus = ARRAY_SIZE({tblname})
> \t\t}},
> \t\t.name = \"{tblname}\",
> \t}},
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [EXT] Re: [PATCH] perf jevents: fix no member named 'entries' issue
2023-09-19 15:52 ` Ian Rogers
@ 2023-09-20 2:07 ` Xu Yang
2023-09-20 4:16 ` Namhyung Kim
0 siblings, 1 reply; 5+ messages in thread
From: Xu Yang @ 2023-09-20 2:07 UTC (permalink / raw)
To: Ian Rogers
Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org,
mark.rutland@arm.com, alexander.shishkin@linux.intel.com,
jolsa@kernel.org, namhyung@kernel.org, adrian.hunter@intel.com,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Hi Lan,
> On Tue, Sep 19, 2023 at 1:04 AM Xu Yang <xu.yang_2@nxp.com> wrote:
> >
> > The struct "pmu_events_table" has been changed after commit
> > 2e255b4f9f41 (perf jevents: Group events by PMU, 2023-08-23).
> > So there doesn't exist 'entries' in pmu_events_table anymore.
> > This will align the members with that commit. Othewise, below
> > errors will be printed when run jevent.py:
> >
> > pmu-events/pmu-events.c:5485:26: error: ‘struct pmu_metrics_table’ has no member named ‘entries’
> > 5485 | .entries = pmu_metrics__freescale_imx8dxl_sys,
> >
> > Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
>
> Reviewed-by: Ian Rogers <irogers@google.com>
>
> Thanks Xu! I wasn't able to repeat the failure but the fix looks good
> to me. Is the failure caused by adding new imx8dxl metrics? I'd like
Yes.
> to make sure we have testing coverage so this doesn't happen again.
> I'm trying:
> $ make -C tools/perf O=/tmp/perf JEVENTS_ARCH=all
> Could you confirm that this make command was broken without your fix
> plus the metric changes you've done?
Below steps will repeat the failure.
$ cd tools/
$ rm perf/pmu-events/arch/arm64/freescale/imx8mm/sys/ddrc.json
$ make clean
$ make JEVENTS_ARCH=all perf
pmu-events/pmu-events.c:76586:26: error: ‘struct pmu_metrics_table’ has no member named ‘entries’
76586 | .entries = pmu_metrics__freescale_imx8mm_sys,
| ^~~~~~~
pmu-events/pmu-events.c:76587:26: error: ‘struct pmu_metrics_table’ has no member named ‘length’
76587 | .length = ARRAY_SIZE(pmu_metrics__freescale_imx8mm_sys)
| ^~~~~~
If only metric table exists, then this error may occur.
Thanks,
Xu Yang
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [EXT] Re: [PATCH] perf jevents: fix no member named 'entries' issue
2023-09-20 2:07 ` [EXT] " Xu Yang
@ 2023-09-20 4:16 ` Namhyung Kim
2023-09-21 18:51 ` Namhyung Kim
0 siblings, 1 reply; 5+ messages in thread
From: Namhyung Kim @ 2023-09-20 4:16 UTC (permalink / raw)
To: Xu Yang
Cc: Ian Rogers, peterz@infradead.org, mingo@redhat.com,
acme@kernel.org, mark.rutland@arm.com,
alexander.shishkin@linux.intel.com, jolsa@kernel.org,
adrian.hunter@intel.com, linux-perf-users@vger.kernel.org,
linux-kernel@vger.kernel.org
Hello,
On Tue, Sep 19, 2023 at 7:07 PM Xu Yang <xu.yang_2@nxp.com> wrote:
>
> Hi Lan,
>
> > On Tue, Sep 19, 2023 at 1:04 AM Xu Yang <xu.yang_2@nxp.com> wrote:
> > >
> > > The struct "pmu_events_table" has been changed after commit
> > > 2e255b4f9f41 (perf jevents: Group events by PMU, 2023-08-23).
> > > So there doesn't exist 'entries' in pmu_events_table anymore.
> > > This will align the members with that commit. Othewise, below
> > > errors will be printed when run jevent.py:
> > >
> > > pmu-events/pmu-events.c:5485:26: error: ‘struct pmu_metrics_table’ has no member named ‘entries’
> > > 5485 | .entries = pmu_metrics__freescale_imx8dxl_sys,
> > >
> > > Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
> >
> > Reviewed-by: Ian Rogers <irogers@google.com>
> >
> > Thanks Xu! I wasn't able to repeat the failure but the fix looks good
> > to me. Is the failure caused by adding new imx8dxl metrics? I'd like
>
> Yes.
>
> > to make sure we have testing coverage so this doesn't happen again.
> > I'm trying:
> > $ make -C tools/perf O=/tmp/perf JEVENTS_ARCH=all
> > Could you confirm that this make command was broken without your fix
> > plus the metric changes you've done?
>
> Below steps will repeat the failure.
>
> $ cd tools/
> $ rm perf/pmu-events/arch/arm64/freescale/imx8mm/sys/ddrc.json
> $ make clean
> $ make JEVENTS_ARCH=all perf
>
> pmu-events/pmu-events.c:76586:26: error: ‘struct pmu_metrics_table’ has no member named ‘entries’
> 76586 | .entries = pmu_metrics__freescale_imx8mm_sys,
> | ^~~~~~~
> pmu-events/pmu-events.c:76587:26: error: ‘struct pmu_metrics_table’ has no member named ‘length’
> 76587 | .length = ARRAY_SIZE(pmu_metrics__freescale_imx8mm_sys)
> | ^~~~~~
>
> If only metric table exists, then this error may occur.
I can reproduce the error and confirm it fixed.
Tested-by: Namhyung Kim <namhyung@kernel.org>
Thanks,
Namhyung
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [EXT] Re: [PATCH] perf jevents: fix no member named 'entries' issue
2023-09-20 4:16 ` Namhyung Kim
@ 2023-09-21 18:51 ` Namhyung Kim
0 siblings, 0 replies; 5+ messages in thread
From: Namhyung Kim @ 2023-09-21 18:51 UTC (permalink / raw)
To: Xu Yang
Cc: Ian Rogers, peterz@infradead.org, mingo@redhat.com,
acme@kernel.org, mark.rutland@arm.com,
alexander.shishkin@linux.intel.com, jolsa@kernel.org,
adrian.hunter@intel.com, linux-perf-users@vger.kernel.org,
linux-kernel@vger.kernel.org
On Tue, Sep 19, 2023 at 9:16 PM Namhyung Kim <namhyung@kernel.org> wrote:
>
> Hello,
>
> On Tue, Sep 19, 2023 at 7:07 PM Xu Yang <xu.yang_2@nxp.com> wrote:
> >
> > Hi Lan,
> >
> > > On Tue, Sep 19, 2023 at 1:04 AM Xu Yang <xu.yang_2@nxp.com> wrote:
> > > >
> > > > The struct "pmu_events_table" has been changed after commit
> > > > 2e255b4f9f41 (perf jevents: Group events by PMU, 2023-08-23).
> > > > So there doesn't exist 'entries' in pmu_events_table anymore.
> > > > This will align the members with that commit. Othewise, below
> > > > errors will be printed when run jevent.py:
> > > >
> > > > pmu-events/pmu-events.c:5485:26: error: ‘struct pmu_metrics_table’ has no member named ‘entries’
> > > > 5485 | .entries = pmu_metrics__freescale_imx8dxl_sys,
> > > >
> > > > Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
> > >
> > > Reviewed-by: Ian Rogers <irogers@google.com>
> > >
> > > Thanks Xu! I wasn't able to repeat the failure but the fix looks good
> > > to me. Is the failure caused by adding new imx8dxl metrics? I'd like
> >
> > Yes.
> >
> > > to make sure we have testing coverage so this doesn't happen again.
> > > I'm trying:
> > > $ make -C tools/perf O=/tmp/perf JEVENTS_ARCH=all
> > > Could you confirm that this make command was broken without your fix
> > > plus the metric changes you've done?
> >
> > Below steps will repeat the failure.
> >
> > $ cd tools/
> > $ rm perf/pmu-events/arch/arm64/freescale/imx8mm/sys/ddrc.json
> > $ make clean
> > $ make JEVENTS_ARCH=all perf
> >
> > pmu-events/pmu-events.c:76586:26: error: ‘struct pmu_metrics_table’ has no member named ‘entries’
> > 76586 | .entries = pmu_metrics__freescale_imx8mm_sys,
> > | ^~~~~~~
> > pmu-events/pmu-events.c:76587:26: error: ‘struct pmu_metrics_table’ has no member named ‘length’
> > 76587 | .length = ARRAY_SIZE(pmu_metrics__freescale_imx8mm_sys)
> > | ^~~~~~
> >
> > If only metric table exists, then this error may occur.
>
> I can reproduce the error and confirm it fixed.
>
> Tested-by: Namhyung Kim <namhyung@kernel.org>
Applied to perf-tools-next, thanks!
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-09-21 18:52 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-19 8:09 [PATCH] perf jevents: fix no member named 'entries' issue Xu Yang
2023-09-19 15:52 ` Ian Rogers
2023-09-20 2:07 ` [EXT] " Xu Yang
2023-09-20 4:16 ` Namhyung Kim
2023-09-21 18:51 ` Namhyung Kim
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).