I'm trying to diagnose an intermittently slow command. When I run the command and see it hanging, I press control + t to get the PID, then in another tab, run diagnose [PID]
- eg, diagnose 123
. I've defined diagnose
as a function in my zsh configuration:
# See system calls of the process with a given PID
function diagnose() { sudo dtruss -cade -p "$1" 2>&1 | tee /tmp/dtruss_output }
Obviously, since I'm reacting when I notice a hang, I run diagnose
several seconds after the process started. The output lists many system calls, but I wonder whether I'm missing anything important.
Does the output of dtruss -p [PID]
include system calls made by that process before dtruss
was run?
Aucun commentaire:
Enregistrer un commentaire