projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #3163 from rpv-tomsk/virt-1
[collectd.git]
/
src
/
irq.c
diff --git
a/src/irq.c
b/src/irq.c
index
371ba64
..
9156356
100644
(file)
--- a/
src/irq.c
+++ b/
src/irq.c
@@
-23,9
+23,9
@@
#include "collectd.h"
#include "collectd.h"
-#include "common.h"
#include "plugin.h"
#include "plugin.h"
-#include "utils_ignorelist.h"
+#include "utils/common/common.h"
+#include "utils/ignorelist/ignorelist.h"
#if !KERNEL_LINUX
#error "No applicable input method."
#if !KERNEL_LINUX
#error "No applicable input method."
@@
-37,7
+37,7
@@
static const char *config_keys[] = {"Irq", "IgnoreSelected"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
static const char *config_keys[] = {"Irq", "IgnoreSelected"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
-static ignorelist_t *ignorelist
= NULL
;
+static ignorelist_t *ignorelist;
/*
* Private functions
/*
* Private functions
@@
-54,10
+54,10
@@
static int irq_config(const char *key, const char *value) {
invert = 0;
ignorelist_set_invert(ignorelist, invert);
} else {
invert = 0;
ignorelist_set_invert(ignorelist, invert);
} else {
- return
(-1)
;
+ return
-1
;
}
}
- return
(0)
;
+ return
0
;
}
static void irq_submit(const char *irq_name, derive_t value) {
}
static void irq_submit(const char *irq_name, derive_t value) {
@@
-90,10
+90,8
@@
static int irq_read(void) {
*/
fh = fopen("/proc/interrupts", "r");
if (fh == NULL) {
*/
fh = fopen("/proc/interrupts", "r");
if (fh == NULL) {
- char errbuf[1024];
- ERROR("irq plugin: fopen (/proc/interrupts): %s",
- sstrerror(errno, errbuf, sizeof(errbuf)));
- return (-1);
+ ERROR("irq plugin: fopen (/proc/interrupts): %s", STRERRNO);
+ return -1;
}
/* Get CPU count from the first line */
}
/* Get CPU count from the first line */
@@
-103,7
+101,7
@@
static int irq_read(void) {
ERROR("irq plugin: unable to get CPU count from first line "
"of /proc/interrupts");
fclose(fh);
ERROR("irq plugin: unable to get CPU count from first line "
"of /proc/interrupts");
fclose(fh);
- return
(-1)
;
+ return
-1
;
}
while (fgets(buffer, sizeof(buffer), fh) != NULL) {
}
while (fgets(buffer, sizeof(buffer), fh) != NULL) {
@@
-140,7
+138,7
@@
static int irq_read(void) {
if (irq_name_len == 4 && (strncmp(irq_name, "FIQ:", 4) == 0))
continue;
if (irq_name_len == 4 && (strncmp(irq_name, "FIQ:", 4) == 0))
continue;
- irq_name[irq_name_len - 1] =
0
;
+ irq_name[irq_name_len - 1] =
'\0'
;
irq_name_len--;
irq_value = 0;
irq_name_len--;
irq_value = 0;
@@
-165,7
+163,7
@@
static int irq_read(void) {
fclose(fh);
fclose(fh);
- return
(0)
;
+ return
0
;
} /* int irq_read */
void module_register(void) {
} /* int irq_read */
void module_register(void) {