tests: thread_analyzer: test for privileged stacks usage

This adds the bits to test the displaying the usage of
privileged stacks for user threads. Note that this only
adds the printk part as this is to test the code path to
fetch usage data rather than the display part.

Also add qemu_xtensa/dc233c/mmu to platform allow list so
the privileged stack code can be tested on that platform.

This replaces mps2/an385 with qemu_x86 as an integration
platform due to the privileged stack test. Since ARM does
not currently support getting privileged stack info, test
would result in twister error due to kconfig warnings.
The board cannot be excluded since it's an integration
platform. So for now, use qemu_x86 as an integration for
32-bit testing. Once ARM has proper support, we can go
back to having mps2/an385 as an integration platform.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
Daniel Leung 2024-08-16 09:45:17 -07:00 committed by Anas Nashif
commit 82d56e8f0b

View file

@ -1,6 +1,6 @@
common: common:
integration_platforms: integration_platforms:
- mps2/an385 - qemu_x86
- qemu_x86_64 - qemu_x86_64
platform_allow: platform_allow:
# Representative platforms to make sure this builds without issues # Representative platforms to make sure this builds without issues
@ -11,6 +11,7 @@ common:
- qemu_x86_64 - qemu_x86_64
- qemu_riscv32 - qemu_riscv32
- qemu_riscv64 - qemu_riscv64
- qemu_xtensa/dc233c/mmu
extra_configs: extra_configs:
- CONFIG_QEMU_ICOUNT=n - CONFIG_QEMU_ICOUNT=n
tags: tags:
@ -37,6 +38,24 @@ tests:
regex: regex:
- "(.*)0x([0-9a-fA-F]+)([ ]+) : STACK: unused [0-9]+ usage [0-9]+ / [0-9]+ (.*)" - "(.*)0x([0-9a-fA-F]+)([ ]+) : STACK: unused [0-9]+ usage [0-9]+ / [0-9]+ (.*)"
- "(.*)ISR0([ ]+) : STACK: unused [0-9]+ usage [0-9]+ / [0-9]+ (.*)" - "(.*)ISR0([ ]+) : STACK: unused [0-9]+ usage [0-9]+ / [0-9]+ (.*)"
debug.thread_analyzer.printk.userspace.priv_stack:
filter: CONFIG_ARCH_HAS_USERSPACE
extra_configs:
- CONFIG_THREAD_ANALYZER_USE_PRINTK=y
- CONFIG_THREAD_ANALYZER_PRIV_STACK_USAGE=y
- CONFIG_USERSPACE=y
platform_exclude:
# These platforms do not yet have the necessary bits to determine
# usage of privileged stacks.
- mps2/an385
- qemu_cortex_a53
harness: console
harness_config:
type: multi_line
regex:
- "(.*)0x([0-9a-fA-F]+)([ ]+) : STACK: unused [0-9]+ usage [0-9]+ / [0-9]+ (.*)"
- "(.*)PRIV_STACK: unused [0-9]+ usage [0-9]+ / [0-9]+"
- "(.*)ISR0([ ]+) : STACK: unused [0-9]+ usage [0-9]+ / [0-9]+ (.*)"
debug.thread_analyzer.log_backend: debug.thread_analyzer.log_backend:
extra_configs: extra_configs:
- CONFIG_THREAD_ANALYZER_USE_LOG=y - CONFIG_THREAD_ANALYZER_USE_LOG=y