collectd.git
9 years agoascent: Add support for specifying a connection timeout
Marc Fournier [Sat, 4 Apr 2015 20:29:22 +0000 (22:29 +0200)]
ascent: Add support for specifying a connection timeout

9 years agonginx: Add support for specifying a connection timeout
Marc Fournier [Sat, 4 Apr 2015 20:28:47 +0000 (22:28 +0200)]
nginx: Add support for specifying a connection timeout

9 years agobind: Add support for specifying a connection timeout
Marc Fournier [Sat, 4 Apr 2015 20:27:53 +0000 (22:27 +0200)]
bind: Add support for specifying a connection timeout

9 years agoapache: Add support for specifying a connection timeout
Marc Fournier [Sat, 4 Apr 2015 20:26:34 +0000 (22:26 +0200)]
apache: Add support for specifying a connection timeout

9 years agocurl_xml: Add support for specifying a connection timeout
Marc Fournier [Sat, 4 Apr 2015 20:20:07 +0000 (22:20 +0200)]
curl_xml: Add support for specifying a connection timeout

9 years agocurl: adapt Timeout doc bits to new behaviour
Marc Fournier [Thu, 2 Apr 2015 16:29:05 +0000 (18:29 +0200)]
curl: adapt Timeout doc bits to new behaviour

Also clarify the ins and outs of stalled network connections regarding
threads consumption and add warning about timeouts and
MeasureResponseTime.

9 years agoMerge branch 'collectd-4.10' into collectd-5.3
Marc Fournier [Thu, 2 Apr 2015 21:05:23 +0000 (23:05 +0200)]
Merge branch 'collectd-4.10' into collectd-5.3

9 years agoFix type instance sanitization in bind plugin
Thomas Kho [Thu, 2 Apr 2015 17:14:24 +0000 (13:14 -0400)]
Fix type instance sanitization in bind plugin

9 years agocurl_json: allow Timeout to be set to 0
Marc Fournier [Thu, 2 Apr 2015 16:25:42 +0000 (18:25 +0200)]
curl_json: allow Timeout to be set to 0

also use the per-instance interval or plugin_get_interval() as the
default value, depending on which one is configured.

9 years agocurl: allow Timeout to be set to 0
Marc Fournier [Thu, 2 Apr 2015 16:21:52 +0000 (18:21 +0200)]
curl: allow Timeout to be set to 0

also use plugin_get_interval() rather than cf_get_default_interval() to
take per-plugin interval in account.

9 years agocurl_json: Add support for specifying a connection timeout
Jan Kundrát [Wed, 25 Mar 2015 17:06:50 +0000 (18:06 +0100)]
curl_json: Add support for specifying a connection timeout

There's apparently no need to init the config values in the `db` struct;
memset() is used earlier in the process. This patch doesn't change this
convention.

9 years agocurl: Add support for specifying a connection timeout
Jan Kundrát [Sat, 21 Feb 2015 15:12:27 +0000 (16:12 +0100)]
curl: Add support for specifying a connection timeout

9 years agobattery: do not report sysfs ENODEV failure
Peter Wu [Tue, 31 Mar 2015 21:17:32 +0000 (23:17 +0200)]
battery: do not report sysfs ENODEV failure

Linux reports ENODEV if the reported battery values are equal to
ACPI_BATTERY_VALUE_UNKNOWN. This can be observed for an unpatched Clevo
B7130 laptop while reading the "Battery Present Charge" attribute.

Since this is a non-fatal, non-recoverable event, do not report such
errors. Also change the error message to report the filename triggering
this error to ease hunting down the error.

9 years agobattery: report current if known
Peter Wu [Mon, 30 Mar 2015 16:48:06 +0000 (18:48 +0200)]
battery: report current if known

The power field is not always available (take my Clevo B7130 laptop for
example). The current is reported though via "current_now".

According to the ACPI spec v5.0, sect. 10.2.2.6 _BST (Battery Status),
the reported field is "battery present rate" which is always positive
(its direction depends on the charging state).

Contents of /sys/class/power_supply/BAT0/uevent for my laptop:

    POWER_SUPPLY_NAME=BAT0
    POWER_SUPPLY_STATUS=Discharging
    POWER_SUPPLY_PRESENT=1
    POWER_SUPPLY_TECHNOLOGY=Li-ion
    POWER_SUPPLY_CYCLE_COUNT=0
    POWER_SUPPLY_VOLTAGE_MIN_DESIGN=11100000
    POWER_SUPPLY_VOLTAGE_NOW=11824000
    POWER_SUPPLY_CURRENT_NOW=1498000
    POWER_SUPPLY_CHARGE_FULL_DESIGN=5200000
    POWER_SUPPLY_CHARGE_FULL=5280000
    POWER_SUPPLY_CHARGE_NOW=4797000
    POWER_SUPPLY_CAPACITY=90
    POWER_SUPPLY_CAPACITY_LEVEL=Normal
    POWER_SUPPLY_MODEL_NAME=BAT
    POWER_SUPPLY_MANUFACTURER=NOTEBOOK
    POWER_SUPPLY_SERIAL_NUMBER=0001

Note for Clevo B7130 owners, the charging rate is not reported when
discharging but this can be [patched][1].

 [1]: https://github.com/Lekensteyn/acpi-stuff/blob/master/Clevo-B7130/BatteryFix.dsl

9 years agowrite_http: add 2 new options to example config
Marc Fournier [Thu, 26 Mar 2015 21:03:29 +0000 (22:03 +0100)]
write_http: add 2 new options to example config

9 years agowrite_http: control rate using only one parameter
Marc Fournier [Thu, 26 Mar 2015 20:52:39 +0000 (21:52 +0100)]
write_http: control rate using only one parameter

- do not enable the feature with an on/off switch. Enable it by setting
  a positive value to the parameter instead. Therefore drop the
  arbitrary default value used previously.

- rename LowLimitBytesPerSec to LowSpeedLimit.

- make LowSpeedLimit refer to bytes per second rather than bytes per
  Interval.

9 years agowrite_http: adapt the behaviour of Timeout option
Marc Fournier [Wed, 25 Mar 2015 23:01:54 +0000 (00:01 +0100)]
write_http: adapt the behaviour of Timeout option

- rename PostTimeoutSec parameter to Timeout

- change Timeout to take milliseconds rather than seconds, for the sake
  of consistency: collectd allow working at the sub-second scale if need
  be, so it's a shame to restrain this here.

- do *not* set the default timeout to the value of Interval. Rationale:
  what matters here is that each POST request completes before the send
  buffer fills up again. How fast the send buffer fills up completely
  depends on how much data is collected. Interval is unrelated to this,
  and unlike read plugins, I don't think it makes a good value to use as
  the default timeout.

9 years agofix functions indentation and statuses initialization.
Fabrice A. Marie [Tue, 24 Mar 2015 08:43:13 +0000 (16:43 +0800)]
fix functions indentation and statuses initialization.

9 years agowrite_sensu cannot be endpoint/proxy.
Fabrice A. Marie [Tue, 24 Mar 2015 08:42:40 +0000 (16:42 +0800)]
write_sensu cannot be endpoint/proxy.

9 years agoMerge remote-tracking branch 'origin/pr/752' into wh_low_speed_limit
Marc Fournier [Tue, 24 Mar 2015 06:37:18 +0000 (07:37 +0100)]
Merge remote-tracking branch 'origin/pr/752' into wh_low_speed_limit

Conflicts:
src/write_http.c

Also slipped in a couple of conding-style consistentcy related changes.

9 years agoUpgrade spec to 5.4.2
Poil [Mon, 23 Mar 2015 10:18:56 +0000 (11:18 +0100)]
Upgrade spec to 5.4.2

9 years agoMerge branch 'collectd-5.3' into collectd-5.4
Marc Fournier [Tue, 24 Mar 2015 06:00:35 +0000 (07:00 +0100)]
Merge branch 'collectd-5.3' into collectd-5.4

Conflicts:
contrib/redhat/collectd.spec
src/collectd.conf.pod

9 years agoRPM specfile: bump version number
Marc Fournier [Tue, 24 Mar 2015 05:51:40 +0000 (06:51 +0100)]
RPM specfile: bump version number

Thanks to @Poil for pointing that out !

9 years agolog_logstash: adapt JSON format to logstash 1.2+
Marc Fournier [Tue, 17 Mar 2015 17:27:05 +0000 (18:27 +0100)]
log_logstash: adapt JSON format to logstash 1.2+

Fixes #974

9 years agowrite_sensu plugin to write datapoints and notification to sensu client TCP socket...
Fabrice A. Marie [Mon, 26 Jan 2015 09:43:23 +0000 (17:43 +0800)]
write_sensu plugin to write datapoints and notification to sensu client TCP socket. Inspired from write_riemann.

9 years agocollectd.conf(5): move misplaced block in postgresql section
Marc Fournier [Thu, 12 Mar 2015 20:02:32 +0000 (21:02 +0100)]
collectd.conf(5): move misplaced block in postgresql section

9 years agoRemove more references to the Globals option
Marc Fournier [Thu, 12 Mar 2015 17:47:52 +0000 (18:47 +0100)]
Remove more references to the Globals option

This is a follow up to commit 5eabeb9248

At this point, the last reference to Globals in the doc & examples is
the detailed explanation in collectd.conf(5).

9 years agoSetting Globals to true is not needed anymore
Ruben Kerkhof [Sun, 1 Mar 2015 14:04:55 +0000 (15:04 +0100)]
Setting Globals to true is not needed anymore

003c6e86b480 made this happen by default

9 years agoMerge branch 'collectd-5.4'
Marc Fournier [Thu, 12 Mar 2015 09:07:27 +0000 (10:07 +0100)]
Merge branch 'collectd-5.4'

Conflicts:
configure.ac
src/dbi.c
src/utils_latency.c

9 years agoRevert "add a conditional for the new dbi reentrant driver interface"
Marc Fournier [Thu, 12 Mar 2015 08:58:28 +0000 (09:58 +0100)]
Revert "add a conditional for the new dbi reentrant driver interface"

This reverts commit f1907a6d0775bc2ed9f2de79bd82b05e06e3e214.

With @pyr's acknowledgement, thanks !

Fixes #962

9 years agoMerge pull request #947 from mfournier/avoid_using_curlopt_userpwd
Marc Fournier [Wed, 11 Mar 2015 21:42:11 +0000 (22:42 +0100)]
Merge pull request #947 from mfournier/avoid_using_curlopt_userpwd

avoid using CURLOPT_USERPWD when possible

9 years agoamqp: add documentation bits for ConnectionRetryDelay feature
Marc Fournier [Wed, 11 Mar 2015 21:15:13 +0000 (22:15 +0100)]
amqp: add documentation bits for ConnectionRetryDelay feature

9 years agoamqp: disable reconnection delaying feature by default
Marc Fournier [Wed, 11 Mar 2015 21:12:16 +0000 (22:12 +0100)]
amqp: disable reconnection delaying feature by default

9 years agoamqp: coding-style consistency
Marc Fournier [Wed, 11 Mar 2015 21:11:15 +0000 (22:11 +0100)]
amqp: coding-style consistency

9 years agoAMQP connection failure leads collectd to use 100%CPU
Yoga Ramalingam [Fri, 31 Oct 2014 20:03:31 +0000 (16:03 -0400)]
AMQP connection failure leads collectd to use 100%CPU

Summary:
Issue : https://ipm.bloomberg.com/jira/browse/SS-103
Solution : When amqp connection fails, it retries for every message, added a fix to retry only after a delay. A new configuration "ConnectionRetryDelay"  has been introduced with default value as 60 seconds.

Test Plan:
1. Tested without the new configuration
2. Tested with the new configuration

In both the cases, verified connection is retried only after the delay and made sure collectd is not taking 100% cpu.

Reviewers: skhajamo

Reviewed By: skhajamo

CC: arcyd
Differential Revision: https://all.phab.dev.bloomberg.com/D149956

Conflicts:
src/amqp.c

9 years agoMerge pull request #965 from rubenk/powerdns-update-auth-stats
Marc Fournier [Tue, 10 Mar 2015 20:10:19 +0000 (21:10 +0100)]
Merge pull request #965 from rubenk/powerdns-update-auth-stats

powerdns: update plugin with stats for pdns 3.4.3

9 years agoMerge pull request #959 from rubenk/fix-ceph-plugin
Marc Fournier [Tue, 10 Mar 2015 18:43:23 +0000 (19:43 +0100)]
Merge pull request #959 from rubenk/fix-ceph-plugin

Ceph: do not define _BSD_SOURCE

9 years agowrite_tsdb plugin: Fix name generation even more.
Florian Forster [Tue, 10 Mar 2015 14:34:10 +0000 (15:34 +0100)]
write_tsdb plugin: Fix name generation even more.

There were more cases in which "type" or "type_instance" were omitted.

Fixes: #945

9 years agowrite_tsdb plugin: Add type and type_instance to the metric name in any case.
Dallin Young [Fri, 20 Feb 2015 18:33:00 +0000 (19:33 +0100)]
write_tsdb plugin: Add type and type_instance to the metric name in any case.

Previously, the generated names were wrong, especially when no
plugin instance was used for a metric.

Fixes: #945
Signed-off-by: Florian Forster <octo@collectd.org>
9 years agoMakefile.am: s/INCLUDES/AM_CPPFLAGS/
Florian Forster [Tue, 10 Mar 2015 14:13:59 +0000 (15:13 +0100)]
Makefile.am: s/INCLUDES/AM_CPPFLAGS/

Fixes the following warning:
  Makefile.am:5: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')

9 years agopowerdns: update plugin with stats for pdns 3.4.3
Ruben Kerkhof [Mon, 9 Mar 2015 21:31:52 +0000 (22:31 +0100)]
powerdns: update plugin with stats for pdns 3.4.3

9 years agowrite_mongodb plugin: Fix BSON memory handling even further.
Florian Forster [Mon, 9 Mar 2015 09:59:38 +0000 (10:59 +0100)]
write_mongodb plugin: Fix BSON memory handling even further.

According to the mongo-c-driver 0.8.1 documentation, each call to
bson_alloc() needs to be matched by a call to bson_dealloc() and each
call to bson_init() needs to be matched by a call to bson_destroy().

Additionally, this patch adds macros for mongo-c-driver < 0.8.0 to map
the new bson_alloc() and bson_deallow() names to the old bson_create()
and bson_dispose() symbol names.

Tested with mongo-c-driver 0.8.1 and 0.7.1.

Fixes: #331, #956

9 years agowrite_mongodb plugin: s/bson_dispose/bson_destroy/
Florian Forster [Mon, 9 Mar 2015 07:56:39 +0000 (08:56 +0100)]
write_mongodb plugin: s/bson_dispose/bson_destroy/

Thanks to @eremenko for providing the initial patch!

Fixes: #331, #956

9 years agoCeph: define _DEFAULT_SOURCE next to _BSD_SOURCE
Ruben Kerkhof [Wed, 4 Mar 2015 14:38:06 +0000 (15:38 +0100)]
Ceph: define _DEFAULT_SOURCE next to _BSD_SOURCE

Fixes:
make[3]: Entering directory '/home/ruben/src/collectd/src'
  CC       ceph_la-ceph.lo
In file included from /usr/include/stdio.h:27:0,
                 from ./daemon/collectd.h:34,
                 from ceph.c:26:
/usr/include/features.h:148:3: error: #warning "_BSD_SOURCE and
_SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Werror=cpp]
 # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use
 # _DEFAULT_SOURCE"
   ^
cc1: all warnings being treated as errors
Makefile:4120: recipe for target 'ceph_la-ceph.lo' failed
make[3]: *** [ceph_la-ceph.lo] Error 1
make[3]: Leaving directory '/home/ruben/src/collectd/src'
Makefile:5096: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/ruben/src/collectd/src'
Makefile:3142: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/ruben/src/collectd/src'
Makefile:551: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

9 years agoStatsd: avoid doing a division by zero when calculating the percentile with an empty...
Wilfried Goesgens [Tue, 29 Jul 2014 11:58:23 +0000 (13:58 +0200)]
Statsd: avoid doing a division by zero when calculating the percentile with an empty histogram.

9 years agoStatsd: avoid doing a division by zero when calculating the average if we didn't...
Wilfried Goesgens [Sat, 21 Jun 2014 19:14:28 +0000 (21:14 +0200)]
Statsd: avoid doing a division by zero when calculating the average if we didn't get any values.

9 years agoutils_latency: use portable format string
Marc Fournier [Tue, 27 Jan 2015 13:46:02 +0000 (14:46 +0100)]
utils_latency: use portable format string

9 years agostatsd histogram to support more than 1 second
Yoga Ramalingam [Fri, 14 Nov 2014 14:23:13 +0000 (09:23 -0500)]
statsd histogram to support more than 1 second

Summary:
Problem: Collectd/Statsd supports configurable percentiles for timers but it limits the value to be 1 to 1000ms. If the timer value is more than 1000ms, it uses for min, max, average,... and drops it for percentile computation.

Solution: Added support for increasing bin width when the value is above histogram's range.

Test Plan: Tested by sending metrics within range and out-of-range (ie above 1000 ms)

Reviewers: skhajamo, shalstea

Reviewed By: skhajamo

CC: arcyd
Differential Revision: https://all.phab.dev.bloomberg.com/D156454

9 years agoMerge pull request #838 from yogeswaran/histogram
Pierre-Yves Ritschard [Fri, 6 Mar 2015 07:30:38 +0000 (08:30 +0100)]
Merge pull request #838 from yogeswaran/histogram

statsd histogram to support more than 1 second

9 years agoconfigure: add liblvm2app to summary output
Marc Fournier [Tue, 3 Mar 2015 23:41:42 +0000 (00:41 +0100)]
configure: add liblvm2app to summary output

9 years agoMerge branch 'collectd-5.3' into collectd-5.4
Marc Fournier [Tue, 3 Mar 2015 23:39:09 +0000 (00:39 +0100)]
Merge branch 'collectd-5.3' into collectd-5.4

Conflicts:
configure.ac

9 years agoconfigure: add missing entries in summary output
Marc Fournier [Tue, 3 Mar 2015 23:29:58 +0000 (00:29 +0100)]
configure: add missing entries in summary output

... and reorder alphabetically.

9 years agoMerge pull request #951 from tokkee/sh/debian-patches
Marc Fournier [Tue, 3 Mar 2015 23:08:37 +0000 (00:08 +0100)]
Merge pull request #951 from tokkee/sh/debian-patches

plugin: Use strcasecmp rather than strncasecmp to find a plugin.

9 years agoMerge pull request #953 from rubenk/powerdns-do-not-look-past-the-end-of-array
Marc Fournier [Tue, 3 Mar 2015 22:59:38 +0000 (23:59 +0100)]
Merge pull request #953 from rubenk/powerdns-do-not-look-past-the-end-of-array

Powerdns plugin: fix logging on failed lookup

9 years agoPowerdns plugin: fix logging on failed lookup
Ruben Kerkhof [Sat, 28 Feb 2015 19:05:14 +0000 (20:05 +0100)]
Powerdns plugin: fix logging on failed lookup

Don't look past the end of the array but check the boundary first.

9 years agoMerge pull request #954 from rubenk/remove-outdated-advice
Marc Fournier [Tue, 3 Mar 2015 22:55:28 +0000 (23:55 +0100)]
Merge pull request #954 from rubenk/remove-outdated-advice

Setting Globals to true is not needed anymore

9 years agoSetting Globals to true is not needed anymore
Ruben Kerkhof [Sun, 1 Mar 2015 14:04:55 +0000 (15:04 +0100)]
Setting Globals to true is not needed anymore

003c6e86b480 made this happen by default

9 years agoclean.sh: take new 'src/daemon' dir in account
Marc Fournier [Tue, 3 Mar 2015 22:41:57 +0000 (23:41 +0100)]
clean.sh: take new 'src/daemon' dir in account

9 years agosnmp plugin: add hostname to "csnmp_value_list_to_value" error message
Sergey [Tue, 3 Mar 2015 21:36:03 +0000 (22:36 +0100)]
snmp plugin: add hostname to "csnmp_value_list_to_value" error message

Fixes #952

9 years agoRPM specfile: add ceph plugin
Marc Fournier [Mon, 24 Nov 2014 09:41:14 +0000 (10:41 +0100)]
RPM specfile: add ceph plugin

9 years agoREADME/AUTHORS: mention ceph plugin
Marc Fournier [Tue, 3 Mar 2015 20:54:58 +0000 (21:54 +0100)]
README/AUTHORS: mention ceph plugin

9 years agoMerge remote-tracking branch 'origin/pr/598'
Marc Fournier [Tue, 3 Mar 2015 20:36:21 +0000 (21:36 +0100)]
Merge remote-tracking branch 'origin/pr/598'

Conflicts:
src/collectd.conf.in
src/types.db

9 years agoRemove superfluous debug statements
daryder [Mon, 2 Mar 2015 14:33:01 +0000 (09:33 -0500)]
Remove superfluous debug statements

9 years agoSetting Globals to true is not needed anymore
Ruben Kerkhof [Sun, 1 Mar 2015 14:04:55 +0000 (15:04 +0100)]
Setting Globals to true is not needed anymore

003c6e86b480 made this happen by default

9 years agoPowerdns plugin: fix logging on failed lookup
Ruben Kerkhof [Sat, 28 Feb 2015 19:05:14 +0000 (20:05 +0100)]
Powerdns plugin: fix logging on failed lookup

Don't look past the end of the array but check the boundary first.

9 years agoTurbostat: adapt src/Makefile.am as per 4de560d2c
Vincent Brillault [Sat, 14 Feb 2015 08:08:55 +0000 (09:08 +0100)]
Turbostat: adapt src/Makefile.am as per 4de560d2c

9 years agoTurbostat: extend the configuration options
Vincent Brillault [Fri, 13 Feb 2015 20:04:27 +0000 (21:04 +0100)]
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

9 years agoTurbostat: simplify RAPL config and collection
Vincent Brillault [Fri, 13 Feb 2015 19:47:47 +0000 (20:47 +0100)]
Turbostat: simplify RAPL config and collection

There is no point configuring and collecting data which
is not submitted.

9 years agoTurbostat: relax dependency on invariant TSC
Vincent Brillault [Thu, 12 Feb 2015 20:33:40 +0000 (21:33 +0100)]
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.

9 years agoTurbostat: Add support for Broadwell (rapl part)
Vincent Brillault [Thu, 12 Feb 2015 20:06:24 +0000 (21:06 +0100)]
Turbostat: Add support for Broadwell (rapl part)

Partial backport of 4e8e863fed2e82278d29c6357de8251adb73acb9
from Len Brown <len.brown@intel.com>

Add comments on all models

9 years agoTurbostat: remove 'future' Silvermont models
Vincent Brillault [Thu, 12 Feb 2015 19:48:33 +0000 (20:48 +0100)]
Turbostat: remove 'future' Silvermont models

These models are not yet supported by upstream
Partial revert of 12bac3a7207cf264f41b69441454dbbbbad25782

9 years agoTurbostat: Add (back) sanity check
Vincent Brillault [Wed, 11 Feb 2015 21:06:45 +0000 (22:06 +0100)]
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

9 years agoTurbostat: frequency add Averange, rename Buzy
Vincent Brillault [Thu, 12 Feb 2015 18:50:29 +0000 (19:50 +0100)]
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.

9 years agoTurbostat plugin: relax dependency on root
Vincent Brillault [Wed, 11 Feb 2015 22:19:53 +0000 (23:19 +0100)]
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.

9 years agoTurbostat: re-order init tests
Vincent Brillault [Wed, 11 Feb 2015 22:00:05 +0000 (23:00 +0100)]
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.

9 years agoTurbostat: Set global variable to static
Vincent Brillault [Wed, 4 Feb 2015 20:53:49 +0000 (21:53 +0100)]
Turbostat: Set global variable to static

9 years agoTurbostat: Some reordering as per coding rules
Vincent Brillault [Wed, 4 Feb 2015 20:47:50 +0000 (21:47 +0100)]
Turbostat: Some reordering as per coding rules

9 years agoTurbostat: Use cdtime for time resolution
Vincent Brillault [Wed, 4 Feb 2015 20:09:12 +0000 (21:09 +0100)]
Turbostat: Use cdtime for time resolution

9 years agoTurbostat: Do not use error code, use error messages
Vincent Brillault [Thu, 25 Sep 2014 19:02:57 +0000 (21:02 +0200)]
Turbostat: Do not use error code, use error messages

9 years agoTurbostat: init_counter cannot fail anymore
Vincent Brillault [Thu, 25 Sep 2014 18:50:50 +0000 (20:50 +0200)]
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

9 years agoTurbostat: value_list_t.plugin_instance limit is DATA_MAX_NAME_LEN
Vincent Brillault [Tue, 23 Sep 2014 20:58:02 +0000 (22:58 +0200)]
Turbostat: value_list_t.plugin_instance limit is DATA_MAX_NAME_LEN

9 years agoTurbostat: add <Plugin /> example
Vincent Brillault [Tue, 23 Sep 2014 20:55:34 +0000 (22:55 +0200)]
Turbostat: add <Plugin /> example

9 years agoTurbostat: add configuration options in man page
Vincent Brillault [Tue, 23 Sep 2014 20:47:46 +0000 (22:47 +0200)]
Turbostat: add configuration options in man page

9 years agoTurbostat: check return value of vsnprintf
Vincent Brillault [Tue, 23 Sep 2014 20:28:52 +0000 (22:28 +0200)]
Turbostat: check return value of vsnprintf

9 years agoTurbostat: whitespace cleanup
Vincent Brillault [Tue, 23 Sep 2014 20:22:36 +0000 (22:22 +0200)]
Turbostat: whitespace cleanup

9 years agoTurbostat: enhance error/warning meesages
Vincent Brillault [Tue, 23 Sep 2014 20:20:05 +0000 (22:20 +0200)]
Turbostat: enhance error/warning meesages

9 years agoTurbostat: complex read register is now useless
Vincent Brillault [Tue, 23 Sep 2014 19:40:46 +0000 (21:40 +0200)]
Turbostat: complex read register is now useless

9 years agoTurbostat: remove superfluous function declaration
Vincent Brillault [Tue, 23 Sep 2014 19:38:34 +0000 (21:38 +0200)]
Turbostat: remove superfluous function declaration

9 years agoTurbostat: fix topology detection
Vincent Brillault [Sat, 20 Sep 2014 17:45:36 +0000 (19:45 +0200)]
Turbostat: fix topology detection

9 years agoTurbostat: fix allocate_cpu_set
Vincent Brillault [Sat, 20 Sep 2014 17:08:40 +0000 (19:08 +0200)]
Turbostat: fix allocate_cpu_set

9 years agoTurbostat: this code can fail in fact...
Vincent Brillault [Sat, 20 Sep 2014 16:49:57 +0000 (18:49 +0200)]
Turbostat: this code can fail in fact...

9 years agoTurbostat: last re-ordering of the module
Vincent Brillault [Sat, 20 Sep 2014 16:34:52 +0000 (18:34 +0200)]
Turbostat: last re-ordering of the module

9 years agoTurbostat: Refactor topology probing
Vincent Brillault [Sat, 20 Sep 2014 16:11:46 +0000 (18:11 +0200)]
Turbostat: Refactor topology probing

Only probe the topology once and store in locally

9 years agoTurbostat: Fix minor compilation warnings
Vincent Brillault [Sat, 20 Sep 2014 07:55:10 +0000 (09:55 +0200)]
Turbostat: Fix minor compilation warnings

9 years agoTurbostat: Re-order code and add comments
Vincent Brillault [Sat, 20 Sep 2014 07:30:47 +0000 (09:30 +0200)]
Turbostat: Re-order code and add comments

No algorithmic change in this commit

9 years agoTrubostat: Refactor delta functions
Vincent Brillault [Fri, 19 Sep 2014 20:59:45 +0000 (22:59 +0200)]
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

9 years agoturbostat: Backport 'Drop temperature checks'
Jean Delvare [Thu, 1 May 2014 09:40:19 +0000 (11:40 +0200)]
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>
9 years agoTurbostat: SNB & later support MSR_PKG_C2_RESIDENCY
Vincent Brillault [Sun, 24 Aug 2014 08:37:34 +0000 (10:37 +0200)]
Turbostat: SNB & later support MSR_PKG_C2_RESIDENCY

9 years agoTurbostat: add a missing fclose
Vincent Brillault [Sat, 23 Aug 2014 23:39:37 +0000 (01:39 +0200)]
Turbostat: add a missing fclose

9 years agoTurbostat: Adding some comments
Vincent Brillault [Sat, 23 Aug 2014 15:41:28 +0000 (17:41 +0200)]
Turbostat: Adding some comments