Zth (libzth)
Loading...
Searching...
No Matches
zth::DefaultConfig Struct Reference

#include <config.h>

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

Classes

struct  Allocator
 Allocator type. More...
 

Static Public Member Functions

static constexpr struct timespec MinTimeslice ()
 Minimum time slice before zth::yield() actually yields.
 
static constexpr struct timespec TimesliceOverrunReportThreshold ()
 Print an overrun reported when this timeslice is exceeded.
 

Static Public Attributes

static bool const Debug
 This is a debug build when set to true.
 
static bool const EnableAssert
 When true, enable zth_assert().
 
static bool const EnableFullAssert
 Show failing expression in case of a failed assert.
 
static bool const EnableBacktrace
 Enable backtrace support.
 
static bool const EnableThreads
 Add (Worker) thread support when true.
 
static bool const EnableDebugPrint
 Actually do print the debug output.
 
static bool const SupportDebugPrint
 Add support to enable debug output prints.
 
static bool const EnableColorLog
 Enable colored output.
 
static int const Print_banner = 12
 ANSI color used by zth_dbg(). Printing this category is disabled when set to 0.
 
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 int const Print_coro = 13
 
static size_t const DefaultFiberStackSize
 Default fiber stack size in bytes.
 
static bool const EnableStackGuard
 When true, enable stack guards.
 
static bool const EnableStackWaterMark
 When true, enable stack watermark to detect maximum stack usage.
 
static bool const ContextSignals
 Take POSIX signal into account when doing a context switch.
 
static bool const CheckTimesliceOverrun
 Check time slice overrun at every context switch.
 
static bool const NamedSynchronizer = SupportDebugPrint && Print_sync > 0
 Save names for all zth::Synchronizer instances.
 
static size_t const PerfEventBufferSize
 Buffer size for perf events.
 
static size_t const PerfEventBufferSpare
 Minimum remaining space before perf event collection is stopped.
 
static bool const DoPerfEvent = false
 Record and output perf events to file automatically.
 
static bool const EnablePerfEvent
 Enable (but not necessarily record) perf.
 
static bool const PerfSyscall
 Also record syscalls by perf.
 
static bool const NamedFsm = Debug || (SupportDebugPrint && Print_fsm > 0)
 Use named FSM guards/actions.
 
static bool const NamedObjects
 Use named objects.
 
static bool const UseZMQ
 Enable ZeroMQ support.
 
static bool const UseLimitedFormatSpecifiers
 Use limited formatting specifiers.
 
static bool const EnableExceptions
 Indicate if exceptions are supported.
 

Detailed Description

Definition at line 56 of file config.h.

Member Function Documentation

◆ MinTimeslice()

static constexpr struct timespec zth::DefaultConfig::MinTimeslice ( )
inlinestatic

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

Definition at line 203 of file config.h.

◆ TimesliceOverrunReportThreshold()

static constexpr struct timespec zth::DefaultConfig::TimesliceOverrunReportThreshold ( )
inlinestatic

Print an overrun reported when this timeslice is exceeded.

Definition at line 214 of file config.h.

Member Data Documentation

◆ CheckTimesliceOverrun

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

Check time slice overrun at every context switch.

Definition at line 228 of file config.h.

◆ ContextSignals

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

Take POSIX signal into account when doing a context switch.

Definition at line 195 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 58 of file config.h.

◆ DefaultFiberStackSize

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

Default fiber stack size in bytes.

Definition at line 169 of file config.h.

◆ DoPerfEvent

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

Record and output perf events to file automatically.

Default to false, but can be overridden by ZTH_CONFIG_DO_PERF_EVENT environment variable.

This only works for targets with a filesystem. The file can be overridden using ZTH_PERF_FILE environment variable. On targets without filesystem, call perf_dump() manually.

Definition at line 262 of file config.h.

◆ EnableAssert

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

When true, enable zth_assert().

Definition at line 70 of file config.h.

◆ EnableBacktrace

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

Enable backtrace support.

Definition at line 98 of file config.h.

◆ EnableColorLog

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

Enable colored output.

Definition at line 143 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 119 of file config.h.

◆ EnableExceptions

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

Indicate if exceptions are supported.

Definition at line 305 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:70

Show failing expression in case of a failed assert.

Disable to reduce binary size.

Definition at line 85 of file config.h.

◆ EnablePerfEvent

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

Enable (but not necessarily record) perf.

Definition at line 265 of file config.h.

◆ EnableStackGuard

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

When true, enable stack guards.

Definition at line 179 of file config.h.

◆ EnableStackWaterMark

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

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

Definition at line 187 of file config.h.

◆ EnableThreads

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

Add (Worker) thread support when true.

Definition at line 106 of file config.h.

◆ NamedFsm

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

Use named FSM guards/actions.

Definition at line 282 of file config.h.

◆ NamedObjects

bool const zth::DefaultConfig::NamedObjects
static
Initial value:
=
static bool const EnablePerfEvent
Enable (but not necessarily record) perf.
Definition config.h:265
static bool const CheckTimesliceOverrun
Check time slice overrun at every context switch.
Definition config.h:228
static bool const SupportDebugPrint
Add support to enable debug output prints.
Definition config.h:131
static bool const NamedSynchronizer
Save names for all zth::Synchronizer instances.
Definition config.h:236

Use named objects.

Definition at line 285 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 236 of file config.h.

◆ PerfEventBufferSize

size_t const zth::DefaultConfig::PerfEventBufferSize
static
Initial value:
=
0x4000

Buffer size for perf events.

Definition at line 239 of file config.h.

◆ PerfEventBufferSpare

size_t const zth::DefaultConfig::PerfEventBufferSpare
static
Initial value:
=
static size_t const PerfEventBufferSize
Buffer size for perf events.
Definition config.h:239

Minimum remaining space before perf event collection is stopped.

Definition at line 249 of file config.h.

◆ PerfSyscall

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

Also record syscalls by perf.

Definition at line 274 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 154 of file config.h.

◆ Print_context

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

Definition at line 160 of file config.h.

◆ Print_coro

int const zth::DefaultConfig::Print_coro = 13
static

Definition at line 166 of file config.h.

◆ Print_fiber

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

Definition at line 159 of file config.h.

◆ Print_fsm

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

Definition at line 164 of file config.h.

◆ Print_io

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

Definition at line 157 of file config.h.

◆ Print_list

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

Definition at line 162 of file config.h.

◆ Print_perf

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

Definition at line 158 of file config.h.

◆ Print_sync

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

Definition at line 161 of file config.h.

◆ Print_thread

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

Definition at line 165 of file config.h.

◆ Print_waiter

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

Definition at line 156 of file config.h.

◆ Print_worker

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

Definition at line 155 of file config.h.

◆ Print_zmq

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

Definition at line 163 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 131 of file config.h.

◆ UseLimitedFormatSpecifiers

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

Use limited formatting specifiers.

Definition at line 297 of file config.h.

◆ UseZMQ

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

Enable ZeroMQ support.

Definition at line 289 of file config.h.


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