blktrace bno_plot.py: output comprehensive message when gnuplot not found
authorEiichi Tsukata <devel@etsukata.com>
Tue, 3 Dec 2013 12:04:59 +0000 (21:04 +0900)
committerJens Axboe <axboe@kernel.dk>
Wed, 4 Dec 2013 02:25:21 +0000 (19:25 -0700)
commit3726f669cd305741e35ae759e0b21f3b04084e4e
treed199fc362b52ae3d718c32b530b83665b4d76583
parent0a915aabe88ff98786a88f30d2e062ef34d0826c
blktrace bno_plot.py: output comprehensive message when gnuplot not found

Currently, bno_plot.py uses os.execvp which does not show enough information
when executed command is not found. For example, when gnuplot is not found
bno_plot.py shows the following messages:

    Traceback (most recent call last):
      File "/usr/local/bin/bno_plot.py", line 123, in <module>
        os.execvp(cmd[0], cmd)
      File "/usr/lib64/python2.7/os.py", line 344, in execvp
        _execvpe(file, args)
      File "/usr/lib64/python2.7/os.py", line 368, in _execvpe
        func(file, *argrest)
    OSError: [Errno 2] No such file or directory

Users can't understand what happend directly from the message.

Instead of os.execvp, this patch uses os.system which shows the following
messages when gnuplot not found:

    sh: gnuplot: command not found

Signed-off-by: Eiichi Tsukata <devel@etsukata.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
btt/bno_plot.py