diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-07-20 04:50:01 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-07-20 04:50:01 +0000 |
commit | cd4377fab21e0f500bef7f06543fa848a039c1e0 (patch) | |
tree | ba00a55e430c052d6bed0b61c0f8bbe8ebedd313 /collectors/debugfs.plugin | |
parent | Releasing debian version 1.40.1-1. (diff) | |
download | netdata-cd4377fab21e0f500bef7f06543fa848a039c1e0.tar.xz netdata-cd4377fab21e0f500bef7f06543fa848a039c1e0.zip |
Merging upstream version 1.41.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'collectors/debugfs.plugin')
-rw-r--r-- | collectors/debugfs.plugin/debugfs_plugin.c | 14 | ||||
-rw-r--r-- | collectors/debugfs.plugin/debugfs_zswap.c | 4 | ||||
-rw-r--r-- | collectors/debugfs.plugin/multi_metadata.yaml | 233 |
3 files changed, 242 insertions, 9 deletions
diff --git a/collectors/debugfs.plugin/debugfs_plugin.c b/collectors/debugfs.plugin/debugfs_plugin.c index 9713be320..1c5bf106e 100644 --- a/collectors/debugfs.plugin/debugfs_plugin.c +++ b/collectors/debugfs.plugin/debugfs_plugin.c @@ -30,18 +30,18 @@ static int debugfs_check_capabilities() { cap_t caps = cap_get_proc(); if (!caps) { - error("Cannot get current capabilities."); + netdata_log_error("Cannot get current capabilities."); return 0; } int ret = 1; cap_flag_value_t cfv = CAP_CLEAR; if (cap_get_flag(caps, CAP_DAC_READ_SEARCH, CAP_EFFECTIVE, &cfv) == -1) { - error("Cannot find if CAP_DAC_READ_SEARCH is effective."); + netdata_log_error("Cannot find if CAP_DAC_READ_SEARCH is effective."); ret = 0; } else { if (cfv != CAP_SET) { - error("debugfs.plugin should run with CAP_DAC_READ_SEARCH."); + netdata_log_error("debugfs.plugin should run with CAP_DAC_READ_SEARCH."); ret = 0; } } @@ -176,7 +176,7 @@ int main(int argc, char **argv) stock_config_dir = getenv("NETDATA_STOCK_CONFIG_DIR"); if (stock_config_dir == NULL) { - // info("NETDATA_CONFIG_DIR is not passed from netdata"); + // netdata_log_info("NETDATA_CONFIG_DIR is not passed from netdata"); stock_config_dir = LIBCONFIG_DIR; } @@ -186,7 +186,7 @@ int main(int argc, char **argv) if (!debugfs_check_capabilities() && !debugfs_am_i_running_as_root() && !debugfs_check_sys_permission()) { uid_t uid = getuid(), euid = geteuid(); #ifdef HAVE_CAPABILITY - error( + netdata_log_error( "debugfs.plugin should either run as root (now running with uid %u, euid %u) or have special capabilities. " "Without these, debugfs.plugin cannot access /sys/kernel/debug. " "To enable capabilities run: sudo setcap cap_dac_read_search,cap_sys_ptrace+ep %s; " @@ -197,7 +197,7 @@ int main(int argc, char **argv) argv[0], argv[0]); #else - error( + netdata_log_error( "debugfs.plugin should either run as root (now running with uid %u, euid %u) or have special capabilities. " "Without these, debugfs.plugin cannot access /sys/kernel/debug." "Your system does not support capabilities. " @@ -235,7 +235,7 @@ int main(int argc, char **argv) enabled++; } if (!enabled) { - info("all modules are disabled, exiting..."); + netdata_log_info("all modules are disabled, exiting..."); return 1; } } diff --git a/collectors/debugfs.plugin/debugfs_zswap.c b/collectors/debugfs.plugin/debugfs_zswap.c index a2991b9f1..c8fc0f030 100644 --- a/collectors/debugfs.plugin/debugfs_zswap.c +++ b/collectors/debugfs.plugin/debugfs_zswap.c @@ -251,7 +251,7 @@ int zswap_collect_data(struct netdata_zswap_metric *metric) snprintfz(filename, FILENAME_MAX, "%s%s", netdata_configured_host_prefix, metric->filename); if (read_single_number_file(filename, (unsigned long long *)&metric->value)) { - error("Cannot read file %s", filename); + netdata_log_error("Cannot read file %s", filename); return 1; } @@ -383,7 +383,7 @@ int do_debugfs_zswap(int update_every, const char *name) static int check_if_enabled = 1; if (likely(check_if_enabled && debugfs_is_zswap_enabled())) { - info("Zswap is disabled"); + netdata_log_info("Zswap is disabled"); return 1; } diff --git a/collectors/debugfs.plugin/multi_metadata.yaml b/collectors/debugfs.plugin/multi_metadata.yaml new file mode 100644 index 000000000..652aff7a7 --- /dev/null +++ b/collectors/debugfs.plugin/multi_metadata.yaml @@ -0,0 +1,233 @@ +name: debugfs.plugin +modules: + - meta: + plugin_name: debugfs.plugin + module_name: /sys/kernel/debug/extfrag + monitored_instance: + name: debugfs /sys/kernel/debug/extfrag + link: '' + categories: [] + icon_filename: '' + related_resources: + integrations: + list: [] + info_provided_to_referring_integrations: + description: '' + keywords: [] + most_popular: false + overview: + data_collection: + metrics_description: '' + method_description: '' + supported_platforms: + include: [] + exclude: [] + multi-instance: true + additional_permissions: + description: '' + default_behavior: + auto_detection: + description: '' + limits: + description: '' + performance_impact: + description: '' + setup: + prerequisites: + list: [] + configuration: + file: + name: '' + description: '' + options: + description: '' + folding: + title: '' + enabled: true + list: [] + examples: + folding: + enabled: true + title: '' + list: [] + troubleshooting: + problems: + list: [] + alerts: [] + metrics: + folding: + title: Metrics + enabled: false + description: "" + availability: [] + scopes: + - name: node + description: "" + labels: + - name: numa_node + description: TBD + metrics: + - name: mem.fragmentation_index_dma + description: Memory fragmentation index for each order + unit: "index" + chart_type: line + dimensions: + - name: order0 + - name: order1 + - name: order2 + - name: order3 + - name: order4 + - name: order5 + - name: order6 + - name: order7 + - name: order8 + - name: order9 + - name: order10 + - name: mem.fragmentation_index_dma32 + description: Memory fragmentation index for each order + unit: "index" + chart_type: line + dimensions: + - name: order0 + - name: order1 + - name: order2 + - name: order3 + - name: order4 + - name: order5 + - name: order6 + - name: order7 + - name: order8 + - name: order9 + - name: order10 + - name: mem.fragmentation_index_normal + description: Memory fragmentation index for each order + unit: "index" + chart_type: line + dimensions: + - name: order0 + - name: order1 + - name: order2 + - name: order3 + - name: order4 + - name: order5 + - name: order6 + - name: order7 + - name: order8 + - name: order9 + - name: order10 + - meta: + plugin_name: debugfs.plugin + module_name: /sys/kernel/debug/zswap + monitored_instance: + name: debugfs /sys/kernel/debug/zswap + link: '' + categories: [] + icon_filename: '' + related_resources: + integrations: + list: [] + info_provided_to_referring_integrations: + description: '' + keywords: [] + most_popular: false + overview: + data_collection: + metrics_description: '' + method_description: '' + supported_platforms: + include: [] + exclude: [] + multi-instance: true + additional_permissions: + description: '' + default_behavior: + auto_detection: + description: '' + limits: + description: '' + performance_impact: + description: '' + setup: + prerequisites: + list: [] + configuration: + file: + name: '' + description: '' + options: + description: '' + folding: + title: '' + enabled: true + list: [] + examples: + folding: + enabled: true + title: '' + list: [] + troubleshooting: + problems: + list: [] + alerts: [] + metrics: + folding: + title: Metrics + enabled: false + description: "" + availability: [] + scopes: + - name: global + description: "" + labels: [] + metrics: + - name: system.zswap_pool_compression_ratio + description: Zswap compression ratio + unit: "ratio" + chart_type: line + dimensions: + - name: compression_ratio + - name: system.zswap_pool_compressed_size + description: Zswap compressed bytes currently stored + unit: "bytes" + chart_type: area + dimensions: + - name: compressed_size + - name: system.zswap_pool_raw_size + description: Zswap uncompressed bytes currently stored + unit: "bytes" + chart_type: area + dimensions: + - name: uncompressed_size + - name: system.zswap_rejections + description: Zswap rejections + unit: "rejections/s" + chart_type: stacked + dimensions: + - name: compress_poor + - name: kmemcache_fail + - name: alloc_fail + - name: reclaim_fail + - name: system.zswap_pool_limit_hit + description: Zswap pool limit was reached + unit: "events/s" + chart_type: line + dimensions: + - name: limit + - name: system.zswap_written_back_raw_bytes + description: Zswap uncomressed bytes written back when pool limit was reached + unit: "bytes/s" + chart_type: area + dimensions: + - name: written_back + - name: system.zswap_same_filled_raw_size + description: Zswap same-value filled uncompressed bytes currently stored + unit: "bytes" + chart_type: area + dimensions: + - name: same_filled + - name: system.zswap_duplicate_entry + description: Zswap duplicate store was encountered + unit: "entries/s" + chart_type: line + dimensions: + - name: duplicate |