[Tarantool-discussions] [RFC] add flamegraphs to lua platform profiler doc

Maxim Kokryashkin max.kokryashkin at gmail.com
Mon Jul 12 15:25:32 MSK 2021


From: Maxim Kokryashkin <m.kokryashkin at tarantool.org>

---
 doc/rfc/781-luajit-platform-profiler.md | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/doc/rfc/781-luajit-platform-profiler.md b/doc/rfc/781-luajit-platform-profiler.md
index fda3d535b..74132c2d4 100644
--- a/doc/rfc/781-luajit-platform-profiler.md
+++ b/doc/rfc/781-luajit-platform-profiler.md
@@ -14,6 +14,17 @@ Currently, available options for profiling LuaJIT are not fine enough to get an
 
 To get a detailed perspective of platform performance, a more advanced profiler is needed. The desired profiler must be able to capture both guest and host stacks simultaneously, along with virtual machine states.
 
+To get the difference, you can take a look at flamegraphs generated by pref, jit.p, and PoC for the proposed profiler below.
+### jit.p
+![jit.p](https://i.imgur.com/sDZZDZx.png)
+
+### perf
+![perf](https://i.imgur.com/DlKbFpo.png)
+
+### sysprof
+![sysprof](https://i.imgur.com/Yf80MDE.png)
+
+
 ## Detailed design
 
 The proposed approach is to extend existing profiler embedded into LuaJIT, so it will be able to capture host stack too. 
@@ -69,4 +80,4 @@ Another way to implement such a thing is to make perf to see guest stack. To do
 Stack unwinding from outside of the LuaJIT is the problem we didn’t manage to solve for today. There are different approaches to do this:
 - *Save rsp register value to rbp and preserve rbp.* However, LuaJIT uses rbp as a general-purpose register, and it is hard not to break everything trying to use it only for stack frames.
 - *Coordinated work of `jit.p` and perf.* This approach requires modifying perf the way it will send LuaJIT suspension signal, and after getting info about the host stack, it will receive information about the guest stack and join them. This solution is quite possible, but modified perf doesn't seem like a production-ready solution.
-- *Dwarf unwinding*
\ No newline at end of file
+- *Dwarf unwinding*
-- 
2.32.0



More information about the Tarantool-discussions mailing list