diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-12-01 06:15:11 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-12-01 06:15:11 +0000 |
commit | 483926a283e118590da3f9ecfa75a8a4d62143ce (patch) | |
tree | cb77052778df9a128a8cd3ff5bf7645322a13bc5 /collectors/slabinfo.plugin | |
parent | Releasing debian version 1.31.0-4. (diff) | |
download | netdata-483926a283e118590da3f9ecfa75a8a4d62143ce.tar.xz netdata-483926a283e118590da3f9ecfa75a8a4d62143ce.zip |
Merging upstream version 1.32.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'collectors/slabinfo.plugin')
-rw-r--r-- | collectors/slabinfo.plugin/slabinfo.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/collectors/slabinfo.plugin/slabinfo.c b/collectors/slabinfo.plugin/slabinfo.c index 863f440e4..58d9c4fff 100644 --- a/collectors/slabinfo.plugin/slabinfo.c +++ b/collectors/slabinfo.plugin/slabinfo.c @@ -51,6 +51,8 @@ char *netdata_configured_host_prefix = ""; int running = 1; int debug = 0; +size_t lines_discovered = 0; +int redraw_chart = 0; // ---------------------------------------------------------------------------- @@ -187,6 +189,10 @@ struct slabinfo *read_file_slabinfo() { // Iterate on all lines to populate / update the slabinfo struct size_t lines = procfile_lines(ff), l; + if (unlikely(lines != lines_discovered)) { + lines_discovered = lines; + redraw_chart = 1; + } slabdebug(" Read %lu lines from procfile", (unsigned long)lines); for(l = 2; l < lines; l++) { @@ -254,7 +260,8 @@ unsigned int do_slab_stats(int update_every) { sactive = read_file_slabinfo(); // Init Charts - if (unlikely(loops == 0)) { + if (unlikely(redraw_chart)) { + redraw_chart = 0; // Memory Usage printf("CHART %s.%s '' 'Memory Usage' 'B' '%s' '' line %d %d %s\n" , CHART_TYPE |