From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: [PATCH 25/27] ts-bench-hostcmp-post: add plotting facilities Date: Wed, 10 Dec 2014 19:12:16 +0100 Message-ID: <20141210181216.26400.96.stgit@Abyss.station> References: <20141210180651.26400.13356.stgit@Abyss.station> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20141210180651.26400.13356.stgit@Abyss.station> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: Ian Jackson , Wei Liu , Ian Campbell List-Id: xen-devel@lists.xenproject.org From: Dario Faggioli in order to have an additional graph, comparing host and guests performance when running unixbench. Signed-off-by: Dario Faggioli Cc: Wei Liu Cc: Ian Campbell Cc: Ian Jackson --- 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 < $pfile.gp" or die "$!"; + print $h < +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= ; + 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();