[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[OSSTEST PATCH 07/60] history reporting (nfc): Break out cache_row_lookup_prep


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
  • Date: Fri, 14 Aug 2020 18:21:12 +0100
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
  • Delivery-date: Fri, 14 Aug 2020 17:22:44 +0000
  • Ironport-sdr: exZqm6N1k7Xa5mO1hHKBYiL8tU9DKSTz8x5hC0DyddGilu+NrguhueaT/GX2FkK1xOz3nNKyI3 uHEYqLr4HLBoPgsJ5C9XPvzLNElHeDYrx0Mpd3e52kxOFkZ81reo9MQNsFMeqIlU7NNUdhf1l8 tyc+aFls9OQ4u3nrqg+3ApT3VlbWRZMgATFW/nvkTefCqPYN/Gt/VeMlUOgLIsXADbLgYlFFPJ FZQ/aKwSQqAmhVr6amO1ltWG0LDCNQC0iYqbyDmtvYwg1LN+K7DXH7xVG9Xx/VC5Vc+8X2+yPx 078=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Prep work.

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 sg-report-host-history | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/sg-report-host-history b/sg-report-host-history
index a8dae159..2724ef27 100755
--- a/sg-report-host-history
+++ b/sg-report-host-history
@@ -112,6 +112,16 @@ sub cache_read_existing ($) {
     close H;
 }
 
+sub cache_row_lookup_prep ($) {
+    my ($jrr) = @_;
+
+    my $cacherow = $cache{cache_row_key($$jrr)};
+    if ($cacherow) {
+       $$jrr = $cacherow;
+       $cachehits++;
+    }
+}
+
 sub cache_write_entry ($$) {
     my ($fh, $jr) = @_;
     print $fh "<!-- osstest-report-reuseable";
@@ -286,11 +296,7 @@ END
     foreach my $jr (@$inrows) {
        #print DEBUG "JOB $jr->{flight}.$jr->{job} ";
 
-       my $cacherow = $cache{cache_row_key($jr)};
-       if ($cacherow) {
-           $jr = $cacherow;
-           $cachehits++;
-       }
+       cache_row_lookup_prep(\$jr);
 
        my $endedrow = cacheable_query($endedq, $jr, 'e');
        if (!$endedrow) {
-- 
2.11.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.