Ruben Kerkhof [Wed, 20 Feb 2019 12:25:00 +0000 (13:25 +0100)]
intel_rdt plugin: fix compiler warnings
make[1]: Entering directory '/home/ruben/src/collectd'
CC src/intel_rdt_la-intel_rdt.lo
src/intel_rdt.c: In function ‘rdt_dump_cgroups’:
src/intel_rdt.c:74:23: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
74 | for (int j = 0; j < cgroup->num_cores; j++) {
| ^
src/intel_rdt.c: In function ‘rdt_dump_data’:
src/intel_rdt.c:103:21: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
103 | for (int i = 0; i < g_rdt->num_groups; i++) {
| ^
CCLD intel_rdt.la
Ruben Kerkhof [Wed, 20 Feb 2019 11:06:27 +0000 (12:06 +0100)]
oauth.c: fix compiler warning
make[1]: Entering directory '/home/ruben/src/collectd'
CC src/utils/oauth/liboauth_la-oauth.lo
src/utils/oauth/oauth.c: In function ‘get_assertion’:
src/utils/oauth/oauth.c:283:19: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
283 | else if (status >= buffer_size)
| ^~
Ruben Kerkhof [Wed, 20 Feb 2019 10:22:30 +0000 (11:22 +0100)]
turbostat plugin: fix two compiler warnings
src/turbostat.c:1466:5: warning: no previous prototype for function 'save_affinity' [-Wmissing-prototypes]
int save_affinity(void) {
^
src/turbostat.c:1479:6: warning: no previous prototype for function 'restore_affinity' [-Wmissing-prototypes]
void restore_affinity(void) {
^
Ruben Kerkhof [Wed, 20 Feb 2019 10:19:16 +0000 (11:19 +0100)]
ovs_stats plugin: fix compiler warning
src/ovs_stats.c:863:23: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < YAJL_GET_ARRAY(ifaces_list)->len; i++) {
~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
Ruben Kerkhof [Tue, 19 Feb 2019 17:53:19 +0000 (18:53 +0100)]
sensu plugin: fix compiler warning when build with --enable-debug
In file included from src/write_sensu.c:31:
src/write_sensu.c: In function ‘sensu_config’:
./src/daemon/plugin.h:398:20: warning: ‘%s’ directive argument is null [-Wformat-overflow=]
398 | #define DEBUG(...) plugin_log(LOG_DEBUG, __VA_ARGS__)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/write_sensu.c:1227:7: note: in expansion of macro ‘DEBUG’
1227 | DEBUG("write_sensu plugin: Got tag: %s", tmp);
| ^~~~~
src/write_sensu.c:1227:43: note: format string is defined here
1227 | DEBUG("write_sensu plugin: Got tag: %s", tmp);
|
Ruben Kerkhof [Tue, 19 Feb 2019 17:27:46 +0000 (18:27 +0100)]
Don't hide errors when creating manpage
Apparently the default behaviour for pod2man changed at some point and
now it exits with a syntax error instead of exiting successfully with a
<POD ERRORS> section.
Now we do display the syntax issue:
[ruben@localhost collectd]$ make -j
POD2MAN src/collectd.conf.5
src/collectd.conf.pod around line 10361: You forgot a '=back' before '=head2'
POD document had syntax errors at /usr/bin/pod2man line 69.
make: *** [Makefile:9641: src/collectd.conf.5] Error 255
Ruben Kerkhof [Tue, 19 Feb 2019 10:58:26 +0000 (11:58 +0100)]
Reduce the nr of allocations when parsing types.db
We allocate a number of times for each line in types.db.
Since plugin_register_dataset() makes a copy of the dataset anyway, we
can create the dataset on the stack instead of the heap.
This reduces the number of calloc calls on my system from 624 to 337
when running collectd -T with the default types.db.
Ruben Kerkhof [Tue, 19 Feb 2019 09:57:03 +0000 (10:57 +0100)]
lua plugin: cleanup properly when shutting down
Found while running collectd -T under valgrind:
==25971== 75 (64 direct, 11 indirect) bytes in 1 blocks are definitely lost in loss record 154 of 274
==25971== at 0x483AB1A: calloc (vg_replace_malloc.c:762)
==25971== by 0x4854009: lua_cb_register_read (lua.c:288)
==25971== by 0x4FBE886: ???
==25971== by 0x4FD4900: ???
==25971== by 0x4FBEAD7: ???
==25971== by 0x4FBEB04: ???
==25971== by 0x4FBDF16: ???
==25971== by 0x4FBEE5E: ???
==25971== by 0x4FB53ED: ???
==25971== by 0x48536E7: lua_script_load (lua.c:465)
==25971== by 0x485387E: lua_config_script (lua.c:532)
==25971== by 0x485395E: lua_config (lua.c:557)
Ruben Kerkhof [Fri, 14 Dec 2018 16:27:44 +0000 (17:27 +0100)]
libcollectdclient: fix gcc warning
make[1]: Entering directory '/home/ruben/src/collectd'
CC src/libcollectdclient/libcollectdclient_la-network_parse.lo
In function ‘parse_string’,
inlined from ‘parse_identifier’ at src/libcollectdclient/network_parse.c:169:7,
inlined from ‘network_parse.constprop’ at src/libcollectdclient/network_parse.c:540:11:
src/libcollectdclient/network_parse.c:161:3: warning: ‘strncpy’ specified bound 64 equals destination size [-Wstringop-truncation]
strncpy(out, in, out_size);
^~~~~~~~~~~~~~~~~~~~~~~~~~