diff options
73 files changed, 677 insertions, 676 deletions
diff --git a/aclk/aclk.c b/aclk/aclk.c index 4e21b87983..6cdb79dc28 100644 --- a/aclk/aclk.c +++ b/aclk/aclk.c @@ -110,7 +110,7 @@ static int load_private_key() netdata_log_error("Claimed agent cannot establish ACLK - unable to load private key '%s' failed.", filename); return 1; } - debug(D_ACLK, "Claimed agent loaded private key len=%ld bytes", bytes_read); + netdata_log_debug(D_ACLK, "Claimed agent loaded private key len=%ld bytes", bytes_read); BIO *key_bio = BIO_new_mem_buf(private_key, -1); if (key_bio==NULL) { @@ -240,7 +240,7 @@ void aclk_mqtt_wss_log_cb(mqtt_wss_log_type_t log_type, const char* str) netdata_log_info("%s", str); return; case MQTT_WSS_LOG_DEBUG: - debug(D_ACLK, "%s", str); + netdata_log_debug(D_ACLK, "%s", str); return; default: netdata_log_error("Unknown log type from mqtt_wss"); @@ -252,7 +252,7 @@ static void msg_callback(const char *topic, const void *msg, size_t msglen, int UNUSED(qos); aclk_rcvd_cloud_msgs++; - debug(D_ACLK, "Got Message From Broker Topic \"%s\" QOS %d", topic, qos); + netdata_log_debug(D_ACLK, "Got Message From Broker Topic \"%s\" QOS %d", topic, qos); if (aclk_shared_state.mqtt_shutdown_msg_id > 0) { netdata_log_error("Link is shutting down. Ignoring incoming message."); diff --git a/aclk/aclk_query.c b/aclk/aclk_query.c index a63bf3dc1b..9c14b9f39e 100644 --- a/aclk/aclk_query.c +++ b/aclk/aclk_query.c @@ -286,10 +286,10 @@ static void aclk_query_process_msg(struct aclk_query_thread *query_thr, aclk_que worker_is_busy(query->type); if (query->type == HTTP_API_V2) { - debug(D_ACLK, "Processing Queued Message of type: \"http_api_request_v2\""); + netdata_log_debug(D_ACLK, "Processing Queued Message of type: \"http_api_request_v2\""); http_api_v2(query_thr, query); } else { - debug(D_ACLK, "Processing Queued Message of type: \"%s\"", query->data.bin_payload.msg_name); + netdata_log_debug(D_ACLK, "Processing Queued Message of type: \"%s\"", query->data.bin_payload.msg_name); send_bin_msg(query_thr, query); } diff --git a/aclk/aclk_rx_msgs.c b/aclk/aclk_rx_msgs.c index 82b6252964..8167bf67b4 100644 --- a/aclk/aclk_rx_msgs.c +++ b/aclk/aclk_rx_msgs.c @@ -180,7 +180,7 @@ int aclk_handle_cloud_cmd_message(char *payload) return 1; } - debug(D_ACLK, "ACLK incoming 'cmd' message (%s)", payload); + netdata_log_debug(D_ACLK, "ACLK incoming 'cmd' message (%s)", payload); int rc = json_parse(payload, &cloud_to_agent, cloud_to_agent_parse); @@ -250,7 +250,7 @@ int create_node_instance_result(const char *msg, size_t msg_len) return 1; } - debug(D_ACLK, "CreateNodeInstanceResult: guid:%s nodeid:%s", res.machine_guid, res.node_id); + netdata_log_debug(D_ACLK, "CreateNodeInstanceResult: guid:%s nodeid:%s", res.machine_guid, res.node_id); uuid_t host_id, node_id; if (uuid_parse(res.machine_guid, host_id)) { @@ -529,7 +529,7 @@ void aclk_handle_new_cloud_msg(const char *message_type, const char *msg, size_t ACLK_STATS_UNLOCK; } new_cloud_rx_msg_t *msg_descriptor = find_rx_handler_by_hash(simple_hash(message_type)); - debug(D_ACLK, "Got message named '%s' from cloud", message_type); + netdata_log_debug(D_ACLK, "Got message named '%s' from cloud", message_type); if (unlikely(!msg_descriptor)) { netdata_log_error("Do not know how to handle message of type '%s'. Ignoring", message_type); if (aclk_stats_enabled) { diff --git a/aclk/aclk_util.c b/aclk/aclk_util.c index da81664770..00920e0690 100644 --- a/aclk/aclk_util.c +++ b/aclk/aclk_util.c @@ -219,7 +219,7 @@ static int topic_cache_add_topic(struct json_object *json, struct aclk_topic *to } topic->topic_id = topic_name_to_id(json_object_get_string(json_object_iter_peek_value(&it))); if (topic->topic_id == ACLK_TOPICID_UNKNOWN) { - debug(D_ACLK, "topic dictionary has unknown topic name \"%s\"", json_object_get_string(json_object_iter_peek_value(&it))); + netdata_log_debug(D_ACLK, "topic dictionary has unknown topic name \"%s\"", json_object_get_string(json_object_iter_peek_value(&it))); } json_object_iter_next(&it); continue; diff --git a/collectors/cgroups.plugin/sys_fs_cgroup.c b/collectors/cgroups.plugin/sys_fs_cgroup.c index d9049b2fab..fb805e63ce 100644 --- a/collectors/cgroups.plugin/sys_fs_cgroup.c +++ b/collectors/cgroups.plugin/sys_fs_cgroup.c @@ -427,10 +427,12 @@ void read_cgroup_plugin_configuration() { //TODO: can there be more than 1 cgroup2 mount point? mi = mountinfo_find_by_filesystem_super_option(root, "cgroup2", "rw"); //there is no cgroup2 specific super option - for now use 'rw' option - if(mi) debug(D_CGROUP, "found unified cgroup root using super options, with path: '%s'", mi->mount_point); + if(mi) + netdata_log_debug(D_CGROUP, "found unified cgroup root using super options, with path: '%s'", mi->mount_point); if(!mi) { mi = mountinfo_find_by_filesystem_mount_source(root, "cgroup2", "cgroup"); - if(mi) debug(D_CGROUP, "found unified cgroup root using mountsource info, with path: '%s'", mi->mount_point); + if(mi) + netdata_log_debug(D_CGROUP, "found unified cgroup root using mountsource info, with path: '%s'", mi->mount_point); } if(!mi) { collector_error("CGROUP: cannot find cgroup2 mountinfo. Assuming default: /sys/fs/cgroup"); @@ -439,7 +441,7 @@ void read_cgroup_plugin_configuration() { else s = mi->mount_point; set_cgroup_base_path(filename, s); cgroup_unified_base = config_get("plugin:cgroups", "path to unified cgroups", filename); - debug(D_CGROUP, "using cgroup root: '%s'", cgroup_unified_base); + netdata_log_debug(D_CGROUP, "using cgroup root: '%s'", cgroup_unified_base); } cgroup_root_max = (int)config_get_number("plugin:cgroups", "max cgroups to allow", cgroup_root_max); @@ -982,13 +984,13 @@ static int k8s_get_container_first_proc_comm(const char *id, char *comm) { ff = procfile_reopen(ff, filename, NULL, CGROUP_PROCFILE_FLAG); if (unlikely(!ff)) { - debug(D_CGROUP, "CGROUP: k8s_is_pause_container(): cannot open file '%s'.", filename); + netdata_log_debug(D_CGROUP, "CGROUP: k8s_is_pause_container(): cannot open file '%s'.", filename); return 1; } ff = procfile_readall(ff); if (unlikely(!ff)) { - debug(D_CGROUP, "CGROUP: k8s_is_pause_container(): cannot read file '%s'.", filename); + netdata_log_debug(D_CGROUP, "CGROUP: k8s_is_pause_container(): cannot read file '%s'.", filename); return 1; } @@ -1006,13 +1008,13 @@ static int k8s_get_container_first_proc_comm(const char *id, char *comm) { ff = procfile_reopen(ff, filename, NULL, PROCFILE_FLAG_DEFAULT); if (unlikely(!ff)) { - debug(D_CGROUP, "CGROUP: k8s_is_pause_container(): cannot open file '%s'.", filename); + netdata_log_debug(D_CGROUP, "CGROUP: k8s_is_pause_container(): cannot open file '%s'.", filename); return 1; } ff = procfile_readall(ff); if (unlikely(!ff)) { - debug(D_CGROUP, "CGROUP: k8s_is_pause_container(): cannot read file '%s'.", filename); + netdata_log_debug(D_CGROUP, "CGROUP: k8s_is_pause_container(): cannot read file '%s'.", filename); return 1; } @@ -1612,7 +1614,7 @@ memory_next: } static inline void read_cgroup(struct cgroup *cg) { - debug(D_CGROUP, "reading metrics for cgroups '%s'", cg->id); + netdata_log_debug(D_CGROUP, "reading metrics for cgroups '%s'", cg->id); if(!(cg->options & CGROUP_OPTIONS_IS_UNIFIED)) { cgroup_read_cpuacct_stat(&cg->cpuacct_stat); cgroup_read_cpuacct_usage(&cg->cpuacct_usage); @@ -1640,7 +1642,7 @@ static inline void read_cgroup(struct cgroup *cg) { } static inline void read_all_discovered_cgroups(struct cgroup *root) { - debug(D_CGROUP, "reading metrics for all cgroups"); + netdata_log_debug(D_CGROUP, "reading metrics for all cgroups"); struct cgroup *cg; for (cg = root; cg; cg = cg->next) { @@ -1655,7 +1657,7 @@ static inline void read_all_discovered_cgroups(struct cgroup *root) { #define CGROUP_NETWORK_INTERFACE_MAX_LINE 2048 static inline void read_cgroup_network_interfaces(struct cgroup *cg) { - debug(D_CGROUP, "looking for the network interfaces of cgroup '%s' with chart id '%s' and title '%s'", cg->id, cg->chart_id, cg->chart_title); + netdata_log_debug(D_CGROUP, "looking for the network interfaces of cgroup '%s' with chart id '%s' and title '%s'", cg->id, cg->chart_id, cg->chart_title); pid_t cgroup_pid; char cgroup_identifier[CGROUP_NETWORK_INTERFACE_MAX_LINE + 1]; @@ -1667,7 +1669,7 @@ static inline void read_cgroup_network_interfaces(struct cgroup *cg) { snprintfz(cgroup_identifier, CGROUP_NETWORK_INTERFACE_MAX_LINE, "%s%s", cgroup_unified_base, cg->id); } - debug(D_CGROUP, "executing cgroup_identifier %s --cgroup '%s' for cgroup '%s'", cgroups_network_interface_script, cgroup_identifier, cg->id); + netdata_log_debug(D_CGROUP, "executing cgroup_identifier %s --cgroup '%s' for cgroup '%s'", cgroups_network_interface_script, cgroup_identifier, cg->id); FILE *fp_child_input, *fp_child_output; (void)netdata_popen_raw_default_flags_and_environment(&cgroup_pid, &fp_child_input, &fp_child_output, cgroups_network_interface_script, "--cgroup", cgroup_identifier); if(!fp_child_output) { @@ -1713,7 +1715,7 @@ static inline void read_cgroup_network_interfaces(struct cgroup *cg) { } netdata_pclose(fp_child_input, fp_child_output, cgroup_pid); - // debug(D_CGROUP, "closed cgroup_identifier for cgroup '%s'", cg->id); + // netdata_log_debug(D_CGROUP, "closed cgroup_identifier for cgroup '%s'", cg->id); } static inline void free_cgroup_network_interfaces(struct cgroup *cg) { @@ -1793,7 +1795,7 @@ static inline void free_pressure(struct pressure *res) { } static inline void cgroup_free(struct cgroup *cg) { - debug(D_CGROUP, "Removing cgroup '%s' with chart id '%s' (was %s and %s)", cg->id, cg->chart_id, (cg->enabled)?"enabled":"disabled", (cg->available)?"available":"not available"); + netdata_log_debug(D_CGROUP, "Removing cgroup '%s' with chart id '%s' (was %s and %s)", cg->id, cg->chart_id, (cg->enabled)?"enabled":"disabled", (cg->available)?"available":"not available"); if(cg->st_cpu) rrdset_is_obsolete(cg->st_cpu); if(cg->st_cpu_limit) rrdset_is_obsolete(cg->st_cpu_limit); @@ -1870,8 +1872,8 @@ static inline void discovery_rename_cgroup(struct cgroup *cg) { } cg->pending_renames--; - debug(D_CGROUP, "looking for the name of cgroup '%s' with chart id '%s' and title '%s'", cg->id, cg->chart_id, cg->chart_title); - debug(D_CGROUP, "executing command %s \"%s\" for cgroup '%s'", cgroups_rename_script, cg->intermediate_id, cg->chart_id); + netdata_log_debug(D_CGROUP, "looking for the name of cgroup '%s' with chart id '%s' and title '%s'", cg->id, cg->chart_id, cg->chart_title); + netdata_log_debug(D_CGROUP, "executing command %s \"%s\" for cgroup '%s'", cgroups_rename_script, cg->intermediate_id, cg->chart_id); pid_t cgroup_pid; FILE *fp_child_input, *fp_child_output; @@ -1984,7 +1986,7 @@ static inline void convert_cgroup_to_systemd_service(struct cgroup *cg) { } static inline struct cgroup *discovery_cgroup_add(const char *id) { - debug(D_CGROUP, "adding to list, cgroup with id '%s'", id); + netdata_log_debug(D_CGROUP, "adding to list, cgroup with id '%s'", id); struct cgroup *cg = callocz(1, sizeof(struct cgroup)); cg->id = strdupz(id); @@ -2011,7 +2013,7 @@ static inline struct cgroup *discovery_cgroup_add(const char *id) { } static inline struct cgroup *discovery_cgroup_find(const char *id) { - debug(D_CGROUP, "searching for cgroup '%s'", id); + netdata_log_debug(D_CGROUP, "searching for cgroup '%s'", id); uint32_t hash = simple_hash(id); @@ -2021,7 +2023,7 @@ static inline struct cgroup *discovery_cgroup_find(const char *id) { break; } - debug(D_CGROUP, "cgroup '%s' %s in memory", id, (cg)?"found":"not found"); + netdata_log_debug(D_CGROUP, "cgroup '%s' %s in memory", id, (cg)?"found":"not found"); return cg; } @@ -2029,7 +2031,7 @@ static inline void discovery_find_cgroup_in_dir_callback(const char *dir) { if (!dir || !*dir) { dir = "/"; } - debug(D_CGROUP, "examining cgroup dir '%s'", dir); + netdata_log_debug(D_CGROUP, "examining cgroup dir '%s'", dir); struct cgroup *cg = discovery_cgroup_find(dir); if (cg) { @@ -2058,7 +2060,7 @@ static inline void discovery_find_cgroup_in_dir_callback(const char *dir) { static inline int discovery_find_dir_in_subdirs(const char *base, const char *this, void (*callback)(const char *)) { if(!this) this = base; - debug(D_CGROUP, "searching for directories in '%s' (base '%s')", this?this:"", base); + netdata_log_debug(D_CGROUP, "searching for directories in '%s' (base '%s')", this?this:"", base); size_t dirlen = strlen(this), baselen = strlen(base); @@ -2112,7 +2114,7 @@ static inline int discovery_find_dir_in_subdirs(const char *base, const char *th } static inline void discovery_mark_all_cgroups_as_unavailable() { - debug(D_CGROUP, "marking all cgroups as not available"); + netdata_log_debug(D_CGROUP, "marking all cgroups as not available"); struct cgroup *cg; for (cg = discovered_cgroup_root; cg; cg = cg->discovered_next) { cg->available = 0; @@ -2126,7 +2128,7 @@ static inline void discovery_update_filenames() { if(unlikely(!cg->available || !cg->enabled || cg->pending_renames)) continue; - debug(D_CGROUP, "checking paths for cgroup '%s'", cg->id); + netdata_log_debug(D_CGROUP, "checking paths for cgroup '%s'", cg->id); // check for newly added cgroups // and update the filenames they read @@ -2143,10 +2145,10 @@ static inline void discovery_update_filenames() { cg->filename_cpu_cfs_period = strdupz(filename); snprintfz(filename, FILENAME_MAX, "%s%s/cpu.cfs_quota_us", cgroup_cpuacct_base, cg->id); cg->filename_cpu_cfs_quota = strdupz(filename); - debug(D_CGROUP, "cpuacct.stat filename for cgroup '%s': '%s'", cg->id, cg->cpuacct_stat.filename); + netdata_log_debug(D_CGROUP, "cpuacct.stat filename for cgroup '%s': '%s'", cg->id, cg->cpuacct_stat.filename); } else - debug(D_CGROUP, "cpuacct.stat file for cgroup '%s': '%s' does not exist.", cg->id, filename); + netdata_log_debug(D_CGROUP, "cpuacct.stat file for cgroup '%s': '%s' does not exist.", cg->id, filename); } if(unlikely(cgroup_enable_cpuacct_usage && !cg->cpuacct_usage.filename && !is_cgroup_systemd_service(cg))) { @@ -2154,20 +2156,20 @@ static inline void discovery_update_filenames() { if(likely(stat(filename, &buf) != -1)) { cg->cpuacct_usage.filename = strdupz(filename); cg->cpuacct_usage.enabled = cgroup_enable_cpuacct_usage; - debug(D_CGROUP, "cpuacct.usage_percpu filename for cgroup '%s': '%s'", cg->id, cg->cpuacct_usage.filename); + netdata_log_debug(D_CGROUP, "cpuacct.usage_percpu filename for cgroup '%s': '%s'", cg->id, cg->cpuacct_usage.filename); } else - debug(D_CGROUP, "cpuacct.usage_percpu file for cgroup '%s': '%s' does not exist.", cg->id, filename); + netdata_log_debug(D_CGROUP, "cpuacct.usage_percpu file for cgroup '%s': '%s' does not exist.", cg->id, filename); } if(unlikely(cgroup_enable_cpuacct_cpu_throttling && !cg->cpuacct_cpu_throttling.filename && !is_cgroup_systemd_service(cg))) { snprintfz(filename, FILENAME_MAX, "%s%s/cpu.stat", cgroup_cpuacct_base, cg->id); if(likely(stat(filename, &buf) != -1)) { cg->cpuacct_cpu_throttling.filename = strdupz(filename); cg->cpuacct_cpu_throttling.enabled = cgroup_enable_cpuacct_cpu_throttling; - debug(D_CGROUP, "cpu.stat filename for cgroup '%s': '%s'", cg->id, cg->cpuacct_cpu_throttling.filename); + netdata_log_debug(D_CGROUP, "cpu.stat filename for cgroup '%s': '%s'", cg->id, cg->cpuacct_cpu_throttling.filename); } else - debug(D_CGROUP, "cpu.stat file for cgroup '%s': '%s' does not exist.", cg->id, filename); + netdata_log_debug(D_CGROUP, "cpu.stat file for cgroup '%s': '%s' does not exist.", cg->id, filename); } if (unlikely( cgroup_enable_cpuacct_cpu_shares && !cg->cpuacct_cpu_shares.filename && @@ -2176,10 +2178,10 @@ static inline void discovery_update_filenames() { if (likely(stat(filename, &buf) != -1)) { cg->cpuacct_cpu_shares.filename = strdupz(filename); cg->cpuacct_cpu_shares.enabled = cgroup_enable_cpuacct_cpu_shares; - debug( + netdata_log_debug( D_CGROUP, "cpu.shares filename for cgroup '%s': '%s'", cg->id, cg->cpuacct_cpu_shares.filename); } else - debug(D_CGROUP, "cpu.shares file for cgroup '%s': '%s' does not exist.", cg->id, filename); + netdata_log_debug(D_CGROUP, "cpu.shares file for cgroup '%s': '%s' does not exist.", cg->id, filename); } if(unlikely((cgroup_enable_detailed_memory || cgroup_used_memory) && !cg->memory.filename_detailed && (cgroup_used_memory || cgroup_enable_systemd_services_detailed_memory || !is_cgroup_systemd_service(cg)))) { @@ -2187,10 +2189,10 @@ static inline void discovery_update_filenames() { if(likely(stat(filename, &buf) != -1)) { cg->memory.filename_detailed = strdupz(filename); cg->memory.enabled_detailed = (cgroup_enable_detailed_memory == CONFIG_BOOLEAN_YES)?CONFIG_BOOLEAN_YES:CONFIG_BOOLEAN_AUTO; - debug(D_CGROUP, "memory.stat filename for cgroup '%s': '%s'", cg->id, cg->memory.filename_detailed); + netdata_log_debug(D_CGROUP, "memory.stat filename for cgroup '%s': '%s'", cg->id, cg->memory.filename_detailed); } else - debug(D_CGROUP, "memory.stat file for cgroup '%s': '%s' does not exist.", cg->id, filename); + netdata_log_debug(D_CGROUP, "memory.stat file for cgroup '%s': '%s' does not exist.", cg->id, filename); } if(unlikely(cgroup_enable_memory && !cg->memory.filename_usage_in_bytes)) { @@ -2198,12 +2200,12 @@ static inline void discovery_update_filenames() { if(likely(stat(filename, &buf) != -1)) {< |