updated the dtrace patch to include new tapset functions ngx_indent, ngx_http_subreq_depth, and ngx_http_req_parent.

pull/34/merge
agentzh (Yichun Zhang) 12 years ago
parent 9e9cf9630c
commit b83fb77107

@ -454,12 +454,45 @@ index efbc244..8d81aab 100644
diff --git a/src/dtrace/nginx.stp b/src/dtrace/nginx.stp
new file mode 100644
index 0000000..6420250
index 0000000..5bae185
--- /dev/null
+++ b/src/dtrace/nginx.stp
@@ -0,0 +1,236 @@
@@ -0,0 +1,269 @@
+/* tapset for nginx */
+
+
+function ngx_indent(n, delta)
+{
+ s = ""
+ for (i = 0; i < n; i++) {
+ s .= delta
+ }
+
+ return s
+}
+
+
+function ngx_http_subreq_depth(r)
+{
+ depth = 0
+
+ for (pr = @cast(r, "ngx_http_request_t", "NGX_SBIN_PATH")->parent;
+ pr != 0;
+ pr = @cast(pr, "ngx_http_request_t", "NGX_SBIN_PATH")->parent)
+ {
+ depth++
+ }
+
+ return depth
+}
+
+
+function ngx_http_req_parent(r)
+{
+ return @cast(r, "ngx_http_request_s", "NGX_SBIN_PATH")->parent
+}
+
+
+/* retrieve the request uri string from the ngx_http_request_t pointer */
+function ngx_http_req_uri(r)
+{

@ -454,12 +454,45 @@ index efbc244..8d81aab 100644
diff --git a/src/dtrace/nginx.stp b/src/dtrace/nginx.stp
new file mode 100644
index 0000000..6420250
index 0000000..5bae185
--- /dev/null
+++ b/src/dtrace/nginx.stp
@@ -0,0 +1,236 @@
@@ -0,0 +1,269 @@
+/* tapset for nginx */
+
+
+function ngx_indent(n, delta)
+{
+ s = ""
+ for (i = 0; i < n; i++) {
+ s .= delta
+ }
+
+ return s
+}
+
+
+function ngx_http_subreq_depth(r)
+{
+ depth = 0
+
+ for (pr = @cast(r, "ngx_http_request_t", "NGX_SBIN_PATH")->parent;
+ pr != 0;
+ pr = @cast(pr, "ngx_http_request_t", "NGX_SBIN_PATH")->parent)
+ {
+ depth++
+ }
+
+ return depth
+}
+
+
+function ngx_http_req_parent(r)
+{
+ return @cast(r, "ngx_http_request_s", "NGX_SBIN_PATH")->parent
+}
+
+
+/* retrieve the request uri string from the ngx_http_request_t pointer */
+function ngx_http_req_uri(r)
+{

Loading…
Cancel
Save