summaryrefslogtreecommitdiff
path: root/modules/benchmark
diff options
context:
space:
mode:
authorBurt P <pburt0@gmail.com>2017-08-15 02:32:23 -0500
committerLeandro A. F. Pereira <leandro@hardinfo.org>2017-08-21 05:47:00 -0700
commit431d86000fb1491ca15eeab6f9bd027c6a75f477 (patch)
tree424bf3d352f0daf6702551c32b350fa5baa82943 /modules/benchmark
parentc83636f963c6fdc1dcf6bd62107b3ed4a3fd6244 (diff)
Add OpenGL Renderer to benchmark result details
For the GPU Drawing benchmark at least, it should give some idea of the graphics capabilities of the machine. This is the only data hardinfo currently has about that. Maybe in the future, more advanced GPU information could be given. Signed-off-by: Burt P <pburt0@gmail.com>
Diffstat (limited to 'modules/benchmark')
-rw-r--r--modules/benchmark/bench_results.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/modules/benchmark/bench_results.c b/modules/benchmark/bench_results.c
index d9d8f8ae..4c7b3dca 100644
--- a/modules/benchmark/bench_results.c
+++ b/modules/benchmark/bench_results.c
@@ -24,6 +24,7 @@ typedef struct {
char *cpu_name;
char *cpu_desc;
char *cpu_config;
+ char *ogl_renderer;
int threads;
char *mid;
} simple_machine;
@@ -146,6 +147,7 @@ simple_machine *simple_machine_this() {
m->cpu_name = module_call_method("devices::getProcessorName");
m->cpu_desc = module_call_method("devices::getProcessorDesc");
m->cpu_config = module_call_method("devices::getProcessorFrequencyDesc");
+ m->ogl_renderer = module_call_method("computer::getOGLRenderer");
tmp = module_call_method("devices::getMemoryTotal");
m->memory_kiB = atoi(tmp);
free(tmp);
@@ -222,7 +224,7 @@ bench_result *bench_result_benchmarkconf(const char *section, const char *key, c
b->machine = simple_machine_new();
b->name = strdup(section);
- if (vl >= 8) {
+ if (vl >= 8) { /* the 9th could be empty */
b->machine->mid = strdup(key);
b->result = atof(values[0]);
b->threads = atoi(values[1]);
@@ -232,6 +234,8 @@ bench_result *bench_result_benchmarkconf(const char *section, const char *key, c
b->machine->cpu_config = strdup(values[5]);
b->machine->memory_kiB = atoi(values[6]);
b->machine->threads = atoi(values[7]);
+ if (vl >= 9)
+ b->machine->ogl_renderer = strdup(values[8]);
b->legacy = 0;
} else if (vl >= 2) {
b->result = atof(values[0]);
@@ -305,13 +309,15 @@ bench_result *bench_result_benchmarkconf(const char *section, const char *key, c
char *bench_result_benchmarkconf_line(bench_result *b) {
char *cpu_config = cpu_config_retranslate(b->machine->cpu_config, 1, 0);
- char *ret = g_strdup_printf("%s=%.2f|%d|%s|%s|%s|%s|%d|%d\n",
+ char *ret = g_strdup_printf("%s=%.2f|%d|%s|%s|%s|%s|%d|%d|%s\n",
b->machine->mid, b->result, b->threads,
(b->machine->board != NULL) ? b->machine->board : "",
b->machine->cpu_name,
(b->machine->cpu_desc != NULL) ? b->machine->cpu_desc : "",
cpu_config,
- b->machine->memory_kiB, b->machine->threads );
+ b->machine->memory_kiB, b->machine->threads,
+ (b->machine->ogl_renderer != NULL) ? b->machine->ogl_renderer : ""
+ );
free(cpu_config);
return ret;
}
@@ -326,6 +332,7 @@ char *bench_result_more_info(bench_result *b) {
/* cpudesc */ "%s=%s\n"
/* cpucfg */ "%s=%s\n"
/* threads */ "%s=%d\n"
+ /* ogl rend */ "%s=%s\n"
/* mem */ "%s=%d %s\n",
_("Benchmark Result"),
_("Threads"), b->threads,
@@ -337,6 +344,7 @@ char *bench_result_more_info(bench_result *b) {
_("CPU Description"), (b->machine->cpu_desc != NULL) ? b->machine->cpu_desc : _("(Unknown)"),
_("CPU Config"), b->machine->cpu_config,
_("Threads Available"), b->machine->threads,
+ _("OpenGL Renderer"), (b->machine->ogl_renderer != NULL) ? b->machine->ogl_renderer : _("(Unknown)"),
_("Memory"), b->machine->memory_kiB, _("kiB")
);
}
@@ -353,6 +361,7 @@ char *bench_result_more_info_complete(bench_result *b) {
/* cpudesc */ "%s=%s\n"
/* cpucfg */ "%s=%s\n"
/* threads */ "%s=%d\n"
+ /* ogl rend */ "%s=%s\n"
/* mem */ "%s=%d %s\n"
"[%s]\n"
/* mid */ "%s=%s\n"
@@ -364,11 +373,12 @@ char *bench_result_more_info_complete(bench_result *b) {
b->legacy ? _("Note") : "#Note",
b->legacy ? _("This result is from an old version of Hardinfo.") : "",
_("Machine"),
- _("Board"), b->machine->board,
+ _("Board"), (b->machine->board != NULL) ? b->machine->board : _("(Unknown)"),
_("CPU Name"), b->machine->cpu_name,
- _("CPU Description"), b->machine->cpu_desc,
+ _("CPU Description"), (b->machine->cpu_desc != NULL) ? b->machine->cpu_desc : _("(Unknown)"),
_("CPU Config"), b->machine->cpu_config,
_("Threads Available"), b->machine->threads,
+ _("OpenGL Renderer"), (b->machine->ogl_renderer != NULL) ? b->machine->ogl_renderer : _("(Unknown)"),
_("Memory"), b->machine->memory_kiB, _("kiB"),
_("Handles"),
_("mid"), b->machine->mid,