]> sourceware.org Git - systemtap.git/commitdiff
Remember which rpms have been checked in the session
authorJosh Stone <jistone@redhat.com>
Fri, 17 Jan 2014 06:10:34 +0000 (22:10 -0800)
committerJosh Stone <jistone@redhat.com>
Fri, 17 Jan 2014 06:21:59 +0000 (22:21 -0800)
When the kernel or any userspace file is missing debuginfo, we run an
rpm query so packages can be suggested.  If the user tries many such
probes on the same target, it's a waste to repeat the same query.  Now
we remember which targets have already been checked in the session.

This was seen on a simple 'stap -l syscall.*', which took much longer to
run when debuginfo was missing than when present.  With this patch, the
first syscall miss will lead to an rpm query, but each following miss
will know it's already been done.

rpm_finder.cxx
session.h

index 72ca43fd356df23436e7bd1b4064ac6574332d16..e87efe3d38439fc5768cb8c822940a2f53c6564c 100644 (file)
@@ -75,6 +75,10 @@ missing_rpm_enlist (systemtap_session& sess, const char *filename, const char *r
       rpm_init_done = 1;
     }
 
+  /* If we've seen this combo before, don't check again... */
+  if (!sess.rpms_checked.insert(string(filename) + rpm_type).second)
+    return 0;
+
   ts = rpmtsCreate(); 
 
   mi = rpmtsInitIterator(ts, RPMTAG_BASENAMES, filename, 0);
index ee467b856a6bc842432177702f2f10a15fd45bfc..1cb58086a03c0de46bc953bb75a7aa3e55a29dda 100644 (file)
--- a/session.h
+++ b/session.h
@@ -392,7 +392,8 @@ public:
         + (panic_warnings ? seen_warnings.size() : 0)); // plus warnings if -W given
     }
 
-  std::set<std::string> rpms_to_install;
+  std::set<std::string> rpms_checked; // enlisted by filename+rpm_type
+  std::set<std::string> rpms_to_install; // resulting rpms
 
   translator_output* op_create_auxiliary();
 
This page took 0.027395 seconds and 5 git commands to generate.