From: Vincent Brillault Date: Mon, 25 Sep 2017 19:35:50 +0000 (+0200) Subject: turbostat: better support for mutli packages X-Git-Tag: collectd-5.8.0~80 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=82aace6f65e85ba568ab7b87227f908e08907db3;p=collectd.git turbostat: better support for mutli packages If multiple packages are defined, support non-logical core enumeration by prefixing each core id by its package id --- diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod index 3be5d4b8..d52da7a3 100644 --- a/src/collectd.conf.pod +++ b/src/collectd.conf.pod @@ -8223,9 +8223,9 @@ collections. The different bits of this bit mask accepted by this plugin are: Boolean enabling the use of logical core numbering for per core statistics. When enabled, CnE> is used as plugin instance, where I is a -sequential number assigned by the kernel. Otherwise, CnE> is used -where I is the n-th core of the socket, causing name conflicts when there is -more than one socket. +dynamic number assigned by the kernel. Otherwise, CnE> is used +if there is only one package and CnE-coreEmE> if there is +more than one, where I is the n-th core of package I. =back diff --git a/src/turbostat.c b/src/turbostat.c index 1049fb2a..b77691f1 100644 --- a/src/turbostat.c +++ b/src/turbostat.c @@ -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))