diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-02-06 16:11:30 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-02-06 16:11:30 +0000 |
commit | aa2fe8ccbfcb117efa207d10229eeeac5d0f97c7 (patch) | |
tree | 941cbdd387b41c1a81587c20a6df9f0e5e0ff7ab /collectors/proc.plugin/sys_block_zram.c | |
parent | Adding upstream version 1.37.1. (diff) | |
download | netdata-aa2fe8ccbfcb117efa207d10229eeeac5d0f97c7.tar.xz netdata-aa2fe8ccbfcb117efa207d10229eeeac5d0f97c7.zip |
Adding upstream version 1.38.0.upstream/1.38.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'collectors/proc.plugin/sys_block_zram.c')
-rw-r--r-- | collectors/proc.plugin/sys_block_zram.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/collectors/proc.plugin/sys_block_zram.c b/collectors/proc.plugin/sys_block_zram.c index 6bae54243..1be725b10 100644 --- a/collectors/proc.plugin/sys_block_zram.c +++ b/collectors/proc.plugin/sys_block_zram.c @@ -144,17 +144,17 @@ static int init_devices(DICTIONARY *devices, unsigned int zram_id, int update_ev snprintfz(filename, FILENAME_MAX, "/dev/%s", de->d_name); if (unlikely(stat(filename, &st) != 0)) { - error("ZRAM : Unable to stat %s: %s", filename, strerror(errno)); + collector_error("ZRAM : Unable to stat %s: %s", filename, strerror(errno)); continue; } if (major(st.st_rdev) == zram_id) { - info("ZRAM : Found device %s", filename); + collector_info("ZRAM : Found device %s", filename); snprintfz(filename, FILENAME_MAX, "/sys/block/%s/mm_stat", de->d_name); ff = procfile_open(filename, " \t:", PROCFILE_FLAG_DEFAULT); if (ff == NULL) { - error("ZRAM : Failed to open %s: %s", filename, strerror(errno)); + collector_error("ZRAM : Failed to open %s: %s", filename, strerror(errno)); continue; } device.file = ff; @@ -170,7 +170,7 @@ static int init_devices(DICTIONARY *devices, unsigned int zram_id, int update_ev static void free_device(DICTIONARY *dict, const char *name) { ZRAM_DEVICE *d = (ZRAM_DEVICE*)dictionary_get(dict, name); - info("ZRAM : Disabling monitoring of device %s", name); + collector_info("ZRAM : Disabling monitoring of device %s", name); rrdset_obsolete_and_pointer_null(d->st_usage); rrdset_obsolete_and_pointer_null(d->st_savings); rrdset_obsolete_and_pointer_null(d->st_alloc_efficiency); @@ -252,7 +252,7 @@ int do_sys_block_zram(int update_every, usec_t dt) { ff = procfile_open("/proc/devices", " \t:", PROCFILE_FLAG_DEFAULT); if (ff == NULL) { - error("Cannot read /proc/devices"); + collector_error("Cannot read /proc/devices"); return 1; } ff = procfile_readall(ff); @@ -267,7 +267,7 @@ int do_sys_block_zram(int update_every, usec_t dt) { } procfile_close(ff); - devices = dictionary_create(DICT_OPTION_SINGLE_THREADED); + devices = dictionary_create_advanced(DICT_OPTION_SINGLE_THREADED, &dictionary_stats_category_collectors, 0); device_count = init_devices(devices, (unsigned int)zram_id, update_every); } |