Conversation
Both HP and HE cores support segger RTT. Signed-off-by: Adam Pogonyi <adam.pogonyi@arm.com>
With symtab enabled, the isr name is collected by symbol table Signed-off-by: WenBin Zhang <freey7955@gmail.com>
Add user config hook to inject customm descriptors into sysview. Signed-off-by: Adam Pogonyi <adam.pogonyi@arm.com>
There was a problem hiding this comment.
Pull request overview
This PR improves SEGGER SystemView tracing integration by enabling SEGGER RTT on Alif Ensemble RTSS cores and enriching SystemView’s system description output (including optional IRQ-to-name mappings), while also adding an application hook for custom system description strings.
Changes:
- Enable
HAS_SEGGER_RTTfor Alif EnsembleRTSS_HEandRTSS_HPSoC configs. - Extend
cbSendSystemDesc()to emit IRQ name mappings whenCONFIG_SYMTABis enabled. - Add a weak
sysview_app_send_sys_desc()hook for applications to append SystemView system-description entries.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| subsys/tracing/sysview/sysview_config.c | Adds optional symbol-based IRQ name emission to SystemView sys-desc and introduces an app hook for extensibility. |
| soc/alif/ensemble/Kconfig | Selects HAS_SEGGER_RTT for RTSS cores to enable RTT-based tracing support. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
| const char *name = symtab_find_symbol_name((uintptr_t)entry->isr, NULL); | ||
|
|
||
| snprintf(isr_desc, SEGGER_SYSVIEW_MAX_STRING_LEN, "I#%d=%s", idx + 16, name); |
There was a problem hiding this comment.
The idx + 16 IRQ number offset is hard-coded and will produce incorrect IRQ numbering on architectures (or configurations) where the external IRQ vector base is not 16. Use the platform/configured IRQ vector base (e.g., CONFIG_GEN_IRQ_START_VECTOR on platforms that provide it, or an appropriate Zephyr/arch macro) instead of a literal 16 so the mapping matches the real vector numbering.
| continue; | ||
| } | ||
| const char *name = symtab_find_symbol_name((uintptr_t)entry->isr, NULL); | ||
|
|
There was a problem hiding this comment.
symtab_find_symbol_name() may return NULL when no symbol is found. Passing a NULL pointer to %s is not portable and can crash on some C libraries/targets. Add a fallback (e.g., skip emitting the mapping, or use a placeholder like "unknown") when name == NULL.
| if (name == NULL) { | |
| name = "unknown"; | |
| } |
| SEGGER_SYSVIEW_SendSysDesc("O=Zephyr"); | ||
|
|
||
| #ifdef CONFIG_SYMTAB | ||
| char isr_desc[SEGGER_SYSVIEW_MAX_STRING_LEN]; |
There was a problem hiding this comment.
In Zephyr, using snprintk() (and sizeof(isr_desc) / ARRAY_SIZE(isr_desc) for the buffer size) is typically preferred over snprintf() to avoid pulling in heavier libc formatting and to match common Zephyr patterns in constrained builds. This also removes dependence on SEGGER_SYSVIEW_MAX_STRING_LEN matching the actual buffer size.
| } | ||
| const char *name = symtab_find_symbol_name((uintptr_t)entry->isr, NULL); | ||
|
|
||
| snprintf(isr_desc, SEGGER_SYSVIEW_MAX_STRING_LEN, "I#%d=%s", idx + 16, name); |
There was a problem hiding this comment.
In Zephyr, using snprintk() (and sizeof(isr_desc) / ARRAY_SIZE(isr_desc) for the buffer size) is typically preferred over snprintf() to avoid pulling in heavier libc formatting and to match common Zephyr patterns in constrained builds. This also removes dependence on SEGGER_SYSVIEW_MAX_STRING_LEN matching the actual buffer size.
There was a problem hiding this comment.
I'm happy to move to snprintk but that would diverge the code from the upstream zephyr. Code owners shall decide.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@pogadam7 Please squash the Copilot changes. |
Summary
This pull request enhances tracing support for Alif Ensemble SoCs and improves the SEGGER SystemView integration in Zephyr. The main changes add support for SEGGER RTT, enable richer system descriptions (including ISR name mappings), and provide a user hook for custom SystemView descriptions.
Tracing and debug improvements:
HAS_SEGGER_RTTselection to bothRTSS_HEandRTSS_HPSoC configurations inKconfig, enabling SEGGER RTT support for these cores. [1] [2]sysview_config.c, included symbol table and ISR table headers whenCONFIG_SYMTABis enabled, preparing for symbol-based features.cbSendSystemDesc) to emit IRQ name mappings whenCONFIG_SYMTABis enabled, improving traceability of interrupts in SystemView.Extensibility:
sysview_app_send_sys_desc()function as a user hook, allowing applications to inject additional SystemView system description strings (e.g., custom IRQ mappings) without modifying Zephyr core code.