openresty/stapxx

Found 0 JITted samples issue

Opened this issue · 8 comments

i see the solve https://github.com/openresty/stapxx/issues/13,and i use the method to solve it.but i can't get the result.
my nginx.conf file

worker_processes  1;
events {
	worker_connections  1024;
}

http {
	include       mime.types;
	default_type  application/octet-stream;
	sendfile        on;
lua_code_cache off;
lua_package_path "/opt/waf/waf/?.lua;;"; 
lua_shared_dict rules_dict 20m;
lua_shared_dict white_dict 10m;
lua_shared_dict black_dict 10m;
lua_shared_dict config_dict 10m;
	init_by_lua_file  /opt/waf/waf/init.lua;
	server {
		listen       80;
		server_name  localhost;
#error_log /tmp/error.log debug;
access_by_lua_file /opt/waf/waf/waf.lua;
log_by_lua_file /opt/waf/waf/log.lua;
		location / {
			proxy_pass   http://192.168.8.89:8881/;
		}
	}
}

i use the command j-lua-stacks.sxx, ab command and ngx-rps.sxx

[root@localhost waf]# ab -c 200 -n 10000 http://192.168.50.91/

^C[root@localhost stapxx]# ./samples/ngx-rps.sxx -x 16798
WARNING: Tracing process 16798 (/usr/local/openresty/nginx/sbin/nginx).
Hit Ctrl-C to end.
[1511514988] 102 req/sec
[1511514989] 107 req/sec
[1511514990] 99 req/sec
[1511514991] 103 req/sec
[1511514992] 95 req/sec
[1511514993] 100 req/sec
[1511514994] 97 req/sec
[1511514995] 95 req/sec
[1511514996] 102 req/sec
[1511514997] 95 req/sec
[1511514998] 102 req/sec
[1511514999] 102 req/sec
[1511515000] 106 req/sec
[1511515001] 105 req/sec

[root@localhost stapxx]# ./samples/lj-lua-stacks.sxx  --skip-badvars -x 16798 > tmp.bt
Found exact match for libluajit: /usr/local/openresty/luajit/lib/libluajit-5.1.so.2.1.0
WARNING: Start tracing 16798 (/usr/local/openresty/nginx/sbin/nginx)
WARNING: Hit Ctrl-C to end.
^CWARNING: Found 0 JITted samples.

this is my operation video:https://youtu.be/hCE-MESXk04
brother chun,I hope to get your help

i use the --exec

[root@localhost stapxx]# ./samples/lj-lua-stacks.sxx --exec /opt/server/nginx/sbin/nginx > t.bt
Found exact match for libluajit: /opt/server/luajit/lib/libluajit-5.1.so.2
WARNING: Start tracing 0 (/opt/server/nginx/sbin/nginx)
WARNING: Hit Ctrl-C to end.
ERROR: read fault [man error::fault] at 0x000000000077e540 (addr) near operator '@var' at stapxx-hMc_WUQw/nginx.lua.stp:10:40
WARNING: Number of errors: 1, skipped probes: 0
WARNING: /usr/bin/staprun exited with status: 1
Pass 5: run failed.  [man error::pass5]

and i found the libluajit

[root@localhost stapxx]# find / -name "*libluajit*"
/opt/server/luajit/lib/libluajit-5.1.a
/opt/server/luajit/lib/libluajit-5.1.so.2.1.0
/opt/server/luajit/lib/libluajit-5.1.so
/opt/server/luajit/lib/libluajit-5.1.so.2

@yingshang It may just be that you indeed have very few or no JITted Lua code. All or most of your Lua code paths are interpreted. You can verify this by other tools like lj-vm-states.

Thank you for your advice, but I've found a way to deal with it.
tools download linkhttps://github.com/openresty/openresty-systemtap-toolkit
i use the command is ok .ngx-sample-lua-bt -p 19075 --luajit20 -t 5 > temp.bt

@yingshang Then it seems that you are still using LuaJIT 2.0? LuaJIT 2.1 is much better.

@yingshang The formal OpenResty releases use LuaJIT 2.1 by default, BTW.

@agentzh
this is my dockerfile ,i install openresty version is 1.11.2.5,and i don't install LuaJit ,the is default install.

from centos:6.8
RUN yum install  -y readline-devel pcre-devel openssl-devel gcc wget lua-devel git gcc gcc-c++  make gmake vim unzip
RUN cd /opt && wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.41.tar.gz && tar zxvf pcre-8.41.tar.gz 
RUN cd /opt && wget https://www.kyne.com.au/~mark/software/download/lua-cjson-2.1.0.tar.gz && tar zxvf lua-cjson-2.1.0.tar.gz && cd lua-cjson-2.1.0 && sed -i 's/\/usr\/local/\/usr\/share\/lua\/5.1/g' Makefile
RUN cd /opt && wget https://openresty.org/download/openresty-1.11.2.5.tar.gz &&  tar zxvf openresty-1.11.2.5.tar.gz &&  cd openresty-1.11.2.5 && ./configure    --prefix=/opt/server/  --with-pcre=/opt/pcre-8.41  --with-pcre-jit && make && make install 
RUN ln -s /opt/server/nginx/sbin/nginx /usr/local/sbin/nginx
RUN cd /opt/ && wget http://luarocks.github.io/luarocks/releases/luarocks-2.4.3.tar.gz && tar zxvf luarocks-2.4.3.tar.gz && cd luarocks-2.4.3 && ./configure && make build && make install 
RUN luarocks install luafilesystem

@yingshang OpenResty 1.11.2.5 should already use LuaJIT 2.1 by default. So maybe it's something else. Not sure.

nerver mind.I'll deal with it in this way.ngx-sample-lua-bt