40 #define FNREC_MAGIC ( 'f' << 24 | 'n' << 16 | 'r' << 8 | 'e' ) 43 #define FNREC_NUM_ENTRIES 4096 49 #define FNREC_PHYS_ADDRESS ( 17 * 1024 * 1024 ) 145 printf (
"fnrec buffer dump:\n" );
152 ( (
unsigned long ) entry->
call_site ) ) +
157 printf (
" (checksum wrong at phys %08lx)",
174 printf (
"fnrec buffer not found\n" );
static struct fnrec_entry * fnrec_append(void *called_fn, void *call_site)
Append an entry to the trace buffer.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
static int fnrec_is_valid(void)
Test whether the trace buffer is valid.
uint8_t checksum
Checksum.
int printf(const char *fmt,...)
Write a formatted string to the console.
struct init_fn fnrec_init_fn __init_fn(INIT_NORMAL)
uint16_t entry_count
Entry count.
#define FNREC_NUM_ENTRIES
Number of trace buffer entries.
static void fnrec_dump(void)
Print the contents of the trace buffer in chronological order.
static __always_inline unsigned long virt_to_phys(volatile const void *addr)
Convert virtual address to a physical address.
Access to external ("user") memory.
void __cyg_profile_func_enter(void *called_fn, void *call_site)
static __always_inline void * phys_to_virt(unsigned long phys_addr)
Convert physical address to a virtual address.
#define FNREC_PHYS_ADDRESS
Trace buffer physical address.
#define INIT_NORMAL
Normal initialisation.
An initialisation function.
void * call_site
Call site.
A 16-bit general register.
static struct fnrec_buffer * fnrec_buffer
The trace buffer.
uint16_t exit_count
Exit count.
static void fnrec_init(void)
Function tracer initialisation function.
struct fnrec_entry data[FNREC_NUM_ENTRIES]
Trace buffer.
static void fnrec_invalidate(void)
Invalidate the trace buffer.
void * called_fn
Called function address.
void __cyg_profile_func_exit(void *called_fn, void *call_site)
unsigned int idx
Next trace buffer entry to fill.
#define FNREC_MAGIC
Constant for identifying valid trace buffers.
void mb(void)
Memory barrier.
unsigned long checksum
Checksum.
uint32_t magic
Constant for identifying valid trace buffers.
static void fnrec_reset(void)
Reset the trace buffer and clear entries.
void * memset(void *dest, int character, size_t len) __nonnull