Turbostat: Use uint32_t for 32b wrapping
Turbostat: extend the configuration options
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
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
Turbostat: simplify RAPL config and collection
There is no point configuring and collecting data which
is not submitted.
There is no point configuring and collecting data which
is not submitted.
Turbostat: relax dependency on invariant TSC
Backport d7899447535929b3672442b7b42a09ae4e48fa91
from Len Brown <len.brown@intel.com>
Turbostat can be useful on systems that do not support invariant TSC,
so allow it to run on those systgems.
All arithmetic in turbostat using the TSC value is per-processsor,
so it does not depend on the TSC values being in sync acrosss
processors.
Turbostat uses cdtime() for the measurement interval
rather than using the TSC directly, so that key metric
is also immune from variable TSC.
Turbostat has a TSC sanity check gauge:
TSC_MHz = TSC_delta/interval
If this column is constant and is close to the processor
base frequency, then the TSC is behaving properly.
The other key turbostat columns are calculated this way:
Avg_Mhz = APERF_delta/interval
Bzy_MHz = TSC_delta/APERF_delta/MPERF_delta/interval
c0 = MPERF_delta/TSC_delta
This adaptation of the original commit has not been tested on any
old CPU. This patch also re-introduce the boolean "do_smi" as such
old CPUs don't have SMI.
Backport d7899447535929b3672442b7b42a09ae4e48fa91
from Len Brown <len.brown@intel.com>
Turbostat can be useful on systems that do not support invariant TSC,
so allow it to run on those systgems.
All arithmetic in turbostat using the TSC value is per-processsor,
so it does not depend on the TSC values being in sync acrosss
processors.
Turbostat uses cdtime() for the measurement interval
rather than using the TSC directly, so that key metric
is also immune from variable TSC.
Turbostat has a TSC sanity check gauge:
TSC_MHz = TSC_delta/interval
If this column is constant and is close to the processor
base frequency, then the TSC is behaving properly.
The other key turbostat columns are calculated this way:
Avg_Mhz = APERF_delta/interval
Bzy_MHz = TSC_delta/APERF_delta/MPERF_delta/interval
c0 = MPERF_delta/TSC_delta
This adaptation of the original commit has not been tested on any
old CPU. This patch also re-introduce the boolean "do_smi" as such
old CPUs don't have SMI.
Turbostat: Add support for Broadwell (rapl part)
Partial backport of 4e8e863fed2e82278d29c6357de8251adb73acb9
from Len Brown <len.brown@intel.com>
Add comments on all models
Partial backport of 4e8e863fed2e82278d29c6357de8251adb73acb9
from Len Brown <len.brown@intel.com>
Add comments on all models
Turbostat: remove 'future' Silvermont models
These models are not yet supported by upstream
Partial revert of 12bac3a7207cf264f41b69441454dbbbbad25782
These models are not yet supported by upstream
Partial revert of 12bac3a7207cf264f41b69441454dbbbbad25782
Turbostat: Add (back) sanity check
This new gauge contains TSC / interval_float.
If TSC and interval_float are behaving correctly, this is supposed to be
constant. Otherwise, other measurements can be wrong
This new gauge contains TSC / interval_float.
If TSC and interval_float are behaving correctly, this is supposed to be
constant. Otherwise, other measurements can be wrong
Turbostat: frequency add Averange, rename Buzy
Partial backport of fc04cc67ea8f44124f048832a745a24bc2fa12fa
from Len Brown <len.brown@intel.com>
Add Avg_MHz column, which is the frequency that many
users expect to see -- the total number of cycles executed
over the measurement interval.
People found the previous GHz to be confusing, since
it was the speed only over the non-idle interval.
That measurement has been re-named Bzy_MHz.
Partial backport of fc04cc67ea8f44124f048832a745a24bc2fa12fa
from Len Brown <len.brown@intel.com>
Add Avg_MHz column, which is the frequency that many
users expect to see -- the total number of cycles executed
over the measurement interval.
People found the previous GHz to be confusing, since
it was the speed only over the non-idle interval.
That measurement has been re-named Bzy_MHz.
Turbostat plugin: relax dependency on root
Backporting commit 98481e79b60a50d699b79292ff1b7e56e7fa8425
from Len Brown <len.brown@intel.com>
For turbostat to run as non-root, it needs to permissions:
1. read access to /dev/cpu/*/msr
via standard user/group/world file permissions
2. CAP_SYS_RAWIO
eg. # setcap cap_sys_rawio=ep $(which collectd)
Yes, running as root still works.
Backporting commit 98481e79b60a50d699b79292ff1b7e56e7fa8425
from Len Brown <len.brown@intel.com>
For turbostat to run as non-root, it needs to permissions:
1. read access to /dev/cpu/*/msr
via standard user/group/world file permissions
2. CAP_SYS_RAWIO
eg. # setcap cap_sys_rawio=ep $(which collectd)
Yes, running as root still works.
Turbostat: re-order init tests
Calling 'stat' on /dev/cpu/0/msr does not need any specific permission
and needs to be checked before probe_cpu.
Calling 'stat' on /dev/cpu/0/msr does not need any specific permission
and needs to be checked before probe_cpu.
Turbostat: Set global variable to static
Turbostat: Some reordering as per coding rules
Turbostat: Use cdtime for time resolution
Turbostat: Do not use error code, use error messages
Turbostat: init_counter cannot fail anymore
Due to the new probing system, the counter initialization cannot
fail anymore. Make init_counter and initialize_counters return void
Due to the new probing system, the counter initialization cannot
fail anymore. Make init_counter and initialize_counters return void
Turbostat: value_list_t.plugin_instance limit is DATA_MAX_NAME_LEN
Turbostat: add <Plugin /> example
Turbostat: add configuration options in man page
Turbostat: check return value of vsnprintf
Turbostat: whitespace cleanup
Turbostat: enhance error/warning meesages
Turbostat: complex read register is now useless
Turbostat: remove superfluous function declaration
Turbostat: fix topology detection
Turbostat: fix allocate_cpu_set
Turbostat: this code can fail in fact...
Turbostat: last re-ordering of the module
Turbostat: Refactor topology probing
Only probe the topology once and store in locally
Only probe the topology once and store in locally
Turbostat: Fix minor compilation warnings
Turbostat: Re-order code and add comments
No algorithmic change in this commit
No algorithmic change in this commit
Trubostat: Refactor delta functions
- merge delta_cpu in for_all_cpus_delta
- for_all_cpus_delta: don't resolve pointers that are not used
- add comments
- merge delta_cpu in for_all_cpus_delta
- for_all_cpus_delta: don't resolve pointers that are not used
- add comments
turbostat: Backport 'Drop temperature checks'
The Intel 64 and IA-32 Architectures Software Developer's Manual says
that TjMax is stored in bits 23:16 of MSR_TEMPERATURE TARGET (0x1a2).
That's 8 bits, not 7, so it must be masked with 0xFF rather than 0x7F.
The manual has no mention of which values should be considered valid,
which kind of implies that they all are. Arbitrarily discarding values
outside a specific range is wrong. The upper range check had to be
fixed recently (commit 144b44b1) and the lower range check is just as
wrong. See bug #75071:
https://bugzilla.kernel.org/show_bug.cgi?id=75071
There are many Xeon processor series with TjMax of 70, 71 or 80
degrees Celsius, way below the arbitrary 85 degrees Celsius limit.
There may be other (past or future) models with even lower limits.
So drop this arbitrary check. The only value that would be clearly
invalid is 0. Everything else should be accepted.
After these changes, turbostat is aligned with what the coretemp
driver does.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Cc: Len Brown <len.brown@intel.com>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[git@lerya.net: Ported to collectd turbostat plugin]
Signed-off-by: Vincent Brillault <git@lerya.net>
The Intel 64 and IA-32 Architectures Software Developer's Manual says
that TjMax is stored in bits 23:16 of MSR_TEMPERATURE TARGET (0x1a2).
That's 8 bits, not 7, so it must be masked with 0xFF rather than 0x7F.
The manual has no mention of which values should be considered valid,
which kind of implies that they all are. Arbitrarily discarding values
outside a specific range is wrong. The upper range check had to be
fixed recently (commit 144b44b1) and the lower range check is just as
wrong. See bug #75071:
https://bugzilla.kernel.org/show_bug.cgi?id=75071
There are many Xeon processor series with TjMax of 70, 71 or 80
degrees Celsius, way below the arbitrary 85 degrees Celsius limit.
There may be other (past or future) models with even lower limits.
So drop this arbitrary check. The only value that would be clearly
invalid is 0. Everything else should be accepted.
After these changes, turbostat is aligned with what the coretemp
driver does.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Cc: Len Brown <len.brown@intel.com>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[git@lerya.net: Ported to collectd turbostat plugin]
Signed-off-by: Vincent Brillault <git@lerya.net>
Turbostat: SNB & later support MSR_PKG_C2_RESIDENCY
Turbostat: add a missing fclose
Turbostat: Adding some comments
Turbostat: move set_temperature_target to setup_all_buffers
setup_all_buffers can be called after a free_all_buffers, which would
remove the tcc_activation_temp
setup_all_buffers can be called after a free_all_buffers, which would
remove the tcc_activation_temp
Turbostat: don't hide the actual size of the buffer in some define
Turbostat: introduce 'delta' data sets
This patch replace the 'old = new - old' mecanism with a simpler
'delta = new - old' one
This patch replace the 'old = new - old' mecanism with a simpler
'delta = new - old' one
Turbostat: remove proc_stat global variable
Turbostat: use _Bool for boolean values
Turbostat: simplify aperf_mperf_unstable & skip_c[01]
Turbostat: Fix sched affinity mess
get_msr doesn't need to be run on the CPU targetted. However, when run
on another CPU, perfomances will decrease as task have to be scheduled
on another CPU. Migrating to another CPU during the setup (where only a
few get_msr are done) is probably not worth it. However, in the
get_counters function, the large number of get_msr query makes it
potentially important.
This patch also introduce the restoration of the scheduling affinity as
it was before the plugin invocation.
get_msr doesn't need to be run on the CPU targetted. However, when run
on another CPU, perfomances will decrease as task have to be scheduled
on another CPU. Migrating to another CPU during the setup (where only a
few get_msr are done) is probably not worth it. However, in the
get_counters function, the large number of get_msr query makes it
potentially important.
This patch also introduce the restoration of the scheduling affinity as
it was before the plugin invocation.
Turbodtat: tcc_activation_temp is a package concept, so store it in packages
Turbostat: use ssnprintf instead of snprintf
Turbostat: fix some WARNING/ERROR calls
Turbostat: use sizeof for the buffer sier of s*printf
Turbostat: better error handling for get/read_msr
Turbostat: Refactor migrate CPU before get_MSR
In two out of three "get_msr" calls, there is a CPU migration, which
does not seem to be used by something else (in one case, it was used by
the rdtsc call).
Move the migrate call directly into the open_msr function
In two out of three "get_msr" calls, there is a CPU migration, which
does not seem to be used by something else (in one case, it was used by
the rdtsc call).
Move the migrate call directly into the open_msr function
Turbostat set_temperature_target: get msr from the correct cpu
Turbostat: Only open msr once in get_counters
Turbostat: use MSR_IA32_TSC instead of rdtsc
Turbostat: reorder checks: start with 'uid == 0 ?'
Turbostat: refactor cpu probing
Reorganization and rewriting of the cpu-probing code:
- Only support genuine_intel CPUs
- Remove variables that are always expected to be true
- Make supported pkg/core cstates more comprehensive
- Simplify rafl code (remove unused warning feature: intervals too long)
Reorganization and rewriting of the cpu-probing code:
- Only support genuine_intel CPUs
- Remove variables that are always expected to be true
- Make supported pkg/core cstates more comprehensive
- Simplify rafl code (remove unused warning feature: intervals too long)
Turbostat: remove unused variable has_epb
Turbostat: remove has_aperf
We refuse to run if it's not true, so let's just assume it is
We refuse to run if it's not true, so let's just assume it is
Turbostat: Remove has_invariant_tsc
We refuse to run if it's not true, so let's just assume it is
We refuse to run if it's not true, so let's just assume it is
Turbostat: remove 'units' variable, only used once
Turbostat: remove unused show_* variables
Turbostat: Explain why _GNU_SOURCE is required
Turbostat: Don't manage 'Interval' manually, already done by collectd
Turbostat: specify parse_int_file format
Turbostat: replace sprintf with ssnprintf from common.h
Turbostat: expand __must_check macro and remove it
Turbostat: replace stdbool.h with C99 _Bool
Turbostat: Emphasize the origin of the code
Turbostat: Don't include msr-index.h, use standard header
Turbostat: Rename instance type "pc%02d" to "pkg%02d"
Turbostat: make DO_OR_GOTO_ERR look like a function
Signed-off-by: Nicolas Iooss <nicolas.iooss_git@polytechnique.org>
[git@lerya.net: Ported from other git, changed commit name]
Signed-off-by: Vincent Brillault <git@lerya.net>
Signed-off-by: Nicolas Iooss <nicolas.iooss_git@polytechnique.org>
[git@lerya.net: Ported from other git, changed commit name]
Signed-off-by: Vincent Brillault <git@lerya.net>
Turbostat plugin: refactor function declarations
- Remove horrible STATIC_MUST_CHECK macro
- Define __must_check __attribute__((warn_unused_result))
- Refactor function declaration: type only on first line
- Remove horrible STATIC_MUST_CHECK macro
- Define __must_check __attribute__((warn_unused_result))
- Refactor function declaration: type only on first line
Include turbostat plugin during compilation
Add sources for new turbostat plugin
snmp plugin: add hostname to "csnmp_instance_list_add" error message
Fixes #939
Fixes #939
Merge branch 'collectd-5.4'
Conflicts:
src/Makefile.am
src/write_http.c
Conflicts:
src/Makefile.am
src/write_http.c
Merge branch 'collectd-5.3' into collectd-5.4
Merge branch 'collectd-4.10' into collectd-5.3
Conflicts:
src/collectd.conf.pod
Conflicts:
src/collectd.conf.pod
Merge pull request #890 from trenkel/master
Fix compiler warnings with Python3.
Fix compiler warnings with Python3.
perl plugin: plugins are linked with *_LIBADD and LIBS not *_LIBS and LIBS
Conflicts:
src/Makefile.am
Conflicts:
src/Makefile.am
libperl's ldopts include libaries and therefore should go in LIBS not LDFLAGS
Without this configure fails compile its libperl test program because
-lperl comes before the test program on the compiler command line.
Conflicts:
src/Makefile.am
Without this configure fails compile its libperl test program because
-lperl comes before the test program on the compiler command line.
Conflicts:
src/Makefile.am
Merge pull request #390 from radford/libperl-ldopts
libperl's ldopts include libaries and therefore should go in LIBS not LDFLAGS
libperl's ldopts include libaries and therefore should go in LIBS not LDFLAGS
modbus: rename register types once more
As I was looking over my config files again, ModbusRegisterType
kind of stuck out like a sore thumb.
Modbus does talk about "read holding" and "read input" as "commands";
perhaps renaming it as this patch does is more intuitive, so that all
of the Modbus register configurations start with Register.
I'm not wedded to it, but if you like it & agree, here you go.
Thanks,
-Eric
As I was looking over my config files again, ModbusRegisterType
kind of stuck out like a sore thumb.
Modbus does talk about "read holding" and "read input" as "commands";
perhaps renaming it as this patch does is more intuitive, so that all
of the Modbus register configurations start with Register.
I'm not wedded to it, but if you like it & agree, here you go.
Thanks,
-Eric
Merge pull request #908 from vincentbernat/fix/libstatgrab4
libstatgrab: fix detection of libstatgrab >= 0.90
libstatgrab: fix detection of libstatgrab >= 0.90
Merge pull request #902 from mfournier/write_http-node-blocks
write_http: deprecate <URL> blocks in favor of <Node>
write_http: deprecate <URL> blocks in favor of <Node>
Merge pull request #899 from mfournier/write_http-multiple-destionations
write_http: make callback names context-dependent
write_http: make callback names context-dependent
RPM specfile: doc clarification
ipmi: use SIGIO instead of SIGUSR2 to avoid conflict with JVM
Java uses SIGUSR2 to suspend/resume threads. The OpenIPMI plugins also
need a signal to resume its event loop when setting a timer. They can't
both use the same signal. We ask OpenIPMI to use SIGIO instead.
This should fix #114.
Java uses SIGUSR2 to suspend/resume threads. The OpenIPMI plugins also
need a signal to resume its event loop when setting a timer. They can't
both use the same signal. We ask OpenIPMI to use SIGIO instead.
This should fix #114.
write_kafka plugin: Topic property not being set
Merge pull request #910 from vincentbernat/fix/ipmi-dont-use-sigusr2
ipmi: use SIGIO instead of SIGUSR2 to avoid conflict with JVM
ipmi: use SIGIO instead of SIGUSR2 to avoid conflict with JVM
ipmi: use SIGIO instead of SIGUSR2 to avoid conflict with JVM
Java uses SIGUSR2 to suspend/resume threads. The OpenIPMI plugins also
need a signal to resume its event loop when setting a timer. They can't
both use the same signal. We ask OpenIPMI to use SIGIO instead.
This should fix #114.
Java uses SIGUSR2 to suspend/resume threads. The OpenIPMI plugins also
need a signal to resume its event loop when setting a timer. They can't
both use the same signal. We ask OpenIPMI to use SIGIO instead.
This should fix #114.
Merge pull request #906 from obazoud/patch-1
Wording automake
Wording automake
added doc CollectStatistics to section rrdcached
Fixes #907
Conflicts:
src/collectd.conf.pod
Fixes #907
Conflicts:
src/collectd.conf.pod
mysql: document defaults to boolean config options
libstatgrab: fix detection of libstatgrab >= 0.90
Ensure linking is done after compilation of the test program, otherwise
symbols cannot be found. `LDFLAGS` and `CFLAGS` are placed before the
test program on gcc command line while `LIBS` is placed after. Even if
in our case, `LDFLAGS` also contain the lib, being put before the
program while the linking phase is done with the same command leads to
`sg_init()` never found which is misinterpreted as requiring an
argument.
Ensure linking is done after compilation of the test program, otherwise
symbols cannot be found. `LDFLAGS` and `CFLAGS` are placed before the
test program on gcc command line while `LIBS` is placed after. Even if
in our case, `LDFLAGS` also contain the lib, being put before the
program while the linking phase is done with the same command leads to
`sg_init()` never found which is misinterpreted as requiring an
argument.
Wording automake
write_http: consistent multi-instance support
This makes the plugin use `<Node>` blocks liks most other write plugins,
while maintaining backwards compatibility with `<URL>` blocks.
It's a follow up to #899, which was merely a fix for the release
branches.
This makes the plugin use `<Node>` blocks liks most other write plugins,
while maintaining backwards compatibility with `<URL>` blocks.
It's a follow up to #899, which was merely a fix for the release
branches.
write_http: make callback names context-dependent
This allows multiple destinations to work again (fixes #821), using the
same logic as other write plugins.
The callback name would now be something like:
`write_http/http://example.com/endpoint`
which is not very nice.
The next step would be to change this plugin to use `<Node>` blocks
like many others, and pass the URL as a parameter inside each instance
block. So I see this patch as the minimum required to let 5.3 and 5.4
users use this plugin with multiple destinations.
Conflicts:
src/write_http.c
This allows multiple destinations to work again (fixes #821), using the
same logic as other write plugins.
The callback name would now be something like:
`write_http/http://example.com/endpoint`
which is not very nice.
The next step would be to change this plugin to use `<Node>` blocks
like many others, and pass the URL as a parameter inside each instance
block. So I see this patch as the minimum required to let 5.3 and 5.4
users use this plugin with multiple destinations.
Conflicts:
src/write_http.c
write_http: make callback names context-dependent
This allows multiple destinations to work again (fixes #821), using the
same logic as other write plugins.
The callback name would now be something like:
`write_http/http://example.com/endpoint`
which is not very nice.
The next step would be to change this plugin to use `<Node>` blocks
like many others, and pass the URL as a parameter inside each instance
block. So I see this patch as the minimum required to let 5.3 and 5.4
users use this plugin with multiple destinations.
This allows multiple destinations to work again (fixes #821), using the
same logic as other write plugins.
The callback name would now be something like:
`write_http/http://example.com/endpoint`
which is not very nice.
The next step would be to change this plugin to use `<Node>` blocks
like many others, and pass the URL as a parameter inside each instance
block. So I see this patch as the minimum required to let 5.3 and 5.4
users use this plugin with multiple destinations.
ensure all curl-based plugins follow HTTP redirects
For the sake of consistency.
For the sake of consistency.
add Modbus/RTU support to modbus plugin
This allows access to a local RS-485 serial port
via the modbus plugin by specifying i.e.
Device "/dev/ttyUSB0"
Baudrate 38400
in a <Host> block.
For now it assumes 8N1; adding another config option
to support other configurations could be done later.
Lightly tested on my local setup.
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
This allows access to a local RS-485 serial port
via the modbus plugin by specifying i.e.
Device "/dev/ttyUSB0"
Baudrate 38400
in a <Host> block.
For now it assumes 8N1; adding another config option
to support other configurations could be done later.
Lightly tested on my local setup.
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
RPM specfile: misc improvements related to perl files
Avoids installing some files in two different packages & locations. Also
avoid unnecessary dependencies on -perl and -contrib packages.
Supersedes #896.
Thanks to @faxm0dem for helping work things out !
Avoids installing some files in two different packages & locations. Also
avoid unnecessary dependencies on -perl and -contrib packages.
Supersedes #896.
Thanks to @faxm0dem for helping work things out !