ascii-chat 0.8.38
Real-time terminal-based video chat with ASCII art conversion
Loading...
Searching...
No Matches
report.c File Reference

Go to the source code of this file.

Data Structures

struct  thread_filter_list
 Dynamic array of thread IDs for filtering instrumentation logs. More...
 
struct  report_config
 Configuration for panic report generation. More...
 
struct  log_record
 Parsed instrumentation log record. More...
 
struct  thread_entry
 Hash table entry for thread-local last log record. More...
 

Typedefs

typedef struct thread_filter_list thread_filter_list_t
 Dynamic array of thread IDs for filtering instrumentation logs.
 
typedef struct report_config report_config_t
 Configuration for panic report generation.
 
typedef struct log_record log_record_t
 Parsed instrumentation log record.
 
typedef struct thread_entry thread_entry_t
 Hash table entry for thread-local last log record.
 

Functions

int main (int argc, char **argv)
 

Typedef Documentation

◆ log_record_t

typedef struct log_record log_record_t

Parsed instrumentation log record.

Represents a single line from an instrumentation log file with all fields extracted and parsed.

◆ report_config_t

Configuration for panic report generation.

◆ thread_entry_t

typedef struct thread_entry thread_entry_t

Hash table entry for thread-local last log record.

Used by uthash to track the most recent log record for each thread when generating panic reports.

◆ thread_filter_list_t

Dynamic array of thread IDs for filtering instrumentation logs.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 633 of file report.c.

633 {
634 report_config_t config = {
635 .log_dir = NULL,
636 .log_file = NULL,
637 .include_filter = NULL,
638 .exclude_filter = NULL,
639 .threads = {.values = NULL, .count = 0, .capacity = 0},
640 .emit_raw_line = false,
641 };
642
643 log_init(NULL, LOG_INFO, false, false);
644
645 int exit_code = EXIT_SUCCESS;
646 if (!parse_arguments(argc, argv, &config)) {
647 exit_code = ERROR_USAGE;
648 goto cleanup;
649 }
650
651 thread_entry_t *entries = NULL;
652 if (!collect_entries(&config, &entries)) {
653 exit_code = ERROR_GENERAL;
654 destroy_entries(&entries);
655 goto cleanup;
656 }
657
658 print_summary(&config, &entries);
659 destroy_entries(&entries);
660
661cleanup:
662 thread_filter_list_destroy(&config.threads);
663 log_destroy();
664 return exit_code;
665}
void log_destroy(void)
void log_init(const char *filename, log_level_t level, bool force_stderr, bool use_mmap)
Configuration for panic report generation.
Definition report.c:42
thread_filter_list_t threads
Thread IDs to include in report.
Definition report.c:47
const char * log_dir
Directory containing instrumentation log files.
Definition report.c:43
Hash table entry for thread-local last log record.
Definition report.c:77

References log_destroy(), report_config::log_dir, log_init(), and report_config::threads.