diff options
author | Burt P <pburt0@gmail.com> | 2018-10-24 16:00:03 -0500 |
---|---|---|
committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2018-11-30 05:00:21 -0800 |
commit | bd3b14dd05b0b7fadf26363cd1424a3e22f7be6a (patch) | |
tree | d4bf14327f9fb4d3dc0e8a75a0de06cd3a7957b4 | |
parent | 5c32c60b3b4bb92fbfd5dd8c465c1f38f063660a (diff) |
add hardinfo param for maximum number of benchmark results to include
Signed-off-by: Burt P <pburt0@gmail.com>
-rw-r--r-- | hardinfo/util.c | 8 | ||||
-rw-r--r-- | includes/hardinfo.h | 1 | ||||
-rw-r--r-- | modules/benchmark.c | 2 |
3 files changed, 10 insertions, 1 deletions
diff --git a/hardinfo/util.c b/hardinfo/util.c index 4acb28be..67e5b663 100644 --- a/hardinfo/util.c +++ b/hardinfo/util.c @@ -394,6 +394,7 @@ void parameters_init(int *argc, char ***argv, ProgramParameters * param) static gchar *run_benchmark = NULL; static gchar *result_format = NULL; static gchar **use_modules = NULL; + static gint max_bench_results = 10; static GOptionEntry options[] = { { @@ -421,6 +422,12 @@ void parameters_init(int *argc, char ***argv, ProgramParameters * param) .arg_data = &result_format, .description = N_("benchmark result format ([short], conf, shell)")}, { + .long_name = "max-results", + .short_name = 'n', + .arg = G_OPTION_ARG_INT, + .arg_data = &max_bench_results, + .description = N_("maximum number of benchmark results to include (-1 for no limit, default is 10)")}, + { .long_name = "list-modules", .short_name = 'l', .arg = G_OPTION_ARG_NONE, @@ -490,6 +497,7 @@ void parameters_init(int *argc, char ***argv, ProgramParameters * param) param->use_modules = use_modules; param->run_benchmark = run_benchmark; param->result_format = result_format; + param->max_bench_results = max_bench_results; param->autoload_deps = autoload_deps; param->run_xmlrpc_server = run_xmlrpc_server; param->skip_benchmarks = skip_benchmarks; diff --git a/includes/hardinfo.h b/includes/hardinfo.h index ab5507bd..881924c5 100644 --- a/includes/hardinfo.h +++ b/includes/hardinfo.h @@ -63,6 +63,7 @@ struct _ProgramParameters { gboolean markup_ok; gint report_format; + gint max_bench_results; gchar **use_modules; gchar *run_benchmark; diff --git a/modules/benchmark.c b/modules/benchmark.c index 9cc7e0b8..1a72e983 100644 --- a/modules/benchmark.c +++ b/modules/benchmark.c @@ -349,7 +349,7 @@ static gchar *__benchmark_include_results(bench_value r, GKeyFile *conf; gchar **machines; gchar *path, *results = g_strdup(""); - int i, len, loc, win_min, win_max, win_size = 10; + int i, len, loc, win_min, win_max, win_size = params.max_bench_results; GSList *result_list = NULL, *li = NULL; |