Linux view stack trace of process

 

strace is a command used to print stack trace of a running process.

strace will show all system calls and signals.

To view stack trace of a process ID 12345 use following command:

$ strace -o strace.out -p 12345

To view stack trace of firefox process use following command:

$ strace -o strace.out -p `pidof firefox`

Both commands will write stack trace output to strace.out file.

strace command requires root permission, so to run strace command either you need to login as root or use it with sudo.

Advertisements

2 comments on “Linux view stack trace of process

  1. strace does only need root permissions if you are trying to use it on processes your user does not own. For your “own” processes, normal user privileges are sufficient.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s