News for hackers. Stuff that matters.
Re:So, what can you do with a PID? by hsfzxjy on Friday December 16, 2022 @02:39PM (#34019150)
And with strace -p pid you can somewhat "spy" on what a process is doing.
Re:So, what can you do with a PID? by gregw2 on Friday December 16, 2022 @07:43PM (#34022793)
This. (Combine with sudo too!)

Now if I could just track NFS client traffic on a client associated with a PID (without having NFS server access). All I can get is all-PID/client-kernel data info vi nfsstat, nothing tying to a PID, filename, directory or inode to tell me which PID is causing all the NFS traffic!

Re:So, what can you do with a PID? by fragmede on Friday December 16, 2022 @10:29PM (#34024234)

    iotop?
Re:So, what can you do with a PID? by gregw2 on Friday December 16, 2022 @11:49PM (#34024811)
Tried it, I think the problem is the nfs io comes from the kernel and is not tied to a PID?
Re:So, what can you do with a PID? by T3OU-736 on Saturday December 17, 2022 @10:01AM (#34028270)
There us a hugely non-trivial (on the order of 100x) slowdown in code running when strace does its thing.

Brendan Gregg's work in the field of performance analysis (eBPF to the rescue) is quite useful in this regard, though not without tradeoffs (AFAIK: need compiler tools on the system to compile eBPF code).

Using `perf` may be a decent middle ground.

Re:So, what can you do with a PID? by jasonhansel on Saturday December 17, 2022 @12:28PM (#34029946)
`lsof -p pid` can also be a good way of determining what a process is doing at a given point in time, if you're just trying to figure out what files it has open.