3 # Copyright Martin J. Bligh (mbligh@mbligh.org), 2006
5 ($file, $y_label, $columns, $title) = @ARGV;
8 die unless ($columns =~ /^1:\d+/);
10 # print " ++++++ plotgraph $file\n";
11 plotgraph
($file, $y_label, $columns, $title);
12 # print " ++++++ plotgraph\n";
14 # First column must be kernel count, second kernel version, third is job number
15 # $columns spec is 1:y-value:y-stddev
17 my ($file, $y_label, $columns, $title) = @_;
25 open (DATA_MAIN
, "> ${file}.main");
26 open (DATA_MM
, "> ${file}.mm");
27 open (DATA_OTHER
, "> ${file}.other");
29 while ($data = <INDATA
>) {
31 ($count, my $version, my $job) = split (/\s+/, $data);
32 $short_ver = $version;
33 $short_ver =~ s/\+.*/+p$job/;
34 push @xtics, "\"$short_ver\" $count";
35 if ($version =~ /^2\.\d+\.\d+(\.\d+|-rc\d+)?(-git\d+)?$/) {
36 print DATA_MAIN
"$data\n";
37 $plot_main = "\"${file}.main\" using $columns title \"mainline\"";
38 } elsif ($version =~ /^2\.\d+\.\d+(-rc\d+)?-mm\d+$/) {
39 print DATA_MM
"$data\n";
40 $plot_mm = "\"${file}.mm\" using $columns title \"-mm\"";
42 print DATA_OTHER
"$data\n";
43 $plot_other = "\"${file}.other\" using $columns title \"other\"";
51 die unless ($count > 0);
54 push @plots, $plot_main if ($plot_main);
55 push @plots, $plot_mm if ($plot_mm);
56 push @plots, $plot_other if ($plot_other);
57 $plots = join (',', @plots);
59 open (GNUPLOT
, "> ${file}.gnuplot");
60 # print "MACHINE: $machine\n";
61 print GNUPLOT
"set terminal png size $x_res,$y_res\n";
62 print GNUPLOT
"set key below\n";
63 print GNUPLOT
"set title \"$title\"\n";
64 print GNUPLOT
"set xlabel \"Kernel\"\n";
65 print GNUPLOT
"set ylabel \"${y_label}\"\n";
66 print GNUPLOT
"set output \"${file}.png\"\n";
67 print GNUPLOT
"set style data yerrorlines\n";
68 print GNUPLOT
"set grid\n";
69 $xtics = join ',', @xtics;
70 print GNUPLOT
"\nset xtics rotate (${xtics})\n\n";
71 print GNUPLOT
"plot $plots\n";
72 print GNUPLOT
"replot";
74 `/usr/bin/gnuplot ${file}.gnuplot`;
75 `chmod 644 ${file}.gnuplot`;
76 `chmod 644 ${file}.png`;