Hello!
2014/1/12 ywsample:
> 运行stapxx工具中的lj-gc-objs脚本,会出现如下错误:
> semantic error: type definition 'GCcdataVar' not found in
> '/usr/home/yaowei2/work/openresty/luajit/lib/libluajit-5.1.so.2.0.2':
看起来像是 LuaJIT 的 .so 文件里缺少调试符号。你可以使用 dwarfdump 这样的工具检查一下
/usr/home/yaowei2/work/openresty/luajit/lib/libluajit-5.1.so.2.0.2
这个文件里是否有 DWARF 调试符号。
另外,你使用的 systemtap 版本是最新的 2.4 发布吗?
我在我的 Linux x86_64 系统上尝试了一下 ngx_openresty 1.4.2.9,lj-gc-objs 工具是可以正确工作的:
$ lj-gc-objs.sxx -x 13944 -D MAXACTION=200000
Start tracing 13944 (/opt/openresty/nginx/sbin/nginx)
GC total size: 44804 bytes
GC state: sweep-string
395 string objects: max=288, avg=25, min=18, sum=10150 (in bytes)
293 function objects: max=144, avg=32, min=20, sum=9536 (in bytes)
56 table objects: max=3104, avg=289, min=32, sum=16184 (in bytes)
5 proto objects: max=200, avg=159, min=126, sum=799 (in bytes)
4 userdata objects: max=64, avg=46, min=40, sum=184 (in bytes)
2 upvalue objects: max=24, avg=24, min=24, sum=48 (in bytes)
1 thread objects: max=424, avg=424, min=424, sum=424 (in bytes)
global state tmpbuf size: 271 bytes
My GC walker detected for total 44804 bytes.
782 microseconds elapsed in the probe handler.
我的 ngx_openresty 的配置是
$ /opt/openresty/nginx/sbin/nginx -V
nginx version: ngx_openresty/1.4.2.9
built by gcc 4.7.2 20120921 (Red Hat 4.7.2-2) (GCC)
TLS SNI support enabled
configure arguments: --prefix=/opt/openresty/nginx
--add-module=../ngx_devel_kit-0.2.19
--add-module=../echo-nginx-module-0.48
--add-module=../xss-nginx-module-0.03rc9
--add-module=../ngx_coolkit-0.2rc1
--add-module=../set-misc-nginx-module-0.22
--add-module=../form-input-nginx-module-0.07
--add-module=../encrypted-session-nginx-module-0.03
--add-module=../srcache-nginx-module-0.22
--add-module=../ngx_lua-0.9.0
--add-module=../headers-more-nginx-module-0.22
--add-module=../array-var-nginx-module-0.03rc1
--add-module=../memc-nginx-module-0.13
--add-module=../redis2-nginx-module-0.10
--add-module=../redis-nginx-module-0.3.6
--add-module=../auth-request-nginx-module-0.2
--add-module=../rds-json-nginx-module-0.12rc10
--add-module=../rds-csv-nginx-module-0.05rc2
--with-ld-opt=-Wl,-rpath,/opt/openresty/luajit/lib
--with-http_ssl_module
Regards,
-agentzh