diff options
author | Josh Stone <jistone@redhat.com> | 2009-06-02 00:43:49 -0700 |
---|---|---|
committer | Josh Stone <jistone@redhat.com> | 2009-06-02 00:43:49 -0700 |
commit | c8ad068755e7424e767660f2c27cb3b1e2d5343d (patch) | |
tree | 8d927da0ab13dac41b24560b5e472d2fa9e13e8e /dwflpp.h | |
parent | 276465828851648edc5b56f762a0d100051c9e32 (diff) | |
download | systemtap-steved-c8ad068755e7424e767660f2c27cb3b1e2d5343d.tar.gz systemtap-steved-c8ad068755e7424e767660f2c27cb3b1e2d5343d.tar.xz systemtap-steved-c8ad068755e7424e767660f2c27cb3b1e2d5343d.zip |
Cache the last result of dwarf_getscopes
This one function accounted for ~30% of my callgrind profile of
"stap -l 'syscall.*'", even though it was only called ~1200 times. We
call dwarf_getscopes for each $target variable, with the same parameters
within a given probe. Since they're no nicely grouped, it's easy to
just cache the most recent call, and the next few calls will be a hit.
Overall this cuts the number of calls down to about 300, for an easy
speed gain.
Diffstat (limited to 'dwflpp.h')
-rw-r--r-- | dwflpp.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -382,6 +382,11 @@ private: bool blacklist_enabled; void build_blacklist(); std::string get_blacklist_section(Dwarf_Addr addr); + + Dwarf_Addr pc_cached_scopes; + int num_cached_scopes; + Dwarf_Die *cached_scopes; + int dwarf_getscopes_cached (Dwarf_Addr pc, Dwarf_Die **scopes); }; #endif // DWFLPP_H |