Skip to content

Commit 5ac9cd1

Browse files
nashifdanieldegrasse
authored andcommitted
cmake: targets: support overriding puncover host and port
Allow overriding puncover default host and port. Using PUNCOVER_HOST/PUNCOVER_PORT it is possible now to set the host and port to something else other than the default. example: export PUNCOVER_HOST=10.0.1.1 export PUNCOVER_PORT=8088 will start puncover on 10.0.1.1:8088 and make it available over the local network. Signed-off-by: Anas Nashif <anas.nashif@intel.com>
1 parent 2724a1e commit 5ac9cd1

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

cmake/reports/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,23 @@ endif()
8787
find_program(PUNCOVER puncover)
8888

8989
if(NOT ${PUNCOVER} STREQUAL PUNCOVER-NOTFOUND)
90+
set(PUNCOVER_ARGS "")
91+
zephyr_get(PUNCOVER_PORT)
92+
zephyr_get(PUNCOVER_HOST)
93+
if(DEFINED PUNCOVER_PORT)
94+
list(APPEND PUNCOVER_ARGS "--port=${PUNCOVER_PORT}")
95+
endif()
96+
if(DEFINED PUNCOVER_HOST)
97+
list(APPEND PUNCOVER_ARGS "--host=${PUNCOVER_HOST}")
98+
endif()
9099
add_custom_target(
91100
puncover
92101
${PUNCOVER}
93102
--elf_file ${ZEPHYR_BINARY_DIR}/${KERNEL_ELF_NAME}
94103
--gcc_tools_base ${CROSS_COMPILE}
95104
--src_root ${ZEPHYR_BASE}
96105
--build_dir ${CMAKE_BINARY_DIR}
106+
${PUNCOVER_ARGS}
97107
DEPENDS ${logical_target_for_zephyr_elf}
98108
$<TARGET_PROPERTY:zephyr_property_target,${report}_DEPENDENCIES>
99109
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}

doc/develop/optimizations/tools.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,9 @@ If you are using :ref:`sysbuild`, see :ref:`sysbuild_dedicated_image_build_targe
186186
:board: reel_board
187187
:goals: puncover
188188

189+
The ``puncover`` target will start a local web server on ``localhost:5000`` by default.
190+
The host IP and port the HTTP server runs on can be changed by setting the environment
191+
variables ``PUNCOVER_HOST`` and ``PUNCOVER_PORT``.
189192

190193
To view worst-case stack usage analysis, build this with the
191194
:kconfig:option:`CONFIG_STACK_USAGE` enabled.

0 commit comments

Comments
 (0)