From 04cd8b6fd11cfde50a433ff41c3dc8e9c1032139 Mon Sep 17 00:00:00 2001 From: Damien Le Moal Date: Fri, 3 Sep 2021 15:20:22 +0000 Subject: [PATCH] tools: fiograph: do not overwrite input script file In fiograph.py, the setup_commandline() function mistakenly initializes the output_file variable to the input fio script file, causing this file to always be overwritten, even if an output file is specified using the --output option. Fix this by properly initializing the output_file variable using the --output option argument value. If an output file name is not provided, the input script file name is used by default. Also fix fiograph configuration file to remove the cmdprio_percentage option repeated entry for io_uring and libaio. Signed-off-by: Damien Le Moal Signed-off-by: Niklas Cassel Signed-off-by: Jens Axboe --- tools/fiograph/fiograph.conf | 4 ++-- tools/fiograph/fiograph.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/fiograph/fiograph.conf b/tools/fiograph/fiograph.conf index 5becc4d9..1957e11d 100644 --- a/tools/fiograph/fiograph.conf +++ b/tools/fiograph/fiograph.conf @@ -51,10 +51,10 @@ specific_options=https http_host http_user http_pass http_s3_key http_s3_ke specific_options=ime_psync ime_psyncv [ioengine_io_uring] -specific_options=hipri cmdprio_percentage cmdprio_percentage fixedbufs registerfiles sqthread_poll sqthread_poll_cpu nonvectored uncached nowait force_async +specific_options=hipri cmdprio_percentage fixedbufs registerfiles sqthread_poll sqthread_poll_cpu nonvectored uncached nowait force_async [ioengine_libaio] -specific_options=userspace_reap cmdprio_percentage cmdprio_percentage nowait +specific_options=userspace_reap cmdprio_percentage nowait [ioengine_libcufile] specific_options=gpu_dev_ids cuda_io diff --git a/tools/fiograph/fiograph.py b/tools/fiograph/fiograph.py index 7695c964..b5669a2d 100755 --- a/tools/fiograph/fiograph.py +++ b/tools/fiograph/fiograph.py @@ -292,9 +292,11 @@ def setup_commandline(): def main(): global config_file args = setup_commandline() - output_file = args.file if args.output is None: + output_file = args.file output_file = output_file.replace('.fio', '') + else: + output_file = args.output config_file = configparser.RawConfigParser(allow_no_value=True) config_file.read(args.config) fio_to_graphviz(args.file, args.format).render(output_file, view=args.view) -- 2.25.1