From patchwork Fri Aug 14 17:21: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: 11714853 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 0F0CD13A4 for ; Fri, 14 Aug 2020 17:23: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 DFAF820708 for ; Fri, 14 Aug 2020 17:23:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b="TIfosQz4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DFAF820708 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject 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 1k6dPD-00024X-Ig; Fri, 14 Aug 2020 17:22:15 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k6dPC-00024Q-JZ for xen-devel@lists.xenproject.org; Fri, 14 Aug 2020 17:22:14 +0000 X-Inumbo-ID: b8347382-924e-4d0d-9e5e-3016f5d321cf Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id b8347382-924e-4d0d-9e5e-3016f5d321cf; Fri, 14 Aug 2020 17:22:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1597425733; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=RjjORyA+rdseRm2tV6Z7JEe1+gg8kiuTDoKkbr3lFMQ=; b=TIfosQz4s08fgocO6QaE7ES6nuU3DsyC5/8VgJp49lL1gz7dcJ+UkDqF HeGDXznnC//J7UfSmYeSz9dMEWk6QysgZ3aW+RGL97Xuq9RBqUDDMJXbE P0L1paw0mR5Pf+Jerp9zm8jgKxWTfbdFbc2l+IZs9FF236vtXVdtMuEiZ 8=; Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: ONtIFVyXJwkCpDNFv43eVx5sFrmhe57dsGwVmo3cuMWhLTNHKS8SlVvhyewcYHDHV4iZaBObwY vOWuIi5UQbmECw0soiEYJ1dZYFlHVVhGNwYG7BhHuVXjWEZHZ/k9GrTLpK17hTTFkQnsBrmsHi HGwyGw6bxn5M/EXEhdGUyO2QiydwC8e+B/T73qLw0KJe8EHJrrZ9UUtfrPJf/WsaSBFX8nlO77 ptbTv70h5jmjOutwcY53VFfDGfULOTnysQwmeZ3aS0l029RIKr3kZfpLCBCfPw8TmaFPoWogLK iEM= X-SBRS: 2.7 X-MesageID: 24900362 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.76,313,1592884800"; d="scan'208";a="24900362" From: Ian Jackson To: CC: Ian Jackson Subject: [OSSTEST PATCH 01/60] history reporting (nfc): Do not key cache on hostname any more Date: Fri, 14 Aug 2020 18:21:06 +0100 Message-ID: <20200814172205.9624-2-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200814172205.9624-1-ian.jackson@eu.citrix.com> References: <20200814172205.9624-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: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Now we process only one host at a time, so we don't need to distinguish. Replace all references to $tcache with %cache. Signed-off-by: Ian Jackson --- sg-report-host-history | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/sg-report-host-history b/sg-report-host-history index 380f8fac..50cc5b58 100755 --- a/sg-report-host-history +++ b/sg-report-host-history @@ -76,7 +76,7 @@ our $restrictflight_cond = restrictflight_cond(); our $flightcond; our $minflight; -our %hcaches; +our %cache; sub read_existing_logs ($) { my ($hostname) = @_; @@ -86,8 +86,7 @@ sub read_existing_logs ($) { return if $!==ENOENT; die "failed to open $html_file: $!"; } - my $tcache = { }; - $hcaches{$hostname} = $tcache; + %cache = (); for (;;) { $_ = // last; next unless m{^\<\!-- osstest-report-reuseable (.*)--\>$}; @@ -106,7 +105,7 @@ sub read_existing_logs ($) { # print DEBUG "GOTCACHE $hostname $k\n"; } # print DEBUG "GOTCACHE $hostname \@ $jr->{flight} $jr->{job} $jr->{status},$jr->{name}\n"; - $tcache->{$jr->{flight},$jr->{job},$jr->{status},$jr->{name}} = $jr; + $cache{$jr->{flight},$jr->{job},$jr->{status},$jr->{name}} = $jr; } close H; } @@ -253,8 +252,6 @@ END my $inrows = $hosts{$hostname}; print DEBUG "FOUND ", (scalar @$inrows), " ROWS for $hostname\n"; - my $tcache = $hcaches{$hostname}; - # Each entry in @$inrows is a $jr, which is a hash # It has keys for the result columns in mainquery # It also has keys '%' (yes, with a literal '%') @@ -267,7 +264,7 @@ END #print DEBUG "JOB $jr->{flight}.$jr->{job} "; my $cacherow = - $tcache->{$jr->{flight},$jr->{job},$jr->{status},$jr->{name}}; + $cache{$jr->{flight},$jr->{job},$jr->{status},$jr->{name}}; if ($cacherow) { $jr = $cacherow; $cachehits++; @@ -285,7 +282,7 @@ END } print DEBUG "CACHE $hostname $cachehits / ".(scalar @rows) - ." of ".(scalar %$tcache)."\n"; + ." of ".(scalar %cache)."\n"; my $write_cache_entry = sub { my ($jr) = @_;