aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhwspeedy <ns@bigbear.dk>2024-03-17 04:53:50 +0100
committerhwspeedy <ns@bigbear.dk>2024-03-17 04:53:50 +0100
commitbc055cb6d4ac04540f8c5f9f8cfba4bacfa25da8 (patch)
tree21d3a8a2e6a8c64f68d5ca9a8c0ae17c9cee4a8c
parent44469bbf6adc7cf2e00e2d53f38aeccbde7038b7 (diff)
FIX Adding linux kernel and os to benchmark
-rw-r--r--modules/benchmark.c3
-rw-r--r--modules/benchmark/bench_results.c16
2 files changed, 18 insertions, 1 deletions
diff --git a/modules/benchmark.c b/modules/benchmark.c
index 59f81501..743441a5 100644
--- a/modules/benchmark.c
+++ b/modules/benchmark.c
@@ -835,7 +835,8 @@ static gchar *get_benchmark_results(gsize *len)
ADD_JSON_VALUE(int, "MachineDataVersion",
this_machine->machine_data_version);
ADD_JSON_VALUE(string, "MachineType", this_machine->machine_type);
-
+ ADD_JSON_VALUE(string, "LinuxKernel", this_machine->linux_kernel);
+ ADD_JSON_VALUE(string, "LinuxOS", this_machine->linux_os);
ADD_JSON_VALUE(boolean, "Legacy", FALSE);
ADD_JSON_VALUE(string, "ExtraInfo", bench_results[i].extra);
ADD_JSON_VALUE(string, "UserNote", bench_results[i].user_note);
diff --git a/modules/benchmark/bench_results.c b/modules/benchmark/bench_results.c
index e0557fc2..9c13797f 100644
--- a/modules/benchmark/bench_results.c
+++ b/modules/benchmark/bench_results.c
@@ -51,6 +51,8 @@ typedef struct {
char *ram_types;
int machine_data_version;
char *machine_type;
+ char *linux_kernel; /*kernelarch*/
+ char *linux_os; /*distroversion*/
} bench_machine;
typedef struct {
@@ -185,6 +187,8 @@ bench_machine *bench_machine_this()
m->memory_phys_MiB = memory_devices_get_system_memory_MiB();
m->ram_types = memory_devices_get_system_memory_types_str();
m->machine_type = module_call_method("computer::getMachineType");
+ m->linux_kernel = module_call_method("computer::getOSKernel");
+ m->linux_os = module_call_method("computer::getOS");
free(tmp);
cpu_procs_cores_threads_nodes(&m->processors, &m->cores, &m->threads, &m->nodes);
@@ -203,6 +207,8 @@ void bench_machine_free(bench_machine *s)
free(s->mid);
free(s->ram_types);
free(s->machine_type);
+ free(s->linux_kernel);
+ free(s->linux_os);
free(s);
}
}
@@ -462,6 +468,8 @@ bench_result *bench_result_benchmarkjson(const gchar *bench_name,
.ram_types = json_get_string_dup(machine, "MemoryTypes"),
.machine_data_version = json_get_int(machine, "MachineDataVersion"),
.machine_type = json_get_string_dup(machine, "MachineType"),
+ .linux_kernel = json_get_string_dup(machine, "LinuxKernel"),
+ .linux_os = json_get_string_dup(machine, "LinuxOS"),
};
return b;
@@ -499,6 +507,8 @@ static char *bench_result_more_info_less(bench_result *b)
"[%s]\n"
/* board */ "%s=%s\n"
/* machine_type */ "%s=%s\n"
+ /* linux_kernel */ "%s=%s\n"
+ /* linux_os */ "%s=%s\n"
/* cpu */ "%s=%s\n"
/* cpudesc */ "%s=%s\n"
/* cpucfg */ "%s=%s\n"
@@ -521,6 +531,8 @@ static char *bench_result_more_info_less(bench_result *b)
_("Machine"),
_("Board"), (b->machine->board != NULL) ? b->machine->board : _(unk),
_("Machine Type"), (b->machine->machine_type != NULL) ? b->machine->machine_type : _(unk),
+ _("Linux Kernel"), (b->machine->linux_kernel != NULL) ? b->machine->linux_kernel : _(unk),
+ _("Linux OS"), (b->machine->linux_os != NULL) ? b->machine->linux_os : _(unk),
_("CPU Name"), b->machine->cpu_name,
_("CPU Description"), (b->machine->cpu_desc != NULL) ? b->machine->cpu_desc : _(unk),
_("CPU Config"), b->machine->cpu_config,
@@ -556,6 +568,8 @@ static char *bench_result_more_info_complete(bench_result *b)
"[%s]\n"
/* board */ "%s=%s\n"
/* machine_type */ "%s=%s\n"
+ /* linux_kernel */ "%s=%s\n"
+ /* linux_os */ "%s=%s\n"
/* cpu */ "%s=%s\n"
/* cpudesc */ "%s=%s\n"
/* cpucfg */ "%s=%s\n"
@@ -584,6 +598,8 @@ static char *bench_result_more_info_complete(bench_result *b)
_("Machine"), _("Board"),
(b->machine->board != NULL) ? b->machine->board : _(unk),
_("Machine Type"), (b->machine->machine_type != NULL) ? b->machine->machine_type : _(unk),
+ _("Linux Kernel"), (b->machine->linux_kernel != NULL) ? b->machine->linux_kernel : _(unk),
+ _("Linux OS"), (b->machine->linux_os != NULL) ? b->machine->linux_os : _(unk),
_("CPU Name"),
b->machine->cpu_name, _("CPU Description"),
(b->machine->cpu_desc != NULL) ? b->machine->cpu_desc : _(unk),