From dfc796b8ec6caa9e5e9a218dcfa177f0546e7e76 Mon Sep 17 00:00:00 2001 From: Eric Liang Date: Thu, 19 Nov 2020 16:02:11 -0800 Subject: [PATCH] Add gdb stack dump command to docs (#12147) * ZZ * pid * Update doc/source/profiling.rst Co-authored-by: Stephanie Wang * Update profiling.rst Co-authored-by: Stephanie Wang --- doc/source/profiling.rst | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/doc/source/profiling.rst b/doc/source/profiling.rst index 364adffcb..32a024d86 100644 --- a/doc/source/profiling.rst +++ b/doc/source/profiling.rst @@ -1,8 +1,21 @@ Profiling for Ray Developers ============================ -This document details, for Ray developers, how to use ``pprof`` to profile Ray -binaries. +This document details, for Ray developers, how to analyze Ray performance. + +Getting a stack trace of Ray C++ processes +---------------------------------------- + +You can use the following GDB command to view the current stack trace of any +running Ray process (e.g., raylet). This can be useful for debugging 100% CPU +utilization or infinite loops (simply run the command a few times to see what +the process is stuck on). + +.. code-block:: shell + + sudo gdb -batch -ex "thread apply all bt" -p + +Note that you can find the pid of the raylet with ``pgrep raylet``. Installation ------------