diff options
author | Kent Sebastian <ksebasti@redhat.com> | 2009-07-31 14:45:10 -0400 |
---|---|---|
committer | Kent Sebastian <ksebasti@redhat.com> | 2009-07-31 14:45:10 -0400 |
commit | ce91eebdf6c262a0235bdd2d3ad3acd0805bf02a (patch) | |
tree | 7ca9eef90de8b29a1a977530d623ec7240740db5 /cache.cxx | |
parent | f1312b2c2bc1ec7b0475a251f27a2f75779f4ccb (diff) | |
download | systemtap-steved-ce91eebdf6c262a0235bdd2d3ad3acd0805bf02a.tar.gz systemtap-steved-ce91eebdf6c262a0235bdd2d3ad3acd0805bf02a.tar.xz systemtap-steved-ce91eebdf6c262a0235bdd2d3ad3acd0805bf02a.zip |
PR10204: Place userspace markers in systemtap itself
* cache.cxx (add_to_cache,clean_cache): add static markers
* main.cxx (main): likewise
* runtime/staprun/common.c (send_request): likewise
* runtime/staprun/mainloop.c (stp_main_loop): likewise
* runtime/staprun/staprun.c (remove_module): likewise
* runtime/staprun/staprun.h: include sdt.h
* runtime/staprun/staprun_funcs.c (insert_module): likewise
* util.cxx (stap_system): likewise
* tapset/stap_staticmarkers.stp: new file
Diffstat (limited to 'cache.cxx')
-rw-r--r-- | cache.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -10,6 +10,7 @@ #include "session.h" #include "cache.h" #include "util.h" +#include "sys/sdt.h" #include <cerrno> #include <string> #include <fstream> @@ -59,6 +60,7 @@ add_to_cache(systemtap_session& s) } string module_src_path = s.tmpdir + "/" + s.module_name + ".ko"; + STAP_PROBE2(stap, cache__add__module, module_src_path.c_str(), s.hash_path.c_str()); if (s.verbose > 1) clog << "Copying " << module_src_path << " to " << s.hash_path << endl; if (copy_file(module_src_path.c_str(), s.hash_path.c_str()) != 0) @@ -79,6 +81,8 @@ add_to_cache(systemtap_session& s) string module_signature_src_path = module_src_path; module_signature_src_path += ".sgn"; + STAP_PROBE2(stap, cache__add__nss, module_signature_src_path.c_str(), module_signature_dest_path.c_str()); + if (s.verbose > 1) clog << "Copying " << module_signature_src_path << " to " << module_signature_dest_path << endl; if (copy_file(module_signature_src_path.c_str(), module_signature_dest_path.c_str()) != 0) @@ -97,6 +101,7 @@ add_to_cache(systemtap_session& s) c_dest_path.resize(c_dest_path.size() - 3); c_dest_path += ".c"; + STAP_PROBE2(stap, cache__add__source, s.translated_source.c_str(), c_dest_path.c_str()); if (s.verbose > 1) clog << "Copying " << s.translated_source << " to " << c_dest_path << endl; @@ -241,6 +246,8 @@ get_from_cache(systemtap_session& s) clog << "Pass 4: using cached " << s.hash_path << endl; } + STAP_PROBE2(stap, cache__get, c_src_path.c_str(), s.hash_path.c_str()); + return true; } @@ -341,6 +348,7 @@ clean_cache(systemtap_session& s) if ( (r_cache_size / 1024 / 1024) < cache_mb_max) //convert r_cache_size to MiB break; + STAP_PROBE1(stap, cache__clean, (i->path).c_str()); //remove this (*i) cache_entry, add to removed list i->unlink(); r_cache_size -= i->size; |