-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export symbols needed for sof probe module llext #81098
Export symbols needed for sof probe module llext #81098
Conversation
FYI @lyakh |
drivers/timer/apic_tsc.c
Outdated
@@ -209,6 +209,7 @@ uint64_t sys_clock_cycle_get_64(void) | |||
{ | |||
return rdtsc(); | |||
} | |||
EXPORT_SYMBOL(sys_clock_cycle_get_64); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this sort of thing would be better served in drivers/timer/export.c that optionally is built with LLEXT enabled
Since there's a few timer API symbols that we might want to export, in particular cycle_get_32 and cycle_get_64 (should be checked for availability!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. This is not that simple. All the drivers/timer options do not implement sys_clock_cycle_get_64()
, causing undefined symbol error with this approach. I could still add a huge
#if CONFIG_APIC_TIMER || CONFIG_APIC_TSC_DEADLINE_TIMER \
CONFIG_ARM_ARCH_TIMER || CONFIG_INTEL_ADSP_TIMER \
CONFIG_CC13XX_CC26XX_RTC_TIMER || CONFIG_CORTEX_M_SYSTICK \
CONFIG_ESP32_SYS_TIMER || CONFIG_HPET_TIMER \
CONFIG_LITEX_TIMER || CONFIG_MCUX_OS_TIMER \
...
if condition around EXPORT_SYMBOL(sys_clock_cycle_get_64());
, but that is painful to get right, and even more painful to maintain. I suggest I go back to my original solution, and just add the export next to each implementation. @teburd what do you say?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then there is of course the third option of exporting only the intel adsp implementation, because that is all I need.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jsarha you could also add a __weak
version of the function, not sure if that would be preferred.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, now there is a new version with a __weak dummy implementation of sys_clock_cycle_get_64().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps using a Kconfig that is selected helps here...
#ifdef CONFIG_TIMER_HAS_64BIT_CYCLE_COUNTER
EXPORT_SYMBOL(sys_clock_cycle_get_64());
#endif
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. It was not hard to find, but I did not know what to look for. Hope this is good now.
762d0bc
to
e37d327
Compare
The SOF side PR requiring this change can be found here: thesofproject/sof#9643 |
8f36db5
to
a32b400
Compare
Export sys_clock_cycle_get_64() implementations to enable k_cycle_get_64() calls from llext libraries. Signed-off-by: Jyri Sarha <[email protected]>
a32b400
to
b32d555
Compare
cc @dbaluta |
My probe llext changes still require some cleaning up, but I'll link the PR here as soon as its ready.