Skip to content

Commit d28602a

Browse files
Freey0cfriedt
authored andcommitted
tracing: systemview: Add isr name for Segger-sysview
With symtab enabled, the isr name is collected by symbol table Signed-off-by: WenBin Zhang <[email protected]>
1 parent 291fed4 commit d28602a

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

subsys/tracing/sysview/sysview_config.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
#include <zephyr/kernel.h>
88
#include <SEGGER_SYSVIEW.h>
99
#include <ksched.h>
10+
#ifdef CONFIG_SYMTAB
11+
#include <zephyr/debug/symtab.h>
12+
#include <zephyr/sw_isr_table.h>
13+
#endif
1014

1115
extern const SEGGER_SYSVIEW_OS_API SYSVIEW_X_OS_TraceAPI;
1216

@@ -53,6 +57,23 @@ static void cbSendSystemDesc(void)
5357
SEGGER_SYSVIEW_SendSysDesc("D=" CONFIG_BOARD " "
5458
CONFIG_SOC_FAMILY " " CONFIG_ARCH);
5559
SEGGER_SYSVIEW_SendSysDesc("O=Zephyr");
60+
61+
#ifdef CONFIG_SYMTAB
62+
char isr_desc[SEGGER_SYSVIEW_MAX_STRING_LEN];
63+
64+
for (int idx = 0; idx < IRQ_TABLE_SIZE; idx++) {
65+
const struct _isr_table_entry *entry = &_sw_isr_table[idx];
66+
67+
if ((entry->isr == z_irq_spurious) || (entry->isr == NULL)) {
68+
continue;
69+
}
70+
const char *name = symtab_find_symbol_name((uintptr_t)entry->isr, NULL);
71+
72+
snprintf(isr_desc, SEGGER_SYSVIEW_MAX_STRING_LEN, "I#%d=%s", idx + 16, name);
73+
74+
SEGGER_SYSVIEW_SendSysDesc(isr_desc);
75+
}
76+
#endif
5677
}
5778

5879
static void send_task_list_cb(void)

0 commit comments

Comments
 (0)