iPXE
|
Function trace recorder for crash and hang debugging. More...
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ipxe/init.h>
#include <ipxe/uaccess.h>
#include <ipxe/io.h>
Go to the source code of this file.
Data Structures | |
struct | fnrec_entry |
A trace buffer entry. More... | |
struct | fnrec_buffer |
A trace buffer. More... | |
Macros | |
#define | FNREC_MAGIC ( 'f' << 24 | 'n' << 16 | 'r' << 8 | 'e' ) |
Constant for identifying valid trace buffers. More... | |
#define | FNREC_NUM_ENTRIES 4096 |
Number of trace buffer entries. More... | |
#define | FNREC_PHYS_ADDRESS ( 17 * 1024 * 1024 ) |
Trace buffer physical address. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
static int | fnrec_is_valid (void) |
Test whether the trace buffer is valid. More... | |
static void | fnrec_invalidate (void) |
Invalidate the trace buffer. More... | |
static void | fnrec_reset (void) |
Reset the trace buffer and clear entries. More... | |
static struct fnrec_entry * | fnrec_append (void *called_fn, void *call_site) |
Append an entry to the trace buffer. More... | |
static void | fnrec_dump (void) |
Print the contents of the trace buffer in chronological order. More... | |
static void | fnrec_init (void) |
Function tracer initialisation function. More... | |
struct init_fn fnrec_init_fn | __init_fn (INIT_NORMAL) |
void | __cyg_profile_func_enter (void *called_fn, void *call_site) |
void | __cyg_profile_func_exit (void *called_fn, void *call_site) |
Variables | |
static struct fnrec_buffer * | fnrec_buffer |
The trace buffer. More... | |
Function trace recorder for crash and hang debugging.
Definition in file fnrec.c.
#define FNREC_MAGIC ( 'f' << 24 | 'n' << 16 | 'r' << 8 | 'e' ) |
#define FNREC_NUM_ENTRIES 4096 |
#define FNREC_PHYS_ADDRESS ( 17 * 1024 * 1024 ) |
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
static |
Test whether the trace buffer is valid.
is_valid | Buffer is valid |
Definition at line 86 of file fnrec.c.
References FNREC_MAGIC, and fnrec_buffer::magic.
Referenced by __cyg_profile_func_enter(), __cyg_profile_func_exit(), and fnrec_init().
|
static |
Invalidate the trace buffer.
Definition at line 94 of file fnrec.c.
References fnrec_buffer::magic.
Referenced by fnrec_init().
|
static |
Reset the trace buffer and clear entries.
Definition at line 101 of file fnrec.c.
References FNREC_MAGIC, fnrec_buffer::magic, and memset().
Referenced by fnrec_init().
|
static |
Append an entry to the trace buffer.
called_fn | Called function |
call_site | Call site |
entry | Trace buffer entry |
Definition at line 113 of file fnrec.c.
References fnrec_entry::call_site, fnrec_entry::called_fn, fnrec_entry::checksum, fnrec_buffer::data, fnrec_entry::entry_count, fnrec_entry::exit_count, FNREC_NUM_ENTRIES, and fnrec_buffer::idx.
Referenced by __cyg_profile_func_enter(), and __cyg_profile_func_exit().
|
static |
Print the contents of the trace buffer in chronological order.
Definition at line 139 of file fnrec.c.
References fnrec_entry::call_site, fnrec_entry::called_fn, checksum, fnrec_entry::checksum, fnrec_buffer::data, fnrec_entry::entry_count, fnrec_entry::exit_count, FNREC_NUM_ENTRIES, fnrec_buffer::idx, printf(), and virt_to_phys().
Referenced by fnrec_init().
|
static |
Function tracer initialisation function.
Definition at line 167 of file fnrec.c.
References fnrec_dump(), fnrec_invalidate(), fnrec_is_valid(), FNREC_PHYS_ADDRESS, fnrec_reset(), phys_to_virt(), and printf().
struct init_fn fnrec_init_fn __init_fn | ( | INIT_NORMAL | ) |
void __cyg_profile_func_enter | ( | void * | called_fn, |
void * | call_site | ||
) |
Definition at line 187 of file fnrec.c.
References fnrec_entry::call_site, fnrec_entry::called_fn, fnrec_entry::checksum, fnrec_entry::entry_count, fnrec_append(), fnrec_is_valid(), and mb().
void __cyg_profile_func_exit | ( | void * | called_fn, |
void * | call_site | ||
) |
Definition at line 198 of file fnrec.c.
References fnrec_entry::call_site, fnrec_entry::called_fn, fnrec_entry::checksum, fnrec_entry::exit_count, fnrec_append(), fnrec_is_valid(), and mb().
|
static |