automotive-dlt
|
#include <stdlib.h>
#include <syslog.h>
#include <sys/procfs.h>
#include <sys/user.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <asm/prctl.h>
#include <inttypes.h>
#include "dlt_cdh.h"
#include "dlt_cdh_cpuinfo.h"
Go to the source code of this file.
Macros | |
#define | ALIGN(x, a) (((x)+(a)-1UL)&~((a)-1UL)) |
#define | NOTE_SIZE(_hdr) (sizeof (_hdr) + ALIGN((_hdr).n_namesz, 4) + (_hdr).n_descsz) |
#define | ADDRESS_REBASE(__x, __phdr_num) (__x - p_proc->m_pPhdr[__phdr_num].p_vaddr) |
#define | READ_STACK_VALUE(__offset, __type) (*(__type*)(stack_page+__offset-sizeof(__type))) |
Functions | |
cdh_status_t | get_phdr_num (proc_info_t *p_proc, unsigned int p_address, int *phdr_num) |
cdh_status_t | get_crashed_registers (proc_info_t *p_proc) |
cdh_status_t | create_crashid (proc_info_t *p_proc) |
int | write_crashid_to_filesystem (proc_info_t *p_proc) |
cdh_status_t | treat_crash_data (proc_info_t *p_proc) |
Definition in file dlt_cdh_crashid.c.
#define ADDRESS_REBASE | ( | __x, | |
__phdr_num | |||
) | (__x - p_proc->m_pPhdr[__phdr_num].p_vaddr) |
Referenced by create_crashid().
#define ALIGN | ( | x, | |
a | |||
) | (((x)+(a)-1UL)&~((a)-1UL)) |
Definition at line 79 of file dlt_cdh_crashid.c.
Referenced by get_crashed_registers().
#define NOTE_SIZE | ( | _hdr | ) | (sizeof (_hdr) + ALIGN((_hdr).n_namesz, 4) + (_hdr).n_descsz) |
Definition at line 80 of file dlt_cdh_crashid.c.
Referenced by get_crashed_registers().
#define READ_STACK_VALUE | ( | __offset, | |
__type | |||
) | (*(__type*)(stack_page+__offset-sizeof(__type))) |
cdh_status_t create_crashid | ( | proc_info_t * | p_proc | ) |
Definition at line 131 of file dlt_cdh_crashid.c.
References ADDRESS_REBASE, CDH_OK, get_phdr_num(), cdh_registers_t::lr, proc_info_t::m_crashid, proc_info_t::m_crashid_phase1, proc_info_t::m_registers, proc_info_t::name, cdh_registers_t::pc, proc_info_t::pid, proc_info_t::signal, and proc_info_t::threadname.
Referenced by treat_crash_data().
cdh_status_t get_crashed_registers | ( | proc_info_t * | p_proc | ) |
Definition at line 82 of file dlt_cdh_crashid.c.
References ALIGN, CDH_NOK, CDH_OK, CityHash64(), ELF_Nhdr, get_registers(), proc_info_t::m_crashed_pid, proc_info_t::m_crashid, proc_info_t::m_crashid_phase1, proc_info_t::m_Nhdr, proc_info_t::m_registers, MAX_PROC_NAME_LENGTH, proc_info_t::name, and NOTE_SIZE.
Referenced by treat_crash_data().
cdh_status_t get_phdr_num | ( | proc_info_t * | p_proc, |
unsigned int | p_address, | ||
int * | phdr_num | ||
) |
Definition at line 56 of file dlt_cdh_crashid.c.
References CDH_NOK, CDH_OK, proc_info_t::m_Ehdr, proc_info_t::m_pPhdr, and NULL.
Referenced by create_crashid().
cdh_status_t treat_crash_data | ( | proc_info_t * | p_proc | ) |
Definition at line 191 of file dlt_cdh_crashid.c.
References CDH_NOK, CDH_OK, create_crashid(), get_crashed_registers(), and write_crashid_to_filesystem().
Referenced by main().
int write_crashid_to_filesystem | ( | proc_info_t * | p_proc | ) |
Definition at line 175 of file dlt_cdh_crashid.c.
References CDH_NOK, CDH_OK, CRASHID_FILE, proc_info_t::m_crashid, NULL, and proc_info_t::pid.
Referenced by treat_crash_data().