Skip to content
Snippets Groups Projects
Commit 6b02fc08 authored by Daniel Agar's avatar Daniel Agar Committed by Lorenz Meier
Browse files

cmake PMP fetch FlameGraph to build directory

parent 1dd67e77
No related branches found
No related tags found
No related merge requests found
......@@ -281,9 +281,21 @@ add_custom_target(debug
DEPENDS ${FW_NAME} ${CMAKE_CURRENT_BINARY_DIR}/.gdbinit
USES_TERMINAL
)
# Poor man's profiler
include(ExternalProject)
ExternalProject_Add(FlameGraph
GIT_REPOSITORY "https://github.com/brendangregg/FlameGraph.git"
UPDATE_COMMAND ""
PATCH_COMMAND ""
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
EXCLUDE_FROM_ALL 1
)
add_custom_target(profile
COMMAND ${PX4_SOURCE_DIR}/platforms/nuttx/Debug/poor-mans-profiler.sh --elf=$<TARGET_FILE:${FW_NAME}> --nsamples=10000
DEPENDS ${FW_NAME} ${PX4_SOURCE_DIR}/platforms/nuttx/Debug/poor-mans-profiler.sh
COMMAND ${CMAKE_COMMAND} -E env PATH="${PX4_BINARY_DIR}/external/Source/FlameGraph:$ENV{PATH}" ${PX4_SOURCE_DIR}/platforms/nuttx/Debug/poor-mans-profiler.sh --elf=$<TARGET_FILE:${FW_NAME}> --nsamples=10000
DEPENDS ${FW_NAME} ${PX4_SOURCE_DIR}/platforms/nuttx/Debug/poor-mans-profiler.sh FlameGraph
USES_TERMINAL
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment