Zth (libzth)
zth::DefaultConfig Struct Reference

#include <config.h>

Inheritance diagram for zth::DefaultConfig:
zth::Config

Classes

struct  Allocator
 Allocator type. More...
 

Static Public Member Functions

constexpr static double MinTimeslice_s ()
 Minimum time slice before zth::yield() actually yields. More...
 

Static Public Attributes

static bool const Debug
 This is a debug build when set to true. More...
 
static bool const EnableAssert
 When true, enable zth_assert(). More...
 
static bool const EnableFullAssert
 Show failing expression in case of a failed assert. More...
 
static bool const EnableThreads
 Add (Worker) thread support when true. More...
 
static bool const EnableDebugPrint
 Actually do print the debug output. More...
 
static bool const SupportDebugPrint
 Add support to enable debug output prints. More...
 
static bool const EnableColorLog = true
 Enable colored output. More...
 
static int const Print_banner = 12
 ANSI color used by zth_dbg(). Printing this category is disabled when set to 0. More...
 
static int const Print_worker = 5
 
static int const Print_waiter = 1
 
static int const Print_io = 9
 
static int const Print_perf = 6
 
static int const Print_fiber = 10
 
static int const Print_context = 2
 
static int const Print_sync = 11
 
static int const Print_list = 8
 
static int const Print_zmq = 9
 
static int const Print_fsm = 14
 
static int const Print_thread = 3
 
static size_t const DefaultFiberStackSize = 0x20000
 Default fiber stack size in bytes. More...
 
static bool const EnableStackGuard = Debug
 When true, enable stack guards. More...
 
static bool const EnableStackWaterMark = Debug
 When true, enable stack watermark to detect maximum stack usage. More...
 
static bool const ContextSignals = false
 Take POSIX signal into account when doing a context switch. More...
 
static int const TimesliceOverrunFactorReportThreshold = 4
 Print an overrun reported when MinTimeslice_s() is exceeded by this factor. More...
 
static bool const CheckTimesliceOverrun = Debug
 Check time slice overrun at every context switch. More...
 
static bool const NamedSynchronizer = SupportDebugPrint && Print_sync > 0
 Save names for all zth::Synchronizer instances. More...
 
static size_t const PerfEventBufferSize = 128
 Buffer size for perf events. More...
 
static size_t const PerfEventBufferThresholdToTriggerVCDWrite = PerfEventBufferSize / 2
 Threshold when to force writing out VCD buffer. More...
 
static size_t const PerfVCDFileBuffer = 0x1000
 VCD file buffer in bytes. More...
 
static bool const DoPerfEvent = false
 Record and output perf events. More...
 
static bool const EnablePerfEvent
 Enable (but not necessarily record) perf. More...
 
static bool const PerfSyscall = true
 Also record syscalls by perf. More...
 
static bool const NamedFsm = Debug || (EnableDebugPrint && Print_fsm > 0)
 Use named FSM guards/actions. More...
 
static bool const UseZMQ
 Enable ZeroMQ support. More...
 

Detailed Description

Definition at line 48 of file config.h.

Member Function Documentation

◆ MinTimeslice_s()

constexpr static double zth::DefaultConfig::MinTimeslice_s ( )
inlinestaticconstexpr

Minimum time slice before zth::yield() actually yields.

Definition at line 141 of file config.h.

Member Data Documentation

◆ CheckTimesliceOverrun

bool const zth::DefaultConfig::CheckTimesliceOverrun = Debug
static

Check time slice overrun at every context switch.

Definition at line 149 of file config.h.

◆ ContextSignals

bool const zth::DefaultConfig::ContextSignals = false
static

Take POSIX signal into account when doing a context switch.

Definition at line 139 of file config.h.

◆ Debug

bool const zth::DefaultConfig::Debug
static
Initial value:
=
true

This is a debug build when set to true.

Definition at line 50 of file config.h.

◆ DefaultFiberStackSize

size_t const zth::DefaultConfig::DefaultFiberStackSize = 0x20000
static

Default fiber stack size in bytes.

Definition at line 133 of file config.h.

◆ DoPerfEvent

bool const zth::DefaultConfig::DoPerfEvent = false
static

Record and output perf events.

Definition at line 161 of file config.h.

◆ EnableAssert

bool const zth::DefaultConfig::EnableAssert
static
Initial value:
=
static bool const Debug
This is a debug build when set to true.
Definition: config.h:50

When true, enable zth_assert().

Definition at line 58 of file config.h.

◆ EnableColorLog

bool const zth::DefaultConfig::EnableColorLog = true
static

Enable colored output.

Definition at line 113 of file config.h.

◆ EnableDebugPrint

bool const zth::DefaultConfig::EnableDebugPrint
static
Initial value:
=
false

Actually do print the debug output.

Needs SupportDebugPrint to be true. Can be overridden by ZTH_CONFIG_ENABLE_DEBUG_PRINT environment variable.

Definition at line 91 of file config.h.

◆ EnableFullAssert

bool const zth::DefaultConfig::EnableFullAssert
static
Initial value:
=
static bool const EnableAssert
When true, enable zth_assert().
Definition: config.h:58

Show failing expression in case of a failed assert.

Disable to reduce binary size.

Definition at line 69 of file config.h.

◆ EnablePerfEvent

bool const zth::DefaultConfig::EnablePerfEvent
static
Initial value:
=
true

Enable (but not necessarily record) perf.

Definition at line 163 of file config.h.

◆ EnableStackGuard

bool const zth::DefaultConfig::EnableStackGuard = Debug
static

When true, enable stack guards.

Definition at line 135 of file config.h.

◆ EnableStackWaterMark

bool const zth::DefaultConfig::EnableStackWaterMark = Debug
static

When true, enable stack watermark to detect maximum stack usage.

Definition at line 137 of file config.h.

◆ EnableThreads

bool const zth::DefaultConfig::EnableThreads
static
Initial value:
=
true

Add (Worker) thread support when true.

Definition at line 78 of file config.h.

◆ NamedFsm

bool const zth::DefaultConfig::NamedFsm = Debug || (EnableDebugPrint && Print_fsm > 0)
static

Use named FSM guards/actions.

Definition at line 174 of file config.h.

◆ NamedSynchronizer

bool const zth::DefaultConfig::NamedSynchronizer = SupportDebugPrint && Print_sync > 0
static

Save names for all zth::Synchronizer instances.

Definition at line 151 of file config.h.

◆ PerfEventBufferSize

size_t const zth::DefaultConfig::PerfEventBufferSize = 128
static

Buffer size for perf events.

Definition at line 154 of file config.h.

◆ PerfEventBufferThresholdToTriggerVCDWrite

size_t const zth::DefaultConfig::PerfEventBufferThresholdToTriggerVCDWrite = PerfEventBufferSize / 2
static

Threshold when to force writing out VCD buffer.

Definition at line 156 of file config.h.

◆ PerfSyscall

bool const zth::DefaultConfig::PerfSyscall = true
static

Also record syscalls by perf.

Definition at line 171 of file config.h.

◆ PerfVCDFileBuffer

size_t const zth::DefaultConfig::PerfVCDFileBuffer = 0x1000
static

VCD file buffer in bytes.

Definition at line 158 of file config.h.

◆ Print_banner

int const zth::DefaultConfig::Print_banner = 12
static

ANSI color used by zth_dbg(). Printing this category is disabled when set to 0.

Definition at line 119 of file config.h.

◆ Print_context

int const zth::DefaultConfig::Print_context = 2
static

Definition at line 125 of file config.h.

◆ Print_fiber

int const zth::DefaultConfig::Print_fiber = 10
static

Definition at line 124 of file config.h.

◆ Print_fsm

int const zth::DefaultConfig::Print_fsm = 14
static

Definition at line 129 of file config.h.

◆ Print_io

int const zth::DefaultConfig::Print_io = 9
static

Definition at line 122 of file config.h.

◆ Print_list

int const zth::DefaultConfig::Print_list = 8
static

Definition at line 127 of file config.h.

◆ Print_perf

int const zth::DefaultConfig::Print_perf = 6
static

Definition at line 123 of file config.h.

◆ Print_sync

int const zth::DefaultConfig::Print_sync = 11
static

Definition at line 126 of file config.h.

◆ Print_thread

int const zth::DefaultConfig::Print_thread = 3
static

Definition at line 130 of file config.h.

◆ Print_waiter

int const zth::DefaultConfig::Print_waiter = 1
static

Definition at line 121 of file config.h.

◆ Print_worker

int const zth::DefaultConfig::Print_worker = 5
static

Definition at line 120 of file config.h.

◆ Print_zmq

int const zth::DefaultConfig::Print_zmq = 9
static

Definition at line 128 of file config.h.

◆ SupportDebugPrint

bool const zth::DefaultConfig::SupportDebugPrint
static
Initial value:

Add support to enable debug output prints.

The output is only actually printed when EnableDebugPrint is true.

Definition at line 103 of file config.h.

◆ TimesliceOverrunFactorReportThreshold

int const zth::DefaultConfig::TimesliceOverrunFactorReportThreshold = 4
static

Print an overrun reported when MinTimeslice_s() is exceeded by this factor.

Definition at line 147 of file config.h.

◆ UseZMQ

bool const zth::DefaultConfig::UseZMQ
static
Initial value:
=
true

Enable ZeroMQ support.

Definition at line 177 of file config.h.


The documentation for this struct was generated from the following file: