summaryrefslogtreecommitdiffstats
path: root/runtime/staprun
diff options
context:
space:
mode:
authorKent Sebastian <ksebasti@redhat.com>2009-07-31 14:45:10 -0400
committerKent Sebastian <ksebasti@redhat.com>2009-07-31 14:45:10 -0400
commitce91eebdf6c262a0235bdd2d3ad3acd0805bf02a (patch)
tree7ca9eef90de8b29a1a977530d623ec7240740db5 /runtime/staprun
parentf1312b2c2bc1ec7b0475a251f27a2f75779f4ccb (diff)
downloadsystemtap-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 'runtime/staprun')
-rw-r--r--runtime/staprun/common.c1
-rw-r--r--runtime/staprun/mainloop.c1
-rw-r--r--runtime/staprun/staprun.c1
-rw-r--r--runtime/staprun/staprun.h3
-rw-r--r--runtime/staprun/staprun_funcs.c1
5 files changed, 7 insertions, 0 deletions
diff --git a/runtime/staprun/common.c b/runtime/staprun/common.c
index 5c4a8431..afe96606 100644
--- a/runtime/staprun/common.c
+++ b/runtime/staprun/common.c
@@ -450,6 +450,7 @@ int send_request(int type, void *data, int len)
char buf[1024];
int rc = 0;
+ STAP_PROBE3(stapio, send__ctlmsg, type, data, len);
/* Before doing memcpy, make sure 'buf' is big enough. */
if ((len + 4) > (int)sizeof(buf)) {
_err("exceeded maximum send_request size.\n");
diff --git a/runtime/staprun/mainloop.c b/runtime/staprun/mainloop.c
index 7125a7bb..45b142bc 100644
--- a/runtime/staprun/mainloop.c
+++ b/runtime/staprun/mainloop.c
@@ -485,6 +485,7 @@ int stp_main_loop(void)
type = *(uint32_t *) recvbuf;
data = (void *)(recvbuf + sizeof(uint32_t));
nb -= sizeof(uint32_t);
+ STAP_PROBE3(staprun, recv__ctlmsg, type, data, nb);
switch (type) {
#if STP_TRANSPORT_VERSION == 1
diff --git a/runtime/staprun/staprun.c b/runtime/staprun/staprun.c
index 42b72ff1..7069cab3 100644
--- a/runtime/staprun/staprun.c
+++ b/runtime/staprun/staprun.c
@@ -192,6 +192,7 @@ static int remove_module(const char *name, int verb)
close_ctl_channel();
dbug(2, "removing module %s\n", name);
+ STAP_PROBE1(staprun, remove__module, name);
ret = delete_module (name, 0);
if (ret != 0) {
err("Error removing module '%s': %s.\n", name, strerror(errno));
diff --git a/runtime/staprun/staprun.h b/runtime/staprun/staprun.h
index 3c9dab3f..1c9aece8 100644
--- a/runtime/staprun/staprun.h
+++ b/runtime/staprun/staprun.h
@@ -38,6 +38,9 @@
/* Include config.h to pick up dependency for --prefix usage. */
#include "config.h"
+/* For STAP_PROBE in staprun.c, staprun_funcs.c, mainloop.c and common.c */
+#include "sys/sdt.h"
+
extern void eprintf(const char *fmt, ...);
extern void switch_syslog(const char *name);
diff --git a/runtime/staprun/staprun_funcs.c b/runtime/staprun/staprun_funcs.c
index 781bb999..c19dc3ba 100644
--- a/runtime/staprun/staprun_funcs.c
+++ b/runtime/staprun/staprun_funcs.c
@@ -94,6 +94,7 @@ int insert_module(const char *path, const char *special_options, char **options)
return -1;
}
+ STAP_PROBE1(staprun, insert__module, path);
/* Actually insert the module */
ret = init_module(file, sbuf.st_size, opts);
saved_errno = errno;