diff options
author | Josh Stone <jistone@redhat.com> | 2010-03-01 18:42:18 -0800 |
---|---|---|
committer | Josh Stone <jistone@redhat.com> | 2010-03-02 16:05:18 -0800 |
commit | 9b3c54b2fc836e20a0a7895aa759938e62eaacf9 (patch) | |
tree | a9db703d81f4fbabe886c5acb77d6c5cb0964a07 /main.cxx | |
parent | 6b067d7d20c10acb68d768003bf8031f155e5f39 (diff) | |
download | systemtap-steved-9b3c54b2fc836e20a0a7895aa759938e62eaacf9.tar.gz systemtap-steved-9b3c54b2fc836e20a0a7895aa759938e62eaacf9.tar.xz systemtap-steved-9b3c54b2fc836e20a0a7895aa759938e62eaacf9.zip |
PR11246 cont'd: Separate script/stapconf caching
I'm separating the caching and creation logic for stapconf, so it can be
conditionalized on s.use_cache instead of s.use_script_cache.
* session.h (systemtap_session): Store base_hash for better reuse.
* hash.cxx (get_base_hash): Get the base from the session, or build it.
(find_hash): Split into separate script/stapconf versions.
* cache.cxx (add_to_cache, get_from_cache): Ditto.
* main.cxx (main): Adapt caller, and delay stapconf until pass-4.
Diffstat (limited to 'main.cxx')
-rw-r--r-- | main.cxx | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -1300,10 +1300,10 @@ main (int argc, char * const argv []) } // Generate hash - find_hash (s, o.str()); + find_script_hash (s, o.str()); // See if we can use cached source/module. - if (get_from_cache(s)) + if (get_script_from_cache(s)) { // If our last pass isn't 5, we're done (since passes 3 and // 4 just generate what we just pulled out of the cache). @@ -1352,6 +1352,12 @@ main (int argc, char * const argv []) times (& tms_before); gettimeofday (&tv_before, NULL); STAP_PROBE1(stap, pass4__start, &s); + + if (s.use_cache) + { + find_stapconf_hash(s); + get_stapconf_from_cache(s); + } rc = compile_pass (s); if (rc == 0 && s.last_pass == 4) @@ -1377,7 +1383,9 @@ main (int argc, char * const argv []) { // Update cache. Cache cleaning is kicked off at the beginning of this function. if (s.use_script_cache) - add_to_cache(s); + add_script_to_cache(s); + if (s.use_cache) + add_stapconf_to_cache(s); // We may need to save the module in $CWD if the cache was // inaccessible for some reason. |