What are the advantages of using `pidstat` for per-process monitoring compared to `top` and `iotop`? How can you use `pidstat` to monitor CPU, memory, and disk usage over time for a specific process? Provide an example command.
In top and iotop, the display refreshes over time, where each update erases the previous output. The pidstat utility allows you to see the resource consumption of a process over time in the style of vmstat. We can monitor memory usage using -r and disk usage using -d. For e.g pidstat -r it lists the memory usage by all the processes and pidstat - d lists the disk usage by all the processes.