automotive-dlt
dlt_cdh_crashid.c File Reference
#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"
Include dependency graph for dlt_cdh_crashid.c:

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)
 

Detailed Description

Author
Magneti Marelli http://www.magnetimarelli.com
Lutz Helwing lutz_.nosp@m.helw.nosp@m.ing@m.nosp@m.ento.nosp@m.r.com

Definition in file dlt_cdh_crashid.c.

Macro Definition Documentation

#define ADDRESS_REBASE (   __x,
  __phdr_num 
)    (__x - p_proc->m_pPhdr[__phdr_num].p_vaddr)

Referenced by create_crashid().

#define ALIGN (   x,
 
)    (((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)))

Function Documentation

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().