All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dario Faggioli <dario.faggioli@citrix.com>
To: xen-devel@lists.xen.org
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Wei Liu <wei.liu2@citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: [PATCH 25/27] ts-bench-hostcmp-post: add plotting facilities
Date: Wed, 10 Dec 2014 19:12:16 +0100	[thread overview]
Message-ID: <20141210181216.26400.96.stgit@Abyss.station> (raw)
In-Reply-To: <20141210180651.26400.13356.stgit@Abyss.station>

From: Dario Faggioli <raistlin@linux.it>

in order to have an additional graph, comparing host and
guests performance when running unixbench.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Cc: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 Osstest/Benchmarking.pm |   22 ++++++++++++++++------
 sg-run-job              |    2 +-
 ts-bench-hostcmp-post   |   43 ++++++++++++++++++++++++++++++++++++++++++-
 ts-unixbench-reslts     |    6 +++---
 4 files changed, 62 insertions(+), 11 deletions(-)

diff --git a/Osstest/Benchmarking.pm b/Osstest/Benchmarking.pm
index ff45766..301af08 100644
--- a/Osstest/Benchmarking.pm
+++ b/Osstest/Benchmarking.pm
@@ -96,21 +96,31 @@ set boxwidth 1 absolute
 EOF
 
 sub unixbench_plot_results ($$$) {
-  my ($dataf,$num_cols,$pfile)= @_;
-  my $h= new IO::File "> $pfile.gp" or die "$!";
+  my ($dfiles,$num_cols,$pfile)= @_;
+  my $f= keys @$dfiles;
+  my $s= join(' ',@$dfiles);
 
-  printf $h <<EOF;
+  my $h= new IO::File "> $pfile.gp" or die "$!";
+  print $h <<EOF;
 set terminal png enhanced font "/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf" 8 size 800,600
 set output '$pfile.png'
 set title 'Unixbench INDEXes for $flight.$job'
 $common_plot_opts
 set bmargin 13
 set rmargin 14
+NDATA=$num_cols
+NHOSTS=$f
 SKIP_COL=1
-NCOL=$num_cols
+NCOL=1*(NHOSTS*NDATA)
 HWIDTH=1.0/(NCOL+1.0)
-plot for [c=SKIP_COL+1:SKIP_COL+NCOL] '$dataf' using c:xtic(1) with histograms title columnhead, \\
-        for [c=SKIP_COL+1:SKIP_COL+NCOL]'' every ::1 using 0:c:c with labels notitle offset first -HWIDTH*(NCOL/2.0)+HWIDTH/2.0+(c-(SKIP_COL+1))*HWIDTH, character 2 rotate by 90
+cols=''
+do for [h=0:NHOSTS-1] {
+        do for [c=1+h*(NDATA+SKIP_COL)+SKIP_COL:1+h*(NDATA+SKIP_COL)+SKIP_COL+NDATA-1] {
+          cols = cols . sprintf("\%d ", c);
+        }
+}
+plot for [c in cols] '< paste $s' using int(c):xtic(1) with histograms title columnhead, \\
+        for [i=1:words(cols)] '' every ::1 using 0:int(word(cols,i)):int(word(cols,i)) with labels notitle offset first -HWIDTH*(NCOL/2.0)+HWIDTH/2.0+(i-1)*HWIDTH, character 2 rotate by 90
 EOF
   close($h);
 
diff --git a/sg-run-job b/sg-run-job
index 5954032..b16584a 100755
--- a/sg-run-job
+++ b/sg-run-job
@@ -406,7 +406,7 @@ proc run-job/bench-hostcmp-unixbench {} {
     run-ts . = ts-bench-hostcmp-host-prep
     run-ts . = ts-host-reboot
     bench-unixbench-host
-    run-ts . = ts-bench-hostcmp-post
+    run-ts . = ts-bench-hostcmp-post       + host unixbench
     run-ts . = ts-host-reboot
 }
 
diff --git a/ts-bench-hostcmp-post b/ts-bench-hostcmp-post
index 26a67f4..383bac0 100755
--- a/ts-bench-hostcmp-post
+++ b/ts-bench-hostcmp-post
@@ -20,13 +20,53 @@ use DBI;
 use Osstest;
 use Osstest::Debian;
 use Osstest::TestSupport;
+use Osstest::Benchmarking;
+use IO::File;
 
 tsreadconfig();
 
-our ($whhost) = @ARGV;
+# what we expect as argument list is:
+#  host=<somehost> <somebench>
+our $whhost= $ARGV[0];
+our $bn= $ARGV[1];
+
+#our ($whhost,$gn,$bn) = @ARGV;
 $whhost ||= 'host';
 our $ho= selecthost($whhost);
 
+sub plot_hostcmp () {
+  opendir my $dir, "$stash" or die "$!";
+
+  my @dfiles = grep(/.*-DATA$/,readdir($dir));
+  closedir($dir);
+
+  # Mangle the data file a bit, so each data set is marked
+  # with the name of the box (either host or a VM) where
+  # the bench did run.
+  my ($fhi,$fho,$ncols);
+  foreach my $i (0 .. $#dfiles) {
+    $_= $dfiles[$i];
+    my $host= m/(\w*)(\.|--).*/;$host= $1;
+    $dfiles[$i]= "$stash/$dfiles[$i]";
+
+    open FH, "<", "$dfiles[$i]" or die "!";
+    my @lines= <FH>;
+    close FH;
+
+    open FH, ">", "$dfiles[$i]" or die "!";
+    foreach my $line (@lines) {
+      if ($line eq $lines[0]) {
+        $line =~ s/"([^"]*\w*[^"]*)"/"$host $1"/g if $line !~ "$host";
+      }
+      print FH $line;
+      # Figure out the number of data columns, for plotting
+      $ncols= () = $line =~ /(\d+\.\d+)/g;
+    }
+    close FH;
+  }
+  unixbench_plot_results(\@dfiles,$ncols,"$stash/$job-PLOT") if $bn eq "unixbench";
+}
+
 sub resetboot () {
   my ($xenhopt,@hooks)= host_bootxen_setup($ho);
   my $want_kernver = get_runvar('kernel_ver',$r{'kernbuildjob'});
@@ -36,4 +76,5 @@ sub resetboot () {
   logm("host reset to booting Xen");
 }
 
+plot_hostcmp();
 resetboot();
diff --git a/ts-unixbench-reslts b/ts-unixbench-reslts
index b480d15..6c3e0a3 100755
--- a/ts-unixbench-reslts
+++ b/ts-unixbench-reslts
@@ -69,15 +69,15 @@ END
 
 sub process () {
   my $resf= "$stash/$gho->{Name}--$lresfile";
-  my $dataf= "$resf-DATA";
+  my @dataf= "$resf-DATA";
   my $plotf= "$resf-PLOT";
 
   unixbench_process_results(\$results,$resf);
-  unixbench_print_results($results,$dataf);
+  unixbench_print_results($results,$dataf[0]);
 
   # For plotting we need to know the number of data columns
   my $ncols= keys $results->{'Double-Precision Whetstone'}{Index};
-  unixbench_plot_results($dataf,$ncols,$plotf);
+  unixbench_plot_results(\@dataf,$ncols,$plotf);
 }
 
 fetch();

  parent reply	other threads:[~2014-12-10 18:12 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-10 18:08 [PATCH 00/27] Running benchmarks via OSSTest Dario Faggioli
2014-12-10 18:09 ` [PATCH 01/27] ts-devbian-hvm-install: prune "cdrom:" from install sources Dario Faggioli
2014-12-10 18:09 ` [PATCH 02/27] Osstest/Debian.pm: fix identifying a Linux baremetal grub2 entry Dario Faggioli
2014-12-10 18:09 ` [PATCH 03/27] Guest setup: allow the amount of RAM to be a runvar Dario Faggioli
2014-12-11 12:05   ` Wei Liu
2014-12-11 12:57     ` Dario Faggioli
2014-12-11 13:06       ` Wei Liu
2014-12-10 18:09 ` [PATCH 04/27] Osstest/TestSupport.pm: Introduce target_getfile_[root_]stash() Dario Faggioli
2014-12-10 18:09 ` [PATCH 05/27] mg-unixbench-download: new script for downloading the unixbench archive Dario Faggioli
2014-12-10 18:09 ` [PATCH 06/27] ts-unixbench-build: prep the environment for running unixbench Dario Faggioli
2014-12-10 18:09 ` [PATCH 07/27] ts-unixbench-run: kick off the benchmark on the target Dario Faggioli
2014-12-10 18:09 ` [PATCH 08/27] ts-unixbench-reslts: for retrieving the results Dario Faggioli
2014-12-11 12:09   ` Wei Liu
2014-12-11 12:59     ` Dario Faggioli
2014-12-10 18:10 ` [PATCH 09/27] ts-unixbench-reslts: process and plot bench results Dario Faggioli
2014-12-11 12:15   ` Wei Liu
2014-12-11 13:11     ` Dario Faggioli
2014-12-11 13:16       ` Wei Liu
2014-12-10 18:10 ` [PATCH 10/27] sg-run-job: recipes for the unixbench jobs Dario Faggioli
2014-12-10 18:10 ` [PATCH 11/27] make-bench-flight: to create a benchmarking flight Dario Faggioli
2014-12-10 18:10 ` [PATCH 12/27] standalone-reset: introduce a new -t option Dario Faggioli
2014-12-10 18:10 ` [PATCH 13/27] mg-kernbench-download: new script for downloading kernbench Dario Faggioli
2014-12-10 18:10 ` [PATCH 14/27] ts-kernbench-build: prep the environment for running kernbench Dario Faggioli
2014-12-10 18:10 ` [PATCH 15/27] ts-kernbench-run: kick off the benchmark on the target Dario Faggioli
2014-12-10 18:11 ` [PATCH 16/27] ts-unixbench-reslts: retrieve and stash kernbench results Dario Faggioli
2014-12-10 18:11 ` [PATCH 17/27] ts-kernbench-reslts: process and plot bench results Dario Faggioli
2014-12-11 13:19   ` Dario Faggioli
2014-12-10 18:11 ` [PATCH 18/27] sg-run-job: recipes for the kernbench jobs Dario Faggioli
2014-12-10 18:11 ` [PATCH 19/27] make-bench-flight: create " Dario Faggioli
2014-12-10 18:11 ` [PATCH 20/27] Osstest/TestSupport.pm: read hosts' hardware characteristics Dario Faggioli
2014-12-10 18:11 ` [PATCH 21/27] ts-bench-hostcmp-guest-prep: new script Dario Faggioli
2014-12-10 18:11 ` [PATCH 22/27] ts-bench-hostcmp-host-prep: " Dario Faggioli
2014-12-11 12:32   ` Wei Liu
2014-12-11 13:23     ` Dario Faggioli
2014-12-10 18:12 ` [PATCH 23/27] ts-bench-hostcmp-host-reset: " Dario Faggioli
2014-12-11 13:20   ` Dario Faggioli
2014-12-10 18:12 ` [PATCH 24/27] Recipes and jobs for running unixbench both on host and guest Dario Faggioli
2014-12-10 18:12 ` Dario Faggioli [this message]
2014-12-10 18:12 ` [PATCH 26/27] Kernbench perf comparison between " Dario Faggioli
2014-12-10 18:12 ` [PATCH 27/27] ts-bench-hostcmp-post: add plotting facilities Dario Faggioli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141210181216.26400.96.stgit@Abyss.station \
    --to=dario.faggioli@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.