Sampling profiler

Implement sampling profiler in LuaJIT

The desired LuaJIT internal sampling profiler works in the following way:

  1. The profiler selects LuaJIT thread (i.e. Tarantool tx worker thread) and starts profiling it.
  2. During the whole profiling process each time after a certain interval passes, the profiler interrupts the thread's work and gets info on vm-states and which function is performed
  3. When profiling is over, the profiler outputs statistics.

Task: the student has to get familiar with LuaJIT guest stack layout (frame types, Lua-Lua calls, TCO), provide the design for implementing LuaJIT sampling profiler (one can look onto the profiler in LuaVela) and implement this feature.

Introduce guest stack processing to the existing sampling profiler

There are several external tools for sampling profiler: perf, gprof. These tools respects only C (host) stack, but Lua (guest) stack is also need to be used in profiler recordings.

Task: the student has to get familiar with the various profiler tools and LuaJIT guest stack layout (frame types, Lua-Lua calls, TCO), provide the design for implementing LuaJIT stack traces in terms of the chosen toolchain and implement this feature.