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 23/27] ts-bench-hostcmp-host-reset: new script
Date: Wed, 10 Dec 2014 19:12:00 +0100	[thread overview]
Message-ID: <20141210181200.26400.71485.stgit@Abyss.station> (raw)
In-Reply-To: <20141210180651.26400.13356.stgit@Abyss.station>

From: Dario Faggioli <raistlin@linux.it>

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/Debian.pm      |   32 +++++++++++++++++---------------
 Osstest/TestSupport.pm |   46 +++++++++++++++++++++++++++++++++++++++++++++-
 ts-bench-hostcmp-post  |   39 +++++++++++++++++++++++++++++++++++++++
 ts-xen-install         |   38 ++------------------------------------
 4 files changed, 103 insertions(+), 52 deletions(-)
 create mode 100755 ts-bench-hostcmp-post

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index 418d9f2..447d2d2 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -87,25 +87,27 @@ sub debian_boot_setup ($$$$;$) {
     my $kern= $bootloader->{GetBootKern}();
     logm("dom0 kernel is $kern");
 
-    system "tar zvtf $distpath->{kern} boot/$kern";
-    $? and die "$distpath->{kern} boot/$kern $?";
-
-    my $kernver= $kern;
-    $kernver =~ s,^/?(?:boot/)?(?:vmlinu[xz]-)?,, or die "$kernver ?";
-    my $kernpath= $kern;
-    $kernpath =~ s,^(?:boot/)?,/boot/,;
-
-    target_cmd_root($ho,
-                    "update-initramfs -k $kernver -c ||".
-                    " update-initramfs -k $kernver -u",
-                    200);
+    if (defined $distpath) {
+        system "tar zvtf $distpath->{kern} boot/$kern";
+        $? and die "$distpath->{kern} boot/$kern $?";
+
+        my $kernver= $kern;
+        $kernver =~ s,^/?(?:boot/)?(?:vmlinu[xz]-)?,, or die "$kernver ?";
+        my $kernpath= $kern;
+        $kernpath =~ s,^(?:boot/)?,/boot/,;
+
+        target_cmd_root($ho,
+                        "update-initramfs -k $kernver -c ||".
+                        " update-initramfs -k $kernver -u",
+                        200);
+
+        store_runvar(target_var_prefix($ho).'xen_kernel_path',$kernpath);
+        store_runvar(target_var_prefix($ho).'xen_kernel_ver',$kernver);
+    }
 
     $bootloader->{PreFinalUpdate}();
 
     $bootloader->{UpdateConfig}($ho);
-
-    store_runvar(target_var_prefix($ho).'xen_kernel_path',$kernpath);
-    store_runvar(target_var_prefix($ho).'xen_kernel_ver',$kernver);
 }
 
 sub bl_getmenu_open ($$$) {
diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index 251668a..c967e4f 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -99,7 +99,7 @@ BEGIN {
                       guest_vncsnapshot_begin guest_vncsnapshot_stash
 		      guest_check_remus_ok guest_editconfig
                       host_involves_pcipassthrough host_get_pcipassthrough_devs
-                      toolstack guest_create
+                      toolstack guest_create host_bootxen_setup
 
                       await_webspace_fetch_byleaf create_webfile
                       file_link_contents get_timeout
@@ -1012,6 +1012,50 @@ sub get_host_memory ($) {
     return $mem;
 }
 
+#---------- bootloader and booting ----------
+#
+sub host_bootxen_setup ($) {
+    my ($ho)= @_;
+
+    my $xenhopt= "conswitch=x watchdog";
+
+    my $cons= get_host_property($ho, 'XenSerialConsole', 'com1');
+
+    if ( $cons eq "com1" ) {
+        $xenhopt .= " com1=$c{Baud},8n1 console=com1,vga gdb=com1";
+    } elsif ( $cons eq "dtuart" ) {
+        $xenhopt .= " console=dtuart";
+        my $dtuart= get_host_property($ho, 'XenDTUARTPath', undef);
+        $xenhopt .= " dtuart=$dtuart" if $dtuart;
+    } else {
+        logm("No Xen console device defined for host");
+    }
+    if (toolstack()->{Dom0MemFixed}) {
+        $xenhopt .= " dom0_mem=512M,max:512M";
+    }
+    my $append= $r{xen_boot_append};
+    $xenhopt .= " $append" if defined $append;
+    $append = get_host_property($ho, 'xen-commandline-append', undef);
+    $xenhopt .= " $append" if defined $append;
+
+    my @hooks;
+
+    if (host_involves_pcipassthrough($ho)) {
+        push @hooks, {
+            EditBootOptions => sub {
+                my ($ho,$hopt,$kopt) = @_;
+                $$hopt .= ' iommu=on';
+                my $hide= ' xen-pciback.hide='. join '',map { "($_->{Bdf})" }
+                    host_get_pcipassthrough_devs($ho);
+                logm("pci passthrough: hiding in dom0: $hide");
+                $$kopt .= $hide;
+            }
+        };
+    }
+
+    return ($xenhopt,@hooks);
+}
+
 #---------- stashed files ----------
 
 sub open_unique_stashfile ($) {
diff --git a/ts-bench-hostcmp-post b/ts-bench-hostcmp-post
new file mode 100755
index 0000000..26a67f4
--- /dev/null
+++ b/ts-bench-hostcmp-post
@@ -0,0 +1,39 @@
+#!/usr/bin/perl -w
+# This is part of "osstest", an automated testing framework for Xen.
+# Copyright (C) 2009-2014 Citrix Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+use strict qw(vars);
+use DBI;
+use Osstest;
+use Osstest::Debian;
+use Osstest::TestSupport;
+
+tsreadconfig();
+
+our ($whhost) = @ARGV;
+$whhost ||= 'host';
+our $ho= selecthost($whhost);
+
+sub resetboot () {
+  my ($xenhopt,@hooks)= host_bootxen_setup($ho);
+  my $want_kernver = get_runvar('kernel_ver',$r{'kernbuildjob'});
+
+  debian_boot_setup($ho, $want_kernver, $xenhopt, undef, \@hooks);
+
+  logm("host reset to booting Xen");
+}
+
+resetboot();
diff --git a/ts-xen-install b/ts-xen-install
index 4d34d1f..d8d38fc 100755
--- a/ts-xen-install
+++ b/ts-xen-install
@@ -134,43 +134,9 @@ sub adjustconfig () {
 }
 
 sub setupboot () {
-    my $xenhopt= "conswitch=x watchdog";
-
-    my $cons= get_host_property($ho, 'XenSerialConsole', 'com1');
-
-    if ( $cons eq "com1" ) {
-	$xenhopt .= " com1=$c{Baud},8n1 console=com1,vga gdb=com1";
-    } elsif ( $cons eq "dtuart" ) {
-	$xenhopt .= " console=dtuart";
-	my $dtuart= get_host_property($ho, 'XenDTUARTPath', undef);
-	$xenhopt .= " dtuart=$dtuart" if $dtuart;
-    } else {
-	logm("No Xen console device defined for host");
-    }
-    if (toolstack()->{Dom0MemFixed}) {
-        $xenhopt .= " dom0_mem=512M,max:512M";
-    }
-    my $append= $r{xen_boot_append};
-    $xenhopt .= " $append" if defined $append;
-    $append = get_host_property($ho, 'xen-commandline-append', undef);
-    $xenhopt .= " $append" if defined $append;
-
-    my @hooks;
-
-    if (host_involves_pcipassthrough($ho)) {
-        push @hooks, {
-            EditBootOptions => sub {
-                my ($ho,$hopt,$kopt) = @_;
-                $$hopt .= ' iommu=on';
-                my $hide= ' xen-pciback.hide='. join '',map { "($_->{Bdf})" }
-                    host_get_pcipassthrough_devs($ho);
-                logm("pci passthrough: hiding in dom0: $hide");
-                $$kopt .= $hide;
-            }
-        };
-    }
-
+    my ($xenhopt,@hooks)= host_bootxen_setup($ho);
     my $want_kernver = get_runvar('kernel_ver',$r{'kernbuildjob'});
+
     debian_boot_setup($ho, $want_kernver, $xenhopt, \%distpath, \@hooks);
 
     logm("ready to boot Xen");

  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 ` Dario Faggioli [this message]
2014-12-11 13:20   ` [PATCH 23/27] ts-bench-hostcmp-host-reset: " 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 ` [PATCH 25/27] ts-bench-hostcmp-post: add plotting facilities Dario Faggioli
2014-12-10 18:12 ` [PATCH 26/27] Kernbench perf comparison between host and guest 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=20141210181200.26400.71485.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.