Skip to content

Latest commit

 

History

History
35 lines (27 loc) · 1.14 KB

PROFILING.md

File metadata and controls

35 lines (27 loc) · 1.14 KB

How to profile Beluga

Generating a flamegraph from recorded perf events

A flamegraph is a convenient tool for understanding how CPU time is being used.

  1. To start, run the docker container in privileged mode:

    docker/run.sh -p
  2. Your code needs to be built with debug info and may also need frame pointers. For that, use:

    colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_CXX_FLAGS="-fno-omit-frame-pointer"
  3. Run the following script to generate the profiling data:

    source /ws/install/setup.bash
    ros2 run beluga_benchmark profile_amcl_with_bagfile

    perf will generate a perf.data file in the folder it was run.

  4. To generate a flamegraph from the recorded data, run:

    source /ws/install/setup.bash
    ros2 run beluga_benchmark flamegraph  # This may take a long time

    To visualize the flamegraph and be able to zoom it in or out, open the generated svg file in a web-browser.

References