-
Notifications
You must be signed in to change notification settings - Fork 350
trace: remove superfluous objects #10510
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
Conversation
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.
Pull request overview
This PR optimizes memory usage in LLEXT (Loadable EXTensions) builds by moving trace context declarations from global scope to monolithic build sections. The trace contexts are only needed when building modules directly into the base firmware, not when building loadable extensions.
Changes:
- Removed global DECLARE_TR_CTX declarations from 38 audio module files
- Re-added DECLARE_TR_CTX declarations within
#elseblocks (non-LLEXT/monolithic builds) where DECLARE_MODULE_ADAPTER is used - Removed EXPORT_SYMBOL(tflm_tr) from tensorflow module as it's no longer globally accessible
Reviewed changes
Copilot reviewed 38 out of 38 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/debug/tester/tester.c | Moved DECLARE_TR_CTX to monolithic build section after SOF_LLEXT_BUILDINFO |
| src/audio/up_down_mixer/up_down_mixer.c | Moved DECLARE_TR_CTX to end of file before DECLARE_MODULE_ADAPTER |
| src/audio/tone/tone-ipc4.c | Moved DECLARE_TR_CTX to monolithic build section after SOF_LLEXT_BUILDINFO |
| src/audio/tone/tone-ipc3.c | Moved DECLARE_TR_CTX before comp_driver definition (no LLEXT support) |
| src/audio/tensorflow/tflm-classify.c | Removed DECLARE_TR_CTX and EXPORT_SYMBOL(tflm_tr), re-added in monolithic section |
| src/audio/template/template.c | Moved DECLARE_TR_CTX to monolithic build section with explanatory comment |
| src/audio/tdfb/tdfb.c | Moved DECLARE_TR_CTX to monolithic build section after SOF_LLEXT_BUILDINFO |
| src/audio/stft_process/stft_process.c | Moved DECLARE_TR_CTX to monolithic build section after SOF_LLEXT_BUILDINFO |
| src/audio/sound_dose/sound_dose.c | Moved DECLARE_TR_CTX to monolithic build section after SOF_LLEXT_BUILDINFO |
| src/audio/smart_amp/smart_amp.c | Moved DECLARE_TR_CTX to end of file before DECLARE_MODULE_ADAPTER |
| src/audio/selector/selector.c | Moved DECLARE_TR_CTX declarations for both IPC3 and IPC4 sections appropriately |
| src/audio/multiband_drc/multiband_drc.c | Moved DECLARE_TR_CTX to monolithic build section after SOF_LLEXT_BUILDINFO |
| src/audio/module_adapter/module/waves/waves.c | Moved DECLARE_TR_CTX to monolithic build section after SOF_LLEXT_BUILDINFO |
| src/audio/module_adapter/module/passthrough.c | Moved DECLARE_TR_CTX to end of file before DECLARE_MODULE_ADAPTER |
| src/audio/module_adapter/module/modules.c | Removed DECLARE_TR_CTX (not needed as no DECLARE_MODULE_ADAPTER) |
| src/audio/module_adapter/module/dolby/dax.c | Moved DECLARE_TR_CTX to monolithic build section after SOF_LLEXT_BUILDINFO |
| src/audio/module_adapter/module/cadence.c | Moved DECLARE_TR_CTX to end of file before DECLARE_MODULE_ADAPTER |
| src/audio/mixin_mixout/mixin_mixout.c | Moved both mixin_tr and mixout_tr DECLARE_TR_CTX to monolithic build section |
| src/audio/mixer/mixer.c | Moved DECLARE_TR_CTX to end of file before DECLARE_MODULE_ADAPTER |
| src/audio/mfcc/mfcc.c | Moved DECLARE_TR_CTX to monolithic build section after SOF_LLEXT_BUILDINFO |
| src/audio/level_multiplier/level_multiplier.c | Moved DECLARE_TR_CTX to monolithic build section after SOF_LLEXT_BUILDINFO |
| src/audio/kpb.c | Moved DECLARE_TR_CTX before comp_driver definition |
| src/audio/igo_nr/igo_nr.c | Moved DECLARE_TR_CTX to monolithic build section after SOF_LLEXT_BUILDINFO |
| src/audio/host-zephyr.c | Moved DECLARE_TR_CTX before comp_driver definition |
| src/audio/host-legacy.c | Moved DECLARE_TR_CTX before comp_driver definition |
| src/audio/google/google_rtc_audio_processing.c | Moved DECLARE_TR_CTX to monolithic build section after SOF_LLEXT_BUILDINFO |
| src/audio/google/google_hotword_detect.c | Moved DECLARE_TR_CTX before comp_driver definition |
| src/audio/google/google_ctc_audio_processing.c | Moved DECLARE_TR_CTX to monolithic build section after SOF_LLEXT_BUILDINFO |
| src/audio/eq_iir/eq_iir.c | Moved DECLARE_TR_CTX to monolithic build section after SOF_LLEXT_BUILDINFO |
| src/audio/eq_fir/eq_fir.c | Moved DECLARE_TR_CTX to monolithic build section after SOF_LLEXT_BUILDINFO |
| src/audio/dcblock/dcblock.c | Moved DECLARE_TR_CTX to monolithic build section after SOF_LLEXT_BUILDINFO |
| src/audio/dai-zephyr.c | Moved DECLARE_TR_CTX before comp_driver definition |
| src/audio/dai-legacy.c | Moved DECLARE_TR_CTX before comp_driver definition |
| src/audio/crossover/crossover.c | Moved DECLARE_TR_CTX to monolithic build section after SOF_LLEXT_BUILDINFO |
| src/audio/copier/copier_ipcgtw.c | Removed DECLARE_TR_CTX (not needed as no DECLARE_MODULE_ADAPTER) |
| src/audio/copier/copier.c | Moved DECLARE_TR_CTX before DECLARE_MODULE_ADAPTER |
| src/audio/codec/dts/dts.c | Moved DECLARE_TR_CTX to monolithic build section after SOF_LLEXT_BUILDINFO |
| src/audio/aria/aria.c | Moved DECLARE_TR_CTX to monolithic build section after SOF_LLEXT_BUILDINFO |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@lrudyX please confirm that QB failures are unrelated. This PR should have no runtime effects, as long as you don't use Tensor Flow |
AEC tests failed, unfortunately I think those are related. |
tmleman
left a comment
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.
If you had mentioned in the commit message that ipcgtw_comp_tr and intel_codec_tr are not used anywhere, I wouldn't have to check why they were treated differently 😉
BTW, the CI failures are caused by these changes:
[ 0.581580] <inf> llext: llext_load: Loaded extension RTC_AEC
[ 0.581686] <err> lib_manager: llext_manager_load_module: .bss 0x33e00 @0xa068b000 isn't within writable data 0x0 @(nil)!
[ 0.581778] <err> lib_manager: lib_manager_module_create: lib_manager_allocate_module() failed!
[ 0.581820] <err> ipc: ipc4_init_module_instance: error: failed to init module 1000 : 0
[ 0.581848] <err> ipc: ipc_cmd: ipc4: MODULE_MSG failed with err 104
aah, nice! This is a separate bug, but uncovered by these changes. Let me fix. |
If a module has .bss and no .data the sanity check will fail. Add a check for that case. Signed-off-by: Guennadi Liakhovetski <[email protected]>
Trace context isn't used when building LLEXT, move it to monolithic build part. In many cases this eliminates the entire module's .data section. Signed-off-by: Guennadi Liakhovetski <[email protected]>
Trace context isn't used when building LLEXT, move it to monolithic build part. In many cases this eliminates the entire module's .data section.