Browse Source

cmake PMP fetch FlameGraph to build directory

sbg
Daniel Agar 7 years ago committed by Lorenz Meier
parent
commit
6b02fc083e
  1. 18
      platforms/nuttx/CMakeLists.txt

18
platforms/nuttx/CMakeLists.txt

@ -281,9 +281,21 @@ add_custom_target(debug @@ -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
)

Loading…
Cancel
Save