diff options
| author | Peter Fors <peter.fors@mindkiller.com> | 2025-10-26 19:28:53 +0100 |
|---|---|---|
| committer | Peter Fors <peter.fors@mindkiller.com> | 2025-10-26 19:28:53 +0100 |
| commit | 3b7621981b56a51756badac70034f68366878df9 (patch) | |
| tree | e85e0b3f2558ea1ec15d9cec319499b0ca55eb9d | |
| parent | b2f646d9f99dd272f3b3a9d045b5039e6fc1dc50 (diff) | |
Changes to layout
| -rwxr-xr-x | Bench.sh | 9 | ||||
| -rw-r--r-- | mknes.c | 1 | ||||
| -rw-r--r-- | mknes_bench.c | 20 |
3 files changed, 12 insertions, 18 deletions
@@ -1,11 +1,8 @@ #!/usr/bin/env bash -# Only rebuild profile data if it doesn't exist -if [ ! -f mknes.gcda ]; then - ./build.sh clean - ./build.sh profile - ./mknes -n 1 -f 1024 # Quick single run for profile generation -fi +./build.sh clean +./build.sh profile +./mknes -n 1 &> /dev/null ./build.sh profile_release @@ -236,7 +236,6 @@ static void framebuffer_callback(struct mkfw_state *mkfw_window, int32_t width, } int main(int argc, char **argv) { - state.toggle_crt_emulation = 1; state.toggle_bloom = 1; setbuf(stdout, 0); diff --git a/mknes_bench.c b/mknes_bench.c index fcc7aae..12fb642 100644 --- a/mknes_bench.c +++ b/mknes_bench.c @@ -34,8 +34,7 @@ struct bench_stats { int n; }; -static long perf_event_open(struct perf_event_attr *hw_event, pid_t pid, - int cpu, int group_fd, unsigned long flags) { +static long perf_event_open(struct perf_event_attr *hw_event, pid_t pid, int cpu, int group_fd, unsigned long flags) { return syscall(__NR_perf_event_open, hw_event, pid, cpu, group_fd, flags); } @@ -228,8 +227,7 @@ static void run_benchmark(struct nes_state *nstate, uint32_t num_runs, uint32_t clock_gettime(CLOCK_MONOTONIC, &end_time); // Calculate elapsed time in nanoseconds - uint64_t elapsed_ns = (end_time.tv_sec - start_time.tv_sec) * 1000000000ULL + - (end_time.tv_nsec - start_time.tv_nsec); + uint64_t elapsed_ns = (end_time.tv_sec - start_time.tv_sec) * 1000000000ULL + (end_time.tv_nsec - start_time.tv_nsec); // Store results runs[run].time_ns = elapsed_ns; @@ -299,13 +297,13 @@ static void run_benchmark(struct nes_state *nstate, uint32_t num_runs, uint32_t double mcps = (double)total_cycles / total_time_s / 1000000.0; printf("\n"); - printf("%20llu instructions # %.2f insn per cycle \n", (unsigned long long)total_instructions, ipc); - printf("%67s# %.2f stalled cycles per insn \n", "", stalled_per_insn); - printf("%20llu cycles # %.3f GHz \n", (unsigned long long)total_cycles, ghz); - printf("%20llu stalled-cycles-frontend # %.2f%% frontend cycles idle \n", (unsigned long long)total_stalled_frontend, stalled_frontend_pct); - printf("%20llu stalled-cycles-backend # %.2f%% backend cycles idle \n", (unsigned long long)total_stalled_backend, stalled_backend_pct); - printf("%20llu branches # %.3f G/sec \n", (unsigned long long)total_branches, branches_per_sec / 1000000000.0); - printf("%20llu branch-misses # %.2f%% of all branches \n", (unsigned long long)total_branch_misses, branch_miss_rate); + printf("%20llu instructions # %.2f insn per cycle \n", (unsigned long long)total_instructions, ipc); + printf("%56s# %.2f stalled cycles per insn \n", "", stalled_per_insn); + printf("%20llu cycles # %.3f GHz \n", (unsigned long long)total_cycles, ghz); + printf("%20llu stalled-cycles-frontend # %.2f%% frontend cycles idle \n", (unsigned long long)total_stalled_frontend, stalled_frontend_pct); + printf("%20llu stalled-cycles-backend # %.2f%% backend cycles idle \n", (unsigned long long)total_stalled_backend, stalled_backend_pct); + printf("%20llu branches # %.3f G/sec \n", (unsigned long long)total_branches, branches_per_sec / 1000000000.0); + printf("%20llu branch-misses # %.2f%% of all branches \n", (unsigned long long)total_branch_misses, branch_miss_rate); printf("\n"); printf("Throughput: %.2f MIPS, %.2f Mcycles/sec\n", mips, mcps); printf("\n"); |
