You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+33-20Lines changed: 33 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -7,9 +7,13 @@ Use ebpf to generate lua flamegraphs:
7
7
- support `luajit 32/luajit 64`
8
8
- working well on new kernel(>=5.13)
9
9
- faster speed
10
-
- run only small binary without any dependencies
10
+
- run only a small binary without any dependencies
11
11
12
-
## probe nginx lua
12
+
> Note:
13
+
> - for the ebpf verifier instructions limit in kernel, the stack-trace deepth is limited to top 15 in lua. If you need to trace deeper, you need to use systemtap instead.
14
+
> - this project is not finished yet, and some errors may occurred.
15
+
16
+
## probe lua stack in nginx
13
17
14
18
see: bpftools/profile_nginx_lua/profile.bpf.c
15
19
@@ -47,8 +51,8 @@ see the `fix_lua_stack` function:
// for the ebpf verifier insns (limit 1000000), we need to limit the max loop times to 12
51
-
for (; i < 12 && frame > bot; i++)
54
+
// for the ebpf verifier insns (limit 1000000), we need to limit the max loop times to 15
55
+
for (; i < 15 && frame > bot; i++)
52
56
{
53
57
if (frame_gc(frame) == obj2gco(L))
54
58
{
@@ -152,6 +156,16 @@ see `bpftools/profile_nginx_lua/profile.c: print_fold_user_stack_with_lua`
152
156
153
157
If the lua stack output `user_stack_id` matches the original `user_stack_id`, this means the stack is a lua stack. Then, we replace the `[unknown]` function whose uip insides the luajit vm function range with our lua stack. This may not be totally correct, but it works for now. After printing the stack, we can use
0 commit comments