summaryrefslogtreecommitdiff
path: root/mknes_mapper.c
diff options
context:
space:
mode:
authorPeter Fors <peter.fors@mindkiller.com>2025-10-25 23:07:35 +0200
committerPeter Fors <peter.fors@mindkiller.com>2025-10-25 23:28:22 +0200
commitb2f646d9f99dd272f3b3a9d045b5039e6fc1dc50 (patch)
tree9ea8977531306f414d94ceca7dcfa6f17c204687 /mknes_mapper.c
parent54ca8318923fcf11e1cf507bd516b210ba7cf221 (diff)
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)
Diffstat (limited to 'mknes_mapper.c')
-rw-r--r--mknes_mapper.c2
1 files changed, 2 insertions, 0 deletions
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);