Skip to contentSkip to conversation

perf jevents: fix no member named 'entries' issue

PATCH Applied Xu Yang 3 participants 5 messages Sep 19, 2023 – Sep 21, 2023 perf events

lore
Share & tools
lore

Xu Yang

author
#0 lore raw

PATCH 1/1 perf jevents: fix no member named 'entries' issue

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,

---
 tools/perf/pmu-events/jevents.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/perf/pmu-events/jevents.py +2 -2
index a7e88332276d..af15fa2cadbd 100755
@@ -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}},
Signature · 1 line
2.34.1
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Xu Yang

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,

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

Quoted 22 lines
---
 tools/perf/pmu-events/jevents.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/perf/pmu-events/jevents.py +2 -3
index a7e88332276d..af15fa2cadbd 100755
@@ -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

author
#2 lore raw

Hi Lan,

Quoted 11 lines · Xu Yang
Quoted 10 lines

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,

Quoted 6 lines
Quoted 1 line

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.

Quoted 5 lines

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

maintainer Tested-by
#3 lore raw

Hello,

Quoted 36 lines · Xu Yang

Hi Lan,

Quoted 11 lines · Xu Yang
Quoted 10 lines

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,

Quoted 6 lines
Quoted 1 line

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.

Quoted 5 lines

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
Quoted 8 lines

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.

Thanks,
Namhyung

maintainer Applied
#4 lore raw
Quoted 47 lines · Namhyung Kim

Hello,

Quoted 43 lines · Xu Yang

Hi Lan,

Quoted 11 lines · Xu Yang
Quoted 10 lines

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,

Quoted 6 lines
Quoted 1 line

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.

Quoted 5 lines

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)
| ^~~~~~

Quoted 5 lines
Quoted 1 line

If only metric table exists, then this error may occur.

I can reproduce the error and confirm it fixed.

Applied to perf-tools-next, thanks!