summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0775c9e)
raw | patch | inline | side by side (parent: 0775c9e)
author | Vincent Brillault <git@lerya.net> | |
Fri, 13 Feb 2015 20:04:27 +0000 (21:04 +0100) | ||
committer | Vincent Brillault <git@lerya.net> | |
Sat, 28 Feb 2015 06:35:42 +0000 (07:35 +0100) |
This commit adds a number of configuration options that overide
which features are enabled by the automated mechanisms.
These options should only be used to turn off unwanted features
or add (temporarily) support for a new CPU
which features are enabled by the automated mechanisms.
These options should only be used to turn off unwanted features
or add (temporarily) support for a new CPU
src/collectd.conf.in | patch | blob | history | |
src/collectd.conf.pod | patch | blob | history | |
src/turbostat.c | patch | blob | history |
diff --git a/src/collectd.conf.in b/src/collectd.conf.in
index 078f2dd90cd34147bb38c14663e92401da20c1f3..a5b82ec6944a4a871260df35162036be9ce1b7ea 100644 (file)
--- a/src/collectd.conf.in
+++ b/src/collectd.conf.in
#</Plugin>
#<Plugin turbostat>
-## The following option should not be used if MSR_IA32_TEMPERATURE_TARGET is supported
-# TCCActivationTemp 100
+## None of the following option should be set manually
+## This plugin automatically detect most optimal options
+## Only set values here if:
+## - The module ask you to
+## - You want to disable the collection of some data
+## - Your (intel) CPU is not supported (yet) by the module
+## - The module generate a lot of errors 'MSR offset 0x... read failed'
+## In the last two cases, please open a bug request
+#
+# TCCActivationTemp "100"
+# CoreCstates "392"
+# PackageCstates "396"
+# SystemManagementInterrupt true
+# DigitalTemperatureSensor true
+# PackageThermalManagement true
+# RunningAveragePowerLimit "7"
#</Plugin>
#<Plugin unixsock>
diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod
index 642d7994fe1c947d76a9c5fd2def6f28fc8dc221..f5425042a2d2921df992d802fbd7a1201cb22275 100644 (file)
--- a/src/collectd.conf.pod
+++ b/src/collectd.conf.pod
=back
-=head2 Plugin C<Turbostat>
+=head2 Plugin C<turbostat>
The I<Turbostat plugin> reads CPU frequency and C-state residency on modern
Intel processors by using the new Model Specific Registers.
=over 4
+=item B<CoreCstates> I<Bitmask(Integer)>
+
+Bitmask of the list of core C states supported by the processor.
+This option should only be used if the automated detection fails.
+Default value extracted from the cpu model and family.
+
+Currently supported C-states (by this plugin): 3, 6, 7
+
+Example: (1<<3)+(1<<6)+(1<<7) = 392 for all states
+
+=item B<PackageCstates> I<Bitmask(Integer)>
+
+Bitmask of the list of pacages C states supported by the processor.
+This option should only be used if the automated detection fails.
+Default value extracted from the cpu model and family.
+
+Currently supported C-states (by this plugin): 2, 3, 6, 7, 8, 9, 10
+
+Example: (1<<2)+(1<<3)+(1<<6)+(1<<7) = 396 for states 2, 3, 6 and 7
+
+=item B<SystemManagementInterrupt> I<true>|I<false>
+
+Boolean enabling the collection of the I/O System-Management Interrupt
+counter'. This option should only be used if the automated detection
+fails or if you want to disable this feature.
+
+=item B<DigitalTemperatureSensor> I<true>|I<false>
+
+Boolean enabling the collection of the temperature of each core.
+This option should only be used if the automated detectionfails or
+if you want to disable this feature.
+
+=item B<DigitalTemperatureSensor> I<true>|I<false>
+
+Boolean enabling the collection of the temperature of each package.
+This option should only be used if the automated detectionfails or
+if you want to disable this feature.
+
=item B<TCCActivationTemp> I<Temperature>
Thermal Control Circuit Activation Temperature of the installed
-CPU. This option should only be used if the automated detection
-fails. Default value extracted from B<MSR_IA32_TEMPERATURE_TARGET>
+CPU. This temperature is used when collecting the temperature of
+cores or packages. This option should only be used if the automated
+detection fails. Default value extracted from B<MSR_IA32_TEMPERATURE_TARGET>
+
+=item B<RunningAveragePowerLimit> I<Bitmask(Integer)>
+
+Bitmask of the list of elements to be thermally monitored. This option
+should only be used if the automated detection fails or if you want to
+disable some collections. The different bits of this bitmask accepted
+by this plugin are:
+
+=over 4
+
+=item 0 ('1'): Package
+
+=item 1 ('2'): DRAM
+
+=item 2 ('4'): Cores
+
+=item 3 ('8'): Embedded graphic device
+
+=back
=back
diff --git a/src/turbostat.c b/src/turbostat.c
index ec8757e7a6040a8cc8c4d8eea48acbae15526e88..5ee45186ade3c2f7855886cdb183f9377e705107 100644 (file)
--- a/src/turbostat.c
+++ b/src/turbostat.c
* Currently supported C-states (by this plugin): 3, 6, 7
*/
static unsigned int do_core_cstate;
+static unsigned int config_core_cstate;
+static _Bool apply_config_core_cstate;
/*
* Bitmask of the list of pacages C states supported by the processor.
* Currently supported C-states (by this plugin): 2, 3, 6, 7, 8, 9, 10
*/
static unsigned int do_pkg_cstate;
+static unsigned int config_pkg_cstate;
+static _Bool apply_config_pkg_cstate;
/*
* Boolean indicating if the processor supports 'I/O System-Management Interrupt counter'
*/
static _Bool do_smi;
+static _Bool config_smi;
+static _Bool apply_config_smi;
/*
* Boolean indicating if the processor supports 'Digital temperature sensor'
* - Temperatures above the tcc_activation_temp are not recorded
*/
static _Bool do_dts;
+static _Bool config_dts;
+static _Bool apply_config_dts;
/*
* Boolean indicating if the processor supports 'Package thermal management'
* - Temperatures above the tcc_activation_temp are not recorded
*/
static _Bool do_ptm;
+static _Bool config_ptm;
+static _Bool apply_config_ptm;
/*
* Thermal Control Circuit Activation Temperature as configured by the user.
static unsigned int tcc_activation_temp;
static unsigned int do_rapl;
+static unsigned int config_rapl;
+static _Bool apply_config_rapl;
static double rapl_energy_units;
#define RAPL_PKG (1 << 0)
static const char *config_keys[] =
{
+ "CoreCstates",
+ "PackageCstates",
+ "SystemManagementInterrupt",
+ "DigitalTemperatureSensor",
+ "PackageThermalManagement",
"TCCActivationTemp",
+ "RunningAveragePowerLimit",
};
static const int config_keys_num = STATIC_ARRAY_SIZE (config_keys);
return -1;
}
+ /* Override detected values with configuration */
+ if (apply_config_core_cstate)
+ do_core_cstate = config_core_cstate;
+ if (apply_config_pkg_cstate)
+ do_pkg_cstate = config_pkg_cstate;
+ if (apply_config_smi)
+ do_smi = config_smi;
+ if (apply_config_dts)
+ do_dts = config_dts;
+ if (apply_config_ptm)
+ do_ptm = config_ptm;
+ if (apply_config_rapl)
+ do_rapl = config_rapl;
+
if (do_rapl) {
unsigned long long msr;
if (get_msr(0, MSR_RAPL_POWER_UNIT, &msr))
long unsigned int tmp_val;
char *end;
- if (strcasecmp("TCCActivationTemp", key) == 0) {
+ if (strcasecmp("CoreCstates", key) == 0) {
+ tmp_val = strtoul(value, &end, 0);
+ if (*end != '\0' || tmp_val > UINT_MAX) {
+ ERROR("Turbostat plugin: Invalid CoreCstates '%s'",
+ value);
+ return -1;
+ }
+ config_core_cstate = (unsigned int) tmp_val;
+ apply_config_core_cstate = 1;
+ } else if (strcasecmp("PackageCstates", key) == 0) {
+ tmp_val = strtoul(value, &end, 0);
+ if (*end != '\0' || tmp_val > UINT_MAX) {
+ ERROR("Turbostat plugin: Invalid PackageCstates '%s'",
+ value);
+ return -1;
+ }
+ config_pkg_cstate = (unsigned int) tmp_val;
+ apply_config_pkg_cstate = 1;
+ } else if (strcasecmp("SystemManagementInterrupt", key) == 0) {
+ config_smi = IS_TRUE(value);
+ apply_config_smi = 1;
+ } else if (strcasecmp("DigitalTemperatureSensor", key) == 0) {
+ config_dts = IS_TRUE(value);
+ apply_config_dts = 1;
+ } else if (strcasecmp("PackageThermalManagement", key) == 0) {
+ config_ptm = IS_TRUE(value);
+ apply_config_ptm = 1;
+ } else if (strcasecmp("RunningAveragePowerLimit", key) == 0) {
+ tmp_val = strtoul(value, &end, 0);
+ if (*end != '\0' || tmp_val > UINT_MAX) {
+ ERROR("Turbostat plugin: Invalid RunningAveragePowerLimit '%s'",
+ value);
+ return -1;
+ }
+ config_rapl = (unsigned int) tmp_val;
+ apply_config_rapl = 1;
+ } else if (strcasecmp("TCCActivationTemp", key) == 0) {
tmp_val = strtoul(value, &end, 0);
if (*end != '\0' || tmp_val > UINT_MAX) {
ERROR("Turbostat plugin: Invalid TCCActivationTemp '%s'",