From ee80684c4fc492e150c46c78cf65640313a9019e Mon Sep 17 00:00:00 2001 From: Sam Demeulemeester Date: Fri, 1 Apr 2022 20:34:52 +0200 Subject: [PATCH] Separate benchmark from smbus/smbios and add a separate flag to enable/disable it --- app/config.c | 7 +++++-- app/config.h | 1 + app/main.c | 4 +--- system/cpuinfo.c | 5 ++++- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/app/config.c b/app/config.c index 0bc02ab..7499971 100644 --- a/app/config.c +++ b/app/config.c @@ -94,6 +94,7 @@ bool enable_temperature = false; bool enable_trace = false; bool enable_sm = true; +bool enable_bench = true; bool pause_at_start = false; @@ -118,6 +119,8 @@ static void parse_option(const char *option, const char *params) } } else if (strncmp(option, "nopause", 8) == 0) { pause_at_start = false; + } else if (strncmp(option, "nobench", 8) == 0) { + enable_bench = false; } else if (strncmp(option, "powersave", 10) == 0) { if (strncmp(params, "off", 4) == 0) { power_save = POWER_SAVE_OFF; @@ -267,7 +270,7 @@ static bool set_all_tests(bool enabled) static bool add_or_remove_test(bool add) { - + display_input_message(POP_R+14, "Enter test #"); int n = read_value(POP_R+14, POP_LM+12, 2, 0); if (n < 0 || n >= NUM_TEST_PATTERNS) { @@ -534,7 +537,7 @@ static bool set_all_cpus(cpu_state_t state, int display_offset) static bool add_or_remove_cpu(bool add, int display_offset) { - + display_input_message(POP_R+16, "Enter CPU #"); int n = read_value(POP_R+16, POP_LM+11, 2, 0); if (n < 1 || n >= num_available_cpus) { diff --git a/app/config.h b/app/config.h index 2b96ef9..d0488c1 100644 --- a/app/config.h +++ b/app/config.h @@ -49,6 +49,7 @@ extern bool enable_temperature; extern bool enable_trace; extern bool enable_sm; +extern bool enable_bench; extern bool pause_at_start; diff --git a/app/main.c b/app/main.c index 6b14ab4..edf66e8 100644 --- a/app/main.c +++ b/app/main.c @@ -210,9 +210,7 @@ static void global_init(void) pci_init(); - if(enable_sm) { - membw_init(); - } + membw_init(); smbios_init(); diff --git a/system/cpuinfo.c b/system/cpuinfo.c index 1e846ba..7d3a943 100644 --- a/system/cpuinfo.c +++ b/system/cpuinfo.c @@ -21,6 +21,7 @@ #include "tsc.h" #include "boot.h" +#include "config.h" #include "pmem.h" #include "vmem.h" #include "memsize.h" @@ -1088,5 +1089,7 @@ void cpuinfo_init(void) void membw_init(void) { - measure_memory_bandwidth(); + if(enable_bench) { + measure_memory_bandwidth(); + } }