[Tarantool-patches] [PATCH] sysprof: fix `SYSPROF_HANDLER_STACK_DEPTH`

Maxim Kokryashkin max.kokryashkin at gmail.com
Wed May 11 11:25:20 MSK 2022


This commit fixes the `SYSPROF_HANDLER_STACK_DEPTH`, by chnaging it to 6.
The `writer` function is called right after `backtrace`, so it will not
appear in the gathered backtrace.

Part of tarantool/tarantool#781
---
Branch: https://github.com/tarantool/luajit/tree/fckxorg/sysprof-rc-full-ci

 src/lj_sysprof.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/src/lj_sysprof.c b/src/lj_sysprof.c
index 3088036f..55cea203 100644
--- a/src/lj_sysprof.c
+++ b/src/lj_sysprof.c
@@ -32,22 +32,20 @@
 ** Number of profiler frames we need to omit during stack
 ** unwinding.
 **   +------------------------+
-** 0 |    stream_frame_host   |
+** 0 | default_backtrace_host |
 **   +------------------------+
-** 1 | default_backtrace_host |
+** 1 | stream_backtrace_host  |
 **   +------------------------+
-** 2 | stream_backtrace_host  |
+** 2 |  stream_{guest/host}   |
 **   +------------------------+
-** 3 |  stream_{guest/host}   |
+** 3 |      stream_event      |
 **   +------------------------+
-** 4 |      stream_event      |
+** 4 | sysprof_record_sample  |
 **   +------------------------+
-** 5 | sysprof_record_sample  |
-**   +------------------------+
-** 6 | sysprof_signal_handler |
+** 5 | sysprof_signal_handler |
 **   +------------------------+
 */
-#define SYSPROF_HANDLER_STACK_DEPTH 7
+#define SYSPROF_HANDLER_STACK_DEPTH 6
 #define SYSPROF_BACKTRACE_FRAME_MAX 512
 
 /* Check that vmstate fits in 4 bits (see streaming format) */
-- 
2.35.1



More information about the Tarantool-patches mailing list