* [OSSTEST PATCH 0/4] Fix use of xenctx
@ 2015-07-02 17:11 Ian Jackson
2015-07-02 17:11 ` [OSSTEST PATCH 1/4] guest_find_domid: Set Vcpus correctly Ian Jackson
` (3 more replies)
0 siblings, 4 replies; 19+ messages in thread
From: Ian Jackson @ 2015-07-02 17:11 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Campbell
I discovered that xenctx was not being run any more. These 4 patches
fix it, and also arrange to run it sooner.
Ian.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [OSSTEST PATCH 1/4] guest_find_domid: Set Vcpus correctly.
2015-07-02 17:11 [OSSTEST PATCH 0/4] Fix use of xenctx Ian Jackson
@ 2015-07-02 17:11 ` Ian Jackson
2015-07-03 8:52 ` Ian Campbell
2015-07-02 17:11 ` [OSSTEST PATCH 2/4] ts-logs-capture: Find xenctx in /usr/local as well Ian Jackson
` (2 subsequent siblings)
3 siblings, 1 reply; 19+ messages in thread
From: Ian Jackson @ 2015-07-02 17:11 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Jackson, Ian Campbell
The regexp was wrong, resulting in the last digit of the memory being
mistaken for the number of vcpus (!)
The only consumer of this is ts-logs-capture.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
Osstest/TestSupport.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index b5994a4..66dc218 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -1918,7 +1918,7 @@ sub guest_find_domid ($$) {
return if defined $gho->{Domid};
my $list= target_cmd_output_root($ho,
common_toolstack($ho)." list $gho->{Name}");
- $list =~ m/^(?!Name\s)(\S+)\s+(\d+)\s+(\d+)+(\d+)\s.*$/m
+ $list =~ m/^(?!Name\s)(\S+)\s+(\d+)\s+(\d+)\s+(\d+)\s.*$/m
or die "domain list: $list";
$1 eq $gho->{Name} or die "domain list name $1 expected $gho->{Name}";
$gho->{MemUsed}= $3;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [OSSTEST PATCH 2/4] ts-logs-capture: Find xenctx in /usr/local as well
2015-07-02 17:11 [OSSTEST PATCH 0/4] Fix use of xenctx Ian Jackson
2015-07-02 17:11 ` [OSSTEST PATCH 1/4] guest_find_domid: Set Vcpus correctly Ian Jackson
@ 2015-07-02 17:11 ` Ian Jackson
2015-07-03 8:52 ` Ian Campbell
2015-07-02 17:11 ` [OSSTEST PATCH 3/4] ts-logs-capture: Break out guest listing and do it earlier Ian Jackson
2015-07-02 17:11 ` [OSSTEST PATCH 4/4] ts-logs-capture: Run xenctx earlier Ian Jackson
3 siblings, 1 reply; 19+ messages in thread
From: Ian Jackson @ 2015-07-02 17:11 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Jackson, Ian Campbell
xenctx is now in /usr/local/lib/xen/bin/xenctx.
^^^^^^
Find it by setting PATH in the shell command.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
ts-logs-capture | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/ts-logs-capture b/ts-logs-capture
index 2498416..13795e8 100755
--- a/ts-logs-capture
+++ b/ts-logs-capture
@@ -210,8 +210,10 @@ sub fetch_logs_guest ($) {
my $sysmaparg = !defined $kernpath ? '' :
$kernpath !~ m,/vmlinuz-, ? die "$kernpath ?" :
"-s $`/System.map-$'";
- try_cmd_output_save("/usr/lib/xen/bin/xenctx ".$sysmaparg.
- " $gho->{Domid} $vcpu");
+ try_cmd_output_save(
+ 'PATH=/usr/local/lib/xen/bin:/usr/lib/xen/bin:$PATH; '.
+ "xenctx $sysmaparg $gho->{Domid} $vcpu"
+ );
}
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [OSSTEST PATCH 3/4] ts-logs-capture: Break out guest listing and do it earlier
2015-07-02 17:11 [OSSTEST PATCH 0/4] Fix use of xenctx Ian Jackson
2015-07-02 17:11 ` [OSSTEST PATCH 1/4] guest_find_domid: Set Vcpus correctly Ian Jackson
2015-07-02 17:11 ` [OSSTEST PATCH 2/4] ts-logs-capture: Find xenctx in /usr/local as well Ian Jackson
@ 2015-07-02 17:11 ` Ian Jackson
2015-07-03 8:54 ` Ian Campbell
2015-07-02 17:11 ` [OSSTEST PATCH 4/4] ts-logs-capture: Run xenctx earlier Ian Jackson
3 siblings, 1 reply; 19+ messages in thread
From: Ian Jackson @ 2015-07-02 17:11 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Jackson, Ian Campbell
Break out the function find_guests from what was
fetch_logs_host_guests, and have it save its results in the @guests
global.
We do this soon because in the next patch we are going to want to
do something to each guest before we call serial_fetch_logs.
The loop containing fetch_logs_guest is now in the main program.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
ts-logs-capture | 60 ++++++++++++++++++++++++++++++++-----------------------
1 file changed, 35 insertions(+), 25 deletions(-)
diff --git a/ts-logs-capture b/ts-logs-capture
index 13795e8..7127675 100755
--- a/ts-logs-capture
+++ b/ts-logs-capture
@@ -33,6 +33,34 @@ our ($whhost) = @ARGV;
$whhost ||= 'host';
our $ho= selecthost($whhost);
+our @guests;
+
+sub find_guests () {
+ my $sth= $dbh_tests->prepare(<<END);
+ SELECT name FROM runvars WHERE flight=? AND job=?
+ AND name LIKE '%_domname'
+ ORDER BY name
+END
+ $sth->execute($flight, $job);
+ my $row;
+ while ($row= $sth->fetchrow_hashref) {
+ my $gn= $row->{name};
+ $gn =~ s/_domname$//;
+
+ my $gho= selectguest($gn,$ho);
+ if (!eval {
+ guest_find_domid($ho,$gho);
+ 1;
+ }) {
+ logm("cannot find domid: $@");;
+ next;
+ }
+
+ push @guests, $gho;
+ }
+ $sth->finish();
+}
+
sub try_fetch_logs ($$) {
my ($lho, $logfilepats) = @_;
my $ok= 0;
@@ -97,7 +125,7 @@ sub try_cmd_output_save ($;$) {
close $fh or die $!;
}
-sub fetch_logs_host_guests () {
+sub fetch_logs_host () {
my $logs= [qw(
/var/log/kern.log*
/var/log/syslog*
@@ -173,33 +201,13 @@ sub fetch_logs_host_guests () {
) {
try_cmd_output_save($cmd);
}
-
- my $sth= $dbh_tests->prepare(<<END);
- SELECT name FROM runvars WHERE flight=? AND job=?
- AND name LIKE '%_domname'
- ORDER BY name
-END
- $sth->execute($flight, $job);
- my $row;
- while ($row= $sth->fetchrow_hashref) {
- my $gn= $row->{name};
- $gn =~ s/_domname$//;
- fetch_logs_guest($gn);
- }
- $sth->finish();
}
sub fetch_logs_guest ($) {
- my ($gn) = @_;
+ my ($gho) = @_;
+ my $gn = $gho->{Name};
logm("saving logs for $gn");
- my $gho= selectguest($gn,$ho);
- if (!eval {
- guest_find_domid($ho,$gho);
- 1;
- }) {
- logm("cannot find domid: $@");
- return;
- }
+
my $consolecmd= toolstack($ho)->consolecmd($gho);
try_cmd_output_save("sleep 1 | $consolecmd | cat",
"guest-$gho->{Name}-console");
@@ -226,6 +234,8 @@ sub fetch_logs_guest ($) {
}
}
+find_guests();
serial_fetch_logs($ho);
-fetch_logs_host_guests();
+fetch_logs_host();
+fetch_logs_guest($_) foreach @guests;
logm("logs captured to $stash");
--
1.7.10.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [OSSTEST PATCH 4/4] ts-logs-capture: Run xenctx earlier
2015-07-02 17:11 [OSSTEST PATCH 0/4] Fix use of xenctx Ian Jackson
` (2 preceding siblings ...)
2015-07-02 17:11 ` [OSSTEST PATCH 3/4] ts-logs-capture: Break out guest listing and do it earlier Ian Jackson
@ 2015-07-02 17:11 ` Ian Jackson
2015-07-03 8:55 ` Ian Campbell
3 siblings, 1 reply; 19+ messages in thread
From: Ian Jackson @ 2015-07-02 17:11 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Jackson, Ian Campbell
Break fetch_xenctx_guest out into its own function, and run it before
serial_fetch_logs.
This is relevant because serial_fetch_logs sends the Xen debug keys,
which might dislodge a stuck guest - and, if it does, we would like to
have captured the stuck state with xenctx, rather than the unstuck
one.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
ts-logs-capture | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/ts-logs-capture b/ts-logs-capture
index 7127675..04cb2fd 100755
--- a/ts-logs-capture
+++ b/ts-logs-capture
@@ -203,14 +203,9 @@ sub fetch_logs_host () {
}
}
-sub fetch_logs_guest ($) {
+sub fetch_xenctx_guest ($) {
my ($gho) = @_;
- my $gn = $gho->{Name};
- logm("saving logs for $gn");
-
- my $consolecmd= toolstack($ho)->consolecmd($gho);
- try_cmd_output_save("sleep 1 | $consolecmd | cat",
- "guest-$gho->{Name}-console");
+ logm("collecting xenctx for $gho->{Name}");
if (defined $gho->{Vcpus}) {
foreach (my $vcpu=0; $vcpu < $gho->{Vcpus}; $vcpu++) {
@@ -224,6 +219,16 @@ sub fetch_logs_guest ($) {
);
}
}
+}
+
+sub fetch_logs_guest ($) {
+ my ($gho) = @_;
+ my $gn = $gho->{Name};
+ logm("saving logs for $gn");
+
+ my $consolecmd= toolstack($ho)->consolecmd($gho);
+ try_cmd_output_save("sleep 1 | $consolecmd | cat",
+ "guest-$gho->{Name}-console");
if (!eval {
my $vnc= guest_vncsnapshot_begin($ho,$gho);
@@ -235,6 +240,7 @@ sub fetch_logs_guest ($) {
}
find_guests();
+fetch_xenctx_guest($_) foreach @guests;
serial_fetch_logs($ho);
fetch_logs_host();
fetch_logs_guest($_) foreach @guests;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [OSSTEST PATCH 1/4] guest_find_domid: Set Vcpus correctly.
2015-07-02 17:11 ` [OSSTEST PATCH 1/4] guest_find_domid: Set Vcpus correctly Ian Jackson
@ 2015-07-03 8:52 ` Ian Campbell
0 siblings, 0 replies; 19+ messages in thread
From: Ian Campbell @ 2015-07-03 8:52 UTC (permalink / raw)
To: Ian Jackson; +Cc: xen-devel
On Thu, 2015-07-02 at 18:11 +0100, Ian Jackson wrote:
> The regexp was wrong, resulting in the last digit of the memory being
> mistaken for the number of vcpus (!)
>
> The only consumer of this is ts-logs-capture.
>
> Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Perhaps at some point in the future once xm is off the test radar we
could consider using xl list --format=json (nb, I didn't check the
concrete syntax) and using that.
> ---
> Osstest/TestSupport.pm | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
> index b5994a4..66dc218 100644
> --- a/Osstest/TestSupport.pm
> +++ b/Osstest/TestSupport.pm
> @@ -1918,7 +1918,7 @@ sub guest_find_domid ($$) {
> return if defined $gho->{Domid};
> my $list= target_cmd_output_root($ho,
> common_toolstack($ho)." list $gho->{Name}");
> - $list =~ m/^(?!Name\s)(\S+)\s+(\d+)\s+(\d+)+(\d+)\s.*$/m
> + $list =~ m/^(?!Name\s)(\S+)\s+(\d+)\s+(\d+)\s+(\d+)\s.*$/m
> or die "domain list: $list";
> $1 eq $gho->{Name} or die "domain list name $1 expected $gho->{Name}";
> $gho->{MemUsed}= $3;
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [OSSTEST PATCH 2/4] ts-logs-capture: Find xenctx in /usr/local as well
2015-07-02 17:11 ` [OSSTEST PATCH 2/4] ts-logs-capture: Find xenctx in /usr/local as well Ian Jackson
@ 2015-07-03 8:52 ` Ian Campbell
0 siblings, 0 replies; 19+ messages in thread
From: Ian Campbell @ 2015-07-03 8:52 UTC (permalink / raw)
To: Ian Jackson; +Cc: xen-devel
On Thu, 2015-07-02 at 18:11 +0100, Ian Jackson wrote:
> xenctx is now in /usr/local/lib/xen/bin/xenctx.
> ^^^^^^
> Find it by setting PATH in the shell command.
>
> Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [OSSTEST PATCH 3/4] ts-logs-capture: Break out guest listing and do it earlier
2015-07-02 17:11 ` [OSSTEST PATCH 3/4] ts-logs-capture: Break out guest listing and do it earlier Ian Jackson
@ 2015-07-03 8:54 ` Ian Campbell
0 siblings, 0 replies; 19+ messages in thread
From: Ian Campbell @ 2015-07-03 8:54 UTC (permalink / raw)
To: Ian Jackson; +Cc: xen-devel
On Thu, 2015-07-02 at 18:11 +0100, Ian Jackson wrote:
> Break out the function find_guests from what was
> fetch_logs_host_guests, and have it save its results in the @guests
> global.
>
> We do this soon because in the next patch we are going to want to
> do something to each guest before we call serial_fetch_logs.
>
> The loop containing fetch_logs_guest is now in the main program.
>
> Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [OSSTEST PATCH 4/4] ts-logs-capture: Run xenctx earlier
2015-07-02 17:11 ` [OSSTEST PATCH 4/4] ts-logs-capture: Run xenctx earlier Ian Jackson
@ 2015-07-03 8:55 ` Ian Campbell
2015-07-03 11:25 ` Ian Jackson
0 siblings, 1 reply; 19+ messages in thread
From: Ian Campbell @ 2015-07-03 8:55 UTC (permalink / raw)
To: Ian Jackson; +Cc: xen-devel
On Thu, 2015-07-02 at 18:11 +0100, Ian Jackson wrote:
> Break fetch_xenctx_guest out into its own function, and run it before
> serial_fetch_logs.
>
> This is relevant because serial_fetch_logs sends the Xen debug keys,
> which might dislodge a stuck guest - and, if it does, we would like to
> have captured the stuck state with xenctx, rather than the unstuck
> one.
>
> Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
At first I wondered if before and after might be useful, but I don't
think the unstuck state would be useful. However two (or more)
back-to-back ctxt's can often be useful, by giving a snapshot of the
loop the guest is stuck.
Ian.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [OSSTEST PATCH 4/4] ts-logs-capture: Run xenctx earlier
2015-07-03 8:55 ` Ian Campbell
@ 2015-07-03 11:25 ` Ian Jackson
2015-07-03 11:49 ` [OSSTEST PATCH 1/6] guest_find_domid: Set Vcpus correctly Ian Jackson
0 siblings, 1 reply; 19+ messages in thread
From: Ian Jackson @ 2015-07-03 11:25 UTC (permalink / raw)
To: Ian Campbell; +Cc: xen-devel
Ian Campbell writes ("Re: [OSSTEST PATCH 4/4] ts-logs-capture: Run xenctx earlier"):
> At first I wondered if before and after might be useful, but I don't
> think the unstuck state would be useful. However two (or more)
> back-to-back ctxt's can often be useful, by giving a snapshot of the
> loop the guest is stuck.
Good idea. I will respin.
Ian.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [OSSTEST PATCH 1/6] guest_find_domid: Set Vcpus correctly.
2015-07-03 11:25 ` Ian Jackson
@ 2015-07-03 11:49 ` Ian Jackson
2015-07-03 11:49 ` [OSSTEST PATCH 2/6] ts-logs-capture: Find xenctx in /usr/local as well Ian Jackson
` (4 more replies)
0 siblings, 5 replies; 19+ messages in thread
From: Ian Jackson @ 2015-07-03 11:49 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Jackson, Ian Campbell
The regexp was wrong, resulting in the last digit of the memory being
mistaken for the number of vcpus (!)
The only consumer of this is ts-logs-capture.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
Osstest/TestSupport.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index b5994a4..66dc218 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -1918,7 +1918,7 @@ sub guest_find_domid ($$) {
return if defined $gho->{Domid};
my $list= target_cmd_output_root($ho,
common_toolstack($ho)." list $gho->{Name}");
- $list =~ m/^(?!Name\s)(\S+)\s+(\d+)\s+(\d+)+(\d+)\s.*$/m
+ $list =~ m/^(?!Name\s)(\S+)\s+(\d+)\s+(\d+)\s+(\d+)\s.*$/m
or die "domain list: $list";
$1 eq $gho->{Name} or die "domain list name $1 expected $gho->{Name}";
$gho->{MemUsed}= $3;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [OSSTEST PATCH 2/6] ts-logs-capture: Find xenctx in /usr/local as well
2015-07-03 11:49 ` [OSSTEST PATCH 1/6] guest_find_domid: Set Vcpus correctly Ian Jackson
@ 2015-07-03 11:49 ` Ian Jackson
2015-07-03 11:49 ` [OSSTEST PATCH 3/6] ts-logs-capture: Break out guest listing and do it earlier Ian Jackson
` (3 subsequent siblings)
4 siblings, 0 replies; 19+ messages in thread
From: Ian Jackson @ 2015-07-03 11:49 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Jackson, Ian Campbell
xenctx is now in /usr/local/lib/xen/bin/xenctx.
^^^^^^
Find it by setting PATH in the shell command.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
ts-logs-capture | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/ts-logs-capture b/ts-logs-capture
index 2498416..13795e8 100755
--- a/ts-logs-capture
+++ b/ts-logs-capture
@@ -210,8 +210,10 @@ sub fetch_logs_guest ($) {
my $sysmaparg = !defined $kernpath ? '' :
$kernpath !~ m,/vmlinuz-, ? die "$kernpath ?" :
"-s $`/System.map-$'";
- try_cmd_output_save("/usr/lib/xen/bin/xenctx ".$sysmaparg.
- " $gho->{Domid} $vcpu");
+ try_cmd_output_save(
+ 'PATH=/usr/local/lib/xen/bin:/usr/lib/xen/bin:$PATH; '.
+ "xenctx $sysmaparg $gho->{Domid} $vcpu"
+ );
}
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [OSSTEST PATCH 3/6] ts-logs-capture: Break out guest listing and do it earlier
2015-07-03 11:49 ` [OSSTEST PATCH 1/6] guest_find_domid: Set Vcpus correctly Ian Jackson
2015-07-03 11:49 ` [OSSTEST PATCH 2/6] ts-logs-capture: Find xenctx in /usr/local as well Ian Jackson
@ 2015-07-03 11:49 ` Ian Jackson
2015-07-03 11:49 ` [OSSTEST PATCH 4/6] ts-logs-capture: Run xenctx earlier Ian Jackson
` (2 subsequent siblings)
4 siblings, 0 replies; 19+ messages in thread
From: Ian Jackson @ 2015-07-03 11:49 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Jackson, Ian Campbell
Break out the function find_guests from what was
fetch_logs_host_guests, and have it save its results in the @guests
global.
We do this soon because in the next patch we are going to want to
do something to each guest before we call serial_fetch_logs.
The loop containing fetch_logs_guest is now in the main program.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
ts-logs-capture | 60 ++++++++++++++++++++++++++++++++-----------------------
1 file changed, 35 insertions(+), 25 deletions(-)
diff --git a/ts-logs-capture b/ts-logs-capture
index 13795e8..7127675 100755
--- a/ts-logs-capture
+++ b/ts-logs-capture
@@ -33,6 +33,34 @@ our ($whhost) = @ARGV;
$whhost ||= 'host';
our $ho= selecthost($whhost);
+our @guests;
+
+sub find_guests () {
+ my $sth= $dbh_tests->prepare(<<END);
+ SELECT name FROM runvars WHERE flight=? AND job=?
+ AND name LIKE '%_domname'
+ ORDER BY name
+END
+ $sth->execute($flight, $job);
+ my $row;
+ while ($row= $sth->fetchrow_hashref) {
+ my $gn= $row->{name};
+ $gn =~ s/_domname$//;
+
+ my $gho= selectguest($gn,$ho);
+ if (!eval {
+ guest_find_domid($ho,$gho);
+ 1;
+ }) {
+ logm("cannot find domid: $@");;
+ next;
+ }
+
+ push @guests, $gho;
+ }
+ $sth->finish();
+}
+
sub try_fetch_logs ($$) {
my ($lho, $logfilepats) = @_;
my $ok= 0;
@@ -97,7 +125,7 @@ sub try_cmd_output_save ($;$) {
close $fh or die $!;
}
-sub fetch_logs_host_guests () {
+sub fetch_logs_host () {
my $logs= [qw(
/var/log/kern.log*
/var/log/syslog*
@@ -173,33 +201,13 @@ sub fetch_logs_host_guests () {
) {
try_cmd_output_save($cmd);
}
-
- my $sth= $dbh_tests->prepare(<<END);
- SELECT name FROM runvars WHERE flight=? AND job=?
- AND name LIKE '%_domname'
- ORDER BY name
-END
- $sth->execute($flight, $job);
- my $row;
- while ($row= $sth->fetchrow_hashref) {
- my $gn= $row->{name};
- $gn =~ s/_domname$//;
- fetch_logs_guest($gn);
- }
- $sth->finish();
}
sub fetch_logs_guest ($) {
- my ($gn) = @_;
+ my ($gho) = @_;
+ my $gn = $gho->{Name};
logm("saving logs for $gn");
- my $gho= selectguest($gn,$ho);
- if (!eval {
- guest_find_domid($ho,$gho);
- 1;
- }) {
- logm("cannot find domid: $@");
- return;
- }
+
my $consolecmd= toolstack($ho)->consolecmd($gho);
try_cmd_output_save("sleep 1 | $consolecmd | cat",
"guest-$gho->{Name}-console");
@@ -226,6 +234,8 @@ sub fetch_logs_guest ($) {
}
}
+find_guests();
serial_fetch_logs($ho);
-fetch_logs_host_guests();
+fetch_logs_host();
+fetch_logs_guest($_) foreach @guests;
logm("logs captured to $stash");
--
1.7.10.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [OSSTEST PATCH 4/6] ts-logs-capture: Run xenctx earlier
2015-07-03 11:49 ` [OSSTEST PATCH 1/6] guest_find_domid: Set Vcpus correctly Ian Jackson
2015-07-03 11:49 ` [OSSTEST PATCH 2/6] ts-logs-capture: Find xenctx in /usr/local as well Ian Jackson
2015-07-03 11:49 ` [OSSTEST PATCH 3/6] ts-logs-capture: Break out guest listing and do it earlier Ian Jackson
@ 2015-07-03 11:49 ` Ian Jackson
2015-07-03 11:49 ` [OSSTEST PATCH 5/6] ts-logs-capture: Run xenctx twice for each guest vcpu Ian Jackson
2015-07-03 11:49 ` [OSSTEST PATCH 6/6] ts-logs-capture: Explicitly set xenctx capture filename Ian Jackson
4 siblings, 0 replies; 19+ messages in thread
From: Ian Jackson @ 2015-07-03 11:49 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Jackson, Ian Campbell
Break fetch_xenctx_guest out into its own function, and run it before
serial_fetch_logs.
This is relevant because serial_fetch_logs sends the Xen debug keys,
which might dislodge a stuck guest - and, if it does, we would like to
have captured the stuck state with xenctx, rather than the unstuck
one.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
ts-logs-capture | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/ts-logs-capture b/ts-logs-capture
index 7127675..04cb2fd 100755
--- a/ts-logs-capture
+++ b/ts-logs-capture
@@ -203,14 +203,9 @@ sub fetch_logs_host () {
}
}
-sub fetch_logs_guest ($) {
+sub fetch_xenctx_guest ($) {
my ($gho) = @_;
- my $gn = $gho->{Name};
- logm("saving logs for $gn");
-
- my $consolecmd= toolstack($ho)->consolecmd($gho);
- try_cmd_output_save("sleep 1 | $consolecmd | cat",
- "guest-$gho->{Name}-console");
+ logm("collecting xenctx for $gho->{Name}");
if (defined $gho->{Vcpus}) {
foreach (my $vcpu=0; $vcpu < $gho->{Vcpus}; $vcpu++) {
@@ -224,6 +219,16 @@ sub fetch_logs_guest ($) {
);
}
}
+}
+
+sub fetch_logs_guest ($) {
+ my ($gho) = @_;
+ my $gn = $gho->{Name};
+ logm("saving logs for $gn");
+
+ my $consolecmd= toolstack($ho)->consolecmd($gho);
+ try_cmd_output_save("sleep 1 | $consolecmd | cat",
+ "guest-$gho->{Name}-console");
if (!eval {
my $vnc= guest_vncsnapshot_begin($ho,$gho);
@@ -235,6 +240,7 @@ sub fetch_logs_guest ($) {
}
find_guests();
+fetch_xenctx_guest($_) foreach @guests;
serial_fetch_logs($ho);
fetch_logs_host();
fetch_logs_guest($_) foreach @guests;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [OSSTEST PATCH 5/6] ts-logs-capture: Run xenctx twice for each guest vcpu
2015-07-03 11:49 ` [OSSTEST PATCH 1/6] guest_find_domid: Set Vcpus correctly Ian Jackson
` (2 preceding siblings ...)
2015-07-03 11:49 ` [OSSTEST PATCH 4/6] ts-logs-capture: Run xenctx earlier Ian Jackson
@ 2015-07-03 11:49 ` Ian Jackson
2015-07-03 12:07 ` Ian Campbell
2015-07-03 11:49 ` [OSSTEST PATCH 6/6] ts-logs-capture: Explicitly set xenctx capture filename Ian Jackson
4 siblings, 1 reply; 19+ messages in thread
From: Ian Jackson @ 2015-07-03 11:49 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Jackson, Ian Campbell
Two (or more) back-to-back ctxt's can often be useful, by giving a
snapshot of a loop the guest is stuck in.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
v2: New patch in this series.
---
ts-logs-capture | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/ts-logs-capture b/ts-logs-capture
index 04cb2fd..b2caa77 100755
--- a/ts-logs-capture
+++ b/ts-logs-capture
@@ -213,10 +213,12 @@ sub fetch_xenctx_guest ($) {
my $sysmaparg = !defined $kernpath ? '' :
$kernpath !~ m,/vmlinuz-, ? die "$kernpath ?" :
"-s $`/System.map-$'";
- try_cmd_output_save(
- 'PATH=/usr/local/lib/xen/bin:/usr/lib/xen/bin:$PATH; '.
- "xenctx $sysmaparg $gho->{Domid} $vcpu"
- );
+ foreach my $iter (0..1) {
+ try_cmd_output_save(
+ 'PATH=/usr/local/lib/xen/bin:/usr/lib/xen/bin:$PATH; '.
+ "xenctx $sysmaparg $gho->{Domid} $vcpu"
+ );
+ }
}
}
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [OSSTEST PATCH 6/6] ts-logs-capture: Explicitly set xenctx capture filename
2015-07-03 11:49 ` [OSSTEST PATCH 1/6] guest_find_domid: Set Vcpus correctly Ian Jackson
` (3 preceding siblings ...)
2015-07-03 11:49 ` [OSSTEST PATCH 5/6] ts-logs-capture: Run xenctx twice for each guest vcpu Ian Jackson
@ 2015-07-03 11:49 ` Ian Jackson
2015-07-03 12:08 ` Ian Campbell
4 siblings, 1 reply; 19+ messages in thread
From: Ian Jackson @ 2015-07-03 11:49 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Jackson, Ian Campbell
Now that the command contains PATH, the autogenerated filename is very
ugly.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
v2: New patch in this version of the series.
---
ts-logs-capture | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/ts-logs-capture b/ts-logs-capture
index b2caa77..0081372 100755
--- a/ts-logs-capture
+++ b/ts-logs-capture
@@ -214,10 +214,11 @@ sub fetch_xenctx_guest ($) {
$kernpath !~ m,/vmlinuz-, ? die "$kernpath ?" :
"-s $`/System.map-$'";
foreach my $iter (0..1) {
+ my $dfn = "$ho->{Name}-xenctx-$gho->{Name},vcpu$vcpu,i$iter";
try_cmd_output_save(
'PATH=/usr/local/lib/xen/bin:/usr/lib/xen/bin:$PATH; '.
- "xenctx $sysmaparg $gho->{Domid} $vcpu"
- );
+ "xenctx $sysmaparg $gho->{Domid} $vcpu",
+ $dfn);
}
}
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [OSSTEST PATCH 5/6] ts-logs-capture: Run xenctx twice for each guest vcpu
2015-07-03 11:49 ` [OSSTEST PATCH 5/6] ts-logs-capture: Run xenctx twice for each guest vcpu Ian Jackson
@ 2015-07-03 12:07 ` Ian Campbell
0 siblings, 0 replies; 19+ messages in thread
From: Ian Campbell @ 2015-07-03 12:07 UTC (permalink / raw)
To: Ian Jackson; +Cc: xen-devel
On Fri, 2015-07-03 at 12:49 +0100, Ian Jackson wrote:
> Two (or more) back-to-back ctxt's can often be useful, by giving a
> snapshot of a loop the guest is stuck in.
>
> Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
I checked that try_cmd_output_save takes care of making the stash
filename unique.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [OSSTEST PATCH 6/6] ts-logs-capture: Explicitly set xenctx capture filename
2015-07-03 11:49 ` [OSSTEST PATCH 6/6] ts-logs-capture: Explicitly set xenctx capture filename Ian Jackson
@ 2015-07-03 12:08 ` Ian Campbell
2015-07-03 13:20 ` Ian Jackson
0 siblings, 1 reply; 19+ messages in thread
From: Ian Campbell @ 2015-07-03 12:08 UTC (permalink / raw)
To: Ian Jackson; +Cc: xen-devel
On Fri, 2015-07-03 at 12:49 +0100, Ian Jackson wrote:
> Now that the command contains PATH, the autogenerated filename is very
> ugly.
>
> Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
I should have read this before checking the behaviour of
try_cmd_output_save in the last patch!
Acked-by: Ian Campbell <ian.campbell@citrix.com>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [OSSTEST PATCH 6/6] ts-logs-capture: Explicitly set xenctx capture filename
2015-07-03 12:08 ` Ian Campbell
@ 2015-07-03 13:20 ` Ian Jackson
0 siblings, 0 replies; 19+ messages in thread
From: Ian Jackson @ 2015-07-03 13:20 UTC (permalink / raw)
To: Ian Campbell; +Cc: xen-devel
Ian Campbell writes ("Re: [OSSTEST PATCH 6/6] ts-logs-capture: Explicitly set xenctx capture filename"):
> On Fri, 2015-07-03 at 12:49 +0100, Ian Jackson wrote:
> > Now that the command contains PATH, the autogenerated filename is very
> > ugly.
> >
> > Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
>
> I should have read this before checking the behaviour of
> try_cmd_output_save in the last patch!
Maybe. But it would still be important for the filename to be made
unique in case (say) ts-logs-capture is run more than once.
But yes, it is made unique (even if the caller passes an explicit
starting point filename) :-).
Thanks,
Ian.
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2015-07-03 13:21 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-02 17:11 [OSSTEST PATCH 0/4] Fix use of xenctx Ian Jackson
2015-07-02 17:11 ` [OSSTEST PATCH 1/4] guest_find_domid: Set Vcpus correctly Ian Jackson
2015-07-03 8:52 ` Ian Campbell
2015-07-02 17:11 ` [OSSTEST PATCH 2/4] ts-logs-capture: Find xenctx in /usr/local as well Ian Jackson
2015-07-03 8:52 ` Ian Campbell
2015-07-02 17:11 ` [OSSTEST PATCH 3/4] ts-logs-capture: Break out guest listing and do it earlier Ian Jackson
2015-07-03 8:54 ` Ian Campbell
2015-07-02 17:11 ` [OSSTEST PATCH 4/4] ts-logs-capture: Run xenctx earlier Ian Jackson
2015-07-03 8:55 ` Ian Campbell
2015-07-03 11:25 ` Ian Jackson
2015-07-03 11:49 ` [OSSTEST PATCH 1/6] guest_find_domid: Set Vcpus correctly Ian Jackson
2015-07-03 11:49 ` [OSSTEST PATCH 2/6] ts-logs-capture: Find xenctx in /usr/local as well Ian Jackson
2015-07-03 11:49 ` [OSSTEST PATCH 3/6] ts-logs-capture: Break out guest listing and do it earlier Ian Jackson
2015-07-03 11:49 ` [OSSTEST PATCH 4/6] ts-logs-capture: Run xenctx earlier Ian Jackson
2015-07-03 11:49 ` [OSSTEST PATCH 5/6] ts-logs-capture: Run xenctx twice for each guest vcpu Ian Jackson
2015-07-03 12:07 ` Ian Campbell
2015-07-03 11:49 ` [OSSTEST PATCH 6/6] ts-logs-capture: Explicitly set xenctx capture filename Ian Jackson
2015-07-03 12:08 ` Ian Campbell
2015-07-03 13:20 ` Ian Jackson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).