Capturing Exception Stacks

When a performance exception is detected, you need to capture and analyze the related stack information in a timely manner.

  • Viewing based on GDB
    gdb -p <pid>
    # Access the GDB CLI and print the call stack of the process or main thread.
    bt
    # View the call stack of a thread.
    info threads
    thread<n>
    bt
  • Viewing based on pstack
    pstack <pid>
  • Viewing based on cat
    cat /proc/<pid>/stack