Implement GDB pretty-printers for folly::fibers
Summary:This adds basic print functions for FiberManager, Fiber and FiberManager map. It also adds a global list of fibers to FiberManager. Fibers are only removed from that list on Fiber object destruction, so it shouldn't have any perf impact. Inspired by tao/server/scripts/fiber_bt.gdb FiberManager map example: (gdb) print_folly_fiber_manager_map Global FiberManager map has 2 entries. (folly::EventBase*)0x7fffffffdb60 -> (folly::fibers::FiberManager*)0x7ffff5b58480 (folly::EventBase*)0x7fffffffd930 -> (folly::fibers::FiberManager*)0x7ffff5b58300 FiberManager example: (gdb) print_folly_fiber_manager &manager (folly::fibers::FiberManager*)0x7fffffffdbe0 Fibers active: 3 Fibers allocated: 3 Fibers pool size: 0 Active fiber: (folly::fibers::Fiber*)(nil) Current fiber: (folly::fibers::Fiber*)(nil) Active fibers: (folly::fibers::Fiber*)0x7ffff5b5b000 State: Awaiting (folly::fibers::Fiber*)0x7ffff5b5b300 State: Awaiting (folly::fibers::Fiber*)0x7ffff5b5b600 State: Awaiting Fiber example: P56244621 Reviewed By: yfeldblum Differential Revision: D3119616 fb-gh-sync-id: defa27b84aafbd4333b2ca301f07c226f0386f44 fbshipit-source-id: defa27b84aafbd4333b2ca301f07c226f0386f44
Showing
Please register or sign in to comment