projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'collectd-5.7' into collectd-5.8
[collectd.git]
/
src
/
turbostat.c
diff --git
a/src/turbostat.c
b/src/turbostat.c
index
73a6769
..
e4419b8
100644
(file)
--- a/
src/turbostat.c
+++ b/
src/turbostat.c
@@
-41,7
+41,7
@@
#include "plugin.h"
#include "utils_time.h"
#include "plugin.h"
#include "utils_time.h"
-#include
<asm/msr-index.h>
+#include
"msr-index.h"
#include <cpuid.h>
#ifdef HAVE_SYS_CAPABILITY_H
#include <sys/capability.h>
#include <cpuid.h>
#ifdef HAVE_SYS_CAPABILITY_H
#include <sys/capability.h>
@@
-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)))
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",
/* 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) {
/* 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))
}
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),
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);
filep = fopen(path, "r");
if (!filep) {
ERROR("turbostat plugin: Failed to open '%s'", path);