From ce91eebdf6c262a0235bdd2d3ad3acd0805bf02a Mon Sep 17 00:00:00 2001 From: Kent Sebastian Date: Fri, 31 Jul 2009 14:45:10 -0400 Subject: 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 --- util.cxx | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'util.cxx') diff --git a/util.cxx b/util.cxx index 5c05a1dd..23deb37b 100644 --- a/util.cxx +++ b/util.cxx @@ -16,6 +16,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #include "util.h" +#include "sys/sdt.h" #include #include @@ -303,12 +304,14 @@ static pid_t spawned_pid = 0; int stap_system(const char *command) { + STAP_PROBE1(stap, stap_system__start, command); const char * argv[] = { "sh", "-c", command, NULL }; int ret, status; spawned_pid = 0; ret = posix_spawn(&spawned_pid, "/bin/sh", NULL, NULL, const_cast(argv), environ); + STAP_PROBE2(stap, stap_system__spawn, ret, spawned_pid); if (ret == 0) { if (waitpid(spawned_pid, &status, 0) == spawned_pid) @@ -316,6 +319,7 @@ stap_system(const char *command) else ret = errno; } + STAP_PROBE1(stap, stap_system__complete, ret); spawned_pid = 0; return ret; } -- cgit