projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
virt.c modifications to bring it in accordance with "octo" comments
[collectd.git]
/
src
/
contextswitch.c
diff --git
a/src/contextswitch.c
b/src/contextswitch.c
index
d3e6fe6
..
834fbd7
100644
(file)
--- a/
src/contextswitch.c
+++ b/
src/contextswitch.c
@@
-22,6
+22,7
@@
**/
#include "collectd.h"
**/
#include "collectd.h"
+
#include "common.h"
#include "plugin.h"
#include "common.h"
#include "plugin.h"
@@
-48,14
+49,10
@@
static void cs_submit (derive_t context_switches)
{
static void cs_submit (derive_t context_switches)
{
- value_t values[1];
value_list_t vl = VALUE_LIST_INIT;
value_list_t vl = VALUE_LIST_INIT;
- values[0].derive = (derive_t) context_switches;
-
- vl.values = values;
+ vl.values = &(value_t) { .derive = context_switches };
vl.values_len = 1;
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "contextswitch", sizeof (vl.plugin));
sstrncpy (vl.type, "contextswitch", sizeof (vl.type));
sstrncpy (vl.plugin, "contextswitch", sizeof (vl.plugin));
sstrncpy (vl.type, "contextswitch", sizeof (vl.type));
@@
-133,7
+130,7
@@
static int cs_read (void)
perfstat_cpu_total_t perfcputotal;
status = perfstat_cpu_total(NULL, &perfcputotal, sizeof(perfstat_cpu_total_t), 1);
perfstat_cpu_total_t perfcputotal;
status = perfstat_cpu_total(NULL, &perfcputotal, sizeof(perfstat_cpu_total_t), 1);
- if (status < 0)
;
+ if (status < 0)
{
char errbuf[1024];
ERROR ("contextswitch plugin: perfstat_cpu_total: %s",
{
char errbuf[1024];
ERROR ("contextswitch plugin: perfstat_cpu_total: %s",
@@
-142,7
+139,7
@@
static int cs_read (void)
}
cs_submit(perfcputotal.pswitch);
}
cs_submit(perfcputotal.pswitch);
-
return (0)
;
+
status = 0
;
#endif /* defined(HAVE_PERFSTAT) */
return status;
#endif /* defined(HAVE_PERFSTAT) */
return status;