iowatcher: Convert start_mpstat to run_program
authorAndrew Price <anprice@redhat.com>
Sun, 27 Apr 2014 00:55:57 +0000 (01:55 +0100)
committerChris Mason <clm@fb.com>
Wed, 24 Sep 2014 19:02:09 +0000 (12:02 -0700)
commit49559b611256ea542f3f9f74951bb787c418fbf8
tree9e9ee4e93c410c088478c9d76d3a3834e9cafd4c
parent30420b587db62a3d919d7bc68ef2dd07df5c75fd
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 <anprice@redhat.com>
iowatcher/blkparse.c
iowatcher/main.c
iowatcher/tracers.c
iowatcher/tracers.h