diff options
author | Josh Stone <jistone@redhat.com> | 2009-06-08 15:36:42 -0700 |
---|---|---|
committer | Josh Stone <jistone@redhat.com> | 2009-06-08 15:48:33 -0700 |
commit | 0e14e0793ffb891bccd465cf518480685e3cd49e (patch) | |
tree | bf35be7cb408dc8aaa78037b0ca78c48bcb4dd89 /dwflpp.cxx | |
parent | a77245e55075e1b756b51a5226483fe5e618940e (diff) | |
download | systemtap-steved-0e14e0793ffb891bccd465cf518480685e3cd49e.tar.gz systemtap-steved-0e14e0793ffb891bccd465cf518480685e3cd49e.tar.xz systemtap-steved-0e14e0793ffb891bccd465cf518480685e3cd49e.zip |
Let query_module abort early for simple matches
query_module was already returning DW_CB_ABORT when a simple match was
found, but dwflpp::iterate_over_modules was ignoring that and instead
forcing the module loop to restart. The only way out of the loop was
with the pending_interrupts flag, which is only for signalled
interrupts.
Now iterate_over_modules will only attempt the dwfl_getmodules loop
once, since that loop will only abort if the CB returns DW_CB_ABORT.
Then query_module is also modified to return ABORT if pending_interrupts
is flagged.
My trusty test, stap -l syscall.*, is nearly 2x faster with this change.
Empirically, I found that the kernel object is always the first "module"
returned, so the syscall probepoints always gets to short-circuit the
loop right away.
Diffstat (limited to 'dwflpp.cxx')
-rw-r--r-- | dwflpp.cxx | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -397,13 +397,8 @@ dwflpp::iterate_over_modules(int (* callback)(Dwfl_Module *, void **, void *), base_query *data) { - ptrdiff_t off = 0; - do - { - if (pending_interrupts) return; - off = dwfl_getmodules (dwfl, callback, data, off); - } - while (off > 0); + dwfl_getmodules (dwfl, callback, data, 0); + // Don't complain if we exited dwfl_getmodules early. // This could be a $target variable error that will be // reported soon anyway. |