From b2f646d9f99dd272f3b3a9d045b5039e6fc1dc50 Mon Sep 17 00:00:00 2001 From: Peter Fors Date: Sat, 25 Oct 2025 23:07:35 +0200 Subject: Refactor benchmarking to self-contained C implementation - Add mknes_bench.c with direct PMC access via perf_event_open() - Remove dependency on external perf/awk for statistics - Add RT priority and CPU affinity control in C code - Use static BSS allocation (page-aligned) instead of malloc - Add stalled-cycles-backend counter (gracefully handles AMD unavailability) - Add throughput metrics (MIPS, Mcycles/sec) - Optimize Bench.sh to only regenerate profile data when needed - Add -n and -f flags for configurable runs and frames - Suppress mapper messages during benchmark - ~6x faster benchmark workflow (20s first run, 16s subsequent) --- mknes_mapper.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mknes_mapper.c') diff --git a/mknes_mapper.c b/mknes_mapper.c index 32e8017..4202769 100644 --- a/mknes_mapper.c +++ b/mknes_mapper.c @@ -91,7 +91,9 @@ static void mapper_reset(struct nes_state *state) { static void mapper_setup(struct nes_state *state) { uint32_t mapper_id = state->ines.mapper << 4 | state->ines.submapper; +#ifndef BENCHMARK printf("Mapper %d_%x requested.\n", state->ines.mapper, state->ines.submapper); +#endif mapper_reset(state); -- cgit v1.2.3