> ## Content Index
> Fetch the complete content index at: https://www.bagz.fr/llms.txt
> Use this file to discover other available public pages before exploring further.

# Using strace with multiples PIDs
- URL: https://www.bagz.fr/using-strace-with-multiples-pids/
- Published: 2015-04-27T10:59:17.000Z
- Updated: 2015-04-27T10:59:17.000Z
- Author: bgazui
- Tags: Linux, #Migrated-1790668826633, #wp, #wp-post, #Import 2026-09-29 08:00

For debugging purposes, it's sometimes necessary to debug multiples PIDs at a same time with **strace** tool.

I will take a simple example: PHP-FPM. PHP-FPM is creating several processes depending on its needs, and if you want to perform debugging on it, you can't easily know what each process is doing. In order to get the results of all the PIDs created for php-fpm, you can use the following command:

strace -tt -T $(pidof 'php-fpm: pool www' | sed 's/\\(\[0-9\]\*\\)/\\-p \\1/g')  

In this command, you can see:

- "**\-tt**" option: displays a more precise time on each line (with microseconds)
- "**\-T**" option: show the time spent in the call
- "**pidof 'php-fpm: pool www'**": retrieves all the PIDs of processes called "php-fpm: pool www" (you can adapt it depending on your process name)

Thanks to this command, you will get the **strace** result for all your PHP-FPM processes (you can filter them later thanks to PID displayed at the beginning of each line).