From: Kevin Bowling Date: Mon, 4 Apr 2016 09:11:33 +0000 (-0700) Subject: Move submit_io_time outside of KERNEL_LINUX X-Git-Tag: collectd-5.6.0~363^2~1 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3f2ebfa21898364fcb67d889127d4b10341ef742;p=collectd.git Move submit_io_time outside of KERNEL_LINUX --- diff --git a/src/disk.c b/src/disk.c index 85b23299..05a863fb 100644 --- a/src/disk.c +++ b/src/disk.c @@ -293,44 +293,44 @@ static void disk_submit (const char *plugin_instance, plugin_dispatch_values (&vl); } /* void disk_submit */ -#if KERNEL_LINUX -static void submit_in_progress (char const *disk_name, gauge_t in_progress) +static void submit_io_time (char const *plugin_instance, derive_t io_time, derive_t weighted_time) { - value_t v; + value_t values[2]; value_list_t vl = VALUE_LIST_INIT; - if (ignorelist_match (ignorelist, disk_name) != 0) + if (ignorelist_match (ignorelist, plugin_instance) != 0) return; - v.gauge = in_progress; + values[0].derive = io_time; + values[1].derive = weighted_time; - vl.values = &v; - vl.values_len = 1; + vl.values = values; + vl.values_len = 2; sstrncpy (vl.host, hostname_g, sizeof (vl.host)); sstrncpy (vl.plugin, "disk", sizeof (vl.plugin)); - sstrncpy (vl.plugin_instance, disk_name, sizeof (vl.plugin_instance)); - sstrncpy (vl.type, "pending_operations", sizeof (vl.type)); + sstrncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance)); + sstrncpy (vl.type, "disk_io_time", sizeof (vl.type)); plugin_dispatch_values (&vl); -} +} /* void submit_io_time */ -static void submit_io_time (char const *plugin_instance, derive_t io_time, derive_t weighted_time) +#if KERNEL_LINUX +static void submit_in_progress (char const *disk_name, gauge_t in_progress) { - value_t values[2]; + value_t v; value_list_t vl = VALUE_LIST_INIT; - if (ignorelist_match (ignorelist, plugin_instance) != 0) + if (ignorelist_match (ignorelist, disk_name) != 0) return; - values[0].derive = io_time; - values[1].derive = weighted_time; + v.gauge = in_progress; - vl.values = values; - vl.values_len = 2; + vl.values = &v; + vl.values_len = 1; sstrncpy (vl.host, hostname_g, sizeof (vl.host)); sstrncpy (vl.plugin, "disk", sizeof (vl.plugin)); - sstrncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance)); - sstrncpy (vl.type, "disk_io_time", sizeof (vl.type)); + sstrncpy (vl.plugin_instance, disk_name, sizeof (vl.plugin_instance)); + sstrncpy (vl.type, "pending_operations", sizeof (vl.type)); plugin_dispatch_values (&vl); }