ZView, a Zephyr RTOS runtime visualizer
Project description
ZView, a Zephyr RTOS runtime visualizer
Zephyr RTOS system-wide runtime visualizer via SWD probe!
Take a broader look on your Zephyr application with a non-heavy, small footprint, Kconfig-only thread stats analyser.
Prerequisites
To properly analyze your Zephyr app, your ELF binary must be compiled with specific Kconfig options enabled:
## prj.conf
CONFIG_INIT_STACKS=y # Required for stack watermarks
CONFIG_THREAD_MONITOR=y # Required for thread discovery
CONFIG_THREAD_STACK_INFO=y # Required for thread metadata
# Optional Features
CONFIG_THREAD_NAME=y # Enables thread name display
CONFIG_THREAD_RUNTIME_STATS=y # Enables CPU usage tracking
CONFIG_SYS_HEAP_RUNTIME_STATS=y # Enables heap runtime stats
Installation
Install ZView in your Python virtual environment:
# From the root of the zview repository
pip install -e .
Or directly through pip:
pip install zview
How to Use
ZView automatically detects your hardware target and MCU by parsing the runners.yaml generated by Zephyr.
Running from the CLI (manual mode)
zview -e build/zephyr/zephyr.elf --runners_yaml build/zephyr/runners.yaml
Integrated West Target
On a ZView compatible Zephyr version, run the target:
west build -t zview
This can also be achieved by adding this snippet to your Zephyr CMakeLists.txt:
find_program(ZVIEW zview)
if(NOT ${ZVIEW} STREQUAL ZVIEW-NOTFOUND)
if(CONFIG_INIT_STACKS AND CONFIG_THREAD_MONITOR AND CONFIG_THREAD_STACK_INFO)
add_custom_target(
zview
${ZVIEW}
--elf ${ZEPHYR_BINARY_DIR}/${KERNEL_ELF_NAME}
--runners_yaml ${ZEPHYR_BINARY_DIR}/runners.yaml
$<$<BOOL:$ENV{ZVIEW_RUNNER}>:--runner=$ENV{ZVIEW_RUNNER}>
$<$<BOOL:${CONFIG_SYS_HEAP_RUNTIME_STATS}>:--has_heap_stats>
$<$<BOOL:${CONFIG_THREAD_RUNTIME_STATS}>:--has_thread_runtime_stats>
$<$<BOOL:${CONFIG_THREAD_NAME}>:--has_thread_names>
--thread_name_size ${CONFIG_THREAD_MAX_NAME_LEN}
DEPENDS ${logical_target_for_zephyr_elf}
$<TARGET_PROPERTY:zephyr_property_target,${report}_DEPENDENCIES>
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
USES_TERMINAL
)
else()
message(WARNING "There are unmet dependencies for ZView, it will be unable to run.")
endif()
endif()
[!NOTE] If it is needed to force one of the available runners with the
--runnerargument, it is possible to set an environment variable to do so, e.g.:export ZVIEW_RUNNER=jlink
CLI Arguments
| Argument | Description |
|---|---|
-e, --elf-file |
(Required) Path to the firmware .elf file. |
--runners_yaml |
Path to runners.yaml for automatic MCU/Runner detection. |
--runner |
Manually select jlink or pyocd. |
--period |
Update period in seconds. |
-n, -r, -m |
Enable thread names, runtime stats, or heap stats. |
How it works
ZView achieves a minimal footprint by avoiding on-target processing or UART/Shell output. It utilizes the debug probe's ability to read memory via the APB bus without halting the CPU. By parsing the ELF file, ZView identifies kernel object locations and performs analysis of stack watermarks and CPU usage.
[!NOTE] The
idlethread expresses true CPU activity. All other threads show usage percentage relative to non-idle time. If threadfooshows 50% usage andidleis 40%,foois effectively consuming 30% of total CPU cycles (50% of the active 60%).
Navigation
ZView acts as a TUI. Navigate with UP and DOWN arrows from the default view:
- ENTER: Track CPU usage for a specific thread (hit ENTER again to return).
- S / I: Sort the data and Invert the sorting order.
- H: Access the Heap Runtime visualization.
In the future...
Listening to community feedback, ZView is ongoing some new features development, such as, and not limited to:
- Heap visualization
- Extra thread information (like number of context switches and so)
- Live global variables tracking
- IDK, feel free to open an issue if you feel like this has some potential!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file zview-0.4.0.tar.gz.
File metadata
- Download URL: zview-0.4.0.tar.gz
- Upload date:
- Size: 23.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc7957e99e2cece125e854f17e3a5881f2d588c11ef8db1cd33f46bb8183dddc
|
|
| MD5 |
4d525e90fe520f3abf5aebfb52eda63a
|
|
| BLAKE2b-256 |
8fc670bb34f7d48101453f0e8613d704b89fb49b5cba5957ea2ef995d77d4cde
|
Provenance
The following attestation bundles were made for zview-0.4.0.tar.gz:
Publisher:
version_release.yml on wkhadgar/zview
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
zview-0.4.0.tar.gz -
Subject digest:
bc7957e99e2cece125e854f17e3a5881f2d588c11ef8db1cd33f46bb8183dddc - Sigstore transparency entry: 857003054
- Sigstore integration time:
-
Permalink:
wkhadgar/zview@3a69dcd0abad14d963bc7790a21484a0a8256720 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/wkhadgar
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
version_release.yml@3a69dcd0abad14d963bc7790a21484a0a8256720 -
Trigger Event:
push
-
Statement type:
File details
Details for the file zview-0.4.0-py3-none-any.whl.
File metadata
- Download URL: zview-0.4.0-py3-none-any.whl
- Upload date:
- Size: 21.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
00df623cdba3c3f208de94e74d9c6406ce5207a1cfa210affcca245bab5e46aa
|
|
| MD5 |
015093a7be4ae1b1b2a1dbf5aa1ca988
|
|
| BLAKE2b-256 |
f8838a905eac2958c2f5a723cfc65f9b9a11a7e08b6b4eb533dd892ea4343e8f
|
Provenance
The following attestation bundles were made for zview-0.4.0-py3-none-any.whl:
Publisher:
version_release.yml on wkhadgar/zview
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
zview-0.4.0-py3-none-any.whl -
Subject digest:
00df623cdba3c3f208de94e74d9c6406ce5207a1cfa210affcca245bab5e46aa - Sigstore transparency entry: 857003156
- Sigstore integration time:
-
Permalink:
wkhadgar/zview@3a69dcd0abad14d963bc7790a21484a0a8256720 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/wkhadgar
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
version_release.yml@3a69dcd0abad14d963bc7790a21484a0a8256720 -
Trigger Event:
push
-
Statement type: