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_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);
+ (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();