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

This commit is contained in:
agentzh (Yichun Zhang) 2012-09-10 19:01:38 -07:00
parent 9e9cf9630c
commit b83fb77107
2 changed files with 70 additions and 4 deletions

View File

@ -454,12 +454,45 @@ index efbc244..8d81aab 100644
diff --git a/src/dtrace/nginx.stp b/src/dtrace/nginx.stp diff --git a/src/dtrace/nginx.stp b/src/dtrace/nginx.stp
new file mode 100644 new file mode 100644
index 0000000..6420250 index 0000000..5bae185
--- /dev/null --- /dev/null
+++ b/src/dtrace/nginx.stp +++ b/src/dtrace/nginx.stp
@@ -0,0 +1,236 @@ @@ -0,0 +1,269 @@
+/* tapset for nginx */ +/* 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 */ +/* retrieve the request uri string from the ngx_http_request_t pointer */
+function ngx_http_req_uri(r) +function ngx_http_req_uri(r)
+{ +{

View File

@ -454,12 +454,45 @@ index efbc244..8d81aab 100644
diff --git a/src/dtrace/nginx.stp b/src/dtrace/nginx.stp diff --git a/src/dtrace/nginx.stp b/src/dtrace/nginx.stp
new file mode 100644 new file mode 100644
index 0000000..6420250 index 0000000..5bae185
--- /dev/null --- /dev/null
+++ b/src/dtrace/nginx.stp +++ b/src/dtrace/nginx.stp
@@ -0,0 +1,236 @@ @@ -0,0 +1,269 @@
+/* tapset for nginx */ +/* 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 */ +/* retrieve the request uri string from the ngx_http_request_t pointer */
+function ngx_http_req_uri(r) +function ngx_http_req_uri(r)
+{ +{