diff options
author | Mark Wielaard <mjw@redhat.com> | 2009-03-22 20:36:13 +0100 |
---|---|---|
committer | Mark Wielaard <mjw@redhat.com> | 2009-03-22 20:36:13 +0100 |
commit | c7ce415ebf181e818166644e572dfe04dbd7b6f6 (patch) | |
tree | c182d43d83acf39ac78b3e614c9d272812ceb386 /tapsets.cxx | |
parent | c9a05b1c5a3219dcc6b9f4060b98e76a67f5795b (diff) | |
parent | 1fa23e70a939c20664d7ae6ee5ef66b51835e0ee (diff) | |
download | systemtap-steved-c7ce415ebf181e818166644e572dfe04dbd7b6f6.tar.gz systemtap-steved-c7ce415ebf181e818166644e572dfe04dbd7b6f6.tar.xz systemtap-steved-c7ce415ebf181e818166644e572dfe04dbd7b6f6.zip |
Merge branch 'master' into pr6866
Diffstat (limited to 'tapsets.cxx')
-rw-r--r-- | tapsets.cxx | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/tapsets.cxx b/tapsets.cxx index d6f89563..143edc64 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -18,6 +18,7 @@ #include "buildrun.h" #include "dwarf_wrappers.h" #include "auto_free.h" +#include "hash.h" #include <cstdlib> #include <algorithm> @@ -206,7 +207,9 @@ common_probe_entryfn_prologue (translator_output* o, string statestr, o->newline() << "c = per_cpu_ptr (contexts, smp_processor_id());"; o->newline() << "if (atomic_inc_return (& c->busy) != 1) {"; - o->newline(1) << "atomic_inc (& skipped_count);"; + o->newline(1) << "#if !INTERRUPTIBLE"; + o->newline() << "atomic_inc (& skipped_count);"; + o->newline() << "#endif"; o->newline() << "#ifdef STP_TIMING"; o->newline() << "atomic_inc (& skipped_count_reentrant);"; o->newline() << "#ifdef DEBUG_REENTRANCY"; @@ -10030,12 +10033,43 @@ tracepoint_builder::init_dw(systemtap_session& s) if (dw != NULL) return true; + if (s.use_cache) + { + // see if the cached module exists + find_tracequery_hash(s); + if (!s.tracequery_path.empty()) + { + int fd = open(s.tracequery_path.c_str(), O_RDONLY); + if (fd != -1) + { + if (s.verbose > 2) + clog << "Pass 2: using cached " << s.tracequery_path << endl; + + dw = new dwflpp(s); + dw->setup_user(s.tracequery_path); + close(fd); + return true; + } + } + } + + // no cached module, time to make it string tracequery_ko; int rc = make_tracequery(s, tracequery_ko); if (rc != 0) return false; - // TODO cache tracequery.ko + if (s.use_cache) + { + // try to save tracequery in the cache + if (s.verbose > 2) + clog << "Copying " << tracequery_ko + << " to " << s.tracequery_path << endl; + if (copy_file(tracequery_ko.c_str(), + s.tracequery_path.c_str()) != 0) + cerr << "Copy failed (\"" << tracequery_ko << "\" to \"" + << s.tracequery_path << "\"): " << strerror(errno) << endl; + } dw = new dwflpp(s); dw->setup_user(tracequery_ko); |