[collectd] [PATCH] Also display values with COLLECT_DEBUG
Solofo.Ramangalahy at bull.net
Solofo.Ramangalahy at bull.net
Thu Nov 25 12:25:05 CET 2010
Allows to also display offending values when compiling with
COLLECT_DEBUG enabled. Ease diagnostic.
---
src/plugin.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
Index: collectd-4.10.1/src/plugin.c
===================================================================
--- collectd-4.10.1.orig/src/plugin.c
+++ collectd-4.10.1/src/plugin.c
@@ -1393,26 +1393,26 @@ int plugin_dispatch_values (value_list_t
vl->plugin, vl->plugin_instance,
vl->type, vl->type_instance);
-#if COLLECT_DEBUG
- assert (0 == strcmp (ds->type, vl->type));
-#else
if (0 != strcmp (ds->type, vl->type))
+ {
WARNING ("plugin_dispatch_values: (ds->type = %s) != (vl->type = %s)",
ds->type, vl->type);
+#if COLLECT_DEBUG
+ assert (0);
#endif
+ }
-#if COLLECT_DEBUG
- assert (ds->ds_num == vl->values_len);
-#else
if (ds->ds_num != vl->values_len)
{
ERROR ("plugin_dispatch_values: ds->type = %s: "
"(ds->ds_num = %i) != "
"(vl->values_len = %i)",
ds->type, ds->ds_num, vl->values_len);
+#if COLLECT_DEBUG
+ assert (0);
+#endif
return (-1);
}
-#endif
escape_slashes (vl->host, sizeof (vl->host));
escape_slashes (vl->plugin, sizeof (vl->plugin));
More information about the collectd
mailing list