Permalink
Browse files

feature: initial support for dtrace static probes. it requires nginx-…

  • Loading branch information...
1 parent c25689b commit d3a9ba25b1d7d59ba4c4a8a4e73b59a52f95288f @agentzh agentzh committed Jul 25, 2012
Showing with 46 additions and 0 deletions.
  1. +3 −0 config
  2. +14 −0 dtrace/ngx_lua_provider.d
  3. +24 −0 src/ngx_http_lua_probe.h
  4. +5 −0 tapset/ngx_lua.stp
View
@@ -247,6 +247,9 @@ if [ $ngx_found = yes ]; then
CORE_LIBS="-Wl,-E $CORE_LIBS"
fi
+NGX_DTRACE_PROVIDERS="$NGX_DTRACE_PROVIDERS $ngx_addon_dir/dtrace/ngx_lua_provider.d"
+NGX_TAPSET_SRCS="$NGX_TAPSET_SRCS $ngx_addon_dir/tapset/ngx_lua.stp"
+
USE_MD5=YES
USE_SHA1=YES
@@ -0,0 +1,14 @@
+typedef struct { int dummy; } lua_State;
+
+
+provider nginx_lua {
+ probe http__lua__register__preload__package(lua_State *L, char *pkg);
+};
+
+
+#pragma D attributes Evolving/Evolving/Common provider nginx provider
+#pragma D attributes Private/Private/Unknown provider nginx module
+#pragma D attributes Private/Private/Unknown provider nginx function
+#pragma D attributes Private/Private/Common provider nginx name
+#pragma D attributes Evolving/Evolving/Common provider nginx args
+
@@ -0,0 +1,24 @@
+#ifndef NGX_HTTP_LUA_PROBE_H
+#define NGX_HTTP_LUA_PROBE_H
+
+
+#include <ngx_config.h>
+#include <ngx_core.h>
+#include <ngx_http.h>
+
+
+#if defined(NGX_DTRACE) && NGX_DTRACE
+
+#include <ngx_dtrace_provider.h>
+
+#define ngx_http_lua_probe_register_preload_package(L, pkg) \
+ NGINX_LUA_HTTP_LUA_REGISTER_PRELOAD_PACKAGE(L, pkg)
+
+#else /* !(NGX_DTRACE) */
+
+#define ngx_http_lua_probe_register_preload_package(L, pkg)
+
+#endif
+
+
+#endif /* NGX_HTTP_LUA_PROBE_H */
View
@@ -0,0 +1,5 @@
+function ngx_http_lua_ctx_context(r)
+{
+
+}
+

0 comments on commit d3a9ba2

Please sign in to comment.