Skip to contentSkip to conversation

Updating tools

GIT PULL Erwan Velu 2 participants 3 messages Jul 30, 2013 – Jul 31, 2013 Kbuild

lore
Share & tools
lore

Erwan Velu

author
#0 lore raw

Hi Jens,

I've been pushing this branch featuring :
- installing fio2gnuplot (and .gpm files) & genfio during make install
- moving fio_generate_plot into tools/ for more coherency
- Adding a option to fio2gnuplot to render gnuplot is a separate dir

Thanks for watching ;o)

Erwan,

The following changes since commit bf974737b15bad8d740f10503e9eab6e0b420aa2:

Update sample atomic write job file (2013-07-26 13:11:52 -0600)

are available in the git repository at:

[email protected]:enovance/fio.git erwan/outputdir

for you to fetch changes up to 1cc6579e7dc114347467ed359f015943b83bb4e9:

fio2gnuplot: Using default install dir for gpm files (2013-07-30
14:07:14 +0200)

----------------------------------------------------------------
Erwan Velu (5):
fio2gnuplot: Option to select gnuplot's output dir
Makefile: Installing fio2gnuplot & sons
Makefile: Installing genfio at install time
Tree: Moving fio_generate_plots in tools/
fio2gnuplot: Using default install dir for gpm files

 Makefile                                           |  8 ++++++--
 fio_generate_plots => tools/fio_generate_plots     |  0
 fio_generate_plots.1 => tools/fio_generate_plots.1 |  0
 tools/plot/fio2gnuplot.py                          | 82 
++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------
 4 files changed, 56 insertions(+), 34 deletions(-)
 rename fio_generate_plots => tools/fio_generate_plots (100%)
 rename fio_generate_plots.1 => tools/fio_generate_plots.1 (100%)
Makefile +1 -2
index 3de9735..8494b27 100644
@@ -20,7 +20,7 @@ OPTFLAGS= -O3 -g -ffast-math
 CFLAGS    = -std=gnu99 -Wwrite-strings -Wall 
-Wdeclaration-after-statement $(OPTFLAGS) $(EXTFLAGS) $(BUILD_CFLAGS)
 LIBS    += -lm $(EXTLIBS)
 PROGS    = fio
-SCRIPTS = fio_generate_plots
+SCRIPTS = tools/fio_generate_plots tools/plot/fio2gnuplot.py tools/genfio
 
 ifdef CONFIG_GFIO

PROGS += gfio
@@ -189,8 +189,10 @@ bindir = $(prefix)/bin

ifeq ($(CONFIG_TARGET_OS), Darwin)
mandir = /usr/share/man
+sharedir = /usr/share/fio
else
mandir = $(prefix)/man
+sharedir = $(prefix)/share/fio
endif

all: $(PROGS) $(SCRIPTS) FORCE
@@ -278,4 +280,6 @@ install: $(PROGS) $(SCRIPTS) FORCE

     $(INSTALL) $(PROGS) $(SCRIPTS) $(DESTDIR)$(bindir)
     $(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man1
     $(INSTALL) -m 644 fio.1 $(DESTDIR)$(mandir)/man1
-    $(INSTALL) -m 644 fio_generate_plots.1 $(DESTDIR)$(mandir)/man1
+    $(INSTALL) -m 644 tools/fio_generate_plots.1 $(DESTDIR)$(mandir)/man1
+    $(INSTALL) -m 755 -d $(DESTDIR)$(sharedir)
+    $(INSTALL) -m 644 tools/plot/*gpm $(DESTDIR)$(sharedir)/
tools/fio_generate_plots renamed from fio_generate_plots +0 -0
similarity index 100%
rename from fio_generate_plots
rename to tools/fio_generate_plots
tools/fio_generate_plots.1 renamed from fio_generate_plots.1 +0 -0
similarity index 100%
rename from fio_generate_plots.1
rename to tools/fio_generate_plots.1
tools/plot/fio2gnuplot.py +29 -26

119 lines not on this page · raw message

before exiting'

     print '-o           or --outputfile <file> : The basename for 
gnuplot traces'
     print '                                       - Basename is set 
with the pattern if defined'
+    print '-d           or --outputdir <dir>   : The directory where gnuplot shall render files'
     print '-t           or --title <title>     : The title of the 
gnuplot traces'
     print '                                       - Title is set with 
the block size detected in fio traces'
     print '-G        or --Global <type>     : Search for <type> in 

.global files match by a pattern'
@@ -280,13 +284,21 @@ def main(argv):
pattern_set_by_user=False
title='No title'
gnuplot_output_filename='result'
+ gnuplot_output_dir='./'
+ gpm_dir="/usr/share/fio/"

     disk_perf=[]
     run_gnuplot=False
     parse_global=False
     global_search=''

+ if not os.path.isfile(gpm_dir+'math.gpm'):
+ gpm_dir="/usr/local/share/fio/"

+            if not os.path.isfile(gpm_dir+'math.gpm'):
+            print "Looks like fio didn't got installed properly as no gpm files found in '/usr/share/fio' or '/usr/local/share/fio'\n"
+            sys.exit(3)

+
try:
- opts, args = getopt.getopt(argv[1:],"ghbio:t:p:G:")
+ opts, args = getopt.getopt(argv[1:],"ghbio:d:t:p:G:")

     except getopt.GetoptError:
      print_help()
          sys.exit(2)
@@ -302,6 +314,12 @@ def main(argv):
      pattern=pattern.replace('\\','')
       elif opt in ("-o", "--outputfile"):
          gnuplot_output_filename=arg

+ elif opt in ("-d", "--outputdir"):
+ gnuplot_output_dir=arg
+ if not gnuplot_output_dir.endswith('/'):
+ gnuplot_output_dir=gnuplot_output_dir+'/'
+ if not os.path.exists(gnuplot_output_dir):
+ os.makedirs(gnuplot_output_dir)

       elif opt in ("-t", "--title"):
          title=arg
       elif opt in ("-g", "--gnuplot"):
@@ -352,14 +370,14 @@ def main(argv):
     if parse_global==True:
     parse_global_files(fio_data_file, global_search)
     else:
-        blk_size=compute_temp_file(fio_data_file,disk_perf)
+ blk_size=compute_temp_file(fio_data_file,disk_perf,gnuplot_output_dir)
         title="%s @ Blocksize = %dK" % (title,blk_size/1024)

- compute_aggregated_file(fio_data_file, gnuplot_output_filename)
- compute_math(fio_data_file,title,gnuplot_output_filename,mode,disk_perf)
- generate_gnuplot_script(fio_data_file,title,gnuplot_output_filename,mode,disk_perf)
+ compute_aggregated_file(fio_data_file, gnuplot_output_filename, gnuplot_output_dir)
+ compute_math(fio_data_file,title,gnuplot_output_filename,gnuplot_output_dir,mode,disk_perf,gpm_dir)
+ generate_gnuplot_script(fio_data_file,title,gnuplot_output_filename,gnuplot_output_dir,mode,disk_perf,gpm_dir)

         if (run_gnuplot==True):

- render_gnuplot()
+ render_gnuplot(gnuplot_output_dir)

# Cleaning temporary files
try:

author
#1 lore raw

Dear Jens,

I've been updating my branch to add a new feature and some visual improvements.

The main feature is if more than one file is matching the pattern, a new set of graphing is generated allowing traces comparaisons on the same graph as does fio_generate_plots

I've been adding sample files in the three moods (raw/smooth/trend) as an attachement.

That's a good addition to the existing plotting I did with fio2gnuplot. Cheers,
Erwan

The following changes since commit bf974737b15bad8d740f10503e9eab6e0b420aa2:

Update sample atomic write job file (2013-07-26 13:11:52 -0600)

are available in the git repository at:

[email protected]:enovance/fio.git erwan/outputdir

for you to fetch changes up to 428b4f6ba681dbb40c8e2213d0c6ae8f8049dcd5:

fio2gnuplot: Adding filename as title for 2D graphs (2013-07-31
12:32:40 +0200)

----------------------------------------------------------------
Erwan Velu (10):
fio2gnuplot: Option to select gnuplot's output dir
Makefile: Installing fio2gnuplot & sons
Makefile: Installing genfio at install time
Tree: Moving fio_generate_plots in tools/
fio2gnuplot: Using default install dir for gpm files
fio2gnuplot: Printing number of selected files
fio2gnuplot: Adding comparing 2D graphs
fio2gnuplot: Fixing help message
fio2gnuplot: Adding information steps
fio2gnuplot: Adding filename as title for 2D graphs

 Makefile                                           |   8 ++++--
 fio_generate_plots => tools/fio_generate_plots     |   0
 fio_generate_plots.1 => tools/fio_generate_plots.1 |   0
 tools/plot/fio2gnuplot.py                          | 159 
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------
 4 files changed, 129 insertions(+), 38 deletions(-)
 rename fio_generate_plots => tools/fio_generate_plots (100%)
 rename fio_generate_plots.1 => tools/fio_generate_plots.1 (100%)
Makefile +1 -2
index 3de9735..8494b27 100644
@@ -20,7 +20,7 @@ OPTFLAGS= -O3 -g -ffast-math
 CFLAGS    = -std=gnu99 -Wwrite-strings -Wall 
-Wdeclaration-after-statement $(OPTFLAGS) $(EXTFLAGS) $(BUILD_CFLAGS)
 LIBS    += -lm $(EXTLIBS)
 PROGS    = fio
-SCRIPTS = fio_generate_plots
+SCRIPTS = tools/fio_generate_plots tools/plot/fio2gnuplot.py tools/genfio
 
 ifdef CONFIG_GFIO

PROGS += gfio
@@ -189,8 +189,10 @@ bindir = $(prefix)/bin

ifeq ($(CONFIG_TARGET_OS), Darwin)
mandir = /usr/share/man
+sharedir = /usr/share/fio
else
mandir = $(prefix)/man
+sharedir = $(prefix)/share/fio
endif

all: $(PROGS) $(SCRIPTS) FORCE
@@ -278,4 +280,6 @@ install: $(PROGS) $(SCRIPTS) FORCE

     $(INSTALL) $(PROGS) $(SCRIPTS) $(DESTDIR)$(bindir)
     $(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man1
     $(INSTALL) -m 644 fio.1 $(DESTDIR)$(mandir)/man1
-    $(INSTALL) -m 644 fio_generate_plots.1 $(DESTDIR)$(mandir)/man1
+    $(INSTALL) -m 644 tools/fio_generate_plots.1 $(DESTDIR)$(mandir)/man1
+    $(INSTALL) -m 755 -d $(DESTDIR)$(sharedir)
+    $(INSTALL) -m 644 tools/plot/*gpm $(DESTDIR)$(sharedir)/
tools/fio_generate_plots renamed from fio_generate_plots +0 -0
similarity index 100%
rename from fio_generate_plots
rename to tools/fio_generate_plots
tools/fio_generate_plots.1 renamed from fio_generate_plots.1 +0 -0
similarity index 100%
rename from fio_generate_plots.1
rename to tools/fio_generate_plots.1
tools/plot/fio2gnuplot.py +98 -29

203 lines not on this page · raw message

to select fio input files'
@@ -268,6 +337,7 @@ def print_help():
print '-g or --gnuplot : Render gnuplot traces
before exiting'

     print '-o           or --outputfile <file> : The basename for 
gnuplot traces'
     print '                                       - Basename is set 
with the pattern if defined'
+    print '-d           or --outputdir <dir>   : The directory where gnuplot shall render files'
     print '-t           or --title <title>     : The title of the 
gnuplot traces'
     print '                                       - Title is set with 
the block size detected in fio traces'
     print '-G        or --Global <type>     : Search for <type> in 

.global files match by a pattern'
@@ -280,13 +350,21 @@ def main(argv):
pattern_set_by_user=False
title='No title'
gnuplot_output_filename='result'
+ gnuplot_output_dir='./'
+ gpm_dir="/usr/share/fio/"

     disk_perf=[]
     run_gnuplot=False
     parse_global=False
     global_search=''

+ if not os.path.isfile(gpm_dir+'math.gpm'):
+ gpm_dir="/usr/local/share/fio/"

+            if not os.path.isfile(gpm_dir+'math.gpm'):
+            print "Looks like fio didn't got installed properly as no gpm files found in '/usr/share/fio' or '/usr/local/share/fio'\n"
+            sys.exit(3)

+
try:
- opts, args = getopt.getopt(argv[1:],"ghbio:t:p:G:")
+ opts, args = getopt.getopt(argv[1:],"ghbio:d:t:p:G:")

     except getopt.GetoptError:
      print_help()
          sys.exit(2)
@@ -302,6 +380,12 @@ def main(argv):
      pattern=pattern.replace('\\','')
       elif opt in ("-o", "--outputfile"):
          gnuplot_output_filename=arg

+ elif opt in ("-d", "--outputdir"):
+ gnuplot_output_dir=arg
+ if not gnuplot_output_dir.endswith('/'):
+ gnuplot_output_dir=gnuplot_output_dir+'/'
+ if not os.path.exists(gnuplot_output_dir):
+ os.makedirs(gnuplot_output_dir)

       elif opt in ("-t", "--title"):
          title=arg
       elif opt in ("-g", "--gnuplot"):
@@ -322,10 +406,12 @@ def main(argv):
     if len(fio_data_file) == 0:
         print "No log file found with pattern %s!" % pattern
         sys.exit(1)

+ else:
+ print "%d files Selected with pattern '%s'" % (len(fio_data_file), pattern)

fio_data_file=sorted(fio_data_file, key=str.lower)
for file in fio_data_file:
- print 'Selected %s' % file
+ print ' |-> %s' % file
if "_bw.log" in file :
mode="Bandwidth (KB/sec)"
if "_iops.log" in file :
@@ -336,6 +422,7 @@ def main(argv):
if "IO" in mode:
title='IO benchmark with %d fio results' % len(fio_data_file)

+ print
#We need to adjust the output filename regarding the pattern
required by the user

     if (pattern_set_by_user == True):
         gnuplot_output_filename=pattern
@@ -352,14 +439,14 @@ def main(argv):
     if parse_global==True:
     parse_global_files(fio_data_file, global_search)
     else:
-        blk_size=compute_temp_file(fio_data_file,disk_perf)
+ blk_size=compute_temp_file(fio_data_file,disk_perf,gnuplot_output_dir)
         title="%s @ Blocksize = %dK" % (title,blk_size/1024)

- compute_aggregated_file(fio_data_file, gnuplot_output_filename)
- compute_math(fio_data_file,title,gnuplot_output_filename,mode,disk_perf)
- generate_gnuplot_script(fio_data_file,title,gnuplot_output_filename,mode,disk_perf)
+ compute_aggregated_file(fio_data_file, gnuplot_output_filename, gnuplot_output_dir)
+ compute_math(fio_data_file,title,gnuplot_output_filename,gnuplot_output_dir,mode,disk_perf,gpm_dir)
+ generate_gnuplot_script(fio_data_file,title,gnuplot_output_filename,gnuplot_output_dir,mode,disk_perf,gpm_dir)

         if (run_gnuplot==True):

- render_gnuplot()
+ render_gnuplot(fio_data_file, gnuplot_output_dir)

# Cleaning temporary files
try:

#2 lore raw
Quoted 11 lines · Erwan Velu

Dear Jens,

I've been updating my branch to add a new feature and some visual improvements.

The main feature is if more than one file is matching the pattern, a new set of graphing is generated allowing traces comparaisons on the same graph as does fio_generate_plots

I've been adding sample files in the three moods (raw/smooth/trend) as an attachement.

Looks good!

Quoted 4 lines

That's a good addition to the existing plotting I did with fio2gnuplot. Cheers,
Erwan

Quoted 8 lines

The following changes since commit
bf974737b15bad8d740f10503e9eab6e0b420aa2:

Update sample atomic write job file (2013-07-26 13:11:52 -0600)

are available in the git repository at:

[email protected]:enovance/fio.git erwan/outputdir

Thanks, pulled.

Signature · 1 line
Jens Axboe