ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
instrument_log.c File Reference

Debug instrumentation logging runtime implementation. More...

Go to the source code of this file.

Data Structures

struct  asciichat_instr_only_selector
 Selector for filtering instrumentation output by file, function, or module. More...
 
struct  asciichat_instr_only_list
 Dynamic array of instrumentation selectors for filtering output. More...
 
struct  asciichat_instr_runtime
 Per-thread instrumentation runtime state. More...
 

Macros

#define ASCII_INSTR_SOURCE_PRINT_HAVE_REGEX   1
 
#define posix_write   write
 
#define ASCII_INSTR_SOURCE_PRINT_DEFAULT_BASENAME   "ascii-instr"
 
#define ASCII_INSTR_SOURCE_PRINT_MAX_LINE   4096
 
#define ASCII_INSTR_SOURCE_PRINT_MAX_SNIPPET   2048
 

Typedefs

typedef enum asciichat_instr_selector_type asciichat_instr_selector_type_t
 
typedef struct asciichat_instr_only_selector asciichat_instr_only_selector_t
 Selector for filtering instrumentation output by file, function, or module.
 
typedef struct asciichat_instr_only_list asciichat_instr_only_list_t
 Dynamic array of instrumentation selectors for filtering output.
 
typedef struct asciichat_instr_runtime asciichat_instr_runtime_t
 Per-thread instrumentation runtime state.
 

Enumerations

enum  asciichat_instr_selector_type { ASCII_INSTR_SOURCE_PRINT_SELECTOR_FILE_SUBSTRING = 0 , ASCII_INSTR_SOURCE_PRINT_SELECTOR_FILE_GLOB = 1 , ASCII_INSTR_SOURCE_PRINT_SELECTOR_FUNCTION_GLOB = 2 , ASCII_INSTR_SOURCE_PRINT_SELECTOR_MODULE = 3 }
 

Functions

asciichat_instr_runtime_t * asciichat_instr_runtime_get (void)
 Get or create the thread-local runtime context.
 
void asciichat_instr_runtime_destroy (asciichat_instr_runtime_t *runtime)
 Destroy a runtime context and release resources.
 
void asciichat_instr_runtime_global_destroy (void)
 Global shutdown of the instrumentation system.
 
void asciichat_instr_log_line (const char *file_path, uint32_t line_number, const char *function_name, const char *snippet, uint8_t is_macro_expansion)
 Log a source line execution event.
 
bool asciichat_instr_coverage_enabled (void)
 Check if coverage logging is enabled.
 
void asciichat_instr_log_pc (uintptr_t program_counter)
 Log a program counter for coverage analysis.
 

Detailed Description

Debug instrumentation logging runtime implementation.

Implements the runtime logging infrastructure for source-code instrumentation. Captures execution traces with filtering, rate limiting, and coverage analysis. See include/ascii-chat/tooling/panic/instrument_log.h for the public API.

Definition in file instrument_log.c.

Macro Definition Documentation

◆ ASCII_INSTR_SOURCE_PRINT_DEFAULT_BASENAME

#define ASCII_INSTR_SOURCE_PRINT_DEFAULT_BASENAME   "ascii-instr"

Definition at line 68 of file instrument_log.c.

◆ ASCII_INSTR_SOURCE_PRINT_HAVE_REGEX

#define ASCII_INSTR_SOURCE_PRINT_HAVE_REGEX   1

Definition at line 45 of file instrument_log.c.

◆ ASCII_INSTR_SOURCE_PRINT_MAX_LINE

#define ASCII_INSTR_SOURCE_PRINT_MAX_LINE   4096

Definition at line 72 of file instrument_log.c.

◆ ASCII_INSTR_SOURCE_PRINT_MAX_SNIPPET

#define ASCII_INSTR_SOURCE_PRINT_MAX_SNIPPET   2048

Definition at line 76 of file instrument_log.c.

◆ posix_write

#define posix_write   write

Definition at line 64 of file instrument_log.c.

Typedef Documentation

◆ asciichat_instr_only_list_t

Dynamic array of instrumentation selectors for filtering output.

◆ asciichat_instr_only_selector_t

Selector for filtering instrumentation output by file, function, or module.

◆ asciichat_instr_runtime_t

Per-thread instrumentation runtime state.

Tracks state for source code instrumentation logging, including file descriptors, filter configuration, and rate limiting for the current thread.

◆ asciichat_instr_selector_type_t

Enumeration Type Documentation

◆ asciichat_instr_selector_type

Enumerator
ASCII_INSTR_SOURCE_PRINT_SELECTOR_FILE_SUBSTRING 
ASCII_INSTR_SOURCE_PRINT_SELECTOR_FILE_GLOB 
ASCII_INSTR_SOURCE_PRINT_SELECTOR_FUNCTION_GLOB 
ASCII_INSTR_SOURCE_PRINT_SELECTOR_MODULE 

Definition at line 79 of file instrument_log.c.

79 {
@ ASCII_INSTR_SOURCE_PRINT_SELECTOR_FUNCTION_GLOB
@ ASCII_INSTR_SOURCE_PRINT_SELECTOR_FILE_GLOB
@ ASCII_INSTR_SOURCE_PRINT_SELECTOR_FILE_SUBSTRING
@ ASCII_INSTR_SOURCE_PRINT_SELECTOR_MODULE
enum asciichat_instr_selector_type asciichat_instr_selector_type_t