From patchwork Fri Jul 31 11:37:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11694649 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 669CC913 for ; Fri, 31 Jul 2020 11:39:20 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4D44B20838 for ; Fri, 31 Jul 2020 11:39:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4D44B20838 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1TMu-0005lT-Qe; Fri, 31 Jul 2020 11:38:32 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1TMt-0005kZ-08 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2020 11:38:31 +0000 X-Inumbo-ID: 59721e70-d322-11ea-8e26-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 59721e70-d322-11ea-8e26-bc764e2007e4; Fri, 31 Jul 2020 11:38:27 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1k1TMo-0001W4-Im; Fri, 31 Jul 2020 12:38:26 +0100 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [OSSTEST PATCH v2 01/41] Add cperl-indent-level to .dir-locals.el Date: Fri, 31 Jul 2020 12:37:40 +0100 Message-Id: <20200731113820.5765-2-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731113820.5765-1-ian.jackson@eu.citrix.com> References: <20200731113820.5765-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" My personal config on my laptop has this set to 2 and that makes editing osstest, which uses 4, quite annoying. Signed-off-by: Ian Jackson --- New in v2. --- .dir-locals.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.dir-locals.el b/.dir-locals.el index d87916f7..ad4fa3dc 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -1 +1,2 @@ -((nil . ((indent-tabs-mode . t)))) +((nil . ((indent-tabs-mode . t))) + (cperl-mode . ((cperl-indent-level . 4)))) From patchwork Fri Jul 31 11:37:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11694661 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3E2EF138C for ; Fri, 31 Jul 2020 11:39:53 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 24F2A20838 for ; Fri, 31 Jul 2020 11:39:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 24F2A20838 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1TMz-0005mh-3A; Fri, 31 Jul 2020 11:38:37 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1TMy-0005kZ-0D for xen-devel@lists.xenproject.org; Fri, 31 Jul 2020 11:38:36 +0000 X-Inumbo-ID: 59a52144-d322-11ea-8e26-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 59a52144-d322-11ea-8e26-bc764e2007e4; Fri, 31 Jul 2020 11:38:27 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1k1TMp-0001W4-15; Fri, 31 Jul 2020 12:38:27 +0100 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [OSSTEST PATCH v2 02/41] SQL: Use "LIKE" rather than "like", etc. Date: Fri, 31 Jul 2020 12:37:41 +0100 Message-Id: <20200731113820.5765-3-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731113820.5765-1-ian.jackson@eu.citrix.com> References: <20200731113820.5765-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" This is more like the rest of the style. It will also make it easier to find instances of the mistaken LIKE syntax. I found these with "git grep" and manually edited them. I have checked the before-and-after result of find * -type f | xargs perl -i~ -pe 's/\bLIKE\b/like/g' and it has only the few expected changes to ANDs and ORs. No functional change. Signed-off-by: Ian Jackson --- New in v2. --- cr-ensure-disk-space | 4 ++-- cs-adjust-flight | 2 +- mg-force-push | 2 +- mg-report-host-usage-collect | 10 +++++----- ms-planner | 2 +- sg-report-flight | 2 +- sg-report-host-history | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/cr-ensure-disk-space b/cr-ensure-disk-space index 3e0288f9..11d801b0 100755 --- a/cr-ensure-disk-space +++ b/cr-ensure-disk-space @@ -99,8 +99,8 @@ my $chkq= db_prepare("SELECT * FROM flights WHERE flight=?"); my $refq= db_prepare(<= ? END diff --git a/cs-adjust-flight b/cs-adjust-flight index 98d40891..d04a2fd7 100755 --- a/cs-adjust-flight +++ b/cs-adjust-flight @@ -526,7 +526,7 @@ sub change__repro_buildjobs { } } my $testq = db_prepare(</dev/null"; -my $namecond= "(name = 'host' or name like '%_host')"; +my $namecond= "(name = 'host' OR name LIKE '%_host')"; csreadconfig(); while (@ARGV && $ARGV[0] =~ m/^-/) { @@ -456,7 +456,7 @@ foreach my $host (@ARGV) { SELECT DISTINCT val FROM runvars WHERE flight=? - AND (name = 'host' or name like '%_host') + AND (name = 'host' OR name LIKE '%_host') END $hostsinflightq->execute($flight); while (my $row = $hostsinflightq->fetchrow_hashref()) { From patchwork Fri Jul 31 11:37:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11694645 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1E155913 for ; Fri, 31 Jul 2020 11:39:00 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 008D320838 for ; Fri, 31 Jul 2020 11:38:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 008D320838 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1TN4-0005oL-At; Fri, 31 Jul 2020 11:38:42 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1TN3-0005kZ-0H for xen-devel@lists.xenproject.org; Fri, 31 Jul 2020 11:38:41 +0000 X-Inumbo-ID: 59d8fa33-d322-11ea-8e26-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 59d8fa33-d322-11ea-8e26-bc764e2007e4; Fri, 31 Jul 2020 11:38:28 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1k1TMp-0001W4-Cw; Fri, 31 Jul 2020 12:38:27 +0100 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [OSSTEST PATCH v2 03/41] SQL: Fix incorrect LIKE pattern syntax (literals) Date: Fri, 31 Jul 2020 12:37:42 +0100 Message-Id: <20200731113820.5765-4-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731113820.5765-1-ian.jackson@eu.citrix.com> References: <20200731113820.5765-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" LIKE takes a weird SQLish glob pattern, where % is like a glob * and (relevantly, here) _ is like a glob ?. Every _ in one of these LIKE patterns needs to be escaped with \. Do that for all the literal LIKE patterns. This fixes bugs. Generally, bugs where the wrong rows might be returned (except that the data probably doesn't have any such rows). Signed-off-by: Ian Jackson --- New in v2. --- mg-force-push | 2 +- mg-report-host-usage-collect | 2 +- sg-report-flight | 2 +- sg-report-host-history | 6 +++--- ts-logs-capture | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mg-force-push b/mg-force-push index 001e0c47..3a701a11 100755 --- a/mg-force-push +++ b/mg-force-push @@ -54,7 +54,7 @@ END FROM rv url JOIN rv built ON url.job = built.job - AND url.name LIKE 'tree_%' + AND url.name LIKE 'tree\_%' AND built.name = 'built_revision_' || substring(url.name, 6) WHERE url.val = ? END diff --git a/mg-report-host-usage-collect b/mg-report-host-usage-collect index 3fab490a..1944c8d7 100755 --- a/mg-report-host-usage-collect +++ b/mg-report-host-usage-collect @@ -166,7 +166,7 @@ END SELECT val, synth FROM runvars WHERE flight=? AND job=? - AND (name LIKE '%_host' OR name='host') + AND (name LIKE '%\_host' OR name='host') END my $finishq = db_prepare(</dev/null"; -my $namecond= "(name = 'host' OR name LIKE '%_host')"; +my $namecond= "(name = 'host' OR name LIKE '%\_host')"; csreadconfig(); while (@ARGV && $ARGV[0] =~ m/^-/) { @@ -256,7 +256,7 @@ END FROM runvars WHERE flight=? AND job=? AND ( - name LIKE (? || '_power_%') + name LIKE (? || '\_power\_%') ) END @@ -456,7 +456,7 @@ foreach my $host (@ARGV) { SELECT DISTINCT val FROM runvars WHERE flight=? - AND (name = 'host' OR name LIKE '%_host') + AND (name = 'host' OR name LIKE '%\_host') END $hostsinflightq->execute($flight); while (my $row = $hostsinflightq->fetchrow_hashref()) { diff --git a/ts-logs-capture b/ts-logs-capture index d75a2fda..62c281b8 100755 --- a/ts-logs-capture +++ b/ts-logs-capture @@ -44,7 +44,7 @@ our (@allguests, @guests); sub find_guests () { my $sth= $dbh_tests->prepare(<execute($flight, $job); From patchwork Fri Jul 31 11:37:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11694653 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 59861138C for ; Fri, 31 Jul 2020 11:39:30 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3FF7120838 for ; Fri, 31 Jul 2020 11:39:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3FF7120838 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1TN9-0005q6-LI; Fri, 31 Jul 2020 11:38:47 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1TN8-0005kZ-0K for xen-devel@lists.xenproject.org; Fri, 31 Jul 2020 11:38:46 +0000 X-Inumbo-ID: 5a418c50-d322-11ea-8e26-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 5a418c50-d322-11ea-8e26-bc764e2007e4; Fri, 31 Jul 2020 11:38:28 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1k1TMp-0001W4-T6; Fri, 31 Jul 2020 12:38:28 +0100 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [OSSTEST PATCH v2 04/41] SQL: Fix incorrect LIKE pattern syntax (program variables) Date: Fri, 31 Jul 2020 12:37:43 +0100 Message-Id: <20200731113820.5765-5-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731113820.5765-1-ian.jackson@eu.citrix.com> References: <20200731113820.5765-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" In two places the pattern for LIKE is constructed programmatically. In this case, too, we need to escape % and _. We pass the actual pattern (or pattern fragment) via ?, so we do not need to worry about '. Signed-off-by: Ian Jackson --- New in v2. --- Osstest.pm | 8 +++++++- Osstest/JobDB/Executive.pm | 2 +- sg-report-host-history | 3 ++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Osstest.pm b/Osstest.pm index 63dddd95..b2b6b741 100644 --- a/Osstest.pm +++ b/Osstest.pm @@ -39,7 +39,7 @@ BEGIN { main_revision_job_cond other_revision_job_suffix $dbh_tests db_retry db_retry_retry db_retry_abort db_readonly_report - db_begin_work db_prepare + db_begin_work db_prepare db_quote_like_pattern get_harness_rev blessing_must_not_modify_host ensuredir get_filecontents_core_quiet system_checked nonempty visible_undef show_abs_time @@ -358,6 +358,12 @@ sub postfork () { $mjobdb->jobdb_postfork(); } +sub db_quote_like_pattern ($) { + local ($_) = @_; + s{[_%\\]}{\\$&}g; + $_; +} + #---------- script entrypoints ---------- sub csreadconfig () { diff --git a/Osstest/JobDB/Executive.pm b/Osstest/JobDB/Executive.pm index be5588fc..39deb8a2 100644 --- a/Osstest/JobDB/Executive.pm +++ b/Osstest/JobDB/Executive.pm @@ -143,7 +143,7 @@ sub _check_testdbs ($) { AND live AND username LIKE (? || '@%') END - $sth->execute($c{Username}); + $sth->execute(db_quote_like_pattern($c{Username})); my $allok = 1; while (my $row = $sth->fetchrow_hashref()) { next if $row->{dbname} =~ m/^$re$/o; diff --git a/sg-report-host-history b/sg-report-host-history index 7505b18b..9730ae7a 100755 --- a/sg-report-host-history +++ b/sg-report-host-history @@ -380,7 +380,8 @@ END $runvarq_hits++; } else { $runvarq_misses++; - $jrunvarq->execute($jr->{flight}, $jr->{job}, $ident); + $jrunvarq->execute($jr->{flight}, $jr->{job}, + db_quote_like_pattern($ident)); my %runvars; while (my ($n, $v) = $jrunvarq->fetchrow_array()) { $runvars{$n} = $v; From patchwork Fri Jul 31 11:37:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11694657 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EC232913 for ; Fri, 31 Jul 2020 11:39:44 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D2BA020838 for ; Fri, 31 Jul 2020 11:39:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D2BA020838 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1TNF-0005sq-1o; Fri, 31 Jul 2020 11:38:53 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1TND-0005kZ-0M for xen-devel@lists.xenproject.org; Fri, 31 Jul 2020 11:38:51 +0000 X-Inumbo-ID: 59d8fa34-d322-11ea-8e26-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 59d8fa34-d322-11ea-8e26-bc764e2007e4; Fri, 31 Jul 2020 11:38:29 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1k1TMq-0001W4-Bf; Fri, 31 Jul 2020 12:38:28 +0100 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [OSSTEST PATCH v2 05/41] sg-report-flight: Add a comment re same-flight search narrowing Date: Fri, 31 Jul 2020 12:37:44 +0100 Message-Id: <20200731113820.5765-6-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731113820.5765-1-ian.jackson@eu.citrix.com> References: <20200731113820.5765-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" In afe851ca1771e5da6395b596afa69e509dbbc278 sg-report-flight: When justifying, disregard out-of-flight build jobs we narrowed sg-report-flight's search algorith. An extensive justification is in the commit message. I think much of this information belongs in-tree, so c&p it (with slight edits) here. No code change. Signed-off-by: Ian Jackson --- sg-report-flight | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sg-report-flight b/sg-report-flight index 831917a9..fc439495 100755 --- a/sg-report-flight +++ b/sg-report-flight @@ -242,9 +242,27 @@ END # jobs. We start with all jobs in $tflight, and for each job # we also process any other jobs it refers to in *buildjob runvars. # + # The real thing we want to check that the build jobs *in the + # same flight as the justifying job* used the right revisions. + # Build jobs from other flights were either (i) build jobs for + # components not being targed for testing by this branch, but + # which were necessary for the justifying job and for which we + # decided to reuse another build job (in which case we don't + # really care what versions they used, even if underlying it + # all there might be a different version of a tree we are + # actually interested in (ii) the kind of continuous update + # thing seen with freebsdbuildjob. + # + # (This is rather different to cs-bisection-step, which is + # less focused on changes in a particular set of trees.) + # + # So we limit the scope of our recursive descent into build + # jobs, to jobs in the same flight. + # # We don't actually use a recursive algorithm because that # would involve recursive use of the same sql query object; # hence the @binfos_todo queue. + my @binfos_todo; my $binfos_queue = sub { my ($inflight,$q,$why) = @_; From patchwork Fri Jul 31 11:37:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11694659 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7CD61138C for ; Fri, 31 Jul 2020 11:39:47 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 637C920838 for ; Fri, 31 Jul 2020 11:39:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 637C920838 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1TNJ-0005vS-Bl; Fri, 31 Jul 2020 11:38:57 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1TNI-0005kZ-0W for xen-devel@lists.xenproject.org; Fri, 31 Jul 2020 11:38:56 +0000 X-Inumbo-ID: 5aa0cf12-d322-11ea-8e26-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 5aa0cf12-d322-11ea-8e26-bc764e2007e4; Fri, 31 Jul 2020 11:38:29 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1k1TMq-0001W4-Ki; Fri, 31 Jul 2020 12:38:28 +0100 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [OSSTEST PATCH v2 06/41] sg-report-flight: Sort failures by job name as last resort Date: Fri, 31 Jul 2020 12:37:45 +0100 Message-Id: <20200731113820.5765-7-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731113820.5765-1-ian.jackson@eu.citrix.com> References: <20200731113820.5765-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" This removes some nondeterminism from the output. Signed-off-by: Ian Jackson --- sg-report-flight | 1 + 1 file changed, 1 insertion(+) diff --git a/sg-report-flight b/sg-report-flight index fc439495..7f2790ce 100755 --- a/sg-report-flight +++ b/sg-report-flight @@ -813,6 +813,7 @@ END # they finished in the same second, we pick the lower-numbered # step, which is the earlier one (if they are sequential at # all). + or $a->{Job} cmp $b->{Job} } @failures; From patchwork Fri Jul 31 11:37:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11694663 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C1D9C138C for ; Fri, 31 Jul 2020 11:40:10 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A6C0120838 for ; Fri, 31 Jul 2020 11:40:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A6C0120838 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1TNO-0005yx-Mi; Fri, 31 Jul 2020 11:39:02 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1TNN-0005kZ-0h for xen-devel@lists.xenproject.org; Fri, 31 Jul 2020 11:39:01 +0000 X-Inumbo-ID: 5aa0cf14-d322-11ea-8e26-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 5aa0cf14-d322-11ea-8e26-bc764e2007e4; Fri, 31 Jul 2020 11:38:29 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1k1TMr-0001W4-0L; Fri, 31 Jul 2020 12:38:29 +0100 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [OSSTEST PATCH v2 07/41] schema: Provide indices for sg-report-flight Date: Fri, 31 Jul 2020 12:37:46 +0100 Message-Id: <20200731113820.5765-8-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731113820.5765-1-ian.jackson@eu.citrix.com> References: <20200731113820.5765-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson , George Dunlap Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" These indexes allow very fast lookup of "relevant" flights eg when trying to justify failures. In my ad-hoc test case, these indices (along with the subsequent changes to sg-report-flight and Executive.pm, reduce the runtime of sg-report-flight from 2-3ks (unacceptably long!) to as little as 5-7s seconds - a speedup of about 500x. (Getting the database snapshot may take a while first, but deploying this code should help with that too by reducing long-running transactions. Quoted perf timings are from snapshot acquisition.) Without these new indexes there may be a performance change from the query changes. I haven't benchmarked this so I am setting the schema updates to be Preparatory/Needed (ie, "Schema first" as schema/README.updates has it), to say that the index should be created before the new code is deployed. Testing: I have tested this series by creating experimental indices "trial_..." in the actual production instance. (Transactional DDL was very helpful with this.) I have verified with \d that schema update instructions in this commit generate indexes which are equivalent to the trial indices. Deployment: AFter these schema updates are applied, the trial indices are redundant duplicates and should be deleted. CC: George Dunlap Signed-off-by: Ian Jackson Reviewed-by: George Dunlap --- v2: Use proper \ escaping for underscores in LIKE --- schema/runvars-built-index.sql | 7 +++++++ schema/runvars-revision-index.sql | 7 +++++++ schema/steps-job-index.sql | 7 +++++++ 3 files changed, 21 insertions(+) create mode 100644 schema/runvars-built-index.sql create mode 100644 schema/runvars-revision-index.sql create mode 100644 schema/steps-job-index.sql diff --git a/schema/runvars-built-index.sql b/schema/runvars-built-index.sql new file mode 100644 index 00000000..7108e0af --- /dev/null +++ b/schema/runvars-built-index.sql @@ -0,0 +1,7 @@ +-- ##OSSTEST## 007 Preparatory +-- +-- This index helps sg-report-flight find relevant flights. + +CREATE INDEX runvars_built_revision_idx + ON runvars (val) + WHERE name LIKE 'built\_revision\_%'; diff --git a/schema/runvars-revision-index.sql b/schema/runvars-revision-index.sql new file mode 100644 index 00000000..8871b528 --- /dev/null +++ b/schema/runvars-revision-index.sql @@ -0,0 +1,7 @@ +-- ##OSSTEST## 008 Preparatory +-- +-- This index helps Executive::report__find_test find relevant flights. + +CREATE INDEX runvars_revision_idx + ON runvars (val) + WHERE name LIKE 'revision\_%'; diff --git a/schema/steps-job-index.sql b/schema/steps-job-index.sql new file mode 100644 index 00000000..07dc5a30 --- /dev/null +++ b/schema/steps-job-index.sql @@ -0,0 +1,7 @@ +-- ##OSSTEST## 006 Preparatory +-- +-- This index helps sg-report-flight find if a test ever passed. + +CREATE INDEX steps_job_testid_status_idx + ON steps (job, testid, status); + From patchwork Fri Jul 31 11:37:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11694651 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0356B13B1 for ; Fri, 31 Jul 2020 11:39:29 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DD9F920838 for ; Fri, 31 Jul 2020 11:39:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DD9F920838 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1TNU-00062m-0s; Fri, 31 Jul 2020 11:39:08 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1TNS-0005kZ-0g for xen-devel@lists.xenproject.org; Fri, 31 Jul 2020 11:39:06 +0000 X-Inumbo-ID: 5aa0cf15-d322-11ea-8e26-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 5aa0cf15-d322-11ea-8e26-bc764e2007e4; Fri, 31 Jul 2020 11:38:30 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1k1TMr-0001W4-BA; Fri, 31 Jul 2020 12:38:29 +0100 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [OSSTEST PATCH v2 08/41] sg-report-flight: Ask the db for flights of interest Date: Fri, 31 Jul 2020 12:37:47 +0100 Message-Id: <20200731113820.5765-9-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731113820.5765-1-ian.jackson@eu.citrix.com> References: <20200731113820.5765-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson , George Dunlap Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Specifically, we narrow the initial query to flights which have at least some job with the built_revision_foo we are looking for. This condition is strictly broader than that implemented inside the flight search loop, so there is no functional change. Perf: runtime of my test case now ~300s-500s. Example query before (from the Perl DBI trace): SELECT * FROM ( SELECT flight, blessing FROM flights WHERE (branch='xen-unstable') AND EXISTS (SELECT 1 FROM jobs WHERE jobs.flight = flights.flight AND jobs.job = ?) AND ( (TRUE AND flight <= 151903) AND (blessing='real') ) ORDER BY flight DESC LIMIT 1000 ) AS sub ORDER BY blessing ASC, flight DESC With these bind variables: "test-armhf-armhf-libvirt" After: SELECT * FROM ( SELECT DISTINCT flight, blessing FROM flights JOIN runvars r1 USING (flight) WHERE (branch='xen-unstable') AND ( (TRUE AND flight <= 151903) AND (blessing='real') ) AND EXISTS (SELECT 1 FROM jobs WHERE jobs.flight = flights.flight AND jobs.job = ?) AND r1.name LIKE 'built\_revision\_%' AND r1.name = ? AND r1.val= ? ORDER BY flight DESC LIMIT 1000 ) AS sub ORDER BY blessing ASC, flight DESC With these bind variables: "test-armhf-armhf-libvirt" 'built_revision_xen' '165f3afbfc3db70fcfdccad07085cde0a03c858b' Diff to the query: SELECT * FROM ( - SELECT flight, blessing FROM flights + SELECT DISTINCT flight, blessing + FROM flights + JOIN runvars r1 USING (flight) + WHERE (branch='xen-unstable') + AND ( (TRUE AND flight <= 151903) AND (blessing='real') ) AND EXISTS (SELECT 1 FROM jobs WHERE jobs.flight = flights.flight AND jobs.job = ?) - AND ( (TRUE AND flight <= 151903) AND (blessing='real') ) + AND r1.name LIKE 'built\_revision\_%' + AND r1.name = ? + AND r1.val= ? + ORDER BY flight DESC LIMIT 1000 ) AS sub CC: George Dunlap Signed-off-by: Ian Jackson Reviewed-by: George Dunlap --- v2: Use proper \ escaping for underscores in LIKE --- schema/runvars-built-index.sql | 2 +- sg-report-flight | 64 ++++++++++++++++++++++++++++++++-- 2 files changed, 62 insertions(+), 4 deletions(-) diff --git a/schema/runvars-built-index.sql b/schema/runvars-built-index.sql index 7108e0af..128e69e9 100644 --- a/schema/runvars-built-index.sql +++ b/schema/runvars-built-index.sql @@ -1,4 +1,4 @@ --- ##OSSTEST## 007 Preparatory +-- ##OSSTEST## 007 Needed -- -- This index helps sg-report-flight find relevant flights. diff --git a/sg-report-flight b/sg-report-flight index 7f2790ce..10127582 100755 --- a/sg-report-flight +++ b/sg-report-flight @@ -185,19 +185,77 @@ END if (defined $job) { push @flightsq_params, $job; $flightsq_jobcond = < X-Patchwork-Id: 11694655 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ED670913 for ; Fri, 31 Jul 2020 11:39:40 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D28CA22CB2 for ; Fri, 31 Jul 2020 11:39:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D28CA22CB2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1TNX-00065Q-AR; Fri, 31 Jul 2020 11:39:11 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1TNX-0005kZ-0j for xen-devel@lists.xenproject.org; Fri, 31 Jul 2020 11:39:11 +0000 X-Inumbo-ID: 5aa0cf16-d322-11ea-8e26-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 5aa0cf16-d322-11ea-8e26-bc764e2007e4; Fri, 31 Jul 2020 11:38:30 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1k1TMr-0001W4-KU; Fri, 31 Jul 2020 12:38:29 +0100 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [OSSTEST PATCH v2 09/41] sg-report-flight: Use WITH to use best index use for $flightsq Date: Fri, 31 Jul 2020 12:37:48 +0100 Message-Id: <20200731113820.5765-10-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731113820.5765-1-ian.jackson@eu.citrix.com> References: <20200731113820.5765-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson , George Dunlap Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" While we're here, convert this EXISTS subquery to a JOIN. Perf: runtime of my test case now ~200-300s. Example query before (from the Perl DBI trace): SELECT * FROM ( SELECT DISTINCT flight, blessing FROM flights JOIN runvars r1 USING (flight) WHERE (branch='xen-unstable') AND ( (TRUE AND flight <= 151903) AND (blessing='real') ) AND EXISTS (SELECT 1 FROM jobs WHERE jobs.flight = flights.flight AND jobs.job = ?) AND r1.name LIKE 'built_revision_%' AND r1.name = ? AND r1.val= ? ORDER BY flight DESC LIMIT 1000 ) AS sub ORDER BY blessing ASC, flight DESC With bind variables: "test-armhf-armhf-libvirt" 'built_revision_xen' '165f3afbfc3db70fcfdccad07085cde0a03c858b' After: WITH sub AS ( SELECT DISTINCT flight, blessing FROM flights JOIN runvars r1 USING (flight) WHERE (branch='xen-unstable') AND ( (TRUE AND flight <= 151903) AND (blessing='real') ) AND r1.name LIKE 'built_revision_%' AND r1.name = ? AND r1.val= ? ORDER BY flight DESC LIMIT 1000 ) SELECT * FROM sub JOIN jobs USING (flight) WHERE (1=1) AND jobs.job = ? ORDER BY blessing ASC, flight DESC With bind variables: 'built_revision_xen' '165f3afbfc3db70fcfdccad07085cde0a03c858b' "test-armhf-armhf-libvirt" Diff to the query: - SELECT * FROM ( + WITH sub AS ( SELECT DISTINCT flight, blessing FROM flights JOIN runvars r1 USING (flight) WHERE (branch='xen-unstable') AND ( (TRUE AND flight <= 151903) AND (blessing='real') ) - AND EXISTS (SELECT 1 - FROM jobs - WHERE jobs.flight = flights.flight - AND jobs.job = ?) - AND r1.name LIKE 'built_revision_%' AND r1.name = ? AND r1.val= ? ORDER BY flight DESC LIMIT 1000 - ) AS sub + ) + SELECT * + FROM sub + JOIN jobs USING (flight) + + WHERE (1=1) + AND jobs.job = ? + ORDER BY blessing ASC, flight DESC Reviewed-by: George Dunlap Signed-off-by: Ian Jackson --- sg-report-flight | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/sg-report-flight b/sg-report-flight index 10127582..d06be292 100755 --- a/sg-report-flight +++ b/sg-report-flight @@ -180,18 +180,6 @@ END return undef; } - my @flightsq_params; - my $flightsq_jobcond='(1=1)'; - if (defined $job) { - push @flightsq_params, $job; - $flightsq_jobcond = < X-Patchwork-Id: 11694819 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 563FE138A for ; Fri, 31 Jul 2020 12:14:13 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3C2E6208E4 for ; Fri, 31 Jul 2020 12:14:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3C2E6208E4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Tu9-00049E-IC; Fri, 31 Jul 2020 12:12:53 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Tu8-000489-8T for xen-devel@lists.xenproject.org; Fri, 31 Jul 2020 12:12:52 +0000 X-Inumbo-ID: 27b4b37a-d327-11ea-8e2c-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 27b4b37a-d327-11ea-8e2c-bc764e2007e4; Fri, 31 Jul 2020 12:12:51 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1k1TMr-0001W4-UZ; Fri, 31 Jul 2020 12:38:30 +0100 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [OSSTEST PATCH v2 10/41] sg-report-flight: Use WITH clause to use index for $anypassq Date: Fri, 31 Jul 2020 12:37:49 +0100 Message-Id: <20200731113820.5765-11-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731113820.5765-1-ian.jackson@eu.citrix.com> References: <20200731113820.5765-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson , George Dunlap Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Perf: runtime of my test case now ~11s Example query before (from the Perl DBI trace): SELECT * FROM flights JOIN steps USING (flight) WHERE (branch='xen-unstable') AND job=? and testid=? and status='pass' AND ( (TRUE AND flight <= 151903) AND (blessing='real') ) LIMIT 1 After: WITH s AS ( SELECT * FROM steps WHERE job=? and testid=? and status='pass' ) SELECT * FROM flights JOIN s USING (flight) WHERE (branch='xen-unstable') AND ( (TRUE AND flight <= 151903) AND (blessing='real') ) LIMIT 1 In both cases with bind vars: "test-amd64-i386-xl-pvshim" "guest-start" Diff to the query: - SELECT * FROM flights JOIN steps USING (flight) + WITH s AS + ( + SELECT * FROM steps + WHERE job=? and testid=? and status='pass' + ) + SELECT * FROM flights JOIN s USING (flight) WHERE (branch='xen-unstable') - AND job=? and testid=? and status='pass' AND ( (TRUE AND flight <= 151903) AND (blessing='real') ) LIMIT 1 Signed-off-by: Ian Jackson Reviewed-by: George Dunlap --- schema/steps-job-index.sql | 2 +- sg-report-flight | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/schema/steps-job-index.sql b/schema/steps-job-index.sql index 07dc5a30..2c33af72 100644 --- a/schema/steps-job-index.sql +++ b/schema/steps-job-index.sql @@ -1,4 +1,4 @@ --- ##OSSTEST## 006 Preparatory +-- ##OSSTEST## 006 Needed -- -- This index helps sg-report-flight find if a test ever passed. diff --git a/sg-report-flight b/sg-report-flight index d06be292..d218b24e 100755 --- a/sg-report-flight +++ b/sg-report-flight @@ -849,10 +849,20 @@ sub justifyfailures ($;$) { my @failures= values %{ $fi->{Failures} }; + # In psql 9.6 this WITH clause makes postgresql do the steps query + # first. This is good because if this test never passed we can + # determine that really quickly using the new index, without + # having to scan the flights table. (If the test passed we will + # probably not have to look at many flights to find one, so in + # that case this is not much worse.) my $anypassq= < X-Patchwork-Id: 11694757 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 05B7B138C for ; Fri, 31 Jul 2020 12:03:10 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DFCC122B40 for ; Fri, 31 Jul 2020 12:03:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DFCC122B40 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Tjk-00022R-Nm; Fri, 31 Jul 2020 12:02:08 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Tjk-000224-5W for xen-devel@lists.xenproject.org; Fri, 31 Jul 2020 12:02:08 +0000 X-Inumbo-ID: a796ee7b-d325-11ea-8e2b-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id a796ee7b-d325-11ea-8e2b-bc764e2007e4; Fri, 31 Jul 2020 12:02:07 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1k1TMs-0001W4-9R; Fri, 31 Jul 2020 12:38:30 +0100 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [OSSTEST PATCH v2 11/41] sg-report-flight: Use the job row from the intitial query Date: Fri, 31 Jul 2020 12:37:50 +0100 Message-Id: <20200731113820.5765-12-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731113820.5765-1-ian.jackson@eu.citrix.com> References: <20200731113820.5765-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" $jcheckq is redundant: we looked this up right at the start. This is not expected to speed things up very much, but it makes things somewhat cleaner and clearer. Signed-off-by: Ian Jackson --- sg-report-flight | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/sg-report-flight b/sg-report-flight index d218b24e..cb6b8174 100755 --- a/sg-report-flight +++ b/sg-report-flight @@ -160,10 +160,6 @@ sub findaflight ($$$$$) { return undef; } - my $jcheckq= db_prepare(<fetchrow_array) { + while (my ($tflight, $tjstatus) = $flightsq->fetchrow_array) { # Recurse from the starting flight looking for relevant build # jobs. We start with all jobs in $tflight, and for each job # we also process any other jobs it refers to in *buildjob runvars. @@ -407,8 +403,7 @@ END $checkq->execute($tflight, $job, $testid); ($chkst) = $checkq->fetchrow_array(); if (!defined $chkst) { - $jcheckq->execute($tflight, $job); - my ($jchkst) = $jcheckq->fetchrow_array(); + my $jchkst = $tflight->{status}; $chkst = $jchkst if $jchkst eq 'starved'; } } From patchwork Fri Jul 31 11:37:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11694693 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1F4D0722 for ; Fri, 31 Jul 2020 11:57:03 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 049852245C for ; Fri, 31 Jul 2020 11:57:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 049852245C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Tdp-0008SJ-9I; Fri, 31 Jul 2020 11:56:01 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Tdn-0008RD-RE for xen-devel@lists.xenproject.org; Fri, 31 Jul 2020 11:55:59 +0000 X-Inumbo-ID: cc2c9506-d324-11ea-8e29-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id cc2c9506-d324-11ea-8e29-bc764e2007e4; Fri, 31 Jul 2020 11:55:59 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1k1TMs-0001W4-It; Fri, 31 Jul 2020 12:38:30 +0100 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [OSSTEST PATCH v2 12/41] Executive: Use index for report__find_test Date: Fri, 31 Jul 2020 12:37:51 +0100 Message-Id: <20200731113820.5765-13-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731113820.5765-1-ian.jackson@eu.citrix.com> References: <20200731113820.5765-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson , George Dunlap Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" After we refactor this query then we can enable the index use. (Both of these things together in this commit because I haven't perf tested the version with just the refactoring.) (We have provided an index that can answer this question really quickly if a version is specified. But the query planner couldn't see that because it works without seeing the bind variables, so doesn't know that the value of name is going to be suitable for this index.) * Convert the two EXISTS subqueries into JOIN/AND with a DISTINCT clause naming the fields on flights, so as to replicate the previous result rows. Then do $selection field last. The subquery is a convenient way to let this do the previous thing for all the values of $selection (including, notably, *). * Add the additional AND clause for r.name, which has no logical effect given the actual values of name, enabling the query planner to use this index. Perf: In my test case the sg-report-flight runtime is now ~8s. I am reasonably confident that this will not make other use cases of this code worse. Perf: runtime of my test case now ~11s Example query before (from the Perl DBI trace): SELECT * FROM flights f WHERE EXISTS ( SELECT 1 FROM runvars r WHERE name=? AND val=? AND r.flight=f.flight AND ( (CASE WHEN (r.job) LIKE 'build-%-prev' THEN 'xprev' WHEN ((r.job) LIKE 'build-%-freebsd' AND 'x' = 'freebsdbuildjob') THEN 'DISCARD' ELSE '' END) = '') ) AND ( (TRUE AND flight <= 151903) AND (blessing='real') ) AND (branch=?) ORDER BY flight DESC LIMIT 1 After: SELECT * FROM ( SELECT DISTINCT flight, started, blessing, branch, intended FROM flights f JOIN runvars r USING (flight) WHERE name=? AND name LIKE 'revision\_%' AND val=? AND r.flight=f.flight AND ( (CASE WHEN (r.job) LIKE 'build-%-prev' THEN 'xprev' WHEN ((r.job) LIKE 'build-%-freebsd' AND 'x' = 'freebsdbuildjob') THEN 'DISCARD' ELSE '' END) = '') AND ( (TRUE AND flight <= 151903) AND (blessing='real') ) AND (branch=?) ) AS sub WHERE TRUE ORDER BY flight DESC LIMIT 1 In both cases with bind vars: 'revision_xen' '165f3afbfc3db70fcfdccad07085cde0a03c858b' "xen-unstable" Diff to the example query: @@ -1,10 +1,10 @@ SELECT * + FROM ( SELECT DISTINCT + flight, started, blessing, branch, intended FROM flights f - WHERE - EXISTS ( - SELECT 1 - FROM runvars r + JOIN runvars r USING (flight) WHERE name=? + AND name LIKE 'revision\_%' AND val=? AND r.flight=f.flight AND ( (CASE @@ -14,8 +14,8 @@ ELSE '' END) = '') - ) AND ( (TRUE AND flight <= 151903) AND (blessing='real') ) AND (branch=?) +) AS sub WHERE TRUE ORDER BY flight DESC LIMIT 1 Reviewed-by: George Dunlap Signed-off-by: Ian Jackson --- v2: Use proper \ escaping for underscores in LIKE --- Osstest/Executive.pm | 20 ++++++++------------ schema/runvars-revision-index.sql | 2 +- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/Osstest/Executive.pm b/Osstest/Executive.pm index c3dc1261..9208d8af 100644 --- a/Osstest/Executive.pm +++ b/Osstest/Executive.pm @@ -415,37 +415,32 @@ sub report__find_test ($$$$$$$) { my $querytext = < X-Patchwork-Id: 11694715 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 67A6F1746 for ; Fri, 31 Jul 2020 12:02:20 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4E3C222CA1 for ; Fri, 31 Jul 2020 12:02:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4E3C222CA1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Tis-0001TI-4l; Fri, 31 Jul 2020 12:01:14 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Tiq-0001R9-36 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2020 12:01:12 +0000 X-Inumbo-ID: 8663f32e-d325-11ea-8e2b-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 8663f32e-d325-11ea-8e2b-bc764e2007e4; Fri, 31 Jul 2020 12:01:11 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1k1TMs-0001W4-Th; Fri, 31 Jul 2020 12:38:31 +0100 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [OSSTEST PATCH v2 13/41] duration_estimator: Ignore truncated jobs unless we know the step Date: Fri, 31 Jul 2020 12:37:52 +0100 Message-Id: <20200731113820.5765-14-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731113820.5765-1-ian.jackson@eu.citrix.com> References: <20200731113820.5765-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" If we are looking for a particular step then we will ignore jobs without that step, so any job which was truncated before it will be ignored. Otherwise we are looking for the whole job duration and a truncated job is not a good representative. This is a bugfix (to duration estimation), not a performance improvement like the preceding and subsequent changes. Signed-off-by: Ian Jackson --- Osstest/Executive.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Osstest/Executive.pm b/Osstest/Executive.pm index 9208d8af..f528edd0 100644 --- a/Osstest/Executive.pm +++ b/Osstest/Executive.pm @@ -1142,6 +1142,10 @@ sub duration_estimator ($$;$$) { # estimated (and only jobs which contained that step will be # considered). + my $or_status_truncated = ''; + if ($will_uptoincl_testid) { + $or_status_truncated = "OR j.status='truncated'!"; + } my $recentflights_q= $dbh_tests->prepare(<= ? ORDER BY f.started DESC From patchwork Fri Jul 31 11:37:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11694705 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EDE98722 for ; Fri, 31 Jul 2020 12:01:52 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D3D4922B40 for ; Fri, 31 Jul 2020 12:01:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D3D4922B40 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Tiu-0001Uc-ED; Fri, 31 Jul 2020 12:01:16 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Tit-0001R9-Mw for xen-devel@lists.xenproject.org; Fri, 31 Jul 2020 12:01:15 +0000 X-Inumbo-ID: 88960e84-d325-11ea-8e2b-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 88960e84-d325-11ea-8e2b-bc764e2007e4; Fri, 31 Jul 2020 12:01:15 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1k1TMt-0001W4-GK; Fri, 31 Jul 2020 12:38:31 +0100 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [OSSTEST PATCH v2 14/41] duration_estimator: Introduce some _qtxt variables Date: Fri, 31 Jul 2020 12:37:53 +0100 Message-Id: <20200731113820.5765-15-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731113820.5765-1-ian.jackson@eu.citrix.com> References: <20200731113820.5765-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" No functional change. Signed-off-by: Ian Jackson --- Osstest/Executive.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Osstest/Executive.pm b/Osstest/Executive.pm index f528edd0..4cb22cc9 100644 --- a/Osstest/Executive.pm +++ b/Osstest/Executive.pm @@ -1146,7 +1146,7 @@ sub duration_estimator ($$;$$) { if ($will_uptoincl_testid) { $or_status_truncated = "OR j.status='truncated'!"; } - my $recentflights_q= $dbh_tests->prepare(<prepare(<prepare($recentflights_qtxt); + my $duration_anyref_q= $dbh_tests->prepare($duration_anyref_qtxt); my $duration_duration_q = $dbh_tests->prepare($duration_duration_qtxt); return sub { From patchwork Fri Jul 31 11:37:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11694707 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 061D8138C for ; Fri, 31 Jul 2020 12:01:53 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E248722CA1 for ; Fri, 31 Jul 2020 12:01:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E248722CA1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1TiV-0001M3-99; Fri, 31 Jul 2020 12:00:51 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1TiU-0001Jk-KF for xen-devel@lists.xenproject.org; Fri, 31 Jul 2020 12:00:50 +0000 X-Inumbo-ID: 78ce6d3e-d325-11ea-8e2b-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 78ce6d3e-d325-11ea-8e2b-bc764e2007e4; Fri, 31 Jul 2020 12:00:48 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1k1TMt-0001W4-O5; Fri, 31 Jul 2020 12:38:31 +0100 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [OSSTEST PATCH v2 15/41] duration_estimator: Explicitly provide null in general host q Date: Fri, 31 Jul 2020 12:37:54 +0100 Message-Id: <20200731113820.5765-16-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731113820.5765-1-ian.jackson@eu.citrix.com> References: <20200731113820.5765-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Our spec. says we return nulls for started and status if we don't find a job matching the host spec. The way this works right now is that we look up the nonexistent entries in $refs->[0]. This is not really brilliant and is going to be troublesome as we continue to refactor. Provide these values explicitly. No functional change. Signed-off-by: Ian Jackson --- Osstest/Executive.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Osstest/Executive.pm b/Osstest/Executive.pm index 4cb22cc9..d45d6557 100644 --- a/Osstest/Executive.pm +++ b/Osstest/Executive.pm @@ -1169,6 +1169,8 @@ END my $duration_anyref_qtxt= < X-Patchwork-Id: 11694699 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2E434722 for ; Fri, 31 Jul 2020 12:01:32 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1443D22BF3 for ; Fri, 31 Jul 2020 12:01:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1443D22BF3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Tin-0001Rg-S7; Fri, 31 Jul 2020 12:01:09 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Tim-0001R9-5A for xen-devel@lists.xenproject.org; Fri, 31 Jul 2020 12:01:08 +0000 X-Inumbo-ID: 83774e7d-d325-11ea-8e2b-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 83774e7d-d325-11ea-8e2b-bc764e2007e4; Fri, 31 Jul 2020 12:01:07 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1k1TMu-0001W4-4C; Fri, 31 Jul 2020 12:38:32 +0100 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [OSSTEST PATCH v2 16/41] duration_estimator: Return job column in first query Date: Fri, 31 Jul 2020 12:37:55 +0100 Message-Id: <20200731113820.5765-17-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731113820.5765-1-ian.jackson@eu.citrix.com> References: <20200731113820.5765-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson , George Dunlap Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Right now this is pointless since the Perl code doesn't need it. But this row is going to be part of a WITH clause soon. No functional change. Diffs to two example queries (from the Perl DBI trace): SELECT f.flight AS flight, + j.job AS job, f.started AS started, j.status AS status FROM flights f JOIN jobs j USING (flight) JOIN runvars r ON f.flight=r.flight AND r.name=? WHERE j.job=r.job AND f.blessing=? AND f.branch=? AND j.job=? AND r.val=? AND (j.status='pass' OR j.status='fail' OR j.status='truncated'!) AND f.started IS NOT NULL AND f.started >= ? ORDER BY f.started DESC SELECT f.flight AS flight, + s.job AS job, NULL as started, NULL as status, max(s.finished) AS max_finished FROM steps s JOIN flights f ON s.flight=f.flight WHERE s.job=? AND f.blessing=? AND f.branch=? AND s.finished IS NOT NULL AND f.started IS NOT NULL AND f.started >= ? - GROUP BY f.flight + GROUP BY f.flight, s.job ORDER BY max_finished DESC CC: George Dunlap Signed-off-by: Ian Jackson --- Osstest/Executive.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Osstest/Executive.pm b/Osstest/Executive.pm index d45d6557..359120c0 100644 --- a/Osstest/Executive.pm +++ b/Osstest/Executive.pm @@ -1148,6 +1148,7 @@ sub duration_estimator ($$;$$) { } my $recentflights_qtxt= <= ? - GROUP BY f.flight + GROUP BY f.flight, s.job ORDER BY max_finished DESC END # s J J J # fix perl-mode From patchwork Fri Jul 31 11:37:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11694721 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 38D4E14E3 for ; Fri, 31 Jul 2020 12:02:23 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1F57422CAE for ; Fri, 31 Jul 2020 12:02:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1F57422CAE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1TjN-0001oE-DQ; Fri, 31 Jul 2020 12:01:45 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1TjL-0001lW-Kc for xen-devel@lists.xenproject.org; Fri, 31 Jul 2020 12:01:43 +0000 X-Inumbo-ID: 9903baab-d325-11ea-8e2b-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 9903baab-d325-11ea-8e2b-bc764e2007e4; Fri, 31 Jul 2020 12:01:43 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1k1TMu-0001W4-DT; Fri, 31 Jul 2020 12:38:32 +0100 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [OSSTEST PATCH v2 17/41] duration_estimator: Move $uptincl_testid to separate @x_params Date: Fri, 31 Jul 2020 12:37:56 +0100 Message-Id: <20200731113820.5765-18-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731113820.5765-1-ian.jackson@eu.citrix.com> References: <20200731113820.5765-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" This is going to be useful soon. No functional change. Signed-off-by: Ian Jackson --- Osstest/Executive.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Osstest/Executive.pm b/Osstest/Executive.pm index 359120c0..fb975dac 100644 --- a/Osstest/Executive.pm +++ b/Osstest/Executive.pm @@ -1223,6 +1223,9 @@ END_ALWAYS return sub { my ($job, $hostidname, $onhost, $uptoincl_testid) = @_; + my @x_params; + push @x_params, $uptoincl_testid if $will_uptoincl_testid; + my $dbg= $debug ? sub { $debug->("DUR $branch $blessing $job $hostidname $onhost @_"); } : sub { }; @@ -1257,7 +1260,7 @@ END_ALWAYS my $duration_max= 0; foreach my $ref (@$refs) { my @d_d_args = ($ref->{flight}, $job); - push @d_d_args, $uptoincl_testid if $will_uptoincl_testid; + push @d_d_args, @x_params; $duration_duration_q->execute(@d_d_args); my ($duration) = $duration_duration_q->fetchrow_array(); $duration_duration_q->finish(); From patchwork Fri Jul 31 11:37:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11694807 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E9E88138A for ; Fri, 31 Jul 2020 12:13:08 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CFDA8208E4 for ; Fri, 31 Jul 2020 12:13:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CFDA8208E4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Ttz-00047x-25; Fri, 31 Jul 2020 12:12:43 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Tty-00047s-0v for xen-devel@lists.xenproject.org; Fri, 31 Jul 2020 12:12:42 +0000 X-Inumbo-ID: 2140508a-d327-11ea-8e2c-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 2140508a-d327-11ea-8e2c-bc764e2007e4; Fri, 31 Jul 2020 12:12:40 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1k1TMv-0001W4-2L; Fri, 31 Jul 2020 12:38:33 +0100 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [OSSTEST PATCH v2 18/41] duration_estimator: Move duration query loop into database Date: Fri, 31 Jul 2020 12:37:57 +0100 Message-Id: <20200731113820.5765-19-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731113820.5765-1-ian.jackson@eu.citrix.com> References: <20200731113820.5765-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson , George Dunlap Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Stuff the two queries together: we use the firsty query as a WITH clause. This is significantly faster, perhaps because the query optimiser does a better job but probably just because it saves on round trips. No functional change. Perf: subjectively this seemed to help when the cache was cold. Now I have a warm cache and it doesn't seem to make much difference. Perf: runtime of my test case now ~5-7s. Example queries before (from the debugging output): Query A part I: SELECT f.flight AS flight, j.job AS job, f.started AS started, j.status AS status FROM flights f JOIN jobs j USING (flight) JOIN runvars r ON f.flight=r.flight AND r.name=? WHERE j.job=r.job AND f.blessing=? AND f.branch=? AND j.job=? AND r.val=? AND (j.status='pass' OR j.status='fail' OR j.status='truncated'!) AND f.started IS NOT NULL AND f.started >= ? ORDER BY f.started DESC With bind variables: "test-amd64-i386-xl-pvshim" "guest-start" Query B part I: SELECT f.flight AS flight, s.job AS job, NULL as started, NULL as status, max(s.finished) AS max_finished FROM steps s JOIN flights f ON s.flight=f.flight WHERE s.job=? AND f.blessing=? AND f.branch=? AND s.finished IS NOT NULL AND f.started IS NOT NULL AND f.started >= ? GROUP BY f.flight, s.job ORDER BY max_finished DESC With bind variables: "test-armhf-armhf-libvirt" 'real' "xen-unstable" 1594144469 Query common part II: WITH tsteps AS ( SELECT * FROM steps WHERE flight=? AND job=? ) , tsteps2 AS ( SELECT * FROM tsteps WHERE finished <= (SELECT finished FROM tsteps WHERE tsteps.testid = ?) ) SELECT ( SELECT max(finished)-min(started) FROM tsteps2 ) - ( SELECT sum(finished-started) FROM tsteps2 WHERE step = 'ts-hosts-allocate' ) AS duration With bind variables from previous query, eg: 152045 "test-armhf-armhf-libvirt" "guest-start.2" After: Query A (combined): WITH f AS ( SELECT f.flight AS flight, j.job AS job, f.started AS started, j.status AS status FROM flights f JOIN jobs j USING (flight) JOIN runvars r ON f.flight=r.flight AND r.name=? WHERE j.job=r.job AND f.blessing=? AND f.branch=? AND j.job=? AND r.val=? AND (j.status='pass' OR j.status='fail' OR j.status='truncated'!) AND f.started IS NOT NULL AND f.started >= ? ORDER BY f.started DESC ) SELECT flight, max_finished, job, started, status, ( WITH tsteps AS ( SELECT * FROM steps WHERE flight=f.flight AND job=f.job ) , tsteps2 AS ( SELECT * FROM tsteps WHERE finished <= (SELECT finished FROM tsteps WHERE tsteps.testid = ?) ) SELECT ( SELECT max(finished)-min(started) FROM tsteps2 ) - ( SELECT sum(finished-started) FROM tsteps2 WHERE step = 'ts-hosts-allocate' ) AS duration ) FROM f Query B (combined): WITH f AS ( SELECT f.flight AS flight, s.job AS job, NULL as started, NULL as status, max(s.finished) AS max_finished FROM steps s JOIN flights f ON s.flight=f.flight WHERE s.job=? AND f.blessing=? AND f.branch=? AND s.finished IS NOT NULL AND f.started IS NOT NULL AND f.started >= ? GROUP BY f.flight, s.job ORDER BY max_finished DESC ) SELECT flight, max_finished, job, started, status, ( WITH tsteps AS ( SELECT * FROM steps WHERE flight=f.flight AND job=f.job ) , tsteps2 AS ( SELECT * FROM tsteps WHERE finished <= (SELECT finished FROM tsteps WHERE tsteps.testid = ?) ) SELECT ( SELECT max(finished)-min(started) FROM tsteps2 ) - ( SELECT sum(finished-started) FROM tsteps2 WHERE step = 'ts-hosts-allocate' ) AS duration ) FROM f Diff for query A: @@ -1,3 +1,4 @@ + WITH f AS ( SELECT f.flight AS flight, j.job AS job, f.started AS started, @@ -18,11 +19,14 @@ AND f.started >= ? ORDER BY f.started DESC + ) + SELECT flight, max_finished, job, started, status, + ( WITH tsteps AS ( SELECT * FROM steps - WHERE flight=? AND job=? + WHERE flight=f.flight AND job=f.job ) , tsteps2 AS ( @@ -42,3 +46,5 @@ WHERE step = 'ts-hosts-allocate' ) AS duration + + ) FROM f Diff for query B: @@ -1,3 +1,4 @@ + WITH f AS ( SELECT f.flight AS flight, s.job AS job, NULL as started, @@ -12,11 +13,14 @@ GROUP BY f.flight, s.job ORDER BY max_finished DESC + ) + SELECT flight, max_finished, job, started, status, + ( WITH tsteps AS ( SELECT * FROM steps - WHERE flight=? AND job=? + WHERE flight=f.flight AND job=f.job ) , tsteps2 AS ( @@ -36,3 +40,5 @@ WHERE step = 'ts-hosts-allocate' ) AS duration + + ) FROM f Reviewed-by: George Dunlap Signed-off-by: Ian Jackson --- Osstest/Executive.pm | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/Osstest/Executive.pm b/Osstest/Executive.pm index fb975dac..684cafc3 100644 --- a/Osstest/Executive.pm +++ b/Osstest/Executive.pm @@ -1192,7 +1192,7 @@ END ( SELECT * FROM steps - WHERE flight=? AND job=? + WHERE flight=f.flight AND job=f.job ) END_ALWAYS , tsteps2 AS @@ -1216,9 +1216,20 @@ END_UPTOINCL AS duration END_ALWAYS - my $recentflights_q= $dbh_tests->prepare($recentflights_qtxt); - my $duration_anyref_q= $dbh_tests->prepare($duration_anyref_qtxt); - my $duration_duration_q = $dbh_tests->prepare($duration_duration_qtxt); + my $prepare_combi = sub { + db_prepare(<($recentflights_qtxt); + my $duration_anyref_q= $prepare_combi->($duration_anyref_qtxt); return sub { my ($job, $hostidname, $onhost, $uptoincl_testid) = @_; @@ -1239,14 +1250,16 @@ END_ALWAYS $branch, $job, $onhost, - $limit); + $limit, + @x_params); $refs= $recentflights_q->fetchall_arrayref({}); $recentflights_q->finish(); $dbg->("SAME-HOST GOT ".scalar(@$refs)); } if (!@$refs) { - $duration_anyref_q->execute($job, $blessing, $branch, $limit); + $duration_anyref_q->execute($job, $blessing, $branch, $limit, + @x_params); $refs= $duration_anyref_q->fetchall_arrayref({}); $duration_anyref_q->finish(); $dbg->("ANY-HOST GOT ".scalar(@$refs)); @@ -1259,11 +1272,7 @@ END_ALWAYS my $duration_max= 0; foreach my $ref (@$refs) { - my @d_d_args = ($ref->{flight}, $job); - push @d_d_args, @x_params; - $duration_duration_q->execute(@d_d_args); - my ($duration) = $duration_duration_q->fetchrow_array(); - $duration_duration_q->finish(); + my ($duration) = $ref->{duration}; if ($duration) { $dbg->("REF $ref->{flight} DURATION $duration ". ($ref->{status} // '')); From patchwork Fri Jul 31 11:37:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11694687 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B41A0722 for ; Fri, 31 Jul 2020 11:56:32 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 99E2E2245C for ; Fri, 31 Jul 2020 11:56:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 99E2E2245C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Tda-0008Po-F6; Fri, 31 Jul 2020 11:55:46 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1TdY-0008Pj-VK for xen-devel@lists.xenproject.org; Fri, 31 Jul 2020 11:55:44 +0000 X-Inumbo-ID: c25a5cad-d324-11ea-8e29-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id c25a5cad-d324-11ea-8e29-bc764e2007e4; Fri, 31 Jul 2020 11:55:43 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1k1TMv-0001W4-F1; Fri, 31 Jul 2020 12:38:33 +0100 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [OSSTEST PATCH v2 19/41] Executive: Drop redundant AND clause Date: Fri, 31 Jul 2020 12:37:58 +0100 Message-Id: <20200731113820.5765-20-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731113820.5765-1-ian.jackson@eu.citrix.com> References: <20200731113820.5765-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson , George Dunlap Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" In "Executive: Use index for report__find_test" we changed an EXISTS subquery into a JOIN. Now, the condition r.flight=f.flight is redundant because this is the join column (from USING). No functional change. CC: George Dunlap Signed-off-by: Ian Jackson Reviewed-by: George Dunlap --- Osstest/Executive.pm | 1 - 1 file changed, 1 deletion(-) diff --git a/Osstest/Executive.pm b/Osstest/Executive.pm index 684cafc3..2f81e89d 100644 --- a/Osstest/Executive.pm +++ b/Osstest/Executive.pm @@ -433,7 +433,6 @@ END WHERE name=? AND name LIKE 'revision\_%' AND val=? - AND r.flight=f.flight AND ${\ main_revision_job_cond('r.job') } END push @params, "revision_$tree", $revision; From patchwork Fri Jul 31 11:37:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11694689 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4DBC6722 for ; Fri, 31 Jul 2020 11:56:34 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 33A282245C for ; Fri, 31 Jul 2020 11:56:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 33A282245C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Tdg-0008QM-NO; Fri, 31 Jul 2020 11:55:52 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Tdf-0008Q8-CS for xen-devel@lists.xenproject.org; Fri, 31 Jul 2020 11:55:51 +0000 X-Inumbo-ID: c723ccb4-d324-11ea-8e29-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id c723ccb4-d324-11ea-8e29-bc764e2007e4; Fri, 31 Jul 2020 11:55:50 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1k1TMv-0001W4-Qw; Fri, 31 Jul 2020 12:38:34 +0100 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [OSSTEST PATCH v2 20/41] schema: Add index for quick lookup by host Date: Fri, 31 Jul 2020 12:37:59 +0100 Message-Id: <20200731113820.5765-21-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731113820.5765-1-ian.jackson@eu.citrix.com> References: <20200731113820.5765-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Signed-off-by: Ian Jackson --- v2: Use proper \ escaping for underscores in LIKE --- schema/runvars-host-index.sql | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 schema/runvars-host-index.sql diff --git a/schema/runvars-host-index.sql b/schema/runvars-host-index.sql new file mode 100644 index 00000000..222a0a30 --- /dev/null +++ b/schema/runvars-host-index.sql @@ -0,0 +1,8 @@ +-- ##OSSTEST## 009 Preparatory +-- +-- This index helps sg-report-host-history find relevant flights. + +CREATE INDEX runvars_host_idx + ON runvars (val, flight) + WHERE name ='host' + OR name LIKE '%\_host'; From patchwork Fri Jul 31 11:38:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11694697 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4C9A11392 for ; Fri, 31 Jul 2020 11:57:21 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3361422B40 for ; Fri, 31 Jul 2020 11:57:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3361422B40 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Tdy-00005B-S1; Fri, 31 Jul 2020 11:56:10 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Tdx-0008RD-Td for xen-devel@lists.xenproject.org; Fri, 31 Jul 2020 11:56:09 +0000 X-Inumbo-ID: d21043bf-d324-11ea-8e29-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id d21043bf-d324-11ea-8e29-bc764e2007e4; Fri, 31 Jul 2020 11:56:09 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1k1TMx-0001W4-0B; Fri, 31 Jul 2020 12:38:35 +0100 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [OSSTEST PATCH v2 21/41] sg-report-host-history: Find flight limit by flight start date Date: Fri, 31 Jul 2020 12:38:00 +0100 Message-Id: <20200731113820.5765-22-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731113820.5765-1-ian.jackson@eu.citrix.com> References: <20200731113820.5765-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" By default we look for anything in (roughly) the last year. This query is in fact quite fast because the flights table is small. There is still the per-host limit of $limit (2000) recent runs. Signed-off-by: Ian Jackson --- sg-report-host-history | 56 ++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/sg-report-host-history b/sg-report-host-history index 9730ae7a..a159df3e 100755 --- a/sg-report-host-history +++ b/sg-report-host-history @@ -29,6 +29,7 @@ use POSIX; use Osstest::Executive qw(:DEFAULT :colours); our $limit= 2000; +our $timelimit= 86400 * (366 + 14); our $flightlimit; our $htmlout = "."; our $read_existing=1; @@ -45,6 +46,8 @@ while (@ARGV && $ARGV[0] =~ m/^-/) { last if m/^--?$/; if (m/^--(limit)\=([1-9]\d*)$/) { $$1= $2; + } elsif (m/^--time-limit\=([1-9]\d*)$/) { + $timelimit= $1; } elsif (m/^--flight-limit\=([1-9]\d*)$/) { $flightlimit= $1; } elsif (restrictflight_arg($_)) { @@ -108,38 +111,33 @@ sub read_existing_logs ($) { } sub computeflightsrange () { - if (!$flightlimit) { - my $flagscond = - '('.join(' OR ', map { "f.hostflag = 'blessed-$_'" } @blessings).')'; - my $nhostsq = db_prepare(<execute(); - my ($nhosts) = $nhostsq->fetchrow_array(); - print DEBUG "COUNTED $nhosts hosts\n"; - $flightlimit = $nhosts * $limit * 2; - } - - my $minflightsq = db_prepare(<execute(); + ($minflight,) = $minflightsq->fetchrow_array(); + } else { + my $minflightsq = db_prepare(<= ? + ORDER BY flight ASC + LIMIT 1 END - $minflightsq->execute(); - ($minflight,) = $minflightsq->fetchrow_array(); + my $now = time // die $!; + $minflightsq->execute($now - $timelimit); + ($minflight,) = $minflightsq->fetchrow_array(); + } $minflight //= 0; $flightcond = "(flight > $minflight)"; From patchwork Fri Jul 31 11:38:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11694815 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 53A8F722 for ; Fri, 31 Jul 2020 12:13:57 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3A25D208E4 for ; Fri, 31 Jul 2020 12:13:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3A25D208E4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1TuF-0004C7-QY; Fri, 31 Jul 2020 12:12:59 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1TuD-0004Ac-Pm for xen-devel@lists.xenproject.org; Fri, 31 Jul 2020 12:12:57 +0000 X-Inumbo-ID: 2b067d9c-d327-11ea-8e2c-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 2b067d9c-d327-11ea-8e2c-bc764e2007e4; Fri, 31 Jul 2020 12:12:57 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1k1TMx-0001W4-Jl; Fri, 31 Jul 2020 12:38:35 +0100 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [OSSTEST PATCH v2 22/41] sg-report-host-history: Drop per-job debug etc. Date: Fri, 31 Jul 2020 12:38:01 +0100 Message-Id: <20200731113820.5765-23-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731113820.5765-1-ian.jackson@eu.citrix.com> References: <20200731113820.5765-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" This printing has a significant effect on the performance of this program, at least after we optimise various other things. Signed-off-by: Ian Jackson --- sg-report-host-history | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sg-report-host-history b/sg-report-host-history index a159df3e..a34458e0 100755 --- a/sg-report-host-history +++ b/sg-report-host-history @@ -102,9 +102,9 @@ sub read_existing_logs ($) { my $k = $1; s{\%([0-9a-f]{2})}{ chr hex $1 }ge; $ch->{$k} = $_; - print DEBUG "GOTCACHE $hostname $k\n"; +# print DEBUG "GOTCACHE $hostname $k\n"; } - print DEBUG "GOTCACHE $hostname \@ $jr->{flight} $jr->{job} $jr->{status},$jr->{name}\n"; +# print DEBUG "GOTCACHE $hostname \@ $jr->{flight} $jr->{job} $jr->{status},$jr->{name}\n"; $tcache->{$jr->{flight},$jr->{job},$jr->{status},$jr->{name}} = $jr; } close H; @@ -272,7 +272,7 @@ END my @rows; my $cachehits = 0; foreach my $jr (@$inrows) { - print DEBUG "JOB $jr->{flight}.$jr->{job} "; + #print DEBUG "JOB $jr->{flight}.$jr->{job} "; my $cacherow = $tcache->{$jr->{flight},$jr->{job},$jr->{status},$jr->{name}}; @@ -283,11 +283,11 @@ END my $endedrow = jobquery($endedq, $jr, 'e'); if (!$endedrow) { - print DEBUG "no-finished\n"; + #print DEBUG "no-finished\n"; next; } - print DEBUG join " ", map { $endedrow->{$_} } sort keys %$endedrow; - print DEBUG ".\n"; + #print DEBUG join " ", map { $endedrow->{$_} } sort keys %$endedrow; + #print DEBUG ".\n"; push @rows, { %$jr, %$endedrow }; } @@ -329,7 +329,7 @@ END next; } - print DEBUG "JR $jr->{flight}.$jr->{job}\n"; + #print DEBUG "JR $jr->{flight}.$jr->{job}\n"; my $ir = jobquery($infoq, $jr, 'i'); my $ar = jobquery($allocdq, $jr, 'a'); my $ident = $jr->{name}; From patchwork Fri Jul 31 11:38:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11694817 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5918B722 for ; Fri, 31 Jul 2020 12:13:58 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3F78C208E4 for ; Fri, 31 Jul 2020 12:13:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3F78C208E4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1TuO-0004GX-E4; Fri, 31 Jul 2020 12:13:08 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1TuM-0004Ac-VB for xen-devel@lists.xenproject.org; Fri, 31 Jul 2020 12:13:06 +0000 X-Inumbo-ID: 2defe6f6-d327-11ea-8e2c-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 2defe6f6-d327-11ea-8e2c-bc764e2007e4; Fri, 31 Jul 2020 12:13:02 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1k1TMy-0001W4-0G; Fri, 31 Jul 2020 12:38:36 +0100 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [OSSTEST PATCH v2 23/41] Executive: Export opendb_tests Date: Fri, 31 Jul 2020 12:38:02 +0100 Message-Id: <20200731113820.5765-24-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731113820.5765-1-ian.jackson@eu.citrix.com> References: <20200731113820.5765-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" sg-report-host-history is going to want this in a moment Signed-off-by: Ian Jackson --- Osstest/Executive.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Osstest/Executive.pm b/Osstest/Executive.pm index 2f81e89d..8e4c5b9a 100644 --- a/Osstest/Executive.pm +++ b/Osstest/Executive.pm @@ -49,7 +49,7 @@ BEGIN { task_spec_desc findtask findtask_spec @all_lock_tables restrictflight_arg restrictflight_cond report_run_getinfo report_altcolour - report_altchangecolour + report_altchangecolour opendb_tests report_blessingscond report_find_push_age_info tcpconnect_queuedaemon plan_search manual_allocation_base_jobinfo From patchwork Fri Jul 31 11:38:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11694739 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A6945138C for ; Fri, 31 Jul 2020 12:02:44 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8B3CE22B40 for ; Fri, 31 Jul 2020 12:02:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8B3CE22B40 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1TjL-0001mI-3V; Fri, 31 Jul 2020 12:01:43 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1TjJ-0001lW-Sp for xen-devel@lists.xenproject.org; Fri, 31 Jul 2020 12:01:41 +0000 X-Inumbo-ID: 982be3e6-d325-11ea-8e2b-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 982be3e6-d325-11ea-8e2b-bc764e2007e4; Fri, 31 Jul 2020 12:01:41 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1k1TMy-0001W4-Vh; Fri, 31 Jul 2020 12:38:37 +0100 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [OSSTEST PATCH v2 24/41] sg-report-host-history: Add a debug print after sorting jobs Date: Fri, 31 Jul 2020 12:38:03 +0100 Message-Id: <20200731113820.5765-25-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731113820.5765-1-ian.jackson@eu.citrix.com> References: <20200731113820.5765-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" This helps rule this sort out as a source of slowness. Signed-off-by: Ian Jackson --- sg-report-host-history | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sg-report-host-history b/sg-report-host-history index a34458e0..1c2d19ae 100755 --- a/sg-report-host-history +++ b/sg-report-host-history @@ -318,6 +318,8 @@ END @rows = sort { $b->{finished} <=> $a->{finished} } @rows; + print DEBUG "SORTED\n"; + my $alternate = 0; my $wrote = 0; my $runvarq_hits = 0; From patchwork Fri Jul 31 11:38:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11694733 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E86A814E3 for ; Fri, 31 Jul 2020 12:02:38 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CF0B522BF3 for ; Fri, 31 Jul 2020 12:02:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CF0B522BF3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Tj7-0001cQ-Ag; Fri, 31 Jul 2020 12:01:29 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Tj6-0001R9-3c for xen-devel@lists.xenproject.org; Fri, 31 Jul 2020 12:01:28 +0000 X-Inumbo-ID: 8fd671a2-d325-11ea-8e2b-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 8fd671a2-d325-11ea-8e2b-bc764e2007e4; Fri, 31 Jul 2020 12:01:27 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1k1TMz-0001W4-DE; Fri, 31 Jul 2020 12:38:37 +0100 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [OSSTEST PATCH v2 25/41] sg-report-host-history: Do the main query per host Date: Fri, 31 Jul 2020 12:38:04 +0100 Message-Id: <20200731113820.5765-26-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731113820.5765-1-ian.jackson@eu.citrix.com> References: <20200731113820.5765-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" In f6001d628c3b3fd42b10cd15351981a04bc02572 we combined these queries into one: sg-report-host-history: Aggregate runvars query for all hosts Now that we have an index, there is a faster way for the db to do this query: via that index. But it doesn't like to do that if be aggregate the queries. Experimentally, doing this query separately once per host is significantly faster. Also, later, it will allow us to parallelise this work. So, we undo that. (Not by reverting, though.) Signed-off-by: Ian Jackson --- v2: Use proper \ escaping for underscores in LIKE --- schema/runvars-host-index.sql | 2 +- sg-report-host-history | 27 +++++++++------------------ 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/schema/runvars-host-index.sql b/schema/runvars-host-index.sql index 222a0a30..6a3ef377 100644 --- a/schema/runvars-host-index.sql +++ b/schema/runvars-host-index.sql @@ -1,4 +1,4 @@ --- ##OSSTEST## 009 Preparatory +-- ##OSSTEST## 009 Needed -- -- This index helps sg-report-host-history find relevant flights. diff --git a/sg-report-host-history b/sg-report-host-history index 1c2d19ae..15866ab6 100755 --- a/sg-report-host-history +++ b/sg-report-host-history @@ -165,34 +165,25 @@ sub jobquery ($$$) { our %hosts; sub mainquery () { - our $valcond = join " OR ", map { "val = ?" } keys %hosts; - our @params = keys %hosts; - our $runvarq //= db_prepare(< ? ORDER BY flight DESC - LIMIT ($limit * 3 + 100) * ? + LIMIT $limit * 2 END + foreach my $host (sort keys %hosts) { + print DEBUG "MAINQUERY $host...\n"; + $runvarq->execute($host, $minflight); - push @params, $minflight; - push @params, scalar keys %hosts; - - print DEBUG "MAINQUERY...\n"; - $runvarq->execute(@params); - - print DEBUG "FIRST PASS\n"; - while (my $jr= $runvarq->fetchrow_hashref()) { - print DEBUG " $jr->{flight}.$jr->{job} "; - push @{ $hosts{$jr->{val}} }, $jr; + $hosts{$host} = $runvarq->fetchall_arrayref({}); + print DEBUG "MAINQUERY $host got ".(scalar @{ $hosts{$host} })."\n"; } - print DEBUG "\n"; } sub reporthost ($) { From patchwork Fri Jul 31 11:38:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11694761 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1CC23722 for ; Fri, 31 Jul 2020 12:03:19 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 02B6F22BF3 for ; Fri, 31 Jul 2020 12:03:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 02B6F22BF3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Tjv-00029K-9j; Fri, 31 Jul 2020 12:02:19 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Tju-00026u-4q for xen-devel@lists.xenproject.org; Fri, 31 Jul 2020 12:02:18 +0000 X-Inumbo-ID: ad15deb1-d325-11ea-8e2b-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id ad15deb1-d325-11ea-8e2b-bc764e2007e4; Fri, 31 Jul 2020 12:02:16 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1k1TMz-0001W4-QA; Fri, 31 Jul 2020 12:38:37 +0100 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [OSSTEST PATCH v2 26/41] sg-report-host-history: Rerganisation: Make mainquery per-host Date: Fri, 31 Jul 2020 12:38:05 +0100 Message-Id: <20200731113820.5765-27-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731113820.5765-1-ian.jackson@eu.citrix.com> References: <20200731113820.5765-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" This moves the loop over hosts into the main program. We are working our way to a new code structure. No functional change. Signed-off-by: Ian Jackson --- sg-report-host-history | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/sg-report-host-history b/sg-report-host-history index 15866ab6..34216aa2 100755 --- a/sg-report-host-history +++ b/sg-report-host-history @@ -164,7 +164,9 @@ sub jobquery ($$$) { our %hosts; -sub mainquery () { +sub mainquery ($) { + my ($host) = @_; + our $runvarq //= db_prepare(<execute($host, $minflight); - $hosts{$host} = $runvarq->fetchall_arrayref({}); - print DEBUG "MAINQUERY $host got ".(scalar @{ $hosts{$host} })."\n"; - } + print DEBUG "MAINQUERY $host...\n"; + $runvarq->execute($host, $minflight); + + $hosts{$host} = $runvarq->fetchall_arrayref({}); + print DEBUG "MAINQUERY $host got ".(scalar @{ $hosts{$host} })."\n"; } sub reporthost ($) { @@ -474,7 +475,9 @@ db_retry($dbh_tests, [], sub { }); db_retry($dbh_tests, [], sub { - mainquery(); + foreach my $host (sort keys %hosts) { + mainquery($host); + } }); foreach my $host (sort keys %hosts) { From patchwork Fri Jul 31 11:38:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11694695 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 03FFE722 for ; Fri, 31 Jul 2020 11:57:07 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DE68B2245C for ; Fri, 31 Jul 2020 11:57:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DE68B2245C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Tdu-0008Uj-IZ; Fri, 31 Jul 2020 11:56:06 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Tds-0008RD-Pc for xen-devel@lists.xenproject.org; Fri, 31 Jul 2020 11:56:04 +0000 X-Inumbo-ID: ce5a97ba-d324-11ea-8e29-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id ce5a97ba-d324-11ea-8e29-bc764e2007e4; Fri, 31 Jul 2020 11:56:02 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1k1TN0-0001W4-4W; Fri, 31 Jul 2020 12:38:38 +0100 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [OSSTEST PATCH v2 27/41] sg-report-host-history: Rerganisation: Read old logs later Date: Fri, 31 Jul 2020 12:38:06 +0100 Message-Id: <20200731113820.5765-28-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731113820.5765-1-ian.jackson@eu.citrix.com> References: <20200731113820.5765-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Perhaps at one point something read from these logs influenced the db query for thye flights range, but that is no longer the case and it doesn't seem likely to need to come back. We want to move the per-host stuff together. No functional change. Signed-off-by: Ian Jackson --- sg-report-host-history | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sg-report-host-history b/sg-report-host-history index 34216aa2..3f4670e5 100755 --- a/sg-report-host-history +++ b/sg-report-host-history @@ -466,14 +466,14 @@ END exit 0 unless %hosts; -foreach (keys %hosts) { - read_existing_logs($_); -} - db_retry($dbh_tests, [], sub { computeflightsrange(); }); +foreach (keys %hosts) { + read_existing_logs($_); +} + db_retry($dbh_tests, [], sub { foreach my $host (sort keys %hosts) { mainquery($host); From patchwork Fri Jul 31 11:38:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11694813 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0FF78138A for ; Fri, 31 Jul 2020 12:13:55 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E9063208E4 for ; Fri, 31 Jul 2020 12:13:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E9063208E4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1TuJ-0004EJ-4s; Fri, 31 Jul 2020 12:13:03 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1TuH-0004Ac-V0 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2020 12:13:01 +0000 X-Inumbo-ID: 2c6d87ca-d327-11ea-8e2c-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 2c6d87ca-d327-11ea-8e2c-bc764e2007e4; Fri, 31 Jul 2020 12:12:59 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1k1TN0-0001W4-HO; Fri, 31 Jul 2020 12:38:38 +0100 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [OSSTEST PATCH v2 28/41] sg-report-host-history: Rerganisation: Change loops Date: Fri, 31 Jul 2020 12:38:07 +0100 Message-Id: <20200731113820.5765-29-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731113820.5765-1-ian.jackson@eu.citrix.com> References: <20200731113820.5765-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Move the per-host code all into the same per-host loop. One effect is to transpose the db_retry and host loops for mainquery. No functional change. Signed-off-by: Ian Jackson --- sg-report-host-history | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/sg-report-host-history b/sg-report-host-history index 3f4670e5..2ca0e235 100755 --- a/sg-report-host-history +++ b/sg-report-host-history @@ -470,18 +470,10 @@ db_retry($dbh_tests, [], sub { computeflightsrange(); }); -foreach (keys %hosts) { - read_existing_logs($_); -} - -db_retry($dbh_tests, [], sub { - foreach my $host (sort keys %hosts) { - mainquery($host); - } -}); - foreach my $host (sort keys %hosts) { + read_existing_logs($host); db_retry($dbh_tests, [], sub { + mainquery($host); reporthost $host; }); } From patchwork Fri Jul 31 11:38:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11694821 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 15564138A for ; Fri, 31 Jul 2020 12:14:43 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EF8AA22CF7 for ; Fri, 31 Jul 2020 12:14:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EF8AA22CF7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1TuY-0004MN-5g; Fri, 31 Jul 2020 12:13:18 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1TuW-0004Ac-VG for xen-devel@lists.xenproject.org; Fri, 31 Jul 2020 12:13:16 +0000 X-Inumbo-ID: 33015f95-d327-11ea-8e2c-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 33015f95-d327-11ea-8e2c-bc764e2007e4; Fri, 31 Jul 2020 12:13:10 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1k1TN0-0001W4-Th; Fri, 31 Jul 2020 12:38:39 +0100 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [OSSTEST PATCH v2 29/41] sg-report-host-history: Drop a redundznt AND clause Date: Fri, 31 Jul 2020 12:38:08 +0100 Message-Id: <20200731113820.5765-30-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731113820.5765-1-ian.jackson@eu.citrix.com> References: <20200731113820.5765-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" This condition is the same as $flightcond. (This has no effect on the db performance since the query planner figures it out, but it is confusing.) Signed-off-by: Ian Jackson --- sg-report-host-history | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sg-report-host-history b/sg-report-host-history index 2ca0e235..f4352fc3 100755 --- a/sg-report-host-history +++ b/sg-report-host-history @@ -175,13 +175,12 @@ sub mainquery ($) { AND val = ? AND $flightcond AND $restrictflight_cond - AND flight > ? ORDER BY flight DESC LIMIT $limit * 2 END print DEBUG "MAINQUERY $host...\n"; - $runvarq->execute($host, $minflight); + $runvarq->execute($host); $hosts{$host} = $runvarq->fetchall_arrayref({}); print DEBUG "MAINQUERY $host got ".(scalar @{ $hosts{$host} })."\n"; From patchwork Fri Jul 31 11:38:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11694691 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 776F0722 for ; Fri, 31 Jul 2020 11:56:43 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5D4BC2245C for ; Fri, 31 Jul 2020 11:56:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5D4BC2245C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Tdn-0008RS-0O; Fri, 31 Jul 2020 11:55:59 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Tdl-0008RD-O1 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2020 11:55:57 +0000 X-Inumbo-ID: caff2b44-d324-11ea-8e29-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id caff2b44-d324-11ea-8e29-bc764e2007e4; Fri, 31 Jul 2020 11:55:57 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1k1TN1-0001W4-JE; Fri, 31 Jul 2020 12:38:39 +0100 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [OSSTEST PATCH v2 30/41] sg-report-host-history: Fork Date: Fri, 31 Jul 2020 12:38:09 +0100 Message-Id: <20200731113820.5765-31-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731113820.5765-1-ian.jackson@eu.citrix.com> References: <20200731113820.5765-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Run each host's report in a separate child. This is considerably faster. Signed-off-by: Ian Jackson --- sg-report-host-history | 47 +++++++++++++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 7 deletions(-) diff --git a/sg-report-host-history b/sg-report-host-history index f4352fc3..dc694ebe 100755 --- a/sg-report-host-history +++ b/sg-report-host-history @@ -34,6 +34,7 @@ our $flightlimit; our $htmlout = "."; our $read_existing=1; our $doinstall=1; +our $maxjobs=10; our @blessings; open DEBUG, ">/dev/null"; @@ -44,7 +45,7 @@ csreadconfig(); while (@ARGV && $ARGV[0] =~ m/^-/) { $_= shift @ARGV; last if m/^--?$/; - if (m/^--(limit)\=([1-9]\d*)$/) { + if (m/^--(limit|maxjobs)\=([1-9]\d*)$/) { $$1= $2; } elsif (m/^--time-limit\=([1-9]\d*)$/) { $timelimit= $1; @@ -469,12 +470,44 @@ db_retry($dbh_tests, [], sub { computeflightsrange(); }); +undef $dbh_tests; + +our %children; +our $worst = 0; + +sub wait_for_max_children ($) { + my ($lim) = @_; + while (keys(%children) > $lim) { + $!=0; $?=0; my $got = wait; + die "$! $got $?" unless exists $children{$got}; + my $host = $children{$got}; + delete $children{$got}; + $worst = $? if $? > $worst; + if ($?) { + print STDERR "sg-report-flight[: [$got] failed for $host: $?\n"; + } else { + print DEBUG "REAPED [$got] $host\n"; + } + } +} + foreach my $host (sort keys %hosts) { - read_existing_logs($host); - db_retry($dbh_tests, [], sub { - mainquery($host); - reporthost $host; - }); + wait_for_max_children($maxjobs); + + my $pid = fork // die $!; + if (!$pid) { + opendb_tests(); + read_existing_logs($host); + db_retry($dbh_tests, [], sub { + mainquery($host); + reporthost $host; + }); + print DEBUG "JQ CACHE ".($jqtotal-$jqcachemisses)." / $jqtotal\n"; + exit(0); + } + print DEBUG "SPAWNED [$pid] $host\n"; + $children{$pid} = $host; } -print DEBUG "JQ CACHE ".($jqtotal-$jqcachemisses)." / $jqtotal\n"; +wait_for_max_children(0); +exit $worst; From patchwork Fri Jul 31 11:38:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11694701 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7F982722 for ; Fri, 31 Jul 2020 12:01:33 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6653022BF3 for ; Fri, 31 Jul 2020 12:01:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6653022BF3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1TiL-0001Jt-P9; Fri, 31 Jul 2020 12:00:41 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1TiK-0001Jk-L8 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2020 12:00:40 +0000 X-Inumbo-ID: 737bffed-d325-11ea-8e2b-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 737bffed-d325-11ea-8e2b-bc764e2007e4; Fri, 31 Jul 2020 12:00:40 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1k1TN1-0001W4-UH; Fri, 31 Jul 2020 12:38:40 +0100 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [OSSTEST PATCH v2 31/41] schema: Add index to help cs-bisection-step Date: Fri, 31 Jul 2020 12:38:10 +0100 Message-Id: <20200731113820.5765-32-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731113820.5765-1-ian.jackson@eu.citrix.com> References: <20200731113820.5765-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" cs-bisection step basis search involves looking for recent flights that weren't broken. A flight is broken if it has broken steps. Make an index for this to save it scanning the steps table. Signed-off-by: Ian Jackson --- schema/steps-broken-index.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 schema/steps-broken-index.sql diff --git a/schema/steps-broken-index.sql b/schema/steps-broken-index.sql new file mode 100644 index 00000000..770747cc --- /dev/null +++ b/schema/steps-broken-index.sql @@ -0,0 +1,7 @@ +-- ##OSSTEST## 010 Harmless +-- +-- This index helps cs-bisection-flight check if flighss are broken. + +CREATE INDEX steps_broken_idx + ON steps (flight) + WHERE status='broken'; From patchwork Fri Jul 31 11:38:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11694745 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6E321722 for ; Fri, 31 Jul 2020 12:02:46 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5525422CA1 for ; Fri, 31 Jul 2020 12:02:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5525422CA1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Tk4-0002HY-Si; Fri, 31 Jul 2020 12:02:28 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Tk4-00026u-5E for xen-devel@lists.xenproject.org; Fri, 31 Jul 2020 12:02:28 +0000 X-Inumbo-ID: b261fa71-d325-11ea-8e2b-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id b261fa71-d325-11ea-8e2b-bc764e2007e4; Fri, 31 Jul 2020 12:02:26 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1k1TN2-0001W4-AN; Fri, 31 Jul 2020 12:38:40 +0100 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [OSSTEST PATCH v2 32/41] adhoc-revtuple-generator: Fix an undef warning in a debug print Date: Fri, 31 Jul 2020 12:38:11 +0100 Message-Id: <20200731113820.5765-33-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731113820.5765-1-ian.jackson@eu.citrix.com> References: <20200731113820.5765-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" $parents might be undef here. Signed-off-by: Ian Jackson --- New in v2. --- adhoc-revtuple-generator | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adhoc-revtuple-generator b/adhoc-revtuple-generator index c8d6f4ad..ec33305a 100755 --- a/adhoc-revtuple-generator +++ b/adhoc-revtuple-generator @@ -463,7 +463,7 @@ sub coalesce { $out->{$node}{Date}= $explode_date; my $parents= $graphs[$explode_i]{ $node[$explode_i] }{Parents}; print DEBUG "#$explode_i $explode_isearliest". - " $explode_date x".scalar(@$parents)."\n"; + " $explode_date x".($parents ? scalar(@$parents) : "-")."\n"; foreach my $subparent (@$parents) { $node[$explode_i]= $subparent; From patchwork Fri Jul 31 11:38:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11694759 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C65C6722 for ; Fri, 31 Jul 2020 12:03:14 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AD09922BF3 for ; Fri, 31 Jul 2020 12:03:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AD09922BF3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Tjt-00027b-0S; Fri, 31 Jul 2020 12:02:17 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Tjr-00026u-HR for xen-devel@lists.xenproject.org; Fri, 31 Jul 2020 12:02:15 +0000 X-Inumbo-ID: ac328bec-d325-11ea-8e2b-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id ac328bec-d325-11ea-8e2b-bc764e2007e4; Fri, 31 Jul 2020 12:02:14 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1k1TN2-0001W4-LZ; Fri, 31 Jul 2020 12:38:40 +0100 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [OSSTEST PATCH v2 33/41] cs-bisection-step: Generalise qtxt_common_rev_ok Date: Fri, 31 Jul 2020 12:38:12 +0100 Message-Id: <20200731113820.5765-34-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731113820.5765-1-ian.jackson@eu.citrix.com> References: <20200731113820.5765-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" * Make it into a subref which takes a $table argument. * Change the two references into function calls using the @{...} syntax * Move the definition earlier in the file No change to the generated query. Signed-off-by: Ian Jackson --- v2: New patch. --- cs-bisection-step | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/cs-bisection-step b/cs-bisection-step index 9a0fee39..5d4e179e 100755 --- a/cs-bisection-step +++ b/cs-bisection-step @@ -182,6 +182,14 @@ END sub flight_rmap ($$) { my ($flight, $need_urls) = @_; + my $qtxt_common_rev_ok = sub { + my ($table) = @_; + [<do(<('rev') } ORDER by rev.name; @@ -262,7 +266,7 @@ $qtxt_common_tables CROSS JOIN tmp_build_info AS url WHERE -$qtxt_common_rev_condition +@{ $qtxt_common_rev_ok->('rev') } AND url.name LIKE E'tree\\_%' AND url.use = rev.use AND url.job = rev.job From patchwork Fri Jul 31 11:38:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11694809 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 23B4F138A for ; Fri, 31 Jul 2020 12:13:31 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 09CB1208E4 for ; Fri, 31 Jul 2020 12:13:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 09CB1208E4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1TuT-0004Jk-Re; Fri, 31 Jul 2020 12:13:13 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1TuR-0004Ac-VB for xen-devel@lists.xenproject.org; Fri, 31 Jul 2020 12:13:11 +0000 X-Inumbo-ID: 3007e43e-d327-11ea-8e2c-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 3007e43e-d327-11ea-8e2c-bc764e2007e4; Fri, 31 Jul 2020 12:13:05 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1k1TN3-0001W4-1J; Fri, 31 Jul 2020 12:38:41 +0100 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [OSSTEST PATCH v2 34/41] cs-bisection-step: Move an AND Date: Fri, 31 Jul 2020 12:38:13 +0100 Message-Id: <20200731113820.5765-35-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731113820.5765-1-ian.jackson@eu.citrix.com> References: <20200731113820.5765-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" This obviously-fine change makes the next commit easier to review. Signed-off-by: Ian Jackson --- v2: New patch. --- cs-bisection-step | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cs-bisection-step b/cs-bisection-step index 5d4e179e..f11726aa 100755 --- a/cs-bisection-step +++ b/cs-bisection-step @@ -266,8 +266,8 @@ $qtxt_common_tables CROSS JOIN tmp_build_info AS url WHERE -@{ $qtxt_common_rev_ok->('rev') } - AND url.name LIKE E'tree\\_%' +@{ $qtxt_common_rev_ok->('rev') } AND + url.name LIKE E'tree\\_%' AND url.use = rev.use AND url.job = rev.job AND (rev.name = 'built_revision_' || substr(url.name,6) OR From patchwork Fri Jul 31 11:38:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11694729 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D86FA722 for ; Fri, 31 Jul 2020 12:02:35 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BEE6B22BF3 for ; Fri, 31 Jul 2020 12:02:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BEE6B22BF3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1TjB-0001ft-Pk; Fri, 31 Jul 2020 12:01:33 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1TjB-0001R9-3l for xen-devel@lists.xenproject.org; Fri, 31 Jul 2020 12:01:33 +0000 X-Inumbo-ID: 9260ce9a-d325-11ea-8e2b-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 9260ce9a-d325-11ea-8e2b-bc764e2007e4; Fri, 31 Jul 2020 12:01:31 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1k1TN3-0001W4-Dg; Fri, 31 Jul 2020 12:38:41 +0100 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [OSSTEST PATCH v2 35/41] cs-bisection-step: Break out qtxt_common_ok Date: Fri, 31 Jul 2020 12:38:14 +0100 Message-Id: <20200731113820.5765-36-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731113820.5765-1-ian.jackson@eu.citrix.com> References: <20200731113820.5765-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Make this bit of query into a subref which takes a $table argument. No change to the generated query. Signed-off-by: Ian Jackson --- v2: New patch. --- cs-bisection-step | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cs-bisection-step b/cs-bisection-step index f11726aa..ba0c6424 100755 --- a/cs-bisection-step +++ b/cs-bisection-step @@ -190,6 +190,13 @@ sub flight_rmap ($$) { END }; + my $qtxt_common_tree_ok = sub { + my ($table) = @_; + [<do(<('rev') } AND - url.name LIKE E'tree\\_%' +@{ $qtxt_common_tree_ok->('url') } AND url.use = rev.use AND url.job = rev.job AND (rev.name = 'built_revision_' || substr(url.name,6) OR From patchwork Fri Jul 31 11:38:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11694811 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 523FA722 for ; Fri, 31 Jul 2020 12:13:49 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 38B3C208E4 for ; Fri, 31 Jul 2020 12:13:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 38B3C208E4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Tu4-00048N-9w; Fri, 31 Jul 2020 12:12:48 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Tu3-000489-Db for xen-devel@lists.xenproject.org; Fri, 31 Jul 2020 12:12:47 +0000 X-Inumbo-ID: 24dc3ab0-d327-11ea-8e2c-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 24dc3ab0-d327-11ea-8e2c-bc764e2007e4; Fri, 31 Jul 2020 12:12:46 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1k1TN3-0001W4-Pd; Fri, 31 Jul 2020 12:38:41 +0100 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [OSSTEST PATCH v2 36/41] cs-bisection-step: Use db_prepare a few times instead of ->do Date: Fri, 31 Jul 2020 12:38:15 +0100 Message-Id: <20200731113820.5765-37-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731113820.5765-1-ian.jackson@eu.citrix.com> References: <20200731113820.5765-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" With $dbh_tests->do(...), we can only get a debug trace of the queries by using DBI_TRACE which produces voluminous output. Using our own db_prepare invokes our own debugging. No functional change. Signed-off-by: Ian Jackson --- v2: New patch. --- cs-bisection-step | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cs-bisection-step b/cs-bisection-step index ba0c6424..1c165b78 100755 --- a/cs-bisection-step +++ b/cs-bisection-step @@ -197,7 +197,7 @@ END END }; - $dbh_tests->do(<execute(); CREATE TEMP TABLE tmp_build_info ( use varchar NOT NULL, name varchar NOT NULL, @@ -206,7 +206,7 @@ END ) END - $dbh_tests->do(<execute($job, $flight); INSERT INTO tmp_build_info SELECT t.name AS use, @@ -230,7 +230,7 @@ END END) END - $dbh_tests->do(<execute($job, $flight); INSERT INTO tmp_build_info SELECT '' AS use, From patchwork Fri Jul 31 11:38:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11694703 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DC3A1722 for ; Fri, 31 Jul 2020 12:01:41 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C2CAD22B40 for ; Fri, 31 Jul 2020 12:01:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C2CAD22B40 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1TiR-0001KY-0p; Fri, 31 Jul 2020 12:00:47 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1TiP-0001Jk-Jv for xen-devel@lists.xenproject.org; Fri, 31 Jul 2020 12:00:45 +0000 X-Inumbo-ID: 76268c7e-d325-11ea-8e2b-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 76268c7e-d325-11ea-8e2b-bc764e2007e4; Fri, 31 Jul 2020 12:00:44 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1k1TN4-0001W4-8W; Fri, 31 Jul 2020 12:38:42 +0100 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [OSSTEST PATCH v2 37/41] cs-bisection-step: temporary table: Insert only rows we care about Date: Fri, 31 Jul 2020 12:38:16 +0100 Message-Id: <20200731113820.5765-38-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731113820.5765-1-ian.jackson@eu.citrix.com> References: <20200731113820.5765-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Every use of this table has a WHERE or ON which invokes at least one of these conditions. So put only those rows into the table. This provides a significant speedup (which I haven't properly measured). No overall functional change. Signed-off-by: Ian Jackson --- v2: New patch. --- cs-bisection-step | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cs-bisection-step b/cs-bisection-step index 1c165b78..718c87b0 100755 --- a/cs-bisection-step +++ b/cs-bisection-step @@ -219,7 +219,9 @@ END WHERE t.job = ? AND t.flight = ? - AND t.name LIKE '%buildjob' + AND t.name LIKE '%buildjob' AND +(@{ $qtxt_common_rev_ok->('b') } OR + @{ $qtxt_common_tree_ok->('b') }) AND b.flight = (CASE WHEN t.val NOT LIKE '%.%' THEN t.flight ELSE cast(split_part(t.val, '.', 1) AS int) @@ -239,7 +241,9 @@ END job AS job FROM runvars WHERE job = ? - AND flight = ? + AND flight = ? AND +(@{ $qtxt_common_rev_ok->('runvars') } OR + @{ $qtxt_common_tree_ok->('runvars') }) END my $qtxt_common_results = < X-Patchwork-Id: 11694717 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0A0AD138C for ; Fri, 31 Jul 2020 12:02:22 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E167122CA1 for ; Fri, 31 Jul 2020 12:02:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E167122CA1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Tix-0001Wj-NT; Fri, 31 Jul 2020 12:01:19 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Tiw-0001R9-6M for xen-devel@lists.xenproject.org; Fri, 31 Jul 2020 12:01:18 +0000 X-Inumbo-ID: 8a0dea02-d325-11ea-8e2b-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 8a0dea02-d325-11ea-8e2b-bc764e2007e4; Fri, 31 Jul 2020 12:01:17 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1k1TN4-0001W4-Jj; Fri, 31 Jul 2020 12:38:43 +0100 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [OSSTEST PATCH v2 38/41] SQL: Change LIKE E'...\\_...' to LIKE '...\_...' Date: Fri, 31 Jul 2020 12:38:17 +0100 Message-Id: <20200731113820.5765-39-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731113820.5765-1-ian.jackson@eu.citrix.com> References: <20200731113820.5765-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" E'...' means to interpret \-escapes. But we don't want them: without E, we can avoid some toothpick-doubling. No functional change. Signed-off-by: Ian Jackson --- v2: New patch. --- cs-bisection-step | 8 ++++---- sg-report-job-history | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cs-bisection-step b/cs-bisection-step index 718c87b0..a82cbfb8 100755 --- a/cs-bisection-step +++ b/cs-bisection-step @@ -185,15 +185,15 @@ sub flight_rmap ($$) { my $qtxt_common_rev_ok = sub { my ($table) = @_; [<{Rtuple}; diff --git a/sg-report-job-history b/sg-report-job-history index d5f91ff1..22a28627 100755 --- a/sg-report-job-history +++ b/sg-report-job-history @@ -92,7 +92,7 @@ if (defined($flight)) { our $revisionsq= db_prepare(< X-Patchwork-Id: 11694735 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 374E3722 for ; Fri, 31 Jul 2020 12:02:39 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1DA2722BF3 for ; Fri, 31 Jul 2020 12:02:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1DA2722BF3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Tj2-0001Z5-1Q; Fri, 31 Jul 2020 12:01:24 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Tj1-0001R9-3N for xen-devel@lists.xenproject.org; Fri, 31 Jul 2020 12:01:23 +0000 X-Inumbo-ID: 8c6e59e4-d325-11ea-8e2b-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 8c6e59e4-d325-11ea-8e2b-bc764e2007e4; Fri, 31 Jul 2020 12:01:21 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1k1TN5-0001W4-Ch; Fri, 31 Jul 2020 12:38:43 +0100 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [OSSTEST PATCH v2 39/41] cs-bisection-step: Add a debug print when we run dot(1) Date: Fri, 31 Jul 2020 12:38:18 +0100 Message-Id: <20200731113820.5765-40-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731113820.5765-1-ian.jackson@eu.citrix.com> References: <20200731113820.5765-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Amongst other things this was useful for perf investigation. Signed-off-by: Ian Jackson --- v2: New patch. --- cs-bisection-step | 1 + 1 file changed, 1 insertion(+) diff --git a/cs-bisection-step b/cs-bisection-step index a82cbfb8..027032a1 100755 --- a/cs-bisection-step +++ b/cs-bisection-step @@ -1114,6 +1114,7 @@ END if (eval { foreach my $fmt (qw(ps png svg)) { + print DEBUG "RUNNING dot -T$fmt\n"; system_checked("dot", "-T$fmt", "-o$graphfile.$fmt", "$graphfile.dot"); } From patchwork Fri Jul 31 11:38:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11694763 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 658EA138C for ; Fri, 31 Jul 2020 12:03:35 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 493C622B40 for ; Fri, 31 Jul 2020 12:03:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 493C622B40 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Tk0-0002Cz-IP; Fri, 31 Jul 2020 12:02:24 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Tjz-00026u-58 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2020 12:02:23 +0000 X-Inumbo-ID: af900828-d325-11ea-8e2b-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id af900828-d325-11ea-8e2b-bc764e2007e4; Fri, 31 Jul 2020 12:02:20 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1k1TN6-0001W4-2a; Fri, 31 Jul 2020 12:38:44 +0100 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [OSSTEST PATCH v2 40/41] cs-bisection-step: Lay out the revision tuple graph once Date: Fri, 31 Jul 2020 12:38:19 +0100 Message-Id: <20200731113820.5765-41-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731113820.5765-1-ian.jackson@eu.citrix.com> References: <20200731113820.5765-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The graph layout algorithm is not very fast, particularly if the revision graph is big. In my test case this saves about 10s. Signed-off-by: Ian Jackson --- v2: New patch. --- cs-bisection-step | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/cs-bisection-step b/cs-bisection-step index 027032a1..8544bac0 100755 --- a/cs-bisection-step +++ b/cs-bisection-step @@ -1113,10 +1113,15 @@ END or die "$!"; if (eval { + print DEBUG "RUNNING dot -Txdot\n"; + system_checked("dot", "-Txdot", "-o$graphfile.xdot", + "$graphfile.dot"); foreach my $fmt (qw(ps png svg)) { - print DEBUG "RUNNING dot -T$fmt\n"; - system_checked("dot", "-T$fmt", "-o$graphfile.$fmt", - "$graphfile.dot"); + # neato rather than dot, because neato just uses positions + # etc. in the input whereas dot does (re)calculation work. + print DEBUG "RUNNING neato -n2 -T$fmt\n"; + system_checked("neato", "-n2", "-T$fmt", "-o$graphfile.$fmt", + "$graphfile.xdot"); } open SVGI, "$graphfile.svg" or die "$graphfile.svg $!"; open SVGO, ">", "$graphfile.svg.new" or die "$graphfile.svg.new $!"; From patchwork Fri Jul 31 11:38:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11694709 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BC960138C for ; Fri, 31 Jul 2020 12:02:12 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A341522CB1 for ; Fri, 31 Jul 2020 12:02:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A341522CB1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1Tia-0001Nh-I8; Fri, 31 Jul 2020 12:00:56 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k1TiZ-0001Jk-KC for xen-devel@lists.xenproject.org; Fri, 31 Jul 2020 12:00:55 +0000 X-Inumbo-ID: 7a17f7c8-d325-11ea-8e2b-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 7a17f7c8-d325-11ea-8e2b-bc764e2007e4; Fri, 31 Jul 2020 12:00:50 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1k1TN6-0001W4-Jg; Fri, 31 Jul 2020 12:38:44 +0100 From: Ian Jackson To: xen-devel@lists.xenproject.org Subject: [OSSTEST PATCH v2 41/41] duration_estimator: Clarify recentflights query a bit Date: Fri, 31 Jul 2020 12:38:20 +0100 Message-Id: <20200731113820.5765-42-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731113820.5765-1-ian.jackson@eu.citrix.com> References: <20200731113820.5765-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson , George Dunlap Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The condition on r.job is more naturally thought of as a join condition than a where condition. (This is an inner join, so the semantics are identical.) Also, for clarity, swap the flight and job conditions round, so that the ON clause is a series of r.thing = otherthing. No functional change. Signed-off-by: Ian Jackson CC: George Dunlap Reviewed-by: George Dunlap --- v2: New patch. --- Osstest/Executive.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Osstest/Executive.pm b/Osstest/Executive.pm index 8e4c5b9a..a69c624f 100644 --- a/Osstest/Executive.pm +++ b/Osstest/Executive.pm @@ -1153,10 +1153,10 @@ sub duration_estimator ($$;$$) { FROM flights f JOIN jobs j USING (flight) JOIN runvars r - ON f.flight=r.flight + ON r.flight=f.flight + AND r.job=j.job= AND r.name=? - WHERE j.job=r.job - AND f.blessing=? + WHERE f.blessing=? AND f.branch=? AND j.job=? AND r.val=?