iowatcher: Convert start_mpstat to run_program
For consistency and deduplication, use run_program in start_mpstat. Add
the ability to pass a path to run_program, which will be opened in the
spawned process and used as stdout, in order to capture mpstat output.
This fixes a tricky descriptor leak in start_mpstat which could have
caused a race condition if it was fixed with close().
Some output formatting tweaks have also been added and a bug from a
previous patch, where tracers were killed immediately when -p wasn't
specified, has been fixed.
Signed-off-by: Andrew Price <firstname.lastname@example.org>
4 files changed