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

Command-line tool for crash report analysis and summarization. More...

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...
 
struct  collect_ctx_t
 

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)
 

Detailed Description

Command-line tool for crash report analysis and summarization.

Generates and summarizes crash reports from instrumentation runtime logs. Analyzes instrumentation traces to identify error patterns and provide diagnostic information.

Definition in file report.c.

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 583 of file report.c.

583 {
584 report_config_t config = {
585 .log_dir = NULL,
586 .log_file = NULL,
587 .include_filter = NULL,
588 .exclude_filter = NULL,
589 .threads = {.values = NULL, .count = 0, .capacity = 0},
590 .emit_raw_line = false,
591 };
592
593 log_init(NULL, LOG_INFO, false, false);
594
595 int exit_code = EXIT_SUCCESS;
596 if (!parse_arguments(argc, argv, &config)) {
597 exit_code = ERROR_USAGE;
598 goto cleanup;
599 }
600
601 thread_entry_t *entries = NULL;
602 if (!collect_entries(&config, &entries)) {
603 exit_code = ERROR_GENERAL;
604 destroy_entries(&entries);
605 goto cleanup;
606 }
607
608 print_summary(&config, &entries);
609 destroy_entries(&entries);
610
611cleanup:
612 thread_filter_list_destroy(&config.threads);
613 log_destroy();
614 return exit_code;
615}
@ ERROR_GENERAL
Definition error_codes.h:52
@ ERROR_USAGE
Definition error_codes.h:53
void log_destroy(void)
Destroy the logging system and close log file.
Definition log/log.c:624
void log_init(const char *filename, log_level_t level, bool force_stderr, bool use_mmap)
Initialize the logging system.
Definition log/log.c:533
Configuration for panic report generation.
Definition report.c:48
thread_filter_list_t threads
Thread IDs to include in report.
Definition report.c:53
const char * log_dir
Directory containing instrumentation log files.
Definition report.c:49
Hash table entry for thread-local last log record.
Definition report.c:83
#define LOG_INFO
Definition types.h:40

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