• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How To Execute The Pstack Command On CentOS/RHEL

by admin

The pstack(1) command print a stack trace of a running process. Use the below steps to install it on a CentOS/RHEL system.

What Package provides pstack Command

For CentOS/RHEL 5

The pstack package can be installed with:

# yum install pstack

For CentOS/RHEL 6,7

In CentOS/RHEL 6/7, the pstack tool is provided by gdb package. To install gdb, please do :

# yum install gdb

The gdb package will include the gstack and pstack commands. For example:

# rpm -ql gdb-7.2-92.el6.x86_64 | egrep "pstack|gstack"
/usr/bin/gstack
/usr/bin/pstack

Command Usage

You can then call it as either ‘pstack‘ or ‘gstack‘.

# gstack
Usage: gstack [process-id]
# pstack 
Usage: pstack [process-id]

Examples

# gstack 21142
Thread 2 (Thread 0x7f1b3181b700 (LWP 21148)):
#0 0x0000003dfaadf3e7 in ppoll () from /lib64/libc.so.6
#1 0x0000003a4f43298e in pa_rtpoll_run () from /usr/lib64/libpulsecore-0.9.21.so
#2 0x00007f1b27bfb0a7 in ?? () from /usr/lib64/pulse-0.9.21/modules/module-null-sink.so
#3 0x00000032b12389b8 in ?? () from /usr/lib64/libpulsecommon-0.9.21.so
#4 0x0000003dfae079d1 in start_thread () from /lib64/libpthread.so.0
#5 0x0000003dfaae89dd in clone () from /lib64/libc.so.6
Thread 1 (Thread 0x7f1b376ad740 (LWP 21142)):
#0 0x0000003dfaadf3e7 in ppoll () from /lib64/libc.so.6
#1 0x00000032b161cb87 in pa_mainloop_poll () from /usr/lib64/libpulse.so.0
#2 0x00000032b161dec9 in pa_mainloop_iterate () from /usr/lib64/libpulse.so.0
#3 0x00000032b161df80 in pa_mainloop_run () from /usr/lib64/libpulse.so.0
#4 0x000000000040a927 in main ()
# pstack 21142
Thread 2 (Thread 0x7f1b3181b700 (LWP 21148)):
#0 0x0000003dfaadf3e7 in ppoll () from /lib64/libc.so.6
#1 0x0000003a4f43298e in pa_rtpoll_run () from /usr/lib64/libpulsecore-0.9.21.so
#2 0x00007f1b27bfb0a7 in ?? () from /usr/lib64/pulse-0.9.21/modules/module-null-sink.so
#3 0x00000032b12389b8 in ?? () from /usr/lib64/libpulsecommon-0.9.21.so
#4 0x0000003dfae079d1 in start_thread () from /lib64/libpthread.so.0
#5 0x0000003dfaae89dd in clone () from /lib64/libc.so.6
Thread 1 (Thread 0x7f1b376ad740 (LWP 21142)):
#0 0x0000003dfaadf3e7 in ppoll () from /lib64/libc.so.6
#1 0x00000032b161cb87 in pa_mainloop_poll () from /usr/lib64/libpulse.so.0
#2 0x00000032b161dec9 in pa_mainloop_iterate () from /usr/lib64/libpulse.so.0
#3 0x00000032b161df80 in pa_mainloop_run () from /usr/lib64/libpulse.so.0
#4 0x000000000040a927 in main ()

Filed Under: CentOS/RHEL 6, CentOS/RHEL 7, Linux

Some more articles you might also be interested in …

  1. mocp Command Examples in Linux
  2. printf Command Examples in Linux
  3. mkfs.ntfs: command not found
  4. goaccess: command not found
  5. Swapon Fails To Mount Swap – Gives Invalid Argument Error
  6. vncserver fails with “Starting VNC server: no displays configured”
  7. CentOS / RHEL 6 : How to completely remove device mapper multipath (dm-multipath)
  8. ping: command not found
  9. Understanding Ksplice Effective Kernel Version
  10. macchanger: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • powertop Command Examples in Linux
  • powertop: command not found
  • powerstat: command not found
  • powerstat Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright