Skip to content

Conversation

@bastien-curutchet
Copy link
Contributor

Hi,

Here's a PR to add support for the 'trigger feature' on AER events.
My use case is on a powperpc P2020 which is a 32-bit big-endian platform. So the first two commits fix some endianness-related bugs and the last commit actually adds the support for AER events

Best regards,
Bastien

@mchehab
Copy link
Owner

mchehab commented Nov 18, 2025

After applying it on the top of current upstream, I'm getting some errors:

ras-events.c: In function ‘parse_ras_data’:
ras-events.c:50:24: error: ‘TEP_LITLLE_ENDIAN’ undeclared (first use in this function); did you mean ‘TEP_LITTLE_ENDIAN’?
50 | #define ENDIAN TEP_LITLLE_ENDIAN
| ^~~~~~~~~~~~~~~~~
ras-events.c:422:52: note: in expansion of macro ‘ENDIAN’
422 | tep_set_file_bigendian(pdata->ras->pevent, ENDIAN);
| ^~~~~~
ras-events.c:50:24: note: each undeclared identifier is reported only once for each function it appears in
50 | #define ENDIAN TEP_LITLLE_ENDIAN
| ^~~~~~~~~~~~~~~~~
ras-events.c:422:52: note: in expansion of macro ‘ENDIAN’
422 | tep_set_file_bigendian(pdata->ras->pevent, ENDIAN);
| ^~~~~~
make[2]: *** [Makefile:847: rasdaemon-ras-events.o] Error 1
make[2]: *** Waiting for unfinished jobs....
ras-aer-handler.c: In function ‘aer_event_trigger_setup’:
ras-aer-handler.c:68:34: error: implicit declaration of function ‘trigger_check’ [-Wimplicit-function-declaration]
68 | aer_ce_trigger = trigger_check(trigger);
| ^~~~~~~~~~~~~
ras-aer-handler.c:68:32: error: assignment to ‘const char *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
68 | aer_ce_trigger = trigger_check(trigger);
| ^
ras-aer-handler.c:85:32: error: assignment to ‘const char *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
85 | aer_ue_trigger = trigger_check(trigger);
| ^
ras-aer-handler.c: In function ‘run_aer_trigger’:
ras-aer-handler.c:166:9: error: implicit declaration of function ‘run_trigger’; did you mean ‘run_aer_trigger’? [-Wimplicit-function-declaration]
166 | run_trigger(aer_trigger, NULL, env, "aer_event");
| ^~~~~~~~~~~
| run_aer_trigger

Please rebase and fix.

@bastien-curutchet
Copy link
Contributor Author

Hi,

Sorry about this, it should work now

@mchehab
Copy link
Owner

mchehab commented Nov 20, 2025

Still didn't build here:

ras-aer-handler.c: In function ‘ras_aer_handler_init’:
ras-aer-handler.c:103:9: error: ‘use_ipmitool’ undeclared (first use in this function); did you mean ‘enable_ipmitool’?
103 | use_ipmitool = (enable_ipmitool > 0) ? 1 : 0;
| ^~~~~~~~~~~~
| enable_ipmitool
ras-aer-handler.c:103:9: note: each undeclared identifier is reported only once for each function it appears in
ras-aer-handler.c: In function ‘ras_aer_event_handler’:
ras-aer-handler.c:336:13: error: ‘use_ipmitool’ undeclared (first use in this function)
336 | if (use_ipmitool)
| ^~~~~~~~~~~~

The long's size is hardcoded to 64 bits. It prevents the event parsing to
work on 32-bits architecture.

Use the KBUFFER_LSIZE_SAME_AS_HOST to set the long's size so
libtraceevent will automatically select the relevant size.
Also use KBUFFER_ENDIAN_SAME_AS_HOST to set the endianness for
consistency.

Signed-off-by: Bastien Curutchet <[email protected]>
tep_set_file_bigendian() is never called so for big-endian hosts, the
libtraceevents thinks it's handling a little-endian file on a big-endian
architecture and swap the bytes when accessing 16-bits or 32-bits words.
It leads to tep_print_event failing because the event ID isn't
recognized.

Call tep_set_file_bigendian() before tep_print_event() to make the
libtraceevent aware of the file's endianness.
Use the ENDIAN macro to state the endianness as this macro is not used
elsewhere.

Signed-off-by: Bastien Curutchet <[email protected]>
Triggers aren't supported on AER events.

Add support for triggers on AER events. It relies on the AER_CE_TRIGGER
and AER_UE_TRIGGER environment variables

Signed-off-by: Bastien Curutchet <[email protected]>
@bastien-curutchet
Copy link
Contributor Author

Should be OK now, I had only tested with / without aer, not with --enable-all sorry

@mchehab
Copy link
Owner

mchehab commented Nov 20, 2025

merged, thanks!

@mchehab mchehab closed this Nov 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants