#!/usr/bin/perl -w
-# Report generation for plot-sgpdd
-# ================================
-# The plot-sgpdd script is used to generate csv file and
+# Report generation for iokit-plot-sgpdd
+# ======================================
+# The iokit-plot-sgpdd script is used to generate csv file and
# instructions files for gnuplot from the output of sgpdd-survey script.
#
-# The plot-sgpdd also creates .scr file that contains instructions
+# iokit-plot-sgpdd 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:
# $ sgpdd-survey > log_filename
-# $ plot-sgpdd <log_filename>
+# $ iokit-plot-sgpdd <log_filename>
# [Note: 1. This script may need modifications whenever there will be
# modifications in output format of sgpdd-survey script.
# 2. Gnuplot version 4.0 or above is required.]
-sub usage()
+sub usage()
{
print STDERR "Usage: $0 [options] <log_filename>\n";
print STDERR " $0 parses and plots graphs from the output of sgpdd-survey\n";
# check whether gnuplot supports png
$pngsupport = "ldd `which gnuplot` | grep -q libpng";
-system ("$pngsupport") == 0 or die "gnuplot installed does not support png.
- Please install gnuplot to support png and try again.\n";
+system ("$pngsupport") == 0 or die "gnuplot installed does not support PNG.
+ Please install gnuplot to support PNG and try again.\n";
my @GraphTitle;
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 ($opt_rdtitle || $opt_wrtitle) {
if ($op eq "rd") {
print SCRFILE "set title \"@GraphTitle\\n$rwlabel, " .
print SCRFILE "set logscale x\n";
print SCRFILE "set grid\n";
print SCRFILE "set key right bottom\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_y != 0) {
print SCRFILE "set yrange [ 0:$opt_y ]\n";
} else {
@operations = ();
# Command line parameter parsing
use Getopt::Long;
-GetOptions ('help' => \$opt_help, 'rt=s' => \$opt_rdtitle, 'wt=s' => \$opt_wrtitle, 'y=i' => \$opt_y) or usage();
+GetOptions ('help' => \$opt_help, 'rt=s' => \$opt_rdtitle, 'wt=s' => \$opt_wrtitle, 'y=i' => \$opt_y) or usage();
if ($opt_help) {
usage();
}