version 1.1.1.2, 2014/07/30 07:55:27
|
version 1.1.1.3, 2019/10/21 14:58:35
|
Line 101 static void proc_read(void)
|
Line 101 static void proc_read(void)
|
{ |
{ |
struct element *e; |
struct element *e; |
FILE *fd; |
FILE *fd; |
char buf[512], *p, *s; | char buf[512], *p, *s, *unused __unused__; |
int w; |
int w; |
|
|
if (!(fd = fopen(c_path, "r"))) |
if (!(fd = fopen(c_path, "r"))) |
quit("Unable to open file %s: %s\n", c_path, strerror(errno)); |
quit("Unable to open file %s: %s\n", c_path, strerror(errno)); |
|
|
/* Ignore header */ |
/* Ignore header */ |
fgets(buf, sizeof(buf), fd); | unused = fgets(buf, sizeof(buf), fd); |
fgets(buf, sizeof(buf), fd); | unused = fgets(buf, sizeof(buf), fd); |
|
|
for (; fgets(buf, sizeof(buf), fd);) { |
for (; fgets(buf, sizeof(buf), fd);) { |
uint64_t data[NUM_PROC_VALUE][2]; |
uint64_t data[NUM_PROC_VALUE][2]; |
Line 151 static void proc_read(void)
|
Line 151 static void proc_read(void)
|
continue; |
continue; |
|
|
if (!(e = element_lookup(grp, p, 0, NULL, ELEMENT_CREAT))) |
if (!(e = element_lookup(grp, p, 0, NULL, ELEMENT_CREAT))) |
return; | goto skip; |
|
|
if (e->e_flags & ELEMENT_FLAG_CREATED) { |
if (e->e_flags & ELEMENT_FLAG_CREATED) { |
if (element_set_key_attr(e, "bytes", "packets") || |
if (element_set_key_attr(e, "bytes", "packets") || |
Line 171 static void proc_read(void)
|
Line 171 static void proc_read(void)
|
element_notify_update(e, NULL); |
element_notify_update(e, NULL); |
element_lifesign(e, 1); |
element_lifesign(e, 1); |
} |
} |
| skip: |
fclose(fd); |
fclose(fd); |
} |
} |
|
|