Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added scripts and docs for systemtap.

  • Loading branch information...
commit fc10cb72d0b1278a1bf2dd66d436fedb53b4a03b 1 parent 41e624c
@agentzh authored
Showing with 27 additions and 3 deletions.
  1. +10 −3 README
  2. +17 −0 run.stp
View
13 README
@@ -1,16 +1,23 @@
Build:
- gmake
- sudo gmake install
+ (Gnu make is recommended.)
+
+ make
+ sudo make install
Run:
Terminal 1:
./test
Terminal 2:
- sudo ./run.d
+ for dtrace:
+ sudo ./run.d
+
+ for systemtap:
+ sudo ./run.stp
Tested on the following systems:
* Solaris 11 Express 2010_11 (i386)
+ * Fedora 17 Linux (x86_64)
View
17 run.stp
@@ -0,0 +1,17 @@
+#!/usr/bin/env stap
+
+probe begin, end {
+ print("Tracing. Hit CTRL-C to stop.\n");
+}
+
+probe process("/home/agentzh/git/usdt-sample/test").mark("request__start")
+{
+ raddr = user_string(@cast($arg1, "ngx_http_dtrace_request_s")->raddr)
+ laddr = user_string(@cast($arg1, "ngx_http_dtrace_request_s")->laddr)
+ id = @cast($arg1, "ngx_http_dtrace_request_s")->id
+ uri = user_string(@cast($arg1, "ngx_http_dtrace_request_s")->uri)
+ args = user_string(@cast($arg1, "ngx_http_dtrace_request_s")->args)
+ printf("done: %s -> %s (id %d, %s?%s)\n", raddr, laddr, id, uri, args)
+ //printf("args: %s", user_string(@cast(&$dt_r, "ngx_http_dtrace_request_t")->args))
+}
+
Please sign in to comment.
Something went wrong with that request. Please try again.