ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
emu_prof.h
Go to the documentation of this file.
1
26
27#pragma once
28
29#include <stdint.h>
30#include <unicorn/unicorn.h>
31
32#include "emu_elf.h"
33#include "ra8_attributes.h"
34
35#ifdef __cplusplus
36extern "C" {
37#endif
38
50typedef enum : uint8_t {
55
71double board_now_s(void);
72
91void prof_load(const emu_elf_source_t* elf);
92
110void prof_add(uint32_t pc, double dt);
111
129void prof_report(void);
130
147void emu_prof_install(uc_engine* uc);
148
165
181uint64_t emu_prof_total_insns(void);
182
199void emu_prof_set_stop_pc(uint32_t pc);
200
214bool emu_prof_stop_hit(void);
215
216#ifdef __cplusplus
217}
218#endif
ELF32 image services for the board emulator (load / symbols / vectors).
prof_mode_t emu_prof_mode(void)
The latched profiler mode.
Definition emu_prof.c:949
void emu_prof_set_stop_pc(uint32_t pc)
Set the RA8_EMU_STOP_PC early-stop address (0 disables).
Definition emu_prof.c:961
prof_mode_t
Profiler mode parsed from RA8_EMU_PROFILE.
Definition emu_prof.h:50
@ k_prof_insn
=full/=insn: exact per-instruction + calls.
Definition emu_prof.h:53
@ k_prof_wall
=1: cheap chunk-start wall-time sampler.
Definition emu_prof.h:52
@ k_prof_off
Disabled (no env, zero cost).
Definition emu_prof.h:51
void prof_add(uint32_t pc, double dt)
Attribute wall seconds to the function owning pc (wall mode).
Definition emu_prof.c:210
bool emu_prof_stop_hit(void)
Whether the RA8_EMU_STOP_PC address was reached.
Definition emu_prof.c:967
void emu_prof_install(uc_engine *uc)
Arm the per-instruction profiling hook (insn mode only).
Definition emu_prof.c:940
void prof_load(const emu_elf_source_t *elf)
Collect + sort FUNC symbols (RA8_EMU_PROFILE only) for PC bucketing.
Definition emu_prof.c:160
void prof_report(void)
Print the top hot functions (by wall time or instruction count).
Definition emu_prof.c:892
double board_now_s(void)
Monotonic wall-clock seconds.
Definition emu_prof.c:31
uint64_t emu_prof_total_insns(void)
Total instructions retired under the per-instruction hook.
Definition emu_prof.c:955
Annotation-attribute framework macros for ra8-firmware.
One independently owned immutable raw-descriptor ELF source.
Definition emu_elf.h:91