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
Manual Installation
Install ZView in your Python virtual environment:
# From the root of the zview repository
pip install .
Or directly through pip:
pip install zview
How to Use
Running from the CLI (manual mode)
zview -e build/zephyr/zephyr.elf -r runner -t runner_mcu_descriptor
Integrated West Command
On your project west environment, with your board flashed and probed, run:
west update zview
west zview
This can be achieved by adding this snippet to your west manifest:
manifest:
projects:
- name: zview
url: https://github.com/wkhadgar/zview
revision: main
path: modules/tools/zview
west-commands: scripts/west-commands.yml
CLI Arguments
| Argument | Description |
|---|---|
-e, --elf-file |
Path to the firmware .elf file. |
-r, --runner |
Manually select jlink or pyocd. |
-t, --runner-target |
MCU descriptor name, as used by the choosen runner. |
--period |
Update period in seconds, can be float. |
QEMU/GDB targets
If debugserver is available:
west debugserver
Or you may launch a GDB server from QEMU directly with -s, this will be necessary if you have no runners.yaml (e.g. mps2/an385):
qemu-system-arm \
-machine mps2-an385 \
-cpu cortex-m3 \
-kernel build/zephyr/zephyr.elf \
-nographic \
-serial mon:stdio \
-s -S
Then attach ZView:
# CLI
zview -e build/zephyr/zephyr.elf -r gdb -t localhost:1234
# West
west zview -r gdb -t localhost:1234
[!NOTE] Due to GDB server limitations, when using
-r gdbthe target is briefly halted prior to memory reads. Be aware of this side effect.
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 is implicit and only express itself on the used CPU %, when available.
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.
Roadmap
Based on community feedback, the following features are in development:
- Detailed thread metrics (e.g., context switch counts).
Also, 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.5.3.tar.gz.
File metadata
- Download URL: zview-0.5.3.tar.gz
- Upload date:
- Size: 25.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef27d2177bc57ec7be8c821b2ef57b3defc7b848ac46701aadf53b62e1b77e89
|
|
| MD5 |
652d9da14b6aa03c0de21746e752a145
|
|
| BLAKE2b-256 |
6ca223cdaeaeef9ca28f7d8263a58dd7a0feff2887e482b13990b6b79869b267
|
Provenance
The following attestation bundles were made for zview-0.5.3.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.5.3.tar.gz -
Subject digest:
ef27d2177bc57ec7be8c821b2ef57b3defc7b848ac46701aadf53b62e1b77e89 - Sigstore transparency entry: 1176283032
- Sigstore integration time:
-
Permalink:
wkhadgar/zview@2b97278fa44b8a0160a71e7715021cb62d2dcf27 -
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@2b97278fa44b8a0160a71e7715021cb62d2dcf27 -
Trigger Event:
push
-
Statement type:
File details
Details for the file zview-0.5.3-py3-none-any.whl.
File metadata
- Download URL: zview-0.5.3-py3-none-any.whl
- Upload date:
- Size: 23.3 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 |
c4367c98e6e0fcb0f4c7a34f78809c06f58a37a508dfe49a3704fbf15cfa2e8f
|
|
| MD5 |
2b5d78e442639843a8a0324b3d5a00bc
|
|
| BLAKE2b-256 |
efd9c8def12e85f15d1be33c2078cf821a4fb8cf9e2fc21ac48febc1054229be
|
Provenance
The following attestation bundles were made for zview-0.5.3-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.5.3-py3-none-any.whl -
Subject digest:
c4367c98e6e0fcb0f4c7a34f78809c06f58a37a508dfe49a3704fbf15cfa2e8f - Sigstore transparency entry: 1176283087
- Sigstore integration time:
-
Permalink:
wkhadgar/zview@2b97278fa44b8a0160a71e7715021cb62d2dcf27 -
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@2b97278fa44b8a0160a71e7715021cb62d2dcf27 -
Trigger Event:
push
-
Statement type: