automotive-dlt
|
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <syslog.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/stat.h>
#include <sys/statvfs.h>
#include "dlt_cdh.h"
#include <dirent.h>
Go to the source code of this file.
Macros | |
#define | UNUSUAL_CHARS ":/\\!*" |
#define | REPLACEMENT_CHAR '_' |
#define | COREDUMP_FILESYSTEM "/var" |
#define | COREDUMP_FILESYSTEM_MIN_SIZE_MB 40 |
#define | COREDUMP_HANDLER_PRIORITY -19 |
Functions | |
void | core_locks (const proc_info_t *p_proc, int action) |
void | init_proc_info (proc_info_t *p_proc) |
cdh_status_t | read_args (int argc, char **argv, proc_info_t *proc) |
void | remove_unusual_chars (char *p_string) |
cdh_status_t | check_disk_space () |
void | clean_core_tmp_dir () |
cdh_status_t | check_and_create_directory (const char *p_dirname, int create_silently) |
cdh_status_t | check_core_directory () |
cdh_status_t | move_to_core_directory (proc_info_t *p_proc) |
int | main (int argc, char *argv[]) |
Definition in file dlt_cdh.c.
#define COREDUMP_FILESYSTEM "/var" |
Definition at line 48 of file dlt_cdh.c.
Referenced by check_disk_space().
#define COREDUMP_FILESYSTEM_MIN_SIZE_MB 40 |
Definition at line 49 of file dlt_cdh.c.
Referenced by check_disk_space().
#define COREDUMP_HANDLER_PRIORITY -19 |
#define REPLACEMENT_CHAR '_' |
Definition at line 46 of file dlt_cdh.c.
Referenced by remove_unusual_chars().
#define UNUSUAL_CHARS ":/\\!*" |
Definition at line 45 of file dlt_cdh.c.
Referenced by remove_unusual_chars().
cdh_status_t check_and_create_directory | ( | const char * | p_dirname, |
int | create_silently | ||
) |
Definition at line 242 of file dlt_cdh.c.
References CDH_NOK, and CDH_OK.
Referenced by check_core_directory().
cdh_status_t check_core_directory | ( | ) |
Definition at line 294 of file dlt_cdh.c.
References CDH_NOK, CDH_OK, check_and_create_directory(), clean_core_tmp_dir(), CORE_DIRECTORY, CORE_LOCK_DIRECTORY, and CORE_TMP_DIRECTORY.
Referenced by main().
cdh_status_t check_disk_space | ( | ) |
Definition at line 176 of file dlt_cdh.c.
References CDH_NOK, CDH_OK, COREDUMP_FILESYSTEM, and COREDUMP_FILESYSTEM_MIN_SIZE_MB.
Referenced by main().
void clean_core_tmp_dir | ( | ) |
Definition at line 199 of file dlt_cdh.c.
References CORE_LOCK_DIRECTORY, CORE_MAX_FILENAME_LENGTH, CORE_TMP_DIRECTORY, and NULL.
Referenced by check_core_directory().
void core_locks | ( | const proc_info_t * | p_proc, |
int | action | ||
) |
Definition at line 414 of file dlt_cdh.c.
References CONTEXT_FILE_PATTERN, CORE_FILE_PATTERN, CORE_LOCK_DIRECTORY, CORE_MAX_FILENAME_LENGTH, proc_info_t::name, NULL, proc_info_t::pid, and proc_info_t::timestamp.
Referenced by main().
void init_proc_info | ( | proc_info_t * | p_proc | ) |
Definition at line 64 of file dlt_cdh.c.
References proc_info_t::can_create_coredump, proc_info_t::m_crashed_pid, proc_info_t::m_crashid, proc_info_t::m_crashid_phase1, proc_info_t::m_Ehdr, proc_info_t::m_Nhdr, proc_info_t::m_note_page_size, proc_info_t::m_pPhdr, proc_info_t::m_registers, proc_info_t::name, NULL, proc_info_t::pid, proc_info_t::signal, proc_info_t::streamer, proc_info_t::threadname, and proc_info_t::timestamp.
Referenced by read_args().
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 360 of file dlt_cdh.c.
References proc_info_t::can_create_coredump, CDH_OK, check_core_directory(), check_disk_space(), core_locks(), COREDUMP_HANDLER_PRIORITY, get_exec_name(), move_to_core_directory(), proc_info_t::name, proc_info_t::pid, read_args(), remove_unusual_chars(), proc_info_t::signal, proc_info_t::timestamp, treat_coredump(), treat_crash_data(), and write_proc_context().
cdh_status_t move_to_core_directory | ( | proc_info_t * | p_proc | ) |
Definition at line 320 of file dlt_cdh.c.
References proc_info_t::can_create_coredump, CDH_NOK, CDH_OK, CONTEXT_FILE_PATTERN, CORE_DIRECTORY, CORE_FILE_PATTERN, CORE_MAX_FILENAME_LENGTH, CORE_TMP_DIRECTORY, proc_info_t::name, NULL, proc_info_t::pid, and proc_info_t::timestamp.
Referenced by main().
cdh_status_t read_args | ( | int | argc, |
char ** | argv, | ||
proc_info_t * | proc | ||
) |
Definition at line 100 of file dlt_cdh.c.
References CDH_NOK, CDH_OK, init_proc_info(), proc_info_t::name, proc_info_t::pid, proc_info_t::signal, proc_info_t::threadname, and proc_info_t::timestamp.
Referenced by main().
void remove_unusual_chars | ( | char * | p_string | ) |
Definition at line 146 of file dlt_cdh.c.
References NULL, REPLACEMENT_CHAR, and UNUSUAL_CHARS.
Referenced by main().