Description
Related dev. issue(s): tarantool/tarantool@3116c4e.
Product: Tarantool
Since: 2.10.0-rc1
Root document:
https://www.tarantool.io/ru/doc/latest/dev_guide/reference_capi/fiber/
https://www.tarantool.io/ru/doc/latest/reference/reference_lua/fiber/
SME: @ CuriousGeorgiy
Details
With backtrace implementation reworked in afc100d, we can now
efficiently collect unwinding information about parents at fiber
creation time:
- Add
core_backtrace_cat
helper for concatenating backtraces. - Add 'parent_bt' field to
struct fiber
for storing fiber parent's
backtrace. - Add
fiber_parent_backtrace_enabled
and corresponding C/Lua toggles for
controlling parent backtrace collection for newly created fibers.
local fiber = require('fiber')
local log = require('log')
local yaml = require('yaml')
local function foo()
log.info("%s", yaml.encode(fiber.info()[fiber.self()[id]].backtrace))
end
-- Parent backtrace collection feature is disable by default.
fiber.parent_backtrace_enable()
-- Backtrace will contain also parent's backtrace.
fiber.create(foo)
fiber.parent_backtrace_disable()
-- Backtrace will not contain parent's backtrace.
fiber.create(foo)
local function bar()
-- Fibers created before enabling parent backtrace feature will not be
-- contained in backtrace.
fiber.parent_backtrace_enable()
fiber.create(foo)
end
-- Grandchild will not contain child's backtrace.
fiber.create(bar)
Definition of done
- You have agreed with @CuriousGeorgiy which sections should have information added and which parameters should be updated
- The necessary sections have been updated.