Whamcloud - gitweb
LU-3962 utils: improve names of iokit tools
[fs/lustre-release.git] / lustre-iokit / obdfilter-survey / iokit-plot-obdfilter
 #
 # Author: Jitendra Pawar <jitendra@clusterfs.com>
 
-# Report generation for plot-obdfilter
+# Report generation for iokit-plot-obdfilter
 # ====================================
-#        The plot-obdfilter script is used to generate csv file and
+# The iokit-plot-obdfilter script is used to generate csv file and
 # instructions files for gnuplot from the output of obdfilter-survey script.
 #
-#        The plot-obdfilter also creates .scr file that contains instructions
+# The iokit-plot-obdfilter also creates .scr file that contains instructions
 # for gnuplot to plot the graph. After generating .dat and .scr files this
 # script invokes gnuplot to display graph.
 #
 # Syntax:
 # $ obdfilter-survey > log_filename
-# $ plot-obdfilter <log_filename>
+# $ iokit-plot-obdfilter <log_filename>
 # [Note: 1. Please use the .summary file generated by obdfilter-survey as log_file.
 #           It is generally available at /tmp/obdfilter_survey_<date_time_system>.summary
 #        2. This script may need modifications whenever there will be
@@ -76,7 +76,7 @@ sub write_scr_file() {
        my $rwlabel = $_[1];
        print "generating plot $file-$rsz-$op.png\n";
        open ( SCRFILE, "> $file-$rsz-$op.scr" ) or die "Can't open scr file for writing";
-       
+
        if ($subtitle) {
                print SCRFILE "set title \"@GraphTitle\\n$rwlabel, Rsize = $rsz KBytes, $subtitle\"\n";
        } else {
@@ -86,11 +86,11 @@ sub write_scr_file() {
        print SCRFILE "set ylabel \"Speeds(MB/s)\"\n";
        print SCRFILE "set logscale x\n";
        print SCRFILE "set grid\n";
-        print SCRFILE "set terminal png\n";
-        print SCRFILE "set output \"/dev/null\"\n";
+       print SCRFILE "set terminal png\n";
+       print SCRFILE "set output \"/dev/null\"\n";
        if ($opt_y0 != -9999) {
                print SCRFILE "set yrange [ $opt_y0: ]\n";
-       } 
+       }
        my $plot = "plot";
        $i = 2;
        $xrange = 1;
@@ -153,7 +153,7 @@ sub write_dat_file() {
                                        } else {
                                                printf DATAFILE "%-10s", "-";
                                        }
-                       } 
+                       }
                }
        }
        close DATAFILE;
@@ -199,7 +199,7 @@ $cnt = 0;
 $graphgen = 0;
 # Command line parameter parsing
 use Getopt::Long;
-GetOptions ('help' => \$opt_help, 'st=s' => \$subtitle, 'y0=i' => \$opt_y0) or usage(); 
+GetOptions ('help' => \$opt_help, 'st=s' => \$subtitle, 'y0=i' => \$opt_y0) or usage();
 if ($opt_help) {
        usage();
 }
@@ -215,8 +215,8 @@ LABEL: while ( <PFILE> ) {
        $linelen = @line;
        if ($linelen > 26 || $linelen < 11) {
                print "invalid file format at line $count\n";
-               exit 1; 
-       } 
+               exit 1;
+       }
        if (!$rsz && $line[5]) {
                $cnt = 0;
                $rsz = $line[5];
@@ -226,7 +226,7 @@ LABEL: while ( <PFILE> ) {
                        if ($line[$i]) {
                                $operations[$cnt] = $line[$i];
                                $cnt++;
-                       }               
+                       }
                }
        }
        if ($rsz ne $line[5]) {
@@ -234,13 +234,13 @@ LABEL: while ( <PFILE> ) {
                $rsz = $line[5];
                $first_obj = $line[7];
                $first_thread = $line[9];
-               @operations = ();                       
+               @operations = ();
                $cnt = 0;
                for ($i = 10; $i <= $linelen; $i = $i + 5) {
                        if ($line[$i]) {
                                $operations[$cnt] = $line[$i];
                                $cnt++;
-                       }               
+                       }
                }
                $obj = 0;
                $thread = 0;
@@ -257,7 +257,7 @@ LABEL: while ( <PFILE> ) {
                        $arwr{$line[9]}{$line[7]} = $line[$i * 5 + 11];
                } elsif ($operations[$i] eq "rewrite_again") {
                        $arwa{$line[9]}{$line[7]} = $line[$i * 5 + 11];
-               }       
+               }
        }
        if ( $obj < $line[9] ) {
                $obj = $line[9];