aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xenstore/xenstored_core.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2008-01-31 09:13:27 +0000
committerKeir Fraser <keir.fraser@citrix.com>2008-01-31 09:13:27 +0000
commitd66e065f7f5e8ded336a4ad42a99ab98b00d1083 (patch)
treefe8a8def386d2661928bc9566cf490a17d755581 /tools/xenstore/xenstored_core.c
parent87fdf3231c5f7998037b1962506dd1bb81cd4ac3 (diff)
downloadxen-d66e065f7f5e8ded336a4ad42a99ab98b00d1083.tar.gz
xen-d66e065f7f5e8ded336a4ad42a99ab98b00d1083.tar.bz2
xen-d66e065f7f5e8ded336a4ad42a99ab98b00d1083.zip
Add DTrace support to xenstored
Add USDT probes for significant xenstore operations to allow dynamic tracing. Signed-off-by: John Levon <john.levon@sun.com>
Diffstat (limited to 'tools/xenstore/xenstored_core.c')
-rw-r--r--tools/xenstore/xenstored_core.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 7f20e30ca0..a643f2d969 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -154,20 +154,25 @@ void trace(const char *fmt, ...)
}
static void trace_io(const struct connection *conn,
- const char *prefix,
- const struct buffered_data *data)
+ const struct buffered_data *data,
+ int out)
{
unsigned int i;
time_t now;
struct tm *tm;
+#ifdef HAVE_DTRACE
+ dtrace_io(conn, data, out);
+#endif
+
if (tracefd < 0)
return;
now = time(NULL);
tm = localtime(&now);
- trace("%s %p %04d%02d%02d %02d:%02d:%02d %s (", prefix, conn,
+ trace("%s %p %04d%02d%02d %02d:%02d:%02d %s (",
+ out ? "OUT" : "IN", conn,
tm->tm_year + 1900, tm->tm_mon + 1,
tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec,
sockmsg_string(data->hdr.msg.type));
@@ -257,7 +262,7 @@ static bool write_messages(struct connection *conn)
if (out->used != out->hdr.msg.len)
return true;
- trace_io(conn, "OUT", out);
+ trace_io(conn, out, 1);
list_del(&out->list);
talloc_free(out);
@@ -1316,7 +1321,7 @@ static void handle_input(struct connection *conn)
if (in->used != in->hdr.msg.len)
return;
- trace_io(conn, "IN ", in);
+ trace_io(conn, in, 0);
consider_message(conn);
return;