From b83fb7710709e9e4241fda269b2b46953c956b56 Mon Sep 17 00:00:00 2001 From: "agentzh (Yichun Zhang)" Date: Mon, 10 Sep 2012 19:01:38 -0700 Subject: [PATCH] updated the dtrace patch to include new tapset functions ngx_indent, ngx_http_subreq_depth, and ngx_http_req_parent. --- patches/nginx-1.2.3-dtrace.patch | 37 ++++++++++++++++++++++++++++++-- patches/nginx-1.3.4-dtrace.patch | 37 ++++++++++++++++++++++++++++++-- 2 files changed, 70 insertions(+), 4 deletions(-) diff --git a/patches/nginx-1.2.3-dtrace.patch b/patches/nginx-1.2.3-dtrace.patch index 2d4b08a..5c0aef8 100644 --- a/patches/nginx-1.2.3-dtrace.patch +++ b/patches/nginx-1.2.3-dtrace.patch @@ -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) +{ diff --git a/patches/nginx-1.3.4-dtrace.patch b/patches/nginx-1.3.4-dtrace.patch index 2d4b08a..5c0aef8 100644 --- a/patches/nginx-1.3.4-dtrace.patch +++ b/patches/nginx-1.3.4-dtrace.patch @@ -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) +{