X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fturbostat.c;h=e4419b85689ea5003d06b799ec37982abcecfa88;hb=9fa98875d6cf81b20c03156ccaf7f081dfa7d1a5;hp=73a6769be44a80a75786fa8b99fdddefe0e4e39e;hpb=be126043c2be20399d7670fe194645292018bde0;p=collectd.git diff --git a/src/turbostat.c b/src/turbostat.c index 73a6769b..e4419b85 100644 --- a/src/turbostat.c +++ b/src/turbostat.c @@ -41,7 +41,7 @@ #include "plugin.h" #include "utils_time.h" -#include +#include "msr-index.h" #include #ifdef HAVE_SYS_CAPABILITY_H #include @@ -567,9 +567,9 @@ static int submit_counters(struct thread_data *t, struct core_data *c, 1.0 / 1000000 * t->aperf / interval_float); if ((!aperf_mperf_unstable) || (!(t->aperf > t->tsc || t->mperf > t->tsc))) - turbostat_submit(name, "frequency", "busy", 1.0 * t->tsc / 1000000 * - t->aperf / t->mperf / - interval_float); + turbostat_submit(name, "frequency", "busy", + 1.0 * t->tsc / 1000000 * t->aperf / t->mperf / + interval_float); /* Sanity check (should stay stable) */ turbostat_submit(name, "gauge", "TSC", @@ -585,7 +585,10 @@ static int submit_counters(struct thread_data *t, struct core_data *c, /* If not using logical core numbering, set core id */ if (!config_lcn) { - snprintf(name, sizeof(name), "core%02d", c->core_id); + if (topology.num_packages > 1) + snprintf(name, sizeof(name), "pkg%02d-core%02d", p->package_id, c->core_id); + else + snprintf(name, sizeof(name), "core%02d", c->core_id); } if (do_core_cstate & (1 << 3)) @@ -1065,7 +1068,7 @@ static int get_threads_on_core(unsigned int cpu) { char character; snprintf(path, sizeof(path), - "/sys/devices/system/cpu/cpu%d/topology/thread_siblings_list", cpu); + "/sys/devices/system/cpu/cpu%d/topology/thread_siblings_list", cpu); filep = fopen(path, "r"); if (!filep) { ERROR("turbostat plugin: Failed to open '%s'", path);