|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Firmware profiler implementation (see emu_prof.h). More...
#include "emu_prof.h"#include <stdio.h>#include <stdlib.h>#include <string.h>#include <time.h>#include "emu_elf.h"#include "emu_host_io_internal.h"Go to the source code of this file.
Data Structures | |
| struct | prof_sym_t |
| struct | prof_name_sink_t |
| Sink configuration for one streamed profiler symbol name. More... | |
Enumerations | |
| enum | : uint32_t { k_prof_max_syms = 8192U , k_prof_top_n = 40U } |
| enum | : uint32_t { k_prof_max_depth = 64U , k_prof_max_samples = 16384U , k_prof_samp_every = 256U } |
| enum | prof_phase_t : uint32_t { k_no_fn = 0xFFFFFFFFU , k_phase_depth = 2U , k_phase_lines = 24U , k_phase_pct_x1 = 100U } |
| Boot-timeline "phase" collapse constants for internal_prof_print_boot_timeline. More... | |
Functions | |
| double | board_now_s (void) |
| Monotonic wall-clock seconds. | |
| static int | internal_prof_cmp (const void *a, const void *b) |
| qsort comparator: order the FUNC symbols by entry address. | |
| static bool | internal_prof_symbol (const emu_elf_symbol_t *symbol, void *ctx) |
| Collect one sized STT_FUNC symbol into the bounded profiler table. | |
| void | prof_load (const emu_elf_source_t *elf) |
| Collect + sort FUNC symbols (RA8_EMU_PROFILE only) for PC bucketing. | |
| static uint32_t | internal_prof_find (uint32_t pc) |
Binary-search the FUNC symbol owning pc; returns s_prof_n if none. | |
| void | prof_add (uint32_t pc, double dt) |
Attribute dt wall seconds to pc's function (wall-sample mode). | |
| static void | internal_prof_decimate (void) |
| Halve the sample store (merge adjacent pairs) when it fills up. | |
| static void | internal_prof_sample (uint32_t weight) |
Append the live call chain as one chronological sample of weight insns. | |
| static void | internal_prof_stack_update (uint32_t f) |
Fold f (PC's owning FUNC index) into the live call chain (push/pop). | |
| static void | internal_prof_insn_hook (uc_engine *uc, uint64_t address, uint32_t size, void *user) |
| Perform prof insn hook for the emu prof model. | |
| static bool | internal_prof_io_ok (emu_io_result_t result) |
| Convert a host-I/O result to the profiler writer's boolean accumulator. | |
| static bool | internal_prof_name_chunk (const char *bytes, size_t length, void *opaque) |
| Emit one transient source-name chunk to a selected sink. | |
| static bool | internal_prof_name (uint32_t symbol, int fd, char escape, bool error_sink) |
| Stream one retained-offset symbol name to a file or error sink. | |
| static bool | internal_prof_json_frames (int fd) |
| Write the speedscope shared.frames array: one entry per symbol. | |
| static bool | internal_prof_json_samples (int fd) |
| Write the speedscope samples array: one frame-index stack per sample. | |
| static bool | internal_prof_json_weights (int fd) |
| Write the speedscope weights array, parallel to the samples array. | |
| static bool | internal_prof_js_frames (int fd) |
| Write the flamechart page's FRAMES array as JavaScript string literals. | |
| static void | internal_prof_write_speedscope (const char *path) |
| Perform prof write speedscope for the emu prof model. | |
| static void | internal_prof_write_html (const char *path, uint64_t total) |
| Write a self-contained, locally-openable HTML flamechart of the samples. | |
| static uint64_t | internal_prof_accumulate_incl_self (void) |
| Reset then fill s_incl/s_self from the samples; return total weight. | |
| static void | internal_prof_print_phase (uint32_t segfn, uint64_t cum, uint64_t segw, uint64_t total) |
| Print one boot-timeline row: start percent, width percent, and phase. | |
| static void | internal_prof_print_boot_timeline (uint64_t total) |
| Print the boot timeline: each contiguous shallow-depth phase run. | |
| static void | internal_prof_print_incl_self_table (const char *html, const char *out, uint64_t total) |
| Print the inclusive/self table (sorted by inclusive weight). | |
| static void | internal_prof_report_flamechart (void) |
| Speedscope export + inclusive/self breakdown + phase timeline (insn mode). | |
| void | prof_report (void) |
| Print the top hot functions (by wall time or instruction count) at run end. | |
| void | emu_prof_install (uc_engine *uc) |
| Implementation of emu_prof_install() – arms the insn hook in insn mode. | |
| prof_mode_t | emu_prof_mode (void) |
| Implementation of emu_prof_mode() – plain state read. | |
| uint64_t | emu_prof_total_insns (void) |
| Implementation of emu_prof_total_insns() – plain counter read. | |
| void | emu_prof_set_stop_pc (uint32_t pc) |
| Implementation of emu_prof_set_stop_pc() – plain state write. | |
| bool | emu_prof_stop_hit (void) |
| Implementation of emu_prof_stop_hit() – plain flag read. | |
Variables | |
| static const double | s_nsec_per_sec = 1.0e9 |
| Nanoseconds per second (timespec tv_nsec -> seconds). | |
| static prof_sym_t | s_prof [k_prof_max_syms] |
| static const emu_elf_source_t * | s_prof_elf |
| Borrowed run-long source for names. | |
| static uint32_t | s_prof_n = 0U |
| static double | s_prof_total_s = 0.0 |
| static uint64_t | s_prof_total_i = 0U |
| static prof_mode_t | s_prof_mode = k_prof_off |
| static uint16_t | s_pstk [k_prof_max_depth] |
| Live chain. | |
| static uint32_t | s_pstk_n = 0U |
| Chain depth. | |
| static uint16_t | s_samp [k_prof_max_samples][k_prof_max_depth] |
| root..leaf. | |
| static uint8_t | s_samp_d [k_prof_max_samples] |
| Per-sample chain depth. | |
| static uint32_t | s_samp_w [k_prof_max_samples] |
| Per-sample weight (insns). | |
| static uint32_t | s_samp_n = 0U |
| Stored sample count. | |
| static uint64_t | s_samp_every = (uint64_t)k_prof_samp_every |
| Insns per sample (>>x2). | |
| static uint64_t | s_samp_acc = 0U |
| Insns since last sample. | |
| static uint32_t | s_prof_stop_pc = 0U |
| RA8_EMU_STOP_PC (0=off). | |
| static bool | s_prof_stop_hit = false |
| Set when STOP_PC reached. | |
| static uint64_t | s_incl [k_prof_max_syms] |
| Inclusive weight (report). | |
| static uint64_t | s_self [k_prof_max_syms] |
| Self (leaf) weight. | |
| static const char | s_k_prof_html_head [] |
| static const char | s_k_prof_html_js [] |
| static const double | s_percent_scale = 100.0 |
| Fraction-to-per-cent scale (fraction * 100.0 == per-cent). | |
Firmware profiler implementation (see emu_prof.h).
The RA8_EMU_PROFILE profiler: FUNC-symbol collection, the wall-time sampler, the exact per-instruction hook with call-chain reconstruction, and the run-end reports (speedscope JSON export, the self-contained HTML flamechart, the boot timeline, and the inclusive/self table) – moved verbatim out of the ra8_emulator main translation unit.
Definition in file emu_prof.c.
| anonymous enum : uint32_t |
| Enumerator | |
|---|---|
| k_prof_max_depth | Deepest call chain captured per sample. |
| k_prof_max_samples | Chronological stack samples (decimated). |
| k_prof_samp_every | Default instructions per chain sample. |
Definition at line 84 of file emu_prof.c.
| anonymous enum : uint32_t |
| Enumerator | |
|---|---|
| k_prof_max_syms | Cap on profiled FUNC symbols. |
| k_prof_top_n | Top entries printed in the report. |
Definition at line 50 of file emu_prof.c.
| enum prof_phase_t : uint32_t |
Boot-timeline "phase" collapse constants for internal_prof_print_boot_timeline.
| Enumerator | |
|---|---|
| k_no_fn | Sentinel for "no phase frame". |
| k_phase_depth | Chain depth used as the boot "phase". |
| k_phase_lines | Cap on printed timeline segments. |
| k_phase_pct_x1 | Per-cent base: keep segments >= 1%. |
Definition at line 701 of file emu_prof.c.
| double board_now_s | ( | void | ) |
Monotonic wall-clock seconds.
CLOCK_MONOTONIC as a double, the time base of the wall-sample profiler mode (and any other host-side wall measurement).
| 0.0 | Only if the clock read fails (it does not on supported hosts). |
Definition at line 31 of file emu_prof.c.
References s_nsec_per_sec.
Referenced by internal_run_loop_prologue().
| void emu_prof_install | ( | uc_engine * | uc | ) |
Implementation of emu_prof_install() – arms the insn hook in insn mode.
Arm the per-instruction profiling hook (insn mode only).
Definition at line 940 of file emu_prof.c.
References internal_prof_insn_hook(), k_prof_insn, and s_prof_mode.
Referenced by internal_main_install_run_seams().
| prof_mode_t emu_prof_mode | ( | void | ) |
Implementation of emu_prof_mode() – plain state read.
The latched profiler mode.
Definition at line 949 of file emu_prof.c.
References s_prof_mode.
Referenced by internal_run_loop_prologue(), and internal_run_stop_prof_idle().
| void emu_prof_set_stop_pc | ( | uint32_t | pc | ) |
Implementation of emu_prof_set_stop_pc() – plain state write.
Set the RA8_EMU_STOP_PC early-stop address (0 disables).
Definition at line 961 of file emu_prof.c.
References s_prof_stop_pc.
Referenced by internal_guard_apply_stop_pc().
| bool emu_prof_stop_hit | ( | void | ) |
Implementation of emu_prof_stop_hit() – plain flag read.
Whether the RA8_EMU_STOP_PC address was reached.
Definition at line 967 of file emu_prof.c.
References s_prof_stop_hit.
Referenced by internal_run_inner_check_stops(), and internal_run_loop_run_chunk().
| uint64_t emu_prof_total_insns | ( | void | ) |
Implementation of emu_prof_total_insns() – plain counter read.
Total instructions retired under the per-instruction hook.
Definition at line 955 of file emu_prof.c.
References s_prof_total_i.
Referenced by internal_run_stop_prof_idle().
|
static |
Reset then fill s_incl/s_self from the samples; return total weight.
Reset then fill s_incl/s_self from the samples; return total weight; this step is contained within the emu prof model and uses bounded caller or module-owned storage.
| value | The operation-specific prof accumulate incl self value. |
Definition at line 718 of file emu_prof.c.
References RA8_INTERNAL, s_incl, s_prof_n, s_samp, s_samp_d, s_samp_n, s_samp_w, and s_self.
Referenced by internal_prof_report_flamechart().
|
static |
qsort comparator: order the FUNC symbols by entry address.
Qsort comparator: order the func symbols by entry address; this step is contained within the emu prof model and uses bounded caller or module-owned storage.
| [in] | a | A input used by the operation. |
| [in] | b | B input used by the operation. |
| value | The operation-specific prof cmp value. |
Definition at line 114 of file emu_prof.c.
References RA8_INTERNAL.
Referenced by prof_load().
|
static |
Halve the sample store (merge adjacent pairs) when it fills up.
Halve the sample store (merge adjacent pairs) when it fills up; this step is contained within the emu prof model and uses bounded caller or module-owned storage.
Definition at line 230 of file emu_prof.c.
References memcpy(), RA8_INTERNAL, s_samp, s_samp_d, s_samp_every, s_samp_n, and s_samp_w.
Referenced by internal_prof_sample().
|
static |
Binary-search the FUNC symbol owning pc; returns s_prof_n if none.
Binary-search the func symbol owning pc; returns s_prof_n if none; this step is contained within the emu prof model and uses bounded caller or module-owned storage.
| [in] | pc | Guest program-counter value associated with the operation. |
| value | The operation-specific prof find value. |
Definition at line 190 of file emu_prof.c.
References RA8_INTERNAL, s_prof, and s_prof_n.
Referenced by internal_prof_insn_hook(), and prof_add().
|
static |
Perform prof insn hook for the emu prof model.
Perform prof insn hook for the emu prof model; this step is contained within the emu prof model and uses bounded caller or module-owned storage.
| [in,out] | uc | Unicorn engine whose emulated state is read or updated. |
| [in] | address | Guest address involved in the operation. |
| [in] | size | Size of the requested region or access in bytes. |
| [in,out] | user | Hook context supplied when the callback was registered. |
Definition at line 314 of file emu_prof.c.
References internal_prof_find(), internal_prof_sample(), internal_prof_stack_update(), s_prof, s_prof_n, s_prof_stop_hit, s_prof_stop_pc, s_prof_total_i, s_samp_acc, and s_samp_every.
Referenced by emu_prof_install().
|
static |
Convert a host-I/O result to the profiler writer's boolean accumulator.
Keeps each writer expression explicit while preserving the first failure.
| [in] | result | Raw descriptor operation result. |
| true | result reports k_emu_io_ok. |
| false | result reports any failure or truncation. |
result is fully initialised. result.status. Definition at line 352 of file emu_prof.c.
References k_emu_io_ok, RA8_INTERNAL, and emu_io_result_t::status.
Referenced by internal_prof_js_frames(), internal_prof_json_frames(), internal_prof_json_samples(), internal_prof_json_weights(), internal_prof_name_chunk(), internal_prof_write_html(), and internal_prof_write_speedscope().
|
static |
Write the flamechart page's FRAMES array as JavaScript string literals.
The same frame names as internal_prof_json_frames, but the viewer markup quotes with ', so ' and \\endiskip are the characters escaped here.
| [in] | fd | Raw output descriptor positioned after the FRAMES=[. |
| true | All quoted names were written. |
| false | At least one descriptor operation failed. |
fd is a valid writable descriptor. Definition at line 539 of file emu_prof.c.
References internal_prof_io_ok(), internal_prof_name(), priv_emu_io_file_char(), priv_emu_io_file_text(), RA8_INTERNAL, and s_prof_n.
Referenced by internal_prof_write_html().
|
static |
Write the speedscope shared.frames array: one entry per symbol.
Escapes JSON quote and backslash characters while copying ELF symbol names.
| [in] | fd | Raw output descriptor positioned after the "frames":[. |
| true | All frame objects were written. |
| false | At least one descriptor operation failed. |
fd is a valid writable descriptor. Definition at line 443 of file emu_prof.c.
References internal_prof_io_ok(), internal_prof_name(), priv_emu_io_file_text(), RA8_INTERNAL, and s_prof_n.
Referenced by internal_prof_write_speedscope().
|
static |
Write the speedscope samples array: one frame-index stack per sample.
Emits each root-to-leaf frame-index vector with JSON delimiters.
| [in] | fd | Raw output descriptor positioned after the "samples":[. |
| true | All sample arrays were written. |
| false | At least one descriptor operation failed. |
fd is a valid writable descriptor. Definition at line 473 of file emu_prof.c.
References internal_prof_io_ok(), priv_emu_io_file_char(), priv_emu_io_filef(), RA8_INTERNAL, s_samp, s_samp_d, and s_samp_n.
Referenced by internal_prof_write_html(), and internal_prof_write_speedscope().
|
static |
Write the speedscope weights array, parallel to the samples array.
Emits the instruction weight corresponding to every captured sample.
| [in] | fd | Raw output descriptor positioned after the "weights":[. |
| true | All weights were written. |
| false | At least one descriptor operation failed. |
Definition at line 508 of file emu_prof.c.
References internal_prof_io_ok(), priv_emu_io_filef(), RA8_INTERNAL, s_samp_n, and s_samp_w.
Referenced by internal_prof_write_html(), and internal_prof_write_speedscope().
|
static |
Stream one retained-offset symbol name to a file or error sink.
Resolves the retained offset against the still-open source in bounded chunks.
| [in] | symbol | Profiler symbol index. |
| [in] | fd | Explicit file descriptor, ignored for error sink. |
| [in] | escape | File-sink quote character to escape, or NUL. |
| [in] | error_sink | Whether to use the injected error sink. |
| true | The complete name was emitted exactly. |
| false | The index/source was invalid or a read/write failed. |
symbol is below s_prof_n and s_prof_elf remains open. fd. Definition at line 416 of file emu_prof.c.
References elf_string_foreach(), internal_prof_name_chunk(), prof_name_sink_t::ok, RA8_INTERNAL, s_prof, s_prof_elf, and s_prof_n.
Referenced by internal_prof_js_frames(), internal_prof_json_frames(), internal_prof_print_incl_self_table(), internal_prof_print_phase(), and prof_report().
|
static |
Emit one transient source-name chunk to a selected sink.
Writes directly to the chosen descriptor or injected error sink.
| [in] | bytes | Name bytes without a terminating NUL. |
| [in] | length | Transient chunk length. |
| [in,out] | opaque | prof_name_sink_t output state. |
| true | The complete chunk was emitted. |
| false | A sink operation failed. |
bytes spans length readable bytes. opaque selects a valid sink. Definition at line 381 of file emu_prof.c.
References prof_name_sink_t::error_sink, prof_name_sink_t::escape, prof_name_sink_t::fd, internal_prof_io_ok(), prof_name_sink_t::ok, priv_emu_io_err_bytes(), priv_emu_io_file_char(), and RA8_INTERNAL.
Referenced by internal_prof_name().
|
static |
Print the boot timeline: each contiguous shallow-depth phase run.
Print the boot timeline: each contiguous shallow-depth phase run; this step is contained within the emu prof model and uses bounded caller or module-owned storage.
| [in] | total | Total count used to normalize or report the operation. |
Definition at line 780 of file emu_prof.c.
References internal_prof_print_phase(), k_no_fn, k_phase_depth, k_phase_lines, k_phase_pct_x1, priv_emu_io_errf(), RA8_INTERNAL, s_samp, s_samp_d, s_samp_n, and s_samp_w.
Referenced by internal_prof_report_flamechart().
|
static |
Print the inclusive/self table (sorted by inclusive weight).
Print the inclusive/self table (sorted by inclusive weight); this step is contained within the emu prof model and uses bounded caller or module-owned storage.
| [in] | html | Html input used by the operation. |
| [in] | out | Destination storage receiving the computed result. |
| [in] | total | Total count used to normalize or report the operation. |
Definition at line 831 of file emu_prof.c.
References internal_prof_name(), k_prof_top_n, priv_emu_io_err_text(), priv_emu_io_errf(), s_incl, s_percent_scale, s_prof_n, s_samp_n, and s_self.
Referenced by internal_prof_report_flamechart().
|
static |
Print one boot-timeline row: start percent, width percent, and phase.
Emits the two normalized percentages, then the phase name when the run belongs to a known function and a placeholder when it does not.
| [in] | segfn | Phase function index, or an out-of-range value when unknown. |
| [in] | cum | Weight accumulated before this run. |
| [in] | segw | Weight of this run. |
| [in] | total | Total sample weight used to normalize both percentages. |
total is non-zero. Definition at line 758 of file emu_prof.c.
References internal_prof_name(), priv_emu_io_err_text(), priv_emu_io_errf(), s_percent_scale, and s_prof_n.
Referenced by internal_prof_print_boot_timeline().
|
static |
Speedscope export + inclusive/self breakdown + phase timeline (insn mode).
Speedscope export + inclusive/self breakdown + phase timeline (insn mode); this step is contained within the emu prof model and uses bounded caller or module-owned storage.
Definition at line 870 of file emu_prof.c.
References internal_prof_accumulate_incl_self(), internal_prof_print_boot_timeline(), internal_prof_print_incl_self_table(), internal_prof_write_html(), internal_prof_write_speedscope(), and RA8_INTERNAL.
Referenced by prof_report().
|
static |
Append the live call chain as one chronological sample of weight insns.
Append the live call chain as one chronological sample of weight insns; this step is contained within the emu prof model and uses bounded caller or module-owned storage.
| [in] | weight | Weight input used by the operation. |
Definition at line 255 of file emu_prof.c.
References internal_prof_decimate(), k_prof_max_depth, k_prof_max_samples, RA8_INTERNAL, s_pstk, s_pstk_n, s_samp, s_samp_d, s_samp_n, and s_samp_w.
Referenced by internal_prof_insn_hook().
|
static |
Fold f (PC's owning FUNC index) into the live call chain (push/pop).
Fold f (pc's owning func index) into the live call chain (push/pop); this step is contained within the emu prof model and uses bounded caller or module-owned storage.
| [in] | f | F input used by the operation. |
Definition at line 281 of file emu_prof.c.
References k_prof_max_depth, RA8_INTERNAL, s_prof_n, s_pstk, and s_pstk_n.
Referenced by internal_prof_insn_hook().
|
static |
Collect one sized STT_FUNC symbol into the bounded profiler table.
Retains only address bounds and the immutable source-name offset.
| [in] | symbol | Bounds-checked symbol entry. |
| [in] | ctx | Unused callback context. |
| true | The symbol was skipped or collected below the fixed cap. |
| false | The fixed profiler-symbol capacity was exhausted. |
symbol is non-null. Definition at line 142 of file emu_prof.c.
References emu_elf_symbol_t::info, k_elf_st_type_mask, k_prof_max_syms, emu_elf_symbol_t::name_offset, RA8_INTERNAL, s_prof, s_prof_n, emu_elf_symbol_t::size, and emu_elf_symbol_t::value.
Referenced by prof_load().
|
static |
Write a self-contained, locally-openable HTML flamechart of the samples.
Write a self-contained, locally-openable html flamechart of the samples; this step is contained within the emu prof model and uses bounded caller or module-owned storage.
| [in] | path | NUL-terminated host path used by the operation. |
| [in] | total | Total count used to normalize or report the operation. |
Definition at line 665 of file emu_prof.c.
References emu_io_txn_t::fd, internal_prof_io_ok(), internal_prof_js_frames(), internal_prof_json_samples(), internal_prof_json_weights(), k_emu_io_ok, priv_emu_io_file_text(), priv_emu_io_filef(), priv_emu_io_txn_abort(), priv_emu_io_txn_begin(), priv_emu_io_txn_commit(), RA8_INTERNAL, s_k_prof_html_head, s_k_prof_html_js, s_prof_n, and s_samp_n.
Referenced by internal_prof_report_flamechart().
|
static |
Perform prof write speedscope for the emu prof model.
Perform prof write speedscope for the emu prof model; this step is contained within the emu prof model and uses bounded caller or module-owned storage.
| [in] | path | NUL-terminated host path used by the operation. |
Definition at line 559 of file emu_prof.c.
References emu_io_txn_t::fd, internal_prof_io_ok(), internal_prof_json_frames(), internal_prof_json_samples(), internal_prof_json_weights(), k_emu_io_ok, priv_emu_io_file_text(), priv_emu_io_filef(), priv_emu_io_txn_abort(), priv_emu_io_txn_begin(), priv_emu_io_txn_commit(), RA8_INTERNAL, s_prof_n, s_samp_n, and s_samp_w.
Referenced by internal_prof_report_flamechart().
| void prof_add | ( | uint32_t | pc, |
| double | dt ) |
Attribute dt wall seconds to pc's function (wall-sample mode).
Attribute wall seconds to the function owning pc (wall mode).
Definition at line 210 of file emu_prof.c.
References internal_prof_find(), k_prof_wall, s_prof, s_prof_mode, s_prof_n, and s_prof_total_s.
Referenced by internal_run_loop_prologue().
| void prof_load | ( | const emu_elf_source_t * | elf | ) |
Collect + sort FUNC symbols (RA8_EMU_PROFILE only) for PC bucketing.
Reads RA8_EMU_PROFILE to pick the mode; when enabled, walks the ELF .symtab for sized FUNC symbols, records each one's [entry, end) range and name, and sorts by entry address so per-PC lookup can binary-search. With the variable unset the profiler stays off at zero cost.
| [in] | elf | Open ELF source; symbol names are retained as source offsets. |
elf is a validated ELF32 source. Definition at line 160 of file emu_prof.c.
References elf_foreach_symbol(), internal_prof_cmp(), internal_prof_symbol(), k_prof_insn, k_prof_off, k_prof_wall, priv_emu_io_errf(), s_prof, s_prof_elf, s_prof_mode, s_prof_n, and strcmp().
Referenced by internal_main_install_run_seams().
| void prof_report | ( | void | ) |
Print the top hot functions (by wall time or instruction count) at run end.
Print the top hot functions (by wall time or instruction count).
Definition at line 892 of file emu_prof.c.
References internal_prof_name(), internal_prof_report_flamechart(), k_prof_insn, k_prof_off, k_prof_top_n, priv_emu_io_err_text(), priv_emu_io_errf(), s_percent_scale, s_prof, s_prof_mode, s_prof_n, s_prof_total_i, s_prof_total_s, and s_samp_n.
Referenced by internal_run_print_stop_summary().
|
static |
Inclusive weight (report).
Definition at line 99 of file emu_prof.c.
Referenced by internal_prof_accumulate_incl_self(), and internal_prof_print_incl_self_table().
|
static |
Definition at line 600 of file emu_prof.c.
Referenced by internal_prof_write_html().
|
static |
Definition at line 616 of file emu_prof.c.
Referenced by internal_prof_write_html().
|
static |
Nanoseconds per second (timespec tv_nsec -> seconds).
Definition at line 28 of file emu_prof.c.
Referenced by board_now_s().
|
static |
Fraction-to-per-cent scale (fraction * 100.0 == per-cent).
Definition at line 698 of file emu_prof.c.
Referenced by internal_prof_print_incl_self_table(), internal_prof_print_phase(), and prof_report().
|
static |
Definition at line 62 of file emu_prof.c.
Referenced by internal_prof_find(), internal_prof_insn_hook(), internal_prof_name(), internal_prof_symbol(), prof_add(), prof_load(), and prof_report().
|
static |
Borrowed run-long source for names.
Definition at line 63 of file emu_prof.c.
Referenced by internal_prof_name(), and prof_load().
|
static |
Definition at line 67 of file emu_prof.c.
Referenced by emu_prof_install(), emu_prof_mode(), prof_add(), prof_load(), and prof_report().
|
static |
Definition at line 64 of file emu_prof.c.
Referenced by internal_prof_accumulate_incl_self(), internal_prof_find(), internal_prof_insn_hook(), internal_prof_js_frames(), internal_prof_json_frames(), internal_prof_name(), internal_prof_print_incl_self_table(), internal_prof_print_phase(), internal_prof_stack_update(), internal_prof_symbol(), internal_prof_write_html(), internal_prof_write_speedscope(), prof_add(), prof_load(), and prof_report().
|
static |
Set when STOP_PC reached.
Definition at line 98 of file emu_prof.c.
Referenced by emu_prof_stop_hit(), and internal_prof_insn_hook().
|
static |
RA8_EMU_STOP_PC (0=off).
Definition at line 97 of file emu_prof.c.
Referenced by emu_prof_set_stop_pc(), and internal_prof_insn_hook().
|
static |
Definition at line 66 of file emu_prof.c.
Referenced by emu_prof_total_insns(), internal_prof_insn_hook(), and prof_report().
|
static |
Definition at line 65 of file emu_prof.c.
Referenced by prof_add(), and prof_report().
|
static |
Live chain.
Definition at line 89 of file emu_prof.c.
Referenced by internal_prof_sample(), and internal_prof_stack_update().
|
static |
Chain depth.
Definition at line 90 of file emu_prof.c.
Referenced by internal_prof_sample(), and internal_prof_stack_update().
|
static |
root..leaf.
Definition at line 91 of file emu_prof.c.
Referenced by internal_prof_accumulate_incl_self(), internal_prof_decimate(), internal_prof_json_samples(), internal_prof_print_boot_timeline(), and internal_prof_sample().
|
static |
Insns since last sample.
Definition at line 96 of file emu_prof.c.
Referenced by internal_prof_insn_hook().
|
static |
Per-sample chain depth.
Definition at line 92 of file emu_prof.c.
Referenced by internal_prof_accumulate_incl_self(), internal_prof_decimate(), internal_prof_json_samples(), internal_prof_print_boot_timeline(), and internal_prof_sample().
|
static |
Insns per sample (>>x2).
Definition at line 95 of file emu_prof.c.
Referenced by internal_prof_decimate(), and internal_prof_insn_hook().
|
static |
Stored sample count.
Definition at line 94 of file emu_prof.c.
Referenced by internal_prof_accumulate_incl_self(), internal_prof_decimate(), internal_prof_json_samples(), internal_prof_json_weights(), internal_prof_print_boot_timeline(), internal_prof_print_incl_self_table(), internal_prof_sample(), internal_prof_write_html(), internal_prof_write_speedscope(), and prof_report().
|
static |
Per-sample weight (insns).
Definition at line 93 of file emu_prof.c.
Referenced by internal_prof_accumulate_incl_self(), internal_prof_decimate(), internal_prof_json_weights(), internal_prof_print_boot_timeline(), internal_prof_sample(), and internal_prof_write_speedscope().
|
static |
Self (leaf) weight.
Definition at line 100 of file emu_prof.c.
Referenced by internal_prof_accumulate_incl_self(), and internal_prof_print_incl_self_table().