projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'collectd-5.8'
[collectd.git]
/
src
/
lpar.c
diff --git
a/src/lpar.c
b/src/lpar.c
index
c019227
..
c4189b7
100644
(file)
--- a/
src/lpar.c
+++ b/
src/lpar.c
@@
-61,10
+61,10
@@
static int lpar_config(const char *key, const char *value) {
else
report_by_serial = 0;
} else {
else
report_by_serial = 0;
} else {
- return
(-1)
;
+ return
-1
;
}
}
- return
(0)
;
+ return
0
;
} /* int lpar_config */
static int lpar_init(void) {
} /* int lpar_config */
static int lpar_init(void) {
@@
-76,10
+76,9
@@
static int lpar_init(void) {
sizeof(perfstat_partition_total_t),
/* number = */ 1 /* (must be 1) */);
if (status != 1) {
sizeof(perfstat_partition_total_t),
/* number = */ 1 /* (must be 1) */);
if (status != 1) {
- char errbuf[1024];
- ERROR("lpar plugin: perfstat_partition_total failed: %s (%i)",
- sstrerror(errno, errbuf, sizeof(errbuf)), status);
- return (-1);
+ ERROR("lpar plugin: perfstat_partition_total failed: %s (%i)", STRERRNO,
+ status);
+ return -1;
}
#if PERFSTAT_SUPPORTS_DONATION
}
#if PERFSTAT_SUPPORTS_DONATION
@@
-95,7
+94,7
@@
static int lpar_init(void) {
pool_stats = 0;
}
pool_stats = 0;
}
- return
(0)
;
+ return
0
;
} /* int lpar_init */
static void lpar_submit(const char *type_instance, double value) {
} /* int lpar_init */
static void lpar_submit(const char *type_instance, double value) {
@@
-128,7
+127,7
@@
static int lpar_read(void) {
from chassis to chassis through Live Partition Mobility (LPM). */
if (uname(&name) != 0) {
ERROR("lpar plugin: uname failed.");
from chassis to chassis through Live Partition Mobility (LPM). */
if (uname(&name) != 0) {
ERROR("lpar plugin: uname failed.");
- return
(-1)
;
+ return
-1
;
}
sstrncpy(serial, name.machine, sizeof(serial));
}
sstrncpy(serial, name.machine, sizeof(serial));
@@
-138,10
+137,9
@@
static int lpar_read(void) {
&lparstats, sizeof(perfstat_partition_total_t),
/* number = */ 1 /* (must be 1) */);
if (status != 1) {
&lparstats, sizeof(perfstat_partition_total_t),
/* number = */ 1 /* (must be 1) */);
if (status != 1) {
- char errbuf[1024];
- ERROR("lpar plugin: perfstat_partition_total failed: %s (%i)",
- sstrerror(errno, errbuf, sizeof(errbuf)), status);
- return (-1);
+ ERROR("lpar plugin: perfstat_partition_total failed: %s (%i)", STRERRNO,
+ status);
+ return -1;
}
/* Number of ticks since we last run. */
}
/* Number of ticks since we last run. */
@@
-149,7
+147,7
@@
static int lpar_read(void) {
if (ticks == 0) {
/* The stats have not been updated. Return now to avoid
* dividing by zero */
if (ticks == 0) {
/* The stats have not been updated. Return now to avoid
* dividing by zero */
- return
(0)
;
+ return
0
;
}
/*
}
/*
@@
-226,16
+224,16
@@
static int lpar_read(void) {
if (pool_busy_cpus < 0.0)
pool_busy_cpus = 0.0;
if (pool_busy_cpus < 0.0)
pool_busy_cpus = 0.0;
- s
s
nprintf(typinst, sizeof(typinst), "pool-%X-busy", lparstats.pool_id);
+ snprintf(typinst, sizeof(typinst), "pool-%X-busy", lparstats.pool_id);
lpar_submit(typinst, pool_busy_cpus);
lpar_submit(typinst, pool_busy_cpus);
- s
s
nprintf(typinst, sizeof(typinst), "pool-%X-idle", lparstats.pool_id);
+ snprintf(typinst, sizeof(typinst), "pool-%X-idle", lparstats.pool_id);
lpar_submit(typinst, pool_idle_cpus);
}
memcpy(&lparstats_old, &lparstats, sizeof(lparstats_old));
lpar_submit(typinst, pool_idle_cpus);
}
memcpy(&lparstats_old, &lparstats, sizeof(lparstats_old));
- return
(0)
;
+ return
0
;
} /* int lpar_read */
void module_register(void) {
} /* int lpar_read */
void module_register(void) {