summaryrefslogtreecommitdiffstats
path: root/src/proc_interrupts.c
diff options
context:
space:
mode:
authorFederico Ceratto <federico.ceratto@gmail.com>2016-11-23 15:49:14 +0000
committerFederico Ceratto <federico.ceratto@gmail.com>2016-11-23 15:49:14 +0000
commit68141d9dac0c08e51d257feef16a79086dd8a2df (patch)
treef4a0f5d31ed2194b5991130754b297b9c8c076e6 /src/proc_interrupts.c
parentRelease v. 1.3.0+dfsg-1 to Unstable (diff)
parentNew upstream version 1.4.0+dfsg (diff)
downloadnetdata-68141d9dac0c08e51d257feef16a79086dd8a2df.tar.xz
netdata-68141d9dac0c08e51d257feef16a79086dd8a2df.zip
Merge tag 'upstream/1.4.0+dfsg'
Upstream version 1.4.0+dfsg
Diffstat (limited to 'src/proc_interrupts.c')
-rw-r--r--src/proc_interrupts.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/proc_interrupts.c b/src/proc_interrupts.c
index fe0e9b1a5..f277a5a90 100644
--- a/src/proc_interrupts.c
+++ b/src/proc_interrupts.c
@@ -21,8 +21,7 @@ static inline struct interrupt *get_interrupts_array(int lines, int cpus) {
static struct interrupt *irrs = NULL;
static int allocated = 0;
- if(lines < allocated) return irrs;
- else {
+ if(lines > allocated) {
irrs = (struct interrupt *)reallocz(irrs, lines * recordsize(cpus));
allocated = lines;
}
@@ -143,15 +142,14 @@ int do_proc_interrupts(int update_every, unsigned long long dt) {
int c;
for(c = 0; c < cpus ; c++) {
- char id[256+1];
- snprintfz(id, 256, "cpu%d_interrupts", c);
+ char id[50+1];
+ snprintfz(id, 50, "cpu%d_interrupts", c);
st = rrdset_find_bytype("cpu", id);
if(!st) {
- char name[256+1], title[256+1];
- snprintfz(name, 256, "cpu%d_interrupts", c);
- snprintfz(title, 256, "CPU%d Interrupts", c);
- st = rrdset_create("cpu", id, name, "interrupts", "cpu.interrupts", title, "interrupts/s", 2000 + c, update_every, RRDSET_TYPE_STACKED);
+ char title[100+1];
+ snprintfz(title, 100, "CPU%d Interrupts", c);
+ st = rrdset_create("cpu", id, NULL, "interrupts", "cpu.interrupts", title, "interrupts/s", 1100 + c, update_every, RRDSET_TYPE_STACKED);
for(l = 0; l < lines ;l++) {
struct interrupt *irr = irrindex(irrs, l, cpus);