diff options
author | Simon Quigley <tsimonq2@ubuntu.com> | 2018-02-27 22:34:48 -0600 |
---|---|---|
committer | Simon Quigley <tsimonq2@ubuntu.com> | 2018-02-27 22:34:48 -0600 |
commit | 09fcc751ef158898c315ebc9299a0fa3a722d914 (patch) | |
tree | 91116653d831ca5de92274277237ba2a42db3365 /hardinfo | |
parent | 11e616945340e87a1f567ab92e6dfac3068875b1 (diff) |
New upstream version 0.5.1+git20180227
Diffstat (limited to 'hardinfo')
-rw-r--r-- | hardinfo/cpu_util.c | 8 | ||||
-rw-r--r-- | hardinfo/cpubits.c | 2 | ||||
-rw-r--r-- | hardinfo/hardinfo.c | 3 | ||||
-rw-r--r-- | hardinfo/util.c | 8 |
4 files changed, 18 insertions, 3 deletions
diff --git a/hardinfo/cpu_util.c b/hardinfo/cpu_util.c index f5bddd5c..a598d2ed 100644 --- a/hardinfo/cpu_util.c +++ b/hardinfo/cpu_util.c @@ -85,7 +85,8 @@ int cpu_procs_cores_threads(int *p, int *c, int *t) { for (i = 0; i <= m; i++) { pack_id = get_cpu_int("topology/physical_package_id", i, CPU_TOPO_NULL); core_id = get_cpu_int("topology/core_id", i, CPU_TOPO_NULL); - if (pack_id >= 0) { CPUBIT_SET(packs, pack_id); } + if (pack_id < 0) pack_id = 0; + CPUBIT_SET(packs, pack_id); if (core_id >= 0) { CPUBIT_SET(cores, (pack_id * MAX_CORES_PER_PACK) + core_id ); } } *t = cpubits_count(threads); @@ -128,6 +129,11 @@ void cpufreq_update(cpufreq_data *cpufd, int cur_only) cpufd->cpukhz_max = get_cpu_int("cpufreq/scaling_max_freq", cpufd->id, 0); if (cpufd->scaling_driver == NULL) cpufd->scaling_driver = g_strdup("(Unknown)"); if (cpufd->scaling_governor == NULL) cpufd->scaling_governor = g_strdup("(Unknown)"); + + /* x86 uses freqdomain_cpus, all others use affected_cpus */ + cpufd->shared_list = get_cpu_str("cpufreq/freqdomain_cpus", cpufd->id); + if (cpufd->shared_list == NULL) cpufd->shared_list = get_cpu_str("cpufreq/affected_cpus", cpufd->id); + if (cpufd->shared_list == NULL) cpufd->shared_list = g_strdup_printf("%d", cpufd->id); } } diff --git a/hardinfo/cpubits.c b/hardinfo/cpubits.c index ba9bffc7..7ab03be8 100644 --- a/hardinfo/cpubits.c +++ b/hardinfo/cpubits.c @@ -41,7 +41,7 @@ uint32_t cpubits_count(cpubits *b) { } int cpubits_max(cpubits *b) { - int i = CPUBITS_SIZE * 8; + int i = CPUBITS_SIZE * 8 - 1; while (i >= 0) { if (CPUBIT_GET(b, i)) break; diff --git a/hardinfo/hardinfo.c b/hardinfo/hardinfo.c index 4401a551..b3bef9b5 100644 --- a/hardinfo/hardinfo.c +++ b/hardinfo/hardinfo.c @@ -121,8 +121,9 @@ int main(int argc, char **argv) result = module_call_method_param("benchmark::runBenchmark", params.run_benchmark); if (!result) { - g_error(_("Unknown benchmark ``%s'' or libbenchmark.so not loaded"), params.run_benchmark); + g_error(_("Unknown benchmark ``%s'' or benchmark.so not loaded"), params.run_benchmark); } else { + fprintf(stderr, "\n"); g_print("%s\n", result); g_free(result); } diff --git a/hardinfo/util.c b/hardinfo/util.c index efa19b9c..7bcc5dd5 100644 --- a/hardinfo/util.c +++ b/hardinfo/util.c @@ -390,6 +390,7 @@ void parameters_init(int *argc, char ***argv, ProgramParameters * param) static gboolean run_xmlrpc_server = FALSE; static gchar *report_format = NULL; static gchar *run_benchmark = NULL; + static gchar *result_format = NULL; static gchar **use_modules = NULL; static GOptionEntry options[] = { @@ -412,6 +413,12 @@ void parameters_init(int *argc, char ***argv, ProgramParameters * param) .arg_data = &run_benchmark, .description = N_("run benchmark; requires benchmark.so to be loaded")}, { + .long_name = "result-format", + .short_name = 'g', + .arg = G_OPTION_ARG_STRING, + .arg_data = &result_format, + .description = N_("benchmark result format ([short], conf, shell)")}, + { .long_name = "list-modules", .short_name = 'l', .arg = G_OPTION_ARG_NONE, @@ -468,6 +475,7 @@ void parameters_init(int *argc, char ***argv, ProgramParameters * param) param->list_modules = list_modules; param->use_modules = use_modules; param->run_benchmark = run_benchmark; + param->result_format = result_format; param->autoload_deps = autoload_deps; param->run_xmlrpc_server = run_xmlrpc_server; param->argv0 = *(argv)[0]; |