Replace `info` macro with a less generic name (#15266)
Carlo Cabrera committed
Jul 1, 2023 at 05:14 UTC
5b56f09dbcfa159605268e731c02734486530507
100 files changed
+568
-568
aclk/aclk.c
+17
-17
@@ -154,7 +154,7 @@ biofailed:
154
155
static int wait_till_cloud_enabled()
156
{
157
- info("Waiting for Cloud to be enabled");
157
+ netdata_log_info("Waiting for Cloud to be enabled");
158
while (!netdata_cloud_enabled) {
159
sleep_usec(USEC_PER_SEC * 1);
160
if (!service_running(SERVICE_ACLK))
@@ -237,7 +237,7 @@ void aclk_mqtt_wss_log_cb(mqtt_wss_log_type_t log_type, const char* str)
237
error_report("%s", str);
238
return;
239
case MQTT_WSS_LOG_INFO:
240
- info("%s", str);
240
+ netdata_log_info("%s", str);
241
return;
242
case MQTT_WSS_LOG_DEBUG:
243
debug(D_ACLK, "%s", str);
@@ -297,7 +297,7 @@ static void puback_callback(uint16_t packet_id)
297
#endif
298
299
if (aclk_shared_state.mqtt_shutdown_msg_id == (int)packet_id) {
300
- info("Shutdown message has been acknowledged by the cloud. Exiting gracefully");
300
+ netdata_log_info("Shutdown message has been acknowledged by the cloud. Exiting gracefully");
301
aclk_shared_state.mqtt_shutdown_msg_rcvd = 1;
302
}
303
}
@@ -335,7 +335,7 @@ static int handle_connection(mqtt_wss_client client)
335
}
336
337
if (disconnect_req || aclk_kill_link) {
338
- info("Going to restart connection due to disconnect_req=%s (cloud req), aclk_kill_link=%s (reclaim)",
338
+ netdata_log_info("Going to restart connection due to disconnect_req=%s (cloud req), aclk_kill_link=%s (reclaim)",
339
disconnect_req ? "true" : "false",
340
aclk_kill_link ? "true" : "false");
341
disconnect_req = 0;
@@ -390,7 +390,7 @@ static inline void mqtt_connected_actions(mqtt_wss_client client)
390
391
void aclk_graceful_disconnect(mqtt_wss_client client)
392
{
393
- info("Preparing to gracefully shutdown ACLK connection");
393
+ netdata_log_info("Preparing to gracefully shutdown ACLK connection");
394
aclk_queue_lock();
395
aclk_queue_flush();
396
@@ -403,17 +403,17 @@ void aclk_graceful_disconnect(mqtt_wss_client client)
403
break;
404
}
405
if (aclk_shared_state.mqtt_shutdown_msg_rcvd) {
406
- info("MQTT App Layer `disconnect` message sent successfully");
406
+ netdata_log_info("MQTT App Layer `disconnect` message sent successfully");
407
break;
408
}
409
}
410
- info("ACLK link is down");
410
+ netdata_log_info("ACLK link is down");
411
log_access("ACLK DISCONNECTED");
412
aclk_stats_upd_online(0);
413
last_disconnect_time = now_realtime_sec();
414
aclk_connected = 0;
415
416
- info("Attempting to gracefully shutdown the MQTT/WSS connection");
416
+ netdata_log_info("Attempting to gracefully shutdown the MQTT/WSS connection");
417
mqtt_wss_disconnect(client, 1000);
418
}
419
@@ -455,7 +455,7 @@ static int aclk_block_till_recon_allowed() {
455
next_connection_attempt = now_realtime_sec() + (recon_delay / MSEC_PER_SEC);
456
last_backoff_value = (float)recon_delay / MSEC_PER_SEC;
457
458
- info("Wait before attempting to reconnect in %.3f seconds", recon_delay / (float)MSEC_PER_SEC);
458
+ netdata_log_info("Wait before attempting to reconnect in %.3f seconds", recon_delay / (float)MSEC_PER_SEC);
459
// we want to wake up from time to time to check netdata_exit
460
while (recon_delay)
461
{
@@ -593,7 +593,7 @@ static int aclk_attempt_to_connect(mqtt_wss_client client)
593
return 1;
594
}
595
596
- info("Attempting connection now");
596
+ netdata_log_info("Attempting connection now");
597
memset(&base_url, 0, sizeof(url_t));
598
if (url_parse(aclk_cloud_base_url, &base_url)) {
599
aclk_status = ACLK_STATUS_INVALID_CLOUD_URL;
@@ -680,7 +680,7 @@ static int aclk_attempt_to_connect(mqtt_wss_client client)
680
error_report("Can't use encoding=proto without at least \"proto\" capability.");
681
continue;
682
}
683
- info("New ACLK protobuf protocol negotiated successfully (/env response).");
683
+ netdata_log_info("New ACLK protobuf protocol negotiated successfully (/env response).");
684
685
memset(&auth_url, 0, sizeof(url_t));
686
if (url_parse(aclk_env->auth_endpoint, &auth_url)) {
@@ -750,7 +750,7 @@ static int aclk_attempt_to_connect(mqtt_wss_client client)
750
751
if (!ret) {
752
last_conn_time_mqtt = now_realtime_sec();
753
- info("ACLK connection successfully established");
753
+ netdata_log_info("ACLK connection successfully established");
754
aclk_status = ACLK_STATUS_CONNECTED;
755
log_access("ACLK CONNECTED");
756
mqtt_connected_actions(client);
@@ -798,7 +798,7 @@ void *aclk_main(void *ptr)
798
netdata_thread_disable_cancelability();
799
800
#if defined( DISABLE_CLOUD ) || !defined( ENABLE_ACLK )
801
- info("Killing ACLK thread -> cloud functionality has been disabled");
801
+ netdata_log_info("Killing ACLK thread -> cloud functionality has been disabled");
802
static_thread->enabled = NETDATA_MAIN_THREAD_EXITED;
803
return NULL;
804
#endif
@@ -924,7 +924,7 @@ void aclk_host_state_update(RRDHOST *host, int cmd)
924
rrdhost_aclk_state_unlock(localhost);
925
create_query->data.bin_payload.topic = ACLK_TOPICID_CREATE_NODE;
926
create_query->data.bin_payload.msg_name = "CreateNodeInstance";
927
- info("Registering host=%s, hops=%u", host->machine_guid, host->system_info->hops);
927
+ netdata_log_info("Registering host=%s, hops=%u", host->machine_guid, host->system_info->hops);
928
aclk_queue_query(create_query);
929
return;
930
}
@@ -947,7 +947,7 @@ void aclk_host_state_update(RRDHOST *host, int cmd)
947
query->data.bin_payload.payload = generate_node_instance_connection(&query->data.bin_payload.size, &node_state_update);
948
rrdhost_aclk_state_unlock(localhost);
949
950
- info("Queuing status update for node=%s, live=%d, hops=%u",(char*)node_state_update.node_id, cmd,
950
+ netdata_log_info("Queuing status update for node=%s, live=%d, hops=%u",(char*)node_state_update.node_id, cmd,
951
host->system_info->hops);
952
freez((void*)node_state_update.node_id);
953
query->data.bin_payload.msg_name = "UpdateNodeInstanceConnection";
@@ -990,7 +990,7 @@ void aclk_send_node_instances()
990
node_state_update.claim_id = localhost->aclk_state.claimed_id;
991
query->data.bin_payload.payload = generate_node_instance_connection(&query->data.bin_payload.size, &node_state_update);
992
rrdhost_aclk_state_unlock(localhost);
993
- info("Queuing status update for node=%s, live=%d, hops=%d",(char*)node_state_update.node_id,
993
+ netdata_log_info("Queuing status update for node=%s, live=%d, hops=%d",(char*)node_state_update.node_id,
994
list->live,
995
list->hops);
996
@@ -1014,7 +1014,7 @@ void aclk_send_node_instances()
1014
node_instance_creation.claim_id = localhost->aclk_state.claimed_id,
1015
create_query->data.bin_payload.payload = generate_node_instance_creation(&create_query->data.bin_payload.size, &node_instance_creation);
1016
rrdhost_aclk_state_unlock(localhost);
1017
- info("Queuing registration for host=%s, hops=%d",(char*)node_instance_creation.machine_guid,
1017
+ netdata_log_info("Queuing registration for host=%s, hops=%d",(char*)node_instance_creation.machine_guid,
1018
list->hops);
1019
freez((void *)node_instance_creation.machine_guid);
1020
aclk_queue_query(create_query);
aclk/aclk_otp.c
+3
-3
@@ -335,7 +335,7 @@ int aclk_get_otp_challenge(url_t *target, const char *agent_id, unsigned char **
335
}
336
buffer_free(url);
337
338
- info ("ACLK_OTP Got Challenge from Cloud");
338
+ netdata_log_info("ACLK_OTP Got Challenge from Cloud");
339
340
json_object *json = json_tokener_parse(resp.payload);
341
if (!json) {
@@ -414,7 +414,7 @@ int aclk_send_otp_response(const char *agent_id, const unsigned char *response,
414
aclk_parse_otp_error(resp.payload);
415
goto cleanup_response;
416
}
417
- info ("ACLK_OTP Got Password from Cloud");
417
+ netdata_log_info("ACLK_OTP Got Password from Cloud");
418
419
if (parse_passwd_response(resp.payload, mqtt_auth)){
420
error("Error parsing response of password endpoint");
@@ -871,7 +871,7 @@ int aclk_get_env(aclk_env_t *env, const char* aclk_hostname, int aclk_port) {
871
return 5;
872
}
873
874
- info("Getting Cloud /env successful");
874
+ netdata_log_info("Getting Cloud /env successful");
875
876
https_req_response_free(&resp);
877
buffer_free(buf);
aclk/aclk_query.c
+1
-1
@@ -357,7 +357,7 @@ void *aclk_query_main_thread(void *ptr)
357
#define TASK_LEN_MAX 22
358
void aclk_query_threads_start(struct aclk_query_threads *query_threads, mqtt_wss_client client)
359
{
360
- info("Starting %d query threads.", query_threads->count);
360
+ netdata_log_info("Starting %d query threads.", query_threads->count);
361
362
char thread_name[TASK_LEN_MAX];
363
query_threads->thread_list = callocz(query_threads->count, sizeof(struct aclk_query_thread));
aclk/aclk_rx_msgs.c
+2
-2
@@ -399,10 +399,10 @@ int handle_disconnect_req(const char *msg, size_t msg_len)
399
error("Cloud Banned This Agent!");
400
aclk_disable_runtime = 1;
401
}
402
- info("Cloud requested disconnect (EC=%u, \"%s\")", (unsigned int)cmd->error_code, cmd->error_description);
402
+ netdata_log_info("Cloud requested disconnect (EC=%u, \"%s\")", (unsigned int)cmd->error_code, cmd->error_description);
403
if (cmd->reconnect_after_s > 0) {
404
aclk_block_until = now_monotonic_sec() + cmd->reconnect_after_s;
405
- info(
405
+ netdata_log_info(
406
"Cloud asks not to reconnect for %u seconds. We shall honor that request",
407
(unsigned int)cmd->reconnect_after_s);
408
}
aclk/https_client.c
+2
-2
@@ -524,7 +524,7 @@ int https_request(https_req_t *request, https_req_response_t *response) {
524
error("Proxy didn't return 200 OK (got %d)", ctx->parse_ctx.http_code);
525
goto exit_sock;
526
}
527
- info("Proxy accepted CONNECT upgrade");
527
+ netdata_log_info("Proxy accepted CONNECT upgrade");
528
}
529
ctx->request = request;
530
@@ -584,7 +584,7 @@ int https_request(https_req_t *request, https_req_response_t *response) {
584
// only exact data without affixed 0x00
585
((char*)response->payload)[response->payload_size] = 0; // mallocz(response->payload_size + 1);
586
}
587
- info("HTTPS \"%s\" request to \"%s\" finished with HTTP code: %d", http_req_type_to_str(ctx->request->request_type), ctx->request->host, response->http_code);
587
+ netdata_log_info("HTTPS \"%s\" request to \"%s\" finished with HTTP code: %d", http_req_type_to_str(ctx->request->request_type), ctx->request->host, response->http_code);
588
589
rc = 0;
590
claim/claim.c
+7
-7
@@ -83,16 +83,16 @@ void claim_agent(char *claiming_arguments)
83
cloud_base_url,
84
claiming_arguments);
85
86
- info("Executing agent claiming command 'netdata-claim.sh'");
86
+ netdata_log_info("Executing agent claiming command 'netdata-claim.sh'");
87
fp_child_output = netdata_popen(command_buffer, &command_pid, &fp_child_input);
88
if(!fp_child_output) {
89
error("Cannot popen(\"%s\").", command_buffer);
90
return;
91
}
92
- info("Waiting for claiming command to finish.");
92
+ netdata_log_info("Waiting for claiming command to finish.");
93
while (fgets(command_buffer, CLAIMING_COMMAND_LENGTH, fp_child_output) != NULL) {;}
94
exit_code = netdata_pclose(fp_child_input, fp_child_output, command_pid);
95
- info("Agent claiming command returned with code %d", exit_code);
95
+ netdata_log_info("Agent claiming command returned with code %d", exit_code);
96
if (0 == exit_code) {
97
load_claiming_state();
98
return;
@@ -148,7 +148,7 @@ void load_claiming_state(void)
148
}
149
if (aclk_connected)
150
{
151
- info("Agent was already connected to Cloud - forcing reconnection under new credentials");
151
+ netdata_log_info("Agent was already connected to Cloud - forcing reconnection under new credentials");
152
aclk_kill_link = 1;
153
}
154
aclk_disable_runtime = 0;
@@ -174,13 +174,13 @@ void load_claiming_state(void)
174
rrdhost_aclk_state_unlock(localhost);
175
176
if (!claimed_id) {
177
- info("Unable to load '%s', setting state to AGENT_UNCLAIMED", filename);
177
+ netdata_log_info("Unable to load '%s', setting state to AGENT_UNCLAIMED", filename);
178
return;
179
}
180
181
freez(claimed_id);
182
183
- info("File '%s' was found. Setting state to AGENT_CLAIMED.", filename);
183
+ netdata_log_info("File '%s' was found. Setting state to AGENT_CLAIMED.", filename);
184
netdata_cloud_enabled = appconfig_get_boolean(&cloud_config, CONFIG_SECTION_GLOBAL, "enabled", 1);
185
#endif
186
}
@@ -202,7 +202,7 @@ void load_cloud_conf(int silent)
202
203
ret = appconfig_load(&cloud_config, filename, 1, NULL);
204
if(!ret && !silent) {
205
- info("CONFIG: cannot load cloud config '%s'. Running with internal defaults.", filename);
205
+ netdata_log_info("CONFIG: cannot load cloud config '%s'. Running with internal defaults.", filename);
206
}
207
freez(filename);
208
}
collectors/apps.plugin/apps_plugin.c
+15
-15
@@ -1471,7 +1471,7 @@ static inline int read_proc_pid_stat(struct pid_stat *p, void *ptr) {
1471
1472
if(enable_guest_charts) {
1473
enable_guest_charts = 0;
1474
- info("Guest charts aren't supported by FreeBSD");
1474
+ netdata_log_info("Guest charts aren't supported by FreeBSD");
1475
}
1476
#else
1477
pid_incremental_rate(stat, p->minflt, str2kernel_uint_t(procfile_lineword(ff, 0, 9)));
@@ -4194,28 +4194,28 @@ static void parse_args(int argc, char **argv)
4194
if(freq > 0) update_every = freq;
4195
4196
if(read_apps_groups_conf(user_config_dir, "groups")) {
4197
- info("Cannot read process groups configuration file '%s/apps_groups.conf'. Will try '%s/apps_groups.conf'", user_config_dir, stock_config_dir);
4197
+ netdata_log_info("Cannot read process groups configuration file '%s/apps_groups.conf'. Will try '%s/apps_groups.conf'", user_config_dir, stock_config_dir);
4198
4199
if(read_apps_groups_conf(stock_config_dir, "groups")) {
4200
error("Cannot read process groups '%s/apps_groups.conf'. There are no internal defaults. Failing.", stock_config_dir);
4201
exit(1);
4202
}
4203
else
4204
- info("Loaded config file '%s/apps_groups.conf'", stock_config_dir);
4204
+ netdata_log_info("Loaded config file '%s/apps_groups.conf'", stock_config_dir);
4205
}
4206
else
4207
- info("Loaded config file '%s/apps_groups.conf'", user_config_dir);
4207
+ netdata_log_info("Loaded config file '%s/apps_groups.conf'", user_config_dir);
4208
}
4209
4210
static int am_i_running_as_root() {
4211
uid_t uid = getuid(), euid = geteuid();
4212
4213
if(uid == 0 || euid == 0) {
4214
- if(debug_enabled) info("I am running with escalated privileges, uid = %u, euid = %u.", uid, euid);
4214
+ if(debug_enabled) netdata_log_info("I am running with escalated privileges, uid = %u, euid = %u.", uid, euid);
4215
return 1;
4216
}
4217
4218
- if(debug_enabled) info("I am not running with escalated privileges, uid = %u, euid = %u.", uid, euid);
4218
+ if(debug_enabled) netdata_log_info("I am not running with escalated privileges, uid = %u, euid = %u.", uid, euid);
4219
return 0;
4220
}
4221
@@ -4227,7 +4227,7 @@ static int check_capabilities() {
4227
return 0;
4228
}
4229
else if(debug_enabled)
4230
- info("Received my capabilities from the system.");
4230
+ netdata_log_info("Received my capabilities from the system.");
4231
4232
int ret = 1;
4233
@@ -4242,7 +4242,7 @@ static int check_capabilities() {
4242
ret = 0;
4243
}
4244
else if(debug_enabled)
4245
- info("apps.plugin runs with CAP_DAC_READ_SEARCH.");
4245
+ netdata_log_info("apps.plugin runs with CAP_DAC_READ_SEARCH.");
4246
}
4247
4248
cfv = CAP_CLEAR;
@@ -4256,7 +4256,7 @@ static int check_capabilities() {
4256
ret = 0;
4257
}
4258
else if(debug_enabled)
4259
- info("apps.plugin runs with CAP_SYS_PTRACE.");
4259
+ netdata_log_info("apps.plugin runs with CAP_SYS_PTRACE.");
4260
}
4261
4262
cap_free(caps);
@@ -5311,23 +5311,23 @@ int main(int argc, char **argv) {
5311
5312
user_config_dir = getenv("NETDATA_USER_CONFIG_DIR");
5313
if(user_config_dir == NULL) {
5314
- // info("NETDATA_CONFIG_DIR is not passed from netdata");
5314
+ // netdata_log_info("NETDATA_CONFIG_DIR is not passed from netdata");
5315
user_config_dir = CONFIG_DIR;
5316
}
5317
- // else info("Found NETDATA_USER_CONFIG_DIR='%s'", user_config_dir);
5317
+ // else netdata_log_info("Found NETDATA_USER_CONFIG_DIR='%s'", user_config_dir);
5318
5319
stock_config_dir = getenv("NETDATA_STOCK_CONFIG_DIR");
5320
if(stock_config_dir == NULL) {
5321
- // info("NETDATA_CONFIG_DIR is not passed from netdata");
5321
+ // netdata_log_info("NETDATA_CONFIG_DIR is not passed from netdata");
5322
stock_config_dir = LIBCONFIG_DIR;
5323
}
5324
- // else info("Found NETDATA_USER_CONFIG_DIR='%s'", user_config_dir);
5324
+ // else netdata_log_info("Found NETDATA_USER_CONFIG_DIR='%s'", user_config_dir);
5325
5326
#ifdef NETDATA_INTERNAL_CHECKS
5327
if(debug_flags != 0) {
5328
struct rlimit rl = { RLIM_INFINITY, RLIM_INFINITY };
5329
if(setrlimit(RLIMIT_CORE, &rl) != 0)
5330
- info("Cannot request unlimited core dumps for debugging... Proceeding anyway...");
5330
+ netdata_log_info("Cannot request unlimited core dumps for debugging... Proceeding anyway...");
5331
#ifdef HAVE_SYS_PRCTL_H
5332
prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);
5333
#endif
@@ -5367,7 +5367,7 @@ int main(int argc, char **argv) {
5367
#endif
5368
}
5369
5370
- info("started on pid %d", getpid());
5370
+ netdata_log_info("started on pid %d", getpid());
5371
5372
snprintfz(all_user_ids.filename, FILENAME_MAX, "%s/etc/passwd", netdata_configured_host_prefix);
5373
debug_log("passwd file: '%s'", all_user_ids.filename);
collectors/cups.plugin/cups_plugin.c
+1
-1
@@ -438,5 +438,5 @@ int main(int argc, char **argv) {
438
}
439
440
httpClose(http);
441
- info("CUPS process exiting");
441
+ netdata_log_info("CUPS process exiting");
442
}
collectors/debugfs.plugin/debugfs_plugin.c
+2
-2
@@ -176,7 +176,7 @@ int main(int argc, char **argv)
176
177
stock_config_dir = getenv("NETDATA_STOCK_CONFIG_DIR");
178
if (stock_config_dir == NULL) {
179
- // info("NETDATA_CONFIG_DIR is not passed from netdata");
179
+ // netdata_log_info("NETDATA_CONFIG_DIR is not passed from netdata");
180
stock_config_dir = LIBCONFIG_DIR;
181
}
182
@@ -235,7 +235,7 @@ int main(int argc, char **argv)
235
enabled++;
236
}
237
if (!enabled) {
238
- info("all modules are disabled, exiting...");
238
+ netdata_log_info("all modules are disabled, exiting...");
239
return 1;
240
}
241
}
collectors/debugfs.plugin/debugfs_zswap.c
+1
-1
@@ -383,7 +383,7 @@ int do_debugfs_zswap(int update_every, const char *name)
383
static int check_if_enabled = 1;
384
385
if (likely(check_if_enabled && debugfs_is_zswap_enabled())) {
386
- info("Zswap is disabled");
386
+ netdata_log_info("Zswap is disabled");
387
return 1;
388
}
389
collectors/ebpf.plugin/ebpf.c
+27
-27
@@ -727,7 +727,7 @@ static void ebpf_stop_threads(int sig)
727
if (ebpf_modules[i].enabled == NETDATA_THREAD_EBPF_RUNNING) {
728
netdata_thread_cancel(*ebpf_modules[i].thread->thread);
729
#ifdef NETDATA_DEV_MODE
730
- info("Sending cancel for thread %s", ebpf_modules[i].thread_name);
730
+ netdata_log_info("Sending cancel for thread %s", ebpf_modules[i].thread_name);
731
#endif
732
}
733
}
@@ -736,7 +736,7 @@ static void ebpf_stop_threads(int sig)
736
pthread_mutex_lock(&mutex_cgroup_shm);
737
netdata_thread_cancel(*cgroup_integration_thread.thread);
738
#ifdef NETDATA_DEV_MODE
739
- info("Sending cancel for thread %s", cgroup_integration_thread.name);
739
+ netdata_log_info("Sending cancel for thread %s", cgroup_integration_thread.name);
740
#endif
741
pthread_mutex_unlock(&mutex_cgroup_shm);
742
@@ -2135,11 +2135,11 @@ static void ebpf_parse_args(int argc, char **argv)
2135
freq = EBPF_DEFAULT_UPDATE_EVERY;
2136
2137
if (load_collector_config(ebpf_user_config_dir, &disable_apps, &disable_cgroups, freq)) {
2138
- info(
2138
+ netdata_log_info(
2139
"Does not have a configuration file inside `%s/ebpf.d.conf. It will try to load stock file.",
2140
ebpf_user_config_dir);
2141
if (load_collector_config(ebpf_stock_config_dir, &disable_apps, &disable_cgroups, freq)) {
2142
- info("Does not have a stock file. It is starting with default options.");
2142
+ netdata_log_info("Does not have a stock file. It is starting with default options.");
2143
}
2144
}
2145
@@ -2154,112 +2154,112 @@ static void ebpf_parse_args(int argc, char **argv)
2154
case EBPF_MODULE_PROCESS_IDX: {
2155
select_threads |= 1<<EBPF_MODULE_PROCESS_IDX;
2156
#ifdef NETDATA_INTERNAL_CHECKS
2157
- info("EBPF enabling \"PROCESS\" charts, because it was started with the option \"[-]-process\".");
2157
+ netdata_log_info("EBPF enabling \"PROCESS\" charts, because it was started with the option \"[-]-process\".");
2158
#endif
2159
break;
2160
}
2161
case EBPF_MODULE_SOCKET_IDX: {
2162
select_threads |= 1<<EBPF_MODULE_SOCKET_IDX;
2163
#ifdef NETDATA_INTERNAL_CHECKS
2164
- info("EBPF enabling \"NET\" charts, because it was started with the option \"[-]-net\".");
2164
+ netdata_log_info("EBPF enabling \"NET\" charts, because it was started with the option \"[-]-net\".");
2165
#endif
2166
break;
2167
}
2168
case EBPF_MODULE_CACHESTAT_IDX: {
2169
select_threads |= 1<<EBPF_MODULE_CACHESTAT_IDX;
2170
#ifdef NETDATA_INTERNAL_CHECKS
2171
- info("EBPF enabling \"CACHESTAT\" charts, because it was started with the option \"[-]-cachestat\".");
2171
+ netdata_log_info("EBPF enabling \"CACHESTAT\" charts, because it was started with the option \"[-]-cachestat\".");
2172
#endif
2173
break;
2174
}
2175
case EBPF_MODULE_SYNC_IDX: {
2176
select_threads |= 1<<EBPF_MODULE_SYNC_IDX;
2177
#ifdef NETDATA_INTERNAL_CHECKS
2178
- info("EBPF enabling \"SYNC\" chart, because it was started with the option \"[-]-sync\".");
2178
+ netdata_log_info("EBPF enabling \"SYNC\" chart, because it was started with the option \"[-]-sync\".");
2179
#endif
2180
break;
2181
}
2182
case EBPF_MODULE_DCSTAT_IDX: {
2183
select_threads |= 1<<EBPF_MODULE_DCSTAT_IDX;
2184
#ifdef NETDATA_INTERNAL_CHECKS
2185
- info("EBPF enabling \"DCSTAT\" charts, because it was started with the option \"[-]-dcstat\".");
2185
+ netdata_log_info("EBPF enabling \"DCSTAT\" charts, because it was started with the option \"[-]-dcstat\".");
2186
#endif
2187
break;
2188
}
2189
case EBPF_MODULE_SWAP_IDX: {
2190
select_threads |= 1<<EBPF_MODULE_SWAP_IDX;
2191
#ifdef NETDATA_INTERNAL_CHECKS
2192
- info("EBPF enabling \"SWAP\" chart, because it was started with the option \"[-]-swap\".");
2192
+ netdata_log_info("EBPF enabling \"SWAP\" chart, because it was started with the option \"[-]-swap\".");
2193
#endif
2194
break;
2195
}
2196
case EBPF_MODULE_VFS_IDX: {
2197
select_threads |= 1<<EBPF_MODULE_VFS_IDX;
2198
#ifdef NETDATA_INTERNAL_CHECKS
2199
- info("EBPF enabling \"VFS\" chart, because it was started with the option \"[-]-vfs\".");
2199
+ netdata_log_info("EBPF enabling \"VFS\" chart, because it was started with the option \"[-]-vfs\".");
2200
#endif
2201
break;
2202
}
2203
case EBPF_MODULE_FILESYSTEM_IDX: {
2204
select_threads |= 1<<EBPF_MODULE_FILESYSTEM_IDX;
2205
#ifdef NETDATA_INTERNAL_CHECKS
2206
- info("EBPF enabling \"FILESYSTEM\" chart, because it was started with the option \"[-]-filesystem\".");
2206
+ netdata_log_info("EBPF enabling \"FILESYSTEM\" chart, because it was started with the option \"[-]-filesystem\".");
2207
#endif
2208
break;
2209
}
2210
case EBPF_MODULE_DISK_IDX: {
2211
select_threads |= 1<<EBPF_MODULE_DISK_IDX;
2212
#ifdef NETDATA_INTERNAL_CHECKS
2213
- info("EBPF enabling \"DISK\" chart, because it was started with the option \"[-]-disk\".");
2213
+ netdata_log_info("EBPF enabling \"DISK\" chart, because it was started with the option \"[-]-disk\".");
2214
#endif
2215
break;
2216
}
2217
case EBPF_MODULE_MOUNT_IDX: {
2218
select_threads |= 1<<EBPF_MODULE_MOUNT_IDX;
2219
#ifdef NETDATA_INTERNAL_CHECKS
2220
- info("EBPF enabling \"MOUNT\" chart, because it was started with the option \"[-]-mount\".");
2220
+ netdata_log_info("EBPF enabling \"MOUNT\" chart, because it was started with the option \"[-]-mount\".");
2221
#endif
2222
break;
2223
}
2224
case EBPF_MODULE_FD_IDX: {
2225
select_threads |= 1<<EBPF_MODULE_FD_IDX;
2226
#ifdef NETDATA_INTERNAL_CHECKS
2227
- info("EBPF enabling \"FILEDESCRIPTOR\" chart, because it was started with the option \"[-]-filedescriptor\".");
2227
+ netdata_log_info("EBPF enabling \"FILEDESCRIPTOR\" chart, because it was started with the option \"[-]-filedescriptor\".");
2228
#endif
2229
break;
2230
}
2231
case EBPF_MODULE_HARDIRQ_IDX: {
2232
select_threads |= 1<<EBPF_MODULE_HARDIRQ_IDX;
2233
#ifdef NETDATA_INTERNAL_CHECKS
2234
- info("EBPF enabling \"HARDIRQ\" chart, because it was started with the option \"[-]-hardirq\".");
2234
+ netdata_log_info("EBPF enabling \"HARDIRQ\" chart, because it was started with the option \"[-]-hardirq\".");
2235
#endif
2236
break;
2237
}
2238
case EBPF_MODULE_SOFTIRQ_IDX: {
2239
select_threads |= 1<<EBPF_MODULE_SOFTIRQ_IDX;
2240
#ifdef NETDATA_INTERNAL_CHECKS
2241
- info("EBPF enabling \"SOFTIRQ\" chart, because it was started with the option \"[-]-softirq\".");
2241
+ netdata_log_info("EBPF enabling \"SOFTIRQ\" chart, because it was started with the option \"[-]-softirq\".");
2242
#endif
2243
break;
2244
}
2245
case EBPF_MODULE_OOMKILL_IDX: {
2246
select_threads |= 1<<EBPF_MODULE_OOMKILL_IDX;
2247
#ifdef NETDATA_INTERNAL_CHECKS
2248
- info("EBPF enabling \"OOMKILL\" chart, because it was started with the option \"[-]-oomkill\".");
2248
+ netdata_log_info("EBPF enabling \"OOMKILL\" chart, because it was started with the option \"[-]-oomkill\".");
2249
#endif
2250
break;
2251
}
2252
case EBPF_MODULE_SHM_IDX: {
2253
select_threads |= 1<<EBPF_MODULE_SHM_IDX;
2254
#ifdef NETDATA_INTERNAL_CHECKS
2255
- info("EBPF enabling \"SHM\" chart, because it was started with the option \"[-]-shm\".");
2255
+ netdata_log_info("EBPF enabling \"SHM\" chart, because it was started with the option \"[-]-shm\".");
2256
#endif
2257
break;
2258
}
2259
case EBPF_MODULE_MDFLUSH_IDX: {
2260
select_threads |= 1<<EBPF_MODULE_MDFLUSH_IDX;
2261
#ifdef NETDATA_INTERNAL_CHECKS
2262
- info("EBPF enabling \"MDFLUSH\" chart, because it was started with the option \"[-]-mdflush\".");
2262
+ netdata_log_info("EBPF enabling \"MDFLUSH\" chart, because it was started with the option \"[-]-mdflush\".");
2263
#endif
2264
break;
2265
}
@@ -2267,7 +2267,7 @@ static void ebpf_parse_args(int argc, char **argv)
2267
disable_apps = 0;
2268
disable_cgroups = 0;
2269
#ifdef NETDATA_INTERNAL_CHECKS
2270
- info("EBPF running with all chart groups, because it was started with the option \"[-]-all\".");
2270
+ netdata_log_info("EBPF running with all chart groups, because it was started with the option \"[-]-all\".");
2271
#endif
2272
break;
2273
}
@@ -2283,28 +2283,28 @@ static void ebpf_parse_args(int argc, char **argv)
2283
disable_apps = 1;
2284
disable_cgroups = 1;
2285
#ifdef NETDATA_INTERNAL_CHECKS
2286
- info("EBPF running with global chart group, because it was started with the option \"[-]-global\".");
2286
+ netdata_log_info("EBPF running with global chart group, because it was started with the option \"[-]-global\".");
2287
#endif
2288
break;
2289
}
2290
case EBPF_OPTION_RETURN_MODE: {
2291
ebpf_set_thread_mode(MODE_RETURN);
2292
#ifdef NETDATA_INTERNAL_CHECKS
2293
- info("EBPF running in \"RETURN\" mode, because it was started with the option \"[-]-return\".");
2293
+ netdata_log_info("EBPF running in \"RETURN\" mode, because it was started with the option \"[-]-return\".");
2294
#endif
2295
break;
2296
}
2297
case EBPF_OPTION_LEGACY: {
2298
ebpf_set_load_mode(EBPF_LOAD_LEGACY, EBPF_LOADED_FROM_USER);
2299
#ifdef NETDATA_INTERNAL_CHECKS
2300
- info("EBPF running with \"LEGACY\" code, because it was started with the option \"[-]-legacy\".");
2300
+ netdata_log_info("EBPF running with \"LEGACY\" code, because it was started with the option \"[-]-legacy\".");
2301
#endif
2302
break;
2303
}
2304
case EBPF_OPTION_CORE: {
2305
ebpf_set_load_mode(EBPF_LOAD_CORE, EBPF_LOADED_FROM_USER);
2306
#ifdef NETDATA_INTERNAL_CHECKS
2307
- info("EBPF running with \"CO-RE\" code, because it was started with the option \"[-]-core\".");
2307
+ netdata_log_info("EBPF running with \"CO-RE\" code, because it was started with the option \"[-]-core\".");
2308
#endif
2309
break;
2310
}
@@ -2361,7 +2361,7 @@ unittest:
2361
// Load apps_groups.conf
2362
if (ebpf_read_apps_groups_conf(
2363
&apps_groups_default_target, &apps_groups_root_target, ebpf_user_config_dir, "groups")) {
2364
- info("Cannot read process groups configuration file '%s/apps_groups.conf'. Will try '%s/apps_groups.conf'",
2364
+ netdata_log_info("Cannot read process groups configuration file '%s/apps_groups.conf'. Will try '%s/apps_groups.conf'",
2365
ebpf_user_config_dir, ebpf_stock_config_dir);
2366
if (ebpf_read_apps_groups_conf(
2367
&apps_groups_default_target, &apps_groups_root_target, ebpf_stock_config_dir, "groups")) {
@@ -2370,7 +2370,7 @@ unittest:
2370
ebpf_exit();
2371
}
2372
} else
2373
- info("Loaded config file '%s/apps_groups.conf'", ebpf_user_config_dir);
2373
+ netdata_log_info("Loaded config file '%s/apps_groups.conf'", ebpf_user_config_dir);
2374
}
2375
2376
/*****************************************************************
collectors/ebpf.plugin/ebpf_apps.c
+1
-1
@@ -44,7 +44,7 @@ void ebpf_aral_init(void)
44
ebpf_aral_process_stat = ebpf_allocate_pid_aral(NETDATA_EBPF_PROC_ARAL_NAME, sizeof(ebpf_process_stat_t));
45
46
#ifdef NETDATA_DEV_MODE
47
- info("Plugin is using ARAL with values %d", NETDATA_EBPF_ALLOC_MAX_PID);
47
+ netdata_log_info("Plugin is using ARAL with values %d", NETDATA_EBPF_ALLOC_MAX_PID);
48
#endif
49
}
50
collectors/ebpf.plugin/ebpf_cgroup.c
+1
-1
@@ -303,7 +303,7 @@ void ebpf_parse_cgroup_shm_data()
303
sem_post(shm_sem_ebpf_cgroup);
304
pthread_mutex_unlock(&mutex_cgroup_shm);
305
#ifdef NETDATA_DEV_MODE
306
- info("Updating cgroup %d (Previous: %d, Current: %d)",
306
+ netdata_log_info("Updating cgroup %d (Previous: %d, Current: %d)",
307
send_cgroup_chart, previous, shm_ebpf_cgroup.header->cgroup_root_count);
308
#endif
309
collectors/ebpf.plugin/ebpf_dcstat.c
+1
-1
@@ -195,7 +195,7 @@ netdata_ebpf_program_loaded_t ebpf_dc_update_load(ebpf_module_t *em)
195
return EBPF_LOAD_TRAMPOLINE;
196
197
if (em->targets[NETDATA_DC_TARGET_LOOKUP_FAST].mode != EBPF_LOAD_RETPROBE)
198
- info("When your kernel was compiled the symbol %s was modified, instead to use `trampoline`, the plugin will use `probes`.",
198
+ netdata_log_info("When your kernel was compiled the symbol %s was modified, instead to use `trampoline`, the plugin will use `probes`.",
199
dc_optional_name[NETDATA_DC_TARGET_LOOKUP_FAST].function_to_attach);
200
201
return EBPF_LOAD_RETPROBE;
collectors/ebpf.plugin/ebpf_disk.c
+1
-1
@@ -311,7 +311,7 @@ static void update_disk_table(char *name, int major, int minor, time_t current_t
311
error("Internal error, cannot insert the AVL tree.");
312
313
#ifdef NETDATA_INTERNAL_CHECKS
314
- info("The Latency is monitoring the hard disk %s (Major = %d, Minor = %d, Device = %u)", name, major, minor,w->dev);
314
+ netdata_log_info("The Latency is monitoring the hard disk %s (Major = %d, Minor = %d, Device = %u)", name, major, minor,w->dev);
315
#endif
316
317
w->flags |= NETDATA_DISK_IS_HERE;
collectors/ebpf.plugin/ebpf_filesystem.c
+1
-1
@@ -685,7 +685,7 @@ void *ebpf_filesystem_thread(void *ptr)
685
686
if (ebpf_update_partitions(em)) {
687
if (em->optional)
688
- info("Netdata cannot monitor the filesystems used on this host.");
688
+ netdata_log_info("Netdata cannot monitor the filesystems used on this host.");
689
690
goto endfilesystem;
691
}
collectors/ebpf.plugin/ebpf_oomkill.c
+2
-2
@@ -379,14 +379,14 @@ void *ebpf_oomkill_thread(void *ptr)
379
// we need to disable it.
380
pthread_mutex_lock(&ebpf_exit_cleanup);
381
if (em->enabled)
382
- info("%s apps integration is completely disabled.", NETDATA_DEFAULT_OOM_DISABLED_MSG);
382
+ netdata_log_info("%s apps integration is completely disabled.", NETDATA_DEFAULT_OOM_DISABLED_MSG);
383
pthread_mutex_unlock(&ebpf_exit_cleanup);
384
385
goto endoomkill;
386
} else if (running_on_kernel < NETDATA_EBPF_KERNEL_4_14) {
387
pthread_mutex_lock(&ebpf_exit_cleanup);
388
if (em->enabled)
389
- info("%s kernel does not have necessary tracepoints.", NETDATA_DEFAULT_OOM_DISABLED_MSG);
389
+ netdata_log_info("%s kernel does not have necessary tracepoints.", NETDATA_DEFAULT_OOM_DISABLED_MSG);
390
pthread_mutex_unlock(&ebpf_exit_cleanup);
391
392
goto endoomkill;
collectors/ebpf.plugin/ebpf_socket.c
+29
-29
@@ -1844,7 +1844,7 @@ static void fill_last_nv_dimension(netdata_socket_plot_t *ptr, int is_outbound)
1844
fill_resolved_name(ptr, hostname, 10 + NETDATA_DOTS_PROTOCOL_COMBINED_LENGTH, service_name, is_outbound);
1845
1846
#ifdef NETDATA_INTERNAL_CHECKS
1847
- info("Last %s dimension added: ID = %u, IP = OTHER, NAME = %s, DIM1 = %s, DIM2 = %s, DIM3 = %s",
1847
+ netdata_log_info("Last %s dimension added: ID = %u, IP = OTHER, NAME = %s, DIM1 = %s, DIM2 = %s, DIM3 = %s",
1848
(is_outbound)?"outbound":"inbound", network_viewer_opt.max_dim - 1, ptr->resolved_name,
1849
ptr->dimension_recv, ptr->dimension_sent, ptr->dimension_retransmit);
1850
#endif
@@ -1932,7 +1932,7 @@ static void store_socket_inside_avl(netdata_vector_plot_t *out, netdata_socket_t
1932
#ifdef NETDATA_INTERNAL_CHECKS
1933
char iptext[INET6_ADDRSTRLEN];
1934
if (inet_ntop(family, &w->index.daddr.addr8, iptext, sizeof(iptext)))
1935
- info("New %s dimension added: ID = %u, IP = %s, NAME = %s, DIM1 = %s, DIM2 = %s, DIM3 = %s",
1935
+ netdata_log_info("New %s dimension added: ID = %u, IP = %s, NAME = %s, DIM1 = %s, DIM2 = %s, DIM3 = %s",
1936
(out == &inbound_vectors)?"inbound":"outbound", curr, iptext, w->resolved_name,
1937
w->dimension_recv, w->dimension_sent, w->dimension_retransmit);
1938
#endif
@@ -2120,7 +2120,7 @@ void update_listen_table(uint16_t value, uint16_t proto, netdata_passive_connect
2120
fill_nv_port_list(w, value, proto, in);
2121
2122
#ifdef NETDATA_INTERNAL_CHECKS
2123
- info("The network viewer is monitoring inbound connections for port %u", ntohs(value));
2123
+ netdata_log_info("The network viewer is monitoring inbound connections for port %u", ntohs(value));
2124
#endif
2125
}
2126
@@ -3044,14 +3044,14 @@ static inline void fill_port_list(ebpf_network_viewer_port_list_t **out, ebpf_ne
3044
uint16_t cmp_last = ntohs(move->last);
3045
if (cmp_first <= first && first <= cmp_last &&
3046
cmp_first <= last && last <= cmp_last ) {
3047
- info("The range/value (%u, %u) is inside the range/value (%u, %u) already inserted, it will be ignored.",
3047
+ netdata_log_info("The range/value (%u, %u) is inside the range/value (%u, %u) already inserted, it will be ignored.",
3048
first, last, cmp_first, cmp_last);
3049
freez(in->value);
3050
freez(in);
3051
return;
3052
} else if (first <= cmp_first && cmp_first <= last &&
3053
first <= cmp_last && cmp_last <= last) {
3054
- info("The range (%u, %u) is bigger than previous range (%u, %u) already inserted, the previous will be ignored.",
3054
+ netdata_log_info("The range (%u, %u) is bigger than previous range (%u, %u) already inserted, the previous will be ignored.",
3055
first, last, cmp_first, cmp_last);
3056
freez(move->value);
3057
move->value = in->value;
@@ -3071,7 +3071,7 @@ static inline void fill_port_list(ebpf_network_viewer_port_list_t **out, ebpf_ne
3071
}
3072
3073
#ifdef NETDATA_INTERNAL_CHECKS
3074
- info("Adding values %s( %u, %u) to %s port list used on network viewer",
3074
+ netdata_log_info("Adding values %s( %u, %u) to %s port list used on network viewer",
3075
in->value, ntohs(in->first), ntohs(in->last),
3076
(*out == network_viewer_opt.included_port)?"included":"excluded");
3077
#endif
@@ -3091,7 +3091,7 @@ static void parse_service_list(void **out, char *service)
3091
serv = getservbyname((const char *)service, "udp");
3092
3093
if (!serv) {
3094
- info("Cannot resolv the service '%s' with protocols TCP and UDP, it will be ignored", service);
3094
+ netdata_log_info("Cannot resolv the service '%s' with protocols TCP and UDP, it will be ignored", service);
3095
return;
3096
}
3097
@@ -3301,7 +3301,7 @@ void ebpf_fill_ip_list(ebpf_network_viewer_ip_list_t **out, ebpf_network_viewer_
3301
while (move) {
3302
if (in->ver == move->ver &&
3303
ebpf_is_ip_inside_range(&move->first, &move->last, &in->first, &in->last, in->ver)) {
3304
- info("The range/value (%s) is inside the range/value (%s) already inserted, it will be ignored.",
3304
+ netdata_log_info("The range/value (%s) is inside the range/value (%s) already inserted, it will be ignored.",
3305
in->value, move->value);
3306
freez(in->value);
3307
freez(in);
@@ -3319,14 +3319,14 @@ void ebpf_fill_ip_list(ebpf_network_viewer_ip_list_t **out, ebpf_network_viewer_
3319
#ifdef NETDATA_INTERNAL_CHECKS
3320
char first[256], last[512];
3321
if (in->ver == AF_INET) {
3322
- info("Adding values %s: (%u - %u) to %s IP list \"%s\" used on network viewer",
3322
+ netdata_log_info("Adding values %s: (%u - %u) to %s IP list \"%s\" used on network viewer",
3323
in->value, in->first.addr32[0], in->last.addr32[0],
3324
(*out == network_viewer_opt.included_ips)?"included":"excluded",
3325
table);
3326
} else {
3327
if (inet_ntop(AF_INET6, in->first.addr8, first, INET6_ADDRSTRLEN) &&
3328
inet_ntop(AF_INET6, in->last.addr8, last, INET6_ADDRSTRLEN))
3329
- info("Adding values %s - %s to %s IP list \"%s\" used on network viewer",
3329
+ netdata_log_info("Adding values %s - %s to %s IP list \"%s\" used on network viewer",
3330
first, last,
3331
(*out == network_viewer_opt.included_ips)?"included":"excluded",
3332
table);
@@ -3373,7 +3373,7 @@ static void ebpf_parse_ip_list(void **out, char *ip)
3373
select = (*end == '/') ? 0 : 1;
3374
*end++ = '\0';
3375
if (*end == '!') {
3376
- info("The exclusion cannot be in the second part of the range %s, it will be ignored.", ipdup);
3376
+ netdata_log_info("The exclusion cannot be in the second part of the range %s, it will be ignored.", ipdup);
3377
goto cleanipdup;
3378
}
3379
@@ -3384,7 +3384,7 @@ static void ebpf_parse_ip_list(void **out, char *ip)
3384
3385
select = (int) str2i(end);
3386
if (select < NETDATA_MINIMUM_IPV4_CIDR || select > NETDATA_MAXIMUM_IPV4_CIDR) {
3387
- info("The specified CIDR %s is not valid, the IP %s will be ignored.", end, ip);
3387
+ netdata_log_info("The specified CIDR %s is not valid, the IP %s will be ignored.", end, ip);
3388
goto cleanipdup;
3389
}
3390
@@ -3400,7 +3400,7 @@ static void ebpf_parse_ip_list(void **out, char *ip)
3400
ipv4_convert.s_addr = ipv4_test;
3401
char ipv4_msg[INET_ADDRSTRLEN];
3402
if(inet_ntop(AF_INET, &ipv4_convert, ipv4_msg, INET_ADDRSTRLEN))
3403
- info("The network value of CIDR %s was updated for %s .", ipdup, ipv4_msg);
3403
+ netdata_log_info("The network value of CIDR %s was updated for %s .", ipdup, ipv4_msg);
3404
}
3405
} else { // Range
3406
select = ip2nl(first.addr8, ip, AF_INET, ipdup);
@@ -3413,7 +3413,7 @@ static void ebpf_parse_ip_list(void **out, char *ip)
3413
}
3414
3415
if (htonl(first.addr32[0]) > htonl(last.addr32[0])) {
3416
- info("The specified range %s is invalid, the second address is smallest than the first, it will be ignored.",
3416
+ netdata_log_info("The specified range %s is invalid, the second address is smallest than the first, it will be ignored.",
3417
ipdup);
3418
goto cleanipdup;
3419
}
@@ -3427,7 +3427,7 @@ static void ebpf_parse_ip_list(void **out, char *ip)
3427
} else if (*end == '-') {
3428
*end++ = 0x00;
3429
if (*end == '!') {
3430
- info("The exclusion cannot be in the second part of the range %s, it will be ignored.", ipdup);
3430
+ netdata_log_info("The exclusion cannot be in the second part of the range %s, it will be ignored.", ipdup);
3431
goto cleanipdup;
3432
}
3433
@@ -3441,13 +3441,13 @@ static void ebpf_parse_ip_list(void **out, char *ip)
3441
} else { // CIDR
3442
*end++ = 0x00;
3443
if (*end == '!') {
3444
- info("The exclusion cannot be in the second part of the range %s, it will be ignored.", ipdup);
3444
+ netdata_log_info("The exclusion cannot be in the second part of the range %s, it will be ignored.", ipdup);
3445
goto cleanipdup;
3446
}
3447
3448
select = str2i(end);
3449
if (select < 0 || select > 128) {
3450
- info("The CIDR %s is not valid, the address %s will be ignored.", end, ip);
3450
+ netdata_log_info("The CIDR %s is not valid, the address %s will be ignored.", end, ip);
3451
goto cleanipdup;
3452
}
3453
@@ -3469,14 +3469,14 @@ static void ebpf_parse_ip_list(void **out, char *ip)
3469
3470
char ipv6_msg[INET6_ADDRSTRLEN];
3471
if(inet_ntop(AF_INET6, &ipv6_convert, ipv6_msg, INET6_ADDRSTRLEN))
3472
- info("The network value of CIDR %s was updated for %s .", ipdup, ipv6_msg);
3472
+ netdata_log_info("The network value of CIDR %s was updated for %s .", ipdup, ipv6_msg);
3473
}
3474
}
3475
3476
if ((be64toh(*(uint64_t *)&first.addr32[2]) > be64toh(*(uint64_t *)&last.addr32[2]) &&
3477
!memcmp(first.addr32, last.addr32, 2*sizeof(uint32_t))) ||
3478
(be64toh(*(uint64_t *)&first.addr32) > be64toh(*(uint64_t *)&last.addr32)) ) {
3479
- info("The specified range %s is invalid, the second address is smallest than the first, it will be ignored.",
3479
+ netdata_log_info("The specified range %s is invalid, the second address is smallest than the first, it will be ignored.",
3480
ipdup);
3481
goto cleanipdup;
3482
}
@@ -3580,7 +3580,7 @@ static void parse_port_list(void **out, char *range)
3580
if (likely(*end)) {
3581
*end++ = '\0';
3582
if (*end == '!') {
3583
- info("The exclusion cannot be in the second part of the range, the range %s will be ignored.", copied);
3583
+ netdata_log_info("The exclusion cannot be in the second part of the range, the range %s will be ignored.", copied);
3584
freez(copied);
3585
return;
3586
}
@@ -3591,7 +3591,7 @@ static void parse_port_list(void **out, char *range)
3591
3592
first = str2i((const char *)range);
3593
if (first < NETDATA_MINIMUM_PORT_VALUE || first > NETDATA_MAXIMUM_PORT_VALUE) {
3594
- info("The first port %d of the range \"%s\" is invalid and it will be ignored!", first, copied);
3594
+ netdata_log_info("The first port %d of the range \"%s\" is invalid and it will be ignored!", first, copied);
3595
freez(copied);
3596
return;
3597
}
@@ -3600,13 +3600,13 @@ static void parse_port_list(void **out, char *range)
3600
last = first;
3601
3602
if (last < NETDATA_MINIMUM_PORT_VALUE || last > NETDATA_MAXIMUM_PORT_VALUE) {
3603
- info("The second port %d of the range \"%s\" is invalid and the whole range will be ignored!", last, copied);
3603
+ netdata_log_info("The second port %d of the range \"%s\" is invalid and the whole range will be ignored!", last, copied);
3604
freez(copied);
3605
return;
3606
}
3607
3608
if (first > last) {
3609
- info("The specified order %s is wrong, the smallest value is always the first, it will be ignored!", copied);
3609
+ netdata_log_info("The specified order %s is wrong, the smallest value is always the first, it will be ignored!", copied);
3610
freez(copied);
3611
return;
3612
}
@@ -3646,7 +3646,7 @@ static void read_max_dimension(struct config *cfg)
3646
3647
maxdim /= 2;
3648
if (!maxdim) {
3649
- info("The number of dimensions is too small (%u), we are setting it to minimum 2", network_viewer_opt.max_dim);
3649
+ netdata_log_info("The number of dimensions is too small (%u), we are setting it to minimum 2", network_viewer_opt.max_dim);
3650
network_viewer_opt.max_dim = 1;
3651
return;
3652
}
@@ -3714,7 +3714,7 @@ static void link_hostname(ebpf_network_viewer_hostname_list_t **out, ebpf_networ
3714
ebpf_network_viewer_hostname_list_t *move = *out;
3715
for (; move->next ; move = move->next ) {
3716
if (move->hash == in->hash && !strcmp(move->value, in->value)) {
3717
- info("The hostname %s was already inserted, it will be ignored.", in->value);
3717
+ netdata_log_info("The hostname %s was already inserted, it will be ignored.", in->value);
3718
freez(in->value);
3719
simple_pattern_free(in->value_pattern);
3720
freez(in);
@@ -3727,7 +3727,7 @@ static void link_hostname(ebpf_network_viewer_hostname_list_t **out, ebpf_networ
3727
*out = in;
3728
}
3729
#ifdef NETDATA_INTERNAL_CHECKS
3730
- info("Adding value %s to %s hostname list used on network viewer",
3730
+ netdata_log_info("Adding value %s to %s hostname list used on network viewer",
3731
in->value,
3732
(*out == network_viewer_opt.included_hostnames)?"included":"excluded");
3733
#endif
@@ -3806,7 +3806,7 @@ void parse_network_viewer_section(struct config *cfg)
3806
value = appconfig_get(cfg, EBPF_NETWORK_VIEWER_SECTION, EBPF_CONFIG_HOSTNAMES, NULL);
3807
link_hostnames(value);
3808
} else {
3809
- info("Name resolution is disabled, collector will not parser \"hostnames\" list.");
3809
+ netdata_log_info("Name resolution is disabled, collector will not parser \"hostnames\" list.");
3810
}
3811
3812
value = appconfig_get(cfg, EBPF_NETWORK_VIEWER_SECTION,
@@ -3845,7 +3845,7 @@ static void link_dimension_name(char *port, uint32_t hash, char *value)
3845
} else {
3846
for (; names->next; names = names->next) {
3847
if (names->port == w->port) {
3848
- info("Duplicated definition for a service, the name %s will be ignored. ", names->name);
3848
+ netdata_log_info("Duplicated definition for a service, the name %s will be ignored. ", names->name);
3849
freez(names->name);
3850
names->name = w->name;
3851
names->hash = w->hash;
@@ -3857,7 +3857,7 @@ static void link_dimension_name(char *port, uint32_t hash, char *value)
3857
}
3858
3859
#ifdef NETDATA_INTERNAL_CHECKS
3860
- info("Adding values %s( %u) to dimension name list used on network viewer", w->name, htons(w->port));
3860
+ netdata_log_info("Adding values %s( %u) to dimension name list used on network viewer", w->name, htons(w->port));
3861
#endif
3862
}
3863
collectors/ebpf.plugin/ebpf_sync.c
+1
-1
@@ -373,7 +373,7 @@ static int ebpf_sync_initialize_syscall(ebpf_module_t *em)
373
}
374
}
375
} else {
376
- info("Cannot find syscall %s we are not going to monitor it.", syscall);
376
+ netdata_log_info("Cannot find syscall %s we are not going to monitor it.", syscall);
377
w->enabled = false;
378
}
379
collectors/plugins.d/plugins_d.c
+9
-9
@@ -65,11 +65,11 @@ static void pluginsd_worker_thread_cleanup(void *arg)
65
66
if (pid) {
67
siginfo_t info;
68
- info("PLUGINSD: 'host:%s', killing data collection child process with pid %d",
68
+ netdata_log_info("PLUGINSD: 'host:%s', killing data collection child process with pid %d",
69
rrdhost_hostname(cd->host), pid);
70
71
if (killpid(pid) != -1) {
72
- info("PLUGINSD: 'host:%s', waiting for data collection child process pid %d to exit...",
72
+ netdata_log_info("PLUGINSD: 'host:%s', waiting for data collection child process pid %d to exit...",
73
rrdhost_hostname(cd->host), pid);
74
75
netdata_waitid(P_PID, (id_t)pid, &info, WEXITED);
@@ -85,7 +85,7 @@ static void pluginsd_worker_thread_handle_success(struct plugind *cd) {
85
}
86
87
if (likely(cd->serial_failures <= SERIAL_FAILURES_THRESHOLD)) {
88
- info("PLUGINSD: 'host:%s', '%s' (pid %d) does not generate useful output but it reports success (exits with 0). %s.",
88
+ netdata_log_info("PLUGINSD: 'host:%s', '%s' (pid %d) does not generate useful output but it reports success (exits with 0). %s.",
89
rrdhost_hostname(cd->host), cd->fullfilename, cd->unsafe.pid,
90
plugin_is_enabled(cd) ? "Waiting a bit before starting it again." : "Will not start it again - it is now disabled.");
91
@@ -105,7 +105,7 @@ static void pluginsd_worker_thread_handle_success(struct plugind *cd) {
105
106
static void pluginsd_worker_thread_handle_error(struct plugind *cd, int worker_ret_code) {
107
if (worker_ret_code == -1) {
108
- info("PLUGINSD: 'host:%s', '%s' (pid %d) was killed with SIGTERM. Disabling it.",
108
+ netdata_log_info("PLUGINSD: 'host:%s', '%s' (pid %d) was killed with SIGTERM. Disabling it.",
109
rrdhost_hostname(cd->host), cd->fullfilename, cd->unsafe.pid);
110
plugin_set_disabled(cd);
111
return;
@@ -157,12 +157,12 @@ static void *pluginsd_worker_thread(void *arg) {
157
break;
158
}
159
160
- info("PLUGINSD: 'host:%s' connected to '%s' running on pid %d",
160
+ netdata_log_info("PLUGINSD: 'host:%s' connected to '%s' running on pid %d",
161
rrdhost_hostname(cd->host), cd->fullfilename, cd->unsafe.pid);
162
163
count = pluginsd_process(cd->host, cd, fp_child_input, fp_child_output, 0);
164
165
- info("PLUGINSD: 'host:%s', '%s' (pid %d) disconnected after %zu successful data collections (ENDs).",
165
+ netdata_log_info("PLUGINSD: 'host:%s', '%s' (pid %d) disconnected after %zu successful data collections (ENDs).",
166
rrdhost_hostname(cd->host), cd->fullfilename, cd->unsafe.pid, count);
167
168
killpid(cd->unsafe.pid);
@@ -186,13 +186,13 @@ static void *pluginsd_worker_thread(void *arg) {
186
static void pluginsd_main_cleanup(void *data) {
187
struct netdata_static_thread *static_thread = (struct netdata_static_thread *)data;
188
static_thread->enabled = NETDATA_MAIN_THREAD_EXITING;
189
- info("PLUGINSD: cleaning up...");
189
+ netdata_log_info("PLUGINSD: cleaning up...");
190
191
struct plugind *cd;
192
for (cd = pluginsd_root; cd; cd = cd->next) {
193
spinlock_lock(&cd->unsafe.spinlock);
194
if (cd->unsafe.enabled && cd->unsafe.running && cd->unsafe.thread != 0) {
195
- info("PLUGINSD: 'host:%s', stopping plugin thread: %s",
195
+ netdata_log_info("PLUGINSD: 'host:%s', stopping plugin thread: %s",
196
rrdhost_hostname(cd->host), cd->id);
197
198
netdata_thread_cancel(cd->unsafe.thread);
@@ -200,7 +200,7 @@ static void pluginsd_main_cleanup(void *data) {
200
spinlock_unlock(&cd->unsafe.spinlock);
201
}
202
203
- info("PLUGINSD: cleanup completed.");
203
+ netdata_log_info("PLUGINSD: cleanup completed.");
204
static_thread->enabled = NETDATA_MAIN_THREAD_EXITED;
205
206
worker_unregister();
collectors/plugins.d/pluginsd_parser.c
+3
-3
@@ -1017,7 +1017,7 @@ static inline PARSER_RC pluginsd_flush(char **words __maybe_unused, size_t num_w
1017
}
1018
1019
static inline PARSER_RC pluginsd_disable(char **words __maybe_unused, size_t num_words __maybe_unused, PARSER *parser) {
1020
- info("PLUGINSD: plugin called DISABLE. Disabling it.");
1020
+ netdata_log_info("PLUGINSD: plugin called DISABLE. Disabling it.");
1021
parser->user.enabled = 0;
1022
return PARSER_RC_STOP;
1023
}
@@ -1796,7 +1796,7 @@ static inline PARSER_RC pluginsd_end_v2(char **words __maybe_unused, size_t num_
1796
}
1797
1798
static inline PARSER_RC pluginsd_exit(char **words __maybe_unused, size_t num_words __maybe_unused, PARSER *parser __maybe_unused) {
1799
- info("PLUGINSD: plugin called EXIT.");
1799
+ netdata_log_info("PLUGINSD: plugin called EXIT.");
1800
return PARSER_RC_STOP;
1801
}
1802
@@ -2173,7 +2173,7 @@ int pluginsd_parser_unittest(void) {
2173
}
2174
usec_t ended = now_realtime_usec();
2175
2176
- info("Parsed %zu lines in %0.2f secs, %0.2f klines/sec", count,
2176
+ netdata_log_info("Parsed %zu lines in %0.2f secs, %0.2f klines/sec", count,
2177
(double)(ended - started) / (double)USEC_PER_SEC,
2178
(double)count / ((double)(ended - started) / (double)USEC_PER_SEC) / 1000.0);
2179
collectors/timex.plugin/plugin_timex.c
+2
-2
@@ -37,7 +37,7 @@ static void timex_main_cleanup(void *ptr)
37
struct netdata_static_thread *static_thread = (struct netdata_static_thread *)ptr;
38
static_thread->enabled = NETDATA_MAIN_THREAD_EXITING;
39
40
- info("cleaning up...");
40
+ netdata_log_info("cleaning up...");
41
42
static_thread->enabled = NETDATA_MAIN_THREAD_EXITED;
43
}
@@ -57,7 +57,7 @@ void *timex_main(void *ptr)
57
int do_offset = config_get_boolean(CONFIG_SECTION_TIMEX, "time offset", CONFIG_BOOLEAN_YES);
58
59
if (unlikely(do_sync == CONFIG_BOOLEAN_NO && do_offset == CONFIG_BOOLEAN_NO)) {
60
- info("No charts to show");
60
+ netdata_log_info("No charts to show");
61
goto exit;
62
}
63
collectors/xenstat.plugin/xenstat_plugin.c
+1
-1
@@ -1066,7 +1066,7 @@ int main(int argc, char **argv) {
1066
1067
libxl_ctx_free(ctx);
1068
xenstat_uninit(xhandle);
1069
- info("XENSTAT process exiting");
1069
+ netdata_log_info("XENSTAT process exiting");
1070
1071
return 0;
1072
}
daemon/analytics.c
+9
-9
@@ -314,7 +314,7 @@ void analytics_alarms_notifications(void)
314
sizeof(char) * (strlen(netdata_configured_primary_plugins_dir) + strlen("alarm-notify.sh dump_methods") + 2));
315
sprintf(script, "%s/%s", netdata_configured_primary_plugins_dir, "alarm-notify.sh");
316
if (unlikely(access(script, R_OK) != 0)) {
317
- info("Alarm notify script %s not found.", script);
317
+ netdata_log_info("Alarm notify script %s not found.", script);
318
freez(script);
319
return;
320
}
@@ -709,13 +709,13 @@ void get_system_timezone(void)
709
// use the TZ variable
710
if (tz && *tz && *tz != ':') {
711
timezone = tz;
712
- info("TIMEZONE: using TZ variable '%s'", timezone);
712
+ netdata_log_info("TIMEZONE: using TZ variable '%s'", timezone);
713
}
714
715
// use the contents of /etc/timezone
716
if (!timezone && !read_file("/etc/timezone", buffer, FILENAME_MAX)) {
717
timezone = buffer;
718
- info("TIMEZONE: using the contents of /etc/timezone");
718
+ netdata_log_info("TIMEZONE: using the contents of /etc/timezone");
719
}
720
721
// read the link /etc/localtime
@@ -731,7 +731,7 @@ void get_system_timezone(void)
731
char *s = strstr(buffer, cmp);
732
if (s && s[cmp_len]) {
733
timezone = &s[cmp_len];
734
- info("TIMEZONE: using the link of /etc/localtime: '%s'", timezone);
734
+ netdata_log_info("TIMEZONE: using the link of /etc/localtime: '%s'", timezone);
735
}
736
} else
737
buffer[0] = '\0';
@@ -751,14 +751,14 @@ void get_system_timezone(void)
751
else {
752
buffer[FILENAME_MAX] = '\0';
753
timezone = buffer;
754
- info("TIMEZONE: using strftime(): '%s'", timezone);
754
+ netdata_log_info("TIMEZONE: using strftime(): '%s'", timezone);
755
}
756
}
757
}
758
759
if (timezone && *timezone) {
760
// make sure it does not have illegal characters
761
- // info("TIMEZONE: fixing '%s'", timezone);
761
+ // netdata_log_info("TIMEZONE: fixing '%s'", timezone);
762
763
size_t len = strlen(timezone);
764
char tmp[len + 1];
@@ -774,7 +774,7 @@ void get_system_timezone(void)
774
*d = '\0';
775
strncpyz(buffer, tmp, len);
776
timezone = buffer;
777
- info("TIMEZONE: fixed as '%s'", timezone);
777
+ netdata_log_info("TIMEZONE: fixed as '%s'", timezone);
778
}
779
780
if (!timezone || !*timezone)
@@ -955,7 +955,7 @@ void send_statistics(const char *action, const char *action_result, const char *
955
sprintf(as_script, "%s/%s", netdata_configured_primary_plugins_dir, "anonymous-statistics.sh");
956
if (unlikely(access(as_script, R_OK) != 0)) {
957
netdata_anonymous_statistics_enabled = 0;
958
- info("Anonymous statistics script %s not found.", as_script);
958
+ netdata_log_info("Anonymous statistics script %s not found.", as_script);
959
freez(as_script);
960
} else {
961
netdata_anonymous_statistics_enabled = 1;
@@ -1026,7 +1026,7 @@ void send_statistics(const char *action, const char *action_result, const char *
1026
analytics_data.netdata_config_oom_score,
1027
analytics_data.netdata_prebuilt_distro);
1028
1029
- info("%s '%s' '%s' '%s'", as_script, action, action_result, action_data);
1029
+ netdata_log_info("%s '%s' '%s' '%s'", as_script, action, action_result, action_data);
1030
1031
FILE *fp_child_input;
1032
FILE *fp_child_output = netdata_popen(command_to_run, &command_pid, &fp_child_input);
daemon/commands.c
+23
-23
@@ -143,7 +143,7 @@ static cmd_status_t cmd_reload_health_execute(char *args, char **message)
143
(void)message;
144
145
error_log_limit_unlimited();
146
- info("COMMAND: Reloading HEALTH configuration.");
146
+ netdata_log_info("COMMAND: Reloading HEALTH configuration.");
147
health_reload();
148
error_log_limit_reset();
149
@@ -156,9 +156,9 @@ static cmd_status_t cmd_save_database_execute(char *args, char **message)
156
(void)message;
157
158
error_log_limit_unlimited();
159
- info("COMMAND: Saving databases.");
159
+ netdata_log_info("COMMAND: Saving databases.");
160
rrdhost_save_all();
161
- info("COMMAND: Databases saved.");
161
+ netdata_log_info("COMMAND: Databases saved.");
162
error_log_limit_reset();
163
164
return CMD_STATUS_SUCCESS;
@@ -170,7 +170,7 @@ static cmd_status_t cmd_reopen_logs_execute(char *args, char **message)
170
(void)message;
171
172
error_log_limit_unlimited();
173
- info("COMMAND: Reopening all log files.");
173
+ netdata_log_info("COMMAND: Reopening all log files.");
174
reopen_all_log_files();
175
error_log_limit_reset();
176
@@ -183,7 +183,7 @@ static cmd_status_t cmd_exit_execute(char *args, char **message)
183
(void)message;
184
185
error_log_limit_unlimited();
186
- info("COMMAND: Cleaning up to exit.");
186
+ netdata_log_info("COMMAND: Cleaning up to exit.");
187
netdata_cleanup_and_exit(0);
188
exit(0);
189
@@ -205,12 +205,12 @@ static cmd_status_t cmd_reload_claiming_state_execute(char *args, char **message
205
(void)args;
206
(void)message;
207
#if defined(DISABLE_CLOUD) || !defined(ENABLE_ACLK)
208
- info("The claiming feature has been explicitly disabled");
208
+ netdata_log_info("The claiming feature has been explicitly disabled");
209
*message = strdupz("This agent cannot be claimed, it was built without support for Cloud");
210
return CMD_STATUS_FAILURE;
211
#endif
212
error_log_limit_unlimited();
213
- info("COMMAND: Reloading Agent Claiming configuration.");
213
+ netdata_log_info("COMMAND: Reloading Agent Claiming configuration.");
214
load_claiming_state();
215
registry_update_cloud_base_url();
216
rrdpush_send_claimed_id(localhost);
@@ -221,7 +221,7 @@ static cmd_status_t cmd_reload_claiming_state_execute(char *args, char **message
221
static cmd_status_t cmd_reload_labels_execute(char *args, char **message)
222
{
223
(void)args;
224
- info("COMMAND: reloading host labels.");
224
+ netdata_log_info("COMMAND: reloading host labels.");
225
reload_host_labels();
226
227
BUFFER *wb = buffer_create(10, NULL);
@@ -272,7 +272,7 @@ static cmd_status_t cmd_read_config_execute(char *args, char **message)
272
static cmd_status_t cmd_write_config_execute(char *args, char **message)
273
{
274
UNUSED(message);
275
- info("write-config %s", args);
275
+ netdata_log_info("write-config %s", args);
276
size_t n = strlen(args);
277
char *separator = strchr(args,'|');
278
if (separator == NULL)
@@ -296,7 +296,7 @@ static cmd_status_t cmd_write_config_execute(char *args, char **message)
296
struct config *tmp_config = strcmp(conf_file, "cloud") ? &netdata_config : &cloud_config;
297
298
appconfig_set(tmp_config, temp + offset + 1, temp + offset2 + 1, temp + offset3 + 1);
299
- info("write-config conf_file=%s section=%s key=%s value=%s",conf_file, temp + offset + 1, temp + offset2 + 1,
299
+ netdata_log_info("write-config conf_file=%s section=%s key=%s value=%s",conf_file, temp + offset + 1, temp + offset2 + 1,
300
temp + offset3 + 1);
301
freez(temp);
302
return CMD_STATUS_SUCCESS;
@@ -313,7 +313,7 @@ static cmd_status_t cmd_ping_execute(char *args, char **message)
313
314
static cmd_status_t cmd_aclk_state(char *args, char **message)
315
{
316
- info("COMMAND: Reopening aclk/cloud state.");
316
+ netdata_log_info("COMMAND: Reopening aclk/cloud state.");
317
if (strstr(args, "json"))
318
*message = aclk_state_json();
319
else
@@ -409,7 +409,7 @@ static void pipe_write_cb(uv_write_t* req, int status)
409
uv_close((uv_handle_t *)client, pipe_close_cb);
410
--clients;
411
buffer_free(client->data);
412
- info("Command Clients = %u\n", clients);
412
+ netdata_log_info("Command Clients = %u\n", clients);
413
}
414
415
static inline void add_char_to_command_reply(BUFFER *reply_string, unsigned *reply_string_size, char character)
@@ -534,9 +534,9 @@ static void pipe_read_cb(uv_stream_t *client, ssize_t nread, const uv_buf_t *buf
534
struct command_context *cmd_ctx = (struct command_context *)client;
535
536
if (0 == nread) {
537
- info("%s: Zero bytes read by command pipe.", __func__);
537
+ netdata_log_info("%s: Zero bytes read by command pipe.", __func__);
538
} else if (UV_EOF == nread) {
539
- info("EOF found in command pipe.");
539
+ netdata_log_info("EOF found in command pipe.");
540
parse_commands(cmd_ctx);
541
} else if (nread < 0) {
542
error("%s: %s", __func__, uv_strerror(nread));
@@ -559,7 +559,7 @@ static void pipe_read_cb(uv_stream_t *client, ssize_t nread, const uv_buf_t *buf
559
if (nread < 0 && UV_EOF != nread) {
560
uv_close((uv_handle_t *)client, pipe_close_cb);
561
--clients;
562
- info("Command Clients = %u\n", clients);
562
+ netdata_log_info("Command Clients = %u\n", clients);
563
}
564
}
565
@@ -595,7 +595,7 @@ static void connection_cb(uv_stream_t *server, int status)
595
}
596
597
++clients;
598
- info("Command Clients = %u\n", clients);
598
+ netdata_log_info("Command Clients = %u\n", clients);
599
/* Start parsing a new command */
600
cmd_ctx->command_string_size = 0;
601
cmd_ctx->command_string[0] = '\0';
@@ -605,7 +605,7 @@ static void connection_cb(uv_stream_t *server, int status)
605
error("uv_read_start(): %s", uv_strerror(ret));
606
uv_close((uv_handle_t *)client, pipe_close_cb);
607
--clients;
608
- info("Command Clients = %u\n", clients);
608
+ netdata_log_info("Command Clients = %u\n", clients);
609
return;
610
}
611
}
@@ -659,7 +659,7 @@ static void command_thread(void *arg)
659
ret = uv_listen((uv_stream_t *)&server_pipe, SOMAXCONN, connection_cb);
660
if (ret) {
661
/* Fallback to backlog of 1 */
662
- info("uv_listen() failed with backlog = %d, falling back to backlog = 1.", SOMAXCONN);
662
+ netdata_log_info("uv_listen() failed with backlog = %d, falling back to backlog = 1.", SOMAXCONN);
663
ret = uv_listen((uv_stream_t *)&server_pipe, 1, connection_cb);
664
}
665
if (ret) {
@@ -677,12 +677,12 @@ static void command_thread(void *arg)
677
uv_run(loop, UV_RUN_DEFAULT);
678
}
679
/* cleanup operations of the event loop */
680
- info("Shutting down command event loop.");
680
+ netdata_log_info("Shutting down command event loop.");
681
uv_close((uv_handle_t *)&async, NULL);
682
uv_close((uv_handle_t*)&server_pipe, NULL);
683
uv_run(loop, UV_RUN_DEFAULT); /* flush all libuv handles */
684
685
- info("Shutting down command loop complete.");
685
+ netdata_log_info("Shutting down command loop complete.");
686
fatal_assert(0 == uv_loop_close(loop));
687
freez(loop);
688
@@ -718,7 +718,7 @@ void commands_init(void)
718
if (command_server_initialized)
719
return;
720
721
- info("Initializing command server.");
721
+ netdata_log_info("Initializing command server.");
722
for (i = 0 ; i < CMD_TOTAL_COMMANDS ; ++i) {
723
fatal_assert(0 == uv_mutex_init(&command_lock_array[i]));
724
}
@@ -758,7 +758,7 @@ void commands_exit(void)
758
return;
759
760
command_thread_shutdown = 1;
761
- info("Shutting down command server.");
761
+ netdata_log_info("Shutting down command server.");
762
/* wake up event loop */
763
fatal_assert(0 == uv_async_send(&async));
764
fatal_assert(0 == uv_thread_join(&thread));
@@ -767,6 +767,6 @@ void commands_exit(void)
767
uv_mutex_destroy(&command_lock_array[i]);
768
}
769
uv_rwlock_destroy(&exclusive_rwlock);
770
- info("Command server has stopped.");
770
+ netdata_log_info("Command server has stopped.");
771
command_server_initialized = 0;
772
}
daemon/daemon.c
+10
-10
@@ -121,7 +121,7 @@ int become_user(const char *username, int pid_fd) {
121
gid_t gid = pw->pw_gid;
122
123
if (am_i_root)
124
- info("I am root, so checking permissions");
124
+ netdata_log_info("I am root, so checking permissions");
125
126
prepare_required_directories(uid, gid);
127
@@ -234,11 +234,11 @@ static void oom_score_adj(void) {
234
if(s && *s && (isdigit(*s) || *s == '-' || *s == '+'))
235
wanted_score = atoll(s);
236
else if(s && !strcmp(s, "keep")) {
237
- info("Out-Of-Memory (OOM) kept as-is (running with %d)", (int) old_score);
237
+ netdata_log_info("Out-Of-Memory (OOM) kept as-is (running with %d)", (int) old_score);
238
return;
239
}
240
else {
241
- info("Out-Of-Memory (OOM) score not changed due to non-numeric setting: '%s' (running with %d)", s, (int)old_score);
241
+ netdata_log_info("Out-Of-Memory (OOM) score not changed due to non-numeric setting: '%s' (running with %d)", s, (int)old_score);
242
return;
243
}
244
@@ -253,7 +253,7 @@ static void oom_score_adj(void) {
253
}
254
255
if(old_score == wanted_score) {
256
- info("Out-Of-Memory (OOM) score is already set to the wanted value %d", (int)old_score);
256
+ netdata_log_info("Out-Of-Memory (OOM) score is already set to the wanted value %d", (int)old_score);
257
return;
258
}
259
@@ -269,7 +269,7 @@ static void oom_score_adj(void) {
269
if(read_single_signed_number_file("/proc/self/oom_score_adj", &final_score))
270
error("Adjusted my Out-Of-Memory (OOM) score to %d, but cannot verify it.", (int)wanted_score);
271
else if(final_score == wanted_score)
272
- info("Adjusted my Out-Of-Memory (OOM) score from %d to %d.", (int)old_score, (int)final_score);
272
+ netdata_log_info("Adjusted my Out-Of-Memory (OOM) score from %d to %d.", (int)old_score, (int)final_score);
273
else
274
error("Adjusted my Out-Of-Memory (OOM) score from %d to %d, but it has been set to %d.", (int)old_score, (int)wanted_score, (int)final_score);
275
analytics_report_oom_score(final_score);
@@ -355,19 +355,19 @@ static void sched_getscheduler_report(void) {
355
return;
356
}
357
else {
358
- info("Running with process scheduling policy '%s', priority %d", scheduler_defaults[i].name, param.sched_priority);
358
+ netdata_log_info("Running with process scheduling policy '%s', priority %d", scheduler_defaults[i].name, param.sched_priority);
359
}
360
}
361
else if(scheduler_defaults[i].flags & SCHED_FLAG_USE_NICE) {
362
#ifdef HAVE_GETPRIORITY
363
int n = getpriority(PRIO_PROCESS, 0);
364
- info("Running with process scheduling policy '%s', nice level %d", scheduler_defaults[i].name, n);
364
+ netdata_log_info("Running with process scheduling policy '%s', nice level %d", scheduler_defaults[i].name, n);
365
#else // !HAVE_GETPRIORITY
366
- info("Running with process scheduling policy '%s'", scheduler_defaults[i].name);
366
+ netdata_log_info("Running with process scheduling policy '%s'", scheduler_defaults[i].name);
367
#endif // !HAVE_GETPRIORITY
368
}
369
else {
370
- info("Running with process scheduling policy '%s'", scheduler_defaults[i].name);
370
+ netdata_log_info("Running with process scheduling policy '%s'", scheduler_defaults[i].name);
371
}
372
373
return;
@@ -436,7 +436,7 @@ static void sched_setscheduler_set(void) {
436
error("Cannot adjust netdata scheduling policy to %s (%d), with priority %d. Falling back to nice.", name, policy, priority);
437
}
438
else {
439
- info("Adjusted netdata scheduling policy to %s (%d), with priority %d.", name, policy, priority);
439
+ netdata_log_info("Adjusted netdata scheduling policy to %s (%d), with priority %d.", name, policy, priority);
440
if(!(flags & SCHED_FLAG_USE_NICE))
441
goto report;
442
}
daemon/global_statistics.c
+3
-3
@@ -4123,7 +4123,7 @@ static void global_statistics_cleanup(void *ptr)
4123
struct netdata_static_thread *static_thread = (struct netdata_static_thread *)ptr;
4124
static_thread->enabled = NETDATA_MAIN_THREAD_EXITING;
4125
4126
- info("cleaning up...");
4126
+ netdata_log_info("cleaning up...");
4127
4128
static_thread->enabled = NETDATA_MAIN_THREAD_EXITED;
4129
}
@@ -4194,7 +4194,7 @@ static void global_statistics_workers_cleanup(void *ptr)
4194
struct netdata_static_thread *static_thread = (struct netdata_static_thread *)ptr;
4195
static_thread->enabled = NETDATA_MAIN_THREAD_EXITING;
4196
4197
- info("cleaning up...");
4197
+ netdata_log_info("cleaning up...");
4198
4199
worker_utilization_finish();
4200
@@ -4238,7 +4238,7 @@ static void global_statistics_sqlite3_cleanup(void *ptr)
4238
struct netdata_static_thread *static_thread = (struct netdata_static_thread *)ptr;
4239
static_thread->enabled = NETDATA_MAIN_THREAD_EXITING;
4240
4241
- info("cleaning up...");
4241
+ netdata_log_info("cleaning up...");
4242
4243
static_thread->enabled = NETDATA_MAIN_THREAD_EXITED;
4244
}
daemon/main.c
+23
-23
@@ -265,7 +265,7 @@ static bool service_wait_exit(SERVICE_TYPE service, usec_t timeout_ut) {
265
266
buffer_flush(service_list);
267
service_to_buffer(service_list, running_services);
268
- info("SERVICE CONTROL: waiting for the following %zu services [ %s] to exit: %s",
268
+ netdata_log_info("SERVICE CONTROL: waiting for the following %zu services [ %s] to exit: %s",
269
running, buffer_tostring(service_list),
270
running <= 10 ? buffer_tostring(thread_list) : "");
271
}
@@ -280,7 +280,7 @@ static bool service_wait_exit(SERVICE_TYPE service, usec_t timeout_ut) {
280
if(running) {
281
buffer_flush(service_list);
282
service_to_buffer(service_list, running_services);
283
- info("SERVICE CONTROL: "
283
+ netdata_log_info("SERVICE CONTROL: "
284
"the following %zu service(s) [ %s] take too long to exit: %s; "
285
"giving up on them...",
286
running, buffer_tostring(service_list),
@@ -297,9 +297,9 @@ static bool service_wait_exit(SERVICE_TYPE service, usec_t timeout_ut) {
297
{ \
298
usec_t now_ut = now_monotonic_usec(); \
299
if(prev_msg) \
300
- info("NETDATA SHUTDOWN: in %7llu ms, %s%s - next: %s", (now_ut - last_ut) / USEC_PER_MS, (timeout)?"(TIMEOUT) ":"", prev_msg, msg); \
300
+ netdata_log_info("NETDATA SHUTDOWN: in %7llu ms, %s%s - next: %s", (now_ut - last_ut) / USEC_PER_MS, (timeout)?"(TIMEOUT) ":"", prev_msg, msg); \
301
else \
302
- info("NETDATA SHUTDOWN: next: %s", msg); \
302
+ netdata_log_info("NETDATA SHUTDOWN: next: %s", msg); \
303
last_ut = now_ut; \
304
prev_msg = msg; \
305
timeout = false; \
@@ -314,7 +314,7 @@ void netdata_cleanup_and_exit(int ret) {
314
bool timeout = false;
315
316
error_log_limit_unlimited();
317
- info("NETDATA SHUTDOWN: initializing shutdown with code %d...", ret);
317
+ netdata_log_info("NETDATA SHUTDOWN: initializing shutdown with code %d...", ret);
318
319
send_statistics("EXIT", ret?"ERROR":"OK","-");
320
@@ -494,7 +494,7 @@ void netdata_cleanup_and_exit(int ret) {
494
delta_shutdown_time("exit");
495
496
usec_t ended_ut = now_monotonic_usec();
497
- info("NETDATA SHUTDOWN: completed in %llu ms - netdata is now exiting - bye bye...", (ended_ut - started_ut) / USEC_PER_MS);
497
+ netdata_log_info("NETDATA SHUTDOWN: completed in %llu ms - netdata is now exiting - bye bye...", (ended_ut - started_ut) / USEC_PER_MS);
498
exit(ret);
499
}
500
@@ -641,7 +641,7 @@ static void set_nofile_limit(struct rlimit *rl) {
641
return;
642
}
643
644
- info("resources control: allowed file descriptors: soft = %zu, max = %zu",
644
+ netdata_log_info("resources control: allowed file descriptors: soft = %zu, max = %zu",
645
(size_t) rl->rlim_cur, (size_t) rl->rlim_max);
646
647
// make the soft/hard limits equal
@@ -668,10 +668,10 @@ void cancel_main_threads() {
668
for (i = 0; static_threads[i].name != NULL ; i++) {
669
if (static_threads[i].enabled == NETDATA_MAIN_THREAD_RUNNING) {
670
if (static_threads[i].thread) {
671
- info("EXIT: Stopping main thread: %s", static_threads[i].name);
671
+ netdata_log_info("EXIT: Stopping main thread: %s", static_threads[i].name);
672
netdata_thread_cancel(*static_threads[i].thread);
673
} else {
674
- info("EXIT: No thread running (marking as EXITED): %s", static_threads[i].name);
674
+ netdata_log_info("EXIT: No thread running (marking as EXITED): %s", static_threads[i].name);
675
static_threads[i].enabled = NETDATA_MAIN_THREAD_EXITED;
676
}
677
found++;
@@ -682,7 +682,7 @@ void cancel_main_threads() {
682
683
while(found && max > 0) {
684
max -= step;
685
- info("Waiting %d threads to finish...", found);
685
+ netdata_log_info("Waiting %d threads to finish...", found);
686
sleep_usec(step);
687
found = 0;
688
for (i = 0; static_threads[i].name != NULL ; i++) {
@@ -698,7 +698,7 @@ void cancel_main_threads() {
698
}
699
}
700
else
701
- info("All threads finished.");
701
+ netdata_log_info("All threads finished.");
702
703
for (i = 0; static_threads[i].name != NULL ; i++)
704
freez(static_threads[i].thread);
@@ -1185,7 +1185,7 @@ static void get_netdata_configured_variables() {
1185
// https://github.com/netdata/netdata/pull/11222#issuecomment-868367920 for more information.
1186
if (rrdset_free_obsolete_time_s < 10) {
1187
rrdset_free_obsolete_time_s = 10;
1188
- info("The \"cleanup obsolete charts after seconds\" option was set to 10 seconds.");
1188
+ netdata_log_info("The \"cleanup obsolete charts after seconds\" option was set to 10 seconds.");
1189
config_set_number(CONFIG_SECTION_DB, "cleanup obsolete charts after secs", rrdset_free_obsolete_time_s);
1190
}
1191
@@ -1221,13 +1221,13 @@ int load_netdata_conf(char *filename, char overwrite_used) {
1221
1222
ret = config_load(filename, overwrite_used, NULL);
1223
if(!ret) {
1224
- info("CONFIG: cannot load user config '%s'. Will try the stock version.", filename);
1224
+ netdata_log_info("CONFIG: cannot load user config '%s'. Will try the stock version.", filename);
1225
freez(filename);
1226
1227
filename = strdupz_path_subpath(netdata_configured_stock_config_dir, "netdata.conf");
1228
ret = config_load(filename, overwrite_used, NULL);
1229
if(!ret)
1230
- info("CONFIG: cannot load stock config '%s'. Running with internal defaults.", filename);
1230
+ netdata_log_info("CONFIG: cannot load stock config '%s'. Running with internal defaults.", filename);
1231
}
1232
1233
freez(filename);
@@ -1247,14 +1247,14 @@ int get_system_info(struct rrdhost_system_info *system_info) {
1247
script = mallocz(sizeof(char) * (strlen(netdata_configured_primary_plugins_dir) + strlen("system-info.sh") + 2));
1248
sprintf(script, "%s/%s", netdata_configured_primary_plugins_dir, "system-info.sh");
1249
if (unlikely(access(script, R_OK) != 0)) {
1250
- info("System info script %s not found.",script);
1250
+ netdata_log_info("System info script %s not found.",script);
1251
freez(script);
1252
return 1;
1253
}
1254
1255
pid_t command_pid;
1256
1257
- info("Executing %s", script);
1257
+ netdata_log_info("Executing %s", script);
1258
1259
FILE *fp_child_input;
1260
FILE *fp_child_output = netdata_popen(script, &command_pid, &fp_child_input);
@@ -1275,10 +1275,10 @@ int get_system_info(struct rrdhost_system_info *system_info) {
1275
coverity_remove_taint(value);
1276
1277
if(unlikely(rrdhost_set_system_info_variable(system_info, line, value))) {
1278
- info("Unexpected environment variable %s=%s", line, value);
1278
+ netdata_log_info("Unexpected environment variable %s=%s", line, value);
1279
}
1280
else {
1281
- info("%s=%s", line, value);
1281
+ netdata_log_info("%s=%s", line, value);
1282
setenv(line, value, 1);
1283
}
1284
}
@@ -1327,9 +1327,9 @@ void post_conf_load(char **user)
1327
{ \
1328
usec_t now_ut = now_monotonic_usec(); \
1329
if(prev_msg) \
1330
- info("NETDATA STARTUP: in %7llu ms, %s - next: %s", (now_ut - last_ut) / USEC_PER_MS, prev_msg, msg); \
1330
+ netdata_log_info("NETDATA STARTUP: in %7llu ms, %s - next: %s", (now_ut - last_ut) / USEC_PER_MS, prev_msg, msg); \
1331
else \
1332
- info("NETDATA STARTUP: next: %s", msg); \
1332
+ netdata_log_info("NETDATA STARTUP: next: %s", msg); \
1333
last_ut = now_ut; \
1334
prev_msg = msg; \
1335
}
@@ -1349,7 +1349,7 @@ int main(int argc, char **argv) {
1349
usec_t started_ut = now_monotonic_usec();
1350
usec_t last_ut = started_ut;
1351
const char *prev_msg = NULL;
1352
- // Initialize stderror avoiding coredump when info() or error() is called
1352
+ // Initialize stderror avoiding coredump when netdata_log_info() or error() is called
1353
stderror = stderr;
1354
1355
int i;
@@ -2018,7 +2018,7 @@ int main(int argc, char **argv) {
2018
if(become_daemon(dont_fork, user) == -1)
2019
fatal("Cannot daemonize myself.");
2020
2021
- info("netdata started on pid %d.", getpid());
2021
+ netdata_log_info("netdata started on pid %d.", getpid());
2022
2023
delta_startup_time("initialize threads after fork");
2024
@@ -2124,7 +2124,7 @@ int main(int argc, char **argv) {
2124
delta_startup_time("ready");
2125
2126
usec_t ready_ut = now_monotonic_usec();
2127
- info("NETDATA STARTUP: completed in %llu ms. Enjoy real-time performance monitoring!", (ready_ut - started_ut) / USEC_PER_MS);
2127
+ netdata_log_info("NETDATA STARTUP: completed in %llu ms. Enjoy real-time performance monitoring!", (ready_ut - started_ut) / USEC_PER_MS);
2128
netdata_ready = true;
2129
2130
send_statistics("START", "-", "-");
daemon/service.c
+3
-3
@@ -40,7 +40,7 @@ static void svc_rrddim_obsolete_to_archive(RRDDIM *rd) {
40
41
const char *cache_filename = rrddim_cache_filename(rd);
42
if(cache_filename) {
43
- info("Deleting dimension file '%s'.", cache_filename);
43
+ netdata_log_info("Deleting dimension file '%s'.", cache_filename);
44
if (unlikely(unlink(cache_filename) == -1))
45
error("Cannot delete dimension file '%s'", cache_filename);
46
}
@@ -91,7 +91,7 @@ static bool svc_rrdset_archive_obsolete_dimensions(RRDSET *st, bool all_dimensio
91
)) {
92
93
if(dictionary_acquired_item_references(rd_dfe.item) == 1) {
94
- info("Removing obsolete dimension '%s' (%s) of '%s' (%s).", rrddim_name(rd), rrddim_id(rd), rrdset_name(st), rrdset_id(st));
94
+ netdata_log_info("Removing obsolete dimension '%s' (%s) of '%s' (%s).", rrddim_name(rd), rrddim_id(rd), rrdset_name(st), rrdset_id(st));
95
svc_rrddim_obsolete_to_archive(rd);
96
}
97
else
@@ -227,7 +227,7 @@ restart_after_removal:
227
if(!rrdhost_should_be_removed(host, protected_host, now))
228
continue;
229
230
- info("Host '%s' with machine guid '%s' is obsolete - cleaning up.", rrdhost_hostname(host), host->machine_guid);
230
+ netdata_log_info("Host '%s' with machine guid '%s' is obsolete - cleaning up.", rrdhost_hostname(host), host->machine_guid);
231
232
if (rrdhost_option_check(host, RRDHOST_OPTION_DELETE_ORPHAN_HOST)
233
/* don't delete multi-host DB host files */
daemon/signals.c
+13
-13
@@ -130,7 +130,7 @@ static void reap_child(pid_t pid) {
130
if (errno != ECHILD)
131
error("SIGNAL: waitid(%d): failed to wait for child", pid);
132
else
133
- info("SIGNAL: waitid(%d): failed - it seems the child is already reaped", pid);
133
+ netdata_log_info("SIGNAL: waitid(%d): failed - it seems the child is already reaped", pid);
134
return;
135
}
136
else if (i.si_pid == 0) {
@@ -141,25 +141,25 @@ static void reap_child(pid_t pid) {
141
142
switch (i.si_code) {
143
case CLD_EXITED:
144
- info("SIGNAL: reap_child(%d) exited with code: %d", pid, i.si_status);
144
+ netdata_log_info("SIGNAL: reap_child(%d) exited with code: %d", pid, i.si_status);
145
break;
146
case CLD_KILLED:
147
- info("SIGNAL: reap_child(%d) killed by signal: %d", pid, i.si_status);
147
+ netdata_log_info("SIGNAL: reap_child(%d) killed by signal: %d", pid, i.si_status);
148
break;
149
case CLD_DUMPED:
150
- info("SIGNAL: reap_child(%d) dumped core by signal: %d", pid, i.si_status);
150
+ netdata_log_info("SIGNAL: reap_child(%d) dumped core by signal: %d", pid, i.si_status);
151
break;
152
case CLD_STOPPED:
153
- info("SIGNAL: reap_child(%d) stopped by signal: %d", pid, i.si_status);
153
+ netdata_log_info("SIGNAL: reap_child(%d) stopped by signal: %d", pid, i.si_status);
154
break;
155
case CLD_TRAPPED:
156
- info("SIGNAL: reap_child(%d) trapped by signal: %d", pid, i.si_status);
156
+ netdata_log_info("SIGNAL: reap_child(%d) trapped by signal: %d", pid, i.si_status);
157
break;
158
case CLD_CONTINUED:
159
- info("SIGNAL: reap_child(%d) continued by signal: %d", pid, i.si_status);
159
+ netdata_log_info("SIGNAL: reap_child(%d) continued by signal: %d", pid, i.si_status);
160
break;
161
default:
162
- info("SIGNAL: reap_child(%d) gave us a SIGCHLD with code %d and status %d.", pid, i.si_code, i.si_status);
162
+ netdata_log_info("SIGNAL: reap_child(%d) gave us a SIGCHLD with code %d and status %d.", pid, i.si_code, i.si_status);
163
break;
164
}
165
}
@@ -204,28 +204,28 @@ void signals_handle(void) {
204
switch (signals_waiting[i].action) {
205
case NETDATA_SIGNAL_RELOAD_HEALTH:
206
error_log_limit_unlimited();
207
- info("SIGNAL: Received %s. Reloading HEALTH configuration...", name);
207
+ netdata_log_info("SIGNAL: Received %s. Reloading HEALTH configuration...", name);
208
error_log_limit_reset();
209
execute_command(CMD_RELOAD_HEALTH, NULL, NULL);
210
break;
211
212
case NETDATA_SIGNAL_SAVE_DATABASE:
213
error_log_limit_unlimited();
214
- info("SIGNAL: Received %s. Saving databases...", name);
214
+ netdata_log_info("SIGNAL: Received %s. Saving databases...", name);
215
error_log_limit_reset();
216
execute_command(CMD_SAVE_DATABASE, NULL, NULL);
217
break;
218
219
case NETDATA_SIGNAL_REOPEN_LOGS:
220
error_log_limit_unlimited();
221
- info("SIGNAL: Received %s. Reopening all log files...", name);
221
+ netdata_log_info("SIGNAL: Received %s. Reopening all log files...", name);
222
error_log_limit_reset();
223
execute_command(CMD_REOPEN_LOGS, NULL, NULL);
224
break;
225
226
case NETDATA_SIGNAL_EXIT_CLEANLY:
227
error_log_limit_unlimited();
228
- info("SIGNAL: Received %s. Cleaning up to exit...", name);
228
+ netdata_log_info("SIGNAL: Received %s. Cleaning up to exit...", name);
229
commands_exit();
230
netdata_cleanup_and_exit(0);
231
exit(0);
@@ -240,7 +240,7 @@ void signals_handle(void) {
240
break;
241
242
default:
243
- info("SIGNAL: Received %s. No signal handler configured. Ignoring it.", name);
243
+ netdata_log_info("SIGNAL: Received %s. No signal handler configured. Ignoring it.", name);
244
break;
245
}
246
}
database/contexts/rrdcontext.c
+1
-1
@@ -241,7 +241,7 @@ void rrdcontext_hub_checkpoint_command(void *ptr) {
241
}
242
243
if(rrdhost_flag_check(host, RRDHOST_FLAG_ACLK_STREAM_CONTEXTS)) {
244
- info("RRDCONTEXT: received checkpoint command for claim id '%s', node id '%s', while node '%s' has an active context streaming.",
244
+ netdata_log_info("RRDCONTEXT: received checkpoint command for claim id '%s', node id '%s', while node '%s' has an active context streaming.",
245
cmd->claim_id, cmd->node_id, rrdhost_hostname(host));
246
247
// disable it temporarily, so that our worker will not attempt to send messages in parallel
database/engine/cache.c
+5
-5
@@ -2090,7 +2090,7 @@ void pgc_open_cache_to_journal_v2(PGC *cache, Word_t section, unsigned datafile_
2090
2091
struct section_pages *sp = *section_pages_pptr;
2092
if(!spinlock_trylock(&sp->migration_to_v2_spinlock)) {
2093
- info("DBENGINE: migration to journal v2 for datafile %u is postponed, another jv2 indexer is already running for this section", datafile_fileno);
2093
+ netdata_log_info("DBENGINE: migration to journal v2 for datafile %u is postponed, another jv2 indexer is already running for this section", datafile_fileno);
2094
pgc_ll_unlock(cache, &cache->hot);
2095
return;
2096
}
@@ -2353,7 +2353,7 @@ void *unittest_stress_test_collector(void *ptr) {
2353
heartbeat_init(&hb);
2354
2355
while(!__atomic_load_n(&pgc_uts.stop, __ATOMIC_RELAXED)) {
2356
- // info("COLLECTOR %zu: collecting metrics %zu to %zu, from %ld to %lu", id, metric_start, metric_end, start_time_t, start_time_t + pgc_uts.points_per_page);
2356
+ // netdata_log_info("COLLECTOR %zu: collecting metrics %zu to %zu, from %ld to %lu", id, metric_start, metric_end, start_time_t, start_time_t + pgc_uts.points_per_page);
2357
2358
netdata_thread_disable_cancelability();
2359
@@ -2483,7 +2483,7 @@ void *unittest_stress_test_service(void *ptr) {
2483
}
2484
2485
static void unittest_stress_test_save_dirty_page_callback(PGC *cache __maybe_unused, PGC_ENTRY *entries_array __maybe_unused, PGC_PAGE **pages_array __maybe_unused, size_t entries __maybe_unused) {
2486
- // info("SAVE %zu pages", entries);
2486
+ // netdata_log_info("SAVE %zu pages", entries);
2487
if(!pgc_uts.stop) {
2488
usec_t t = pgc_uts.time_per_flush_ut;
2489
@@ -2623,7 +2623,7 @@ void unittest_stress_test(void) {
2623
if(stats.events_flush_critical > old_stats.events_flush_critical)
2624
flushing_status = "F";
2625
2626
- info("PGS %5zuk +%4zuk/-%4zuk "
2626
+ netdata_log_info("PGS %5zuk +%4zuk/-%4zuk "
2627
"| RF %5zuk "
2628
"| HOT %5zuk +%4zuk -%4zuk "
2629
"| DRT %s %5zuk +%4zuk -%4zuk "
@@ -2649,7 +2649,7 @@ void unittest_stress_test(void) {
2649
#endif
2650
);
2651
}
2652
- info("Waiting for threads to stop...");
2652
+ netdata_log_info("Waiting for threads to stop...");
2653
__atomic_store_n(&pgc_uts.stop, true, __ATOMIC_RELAXED);
2654
2655
netdata_thread_join(service_thread, NULL);
database/engine/datafile.c
+12
-12
@@ -338,7 +338,7 @@ static int load_data_file(struct rrdengine_datafile *datafile)
338
ctx_fs_error(ctx);
339
return fd;
340
}
341
- info("DBENGINE: initializing data file \"%s\".", path);
341
+ netdata_log_info("DBENGINE: initializing data file \"%s\".", path);
342
343
ret = check_file_properties(file, &file_size, sizeof(struct rrdeng_df_sb));
344
if (ret)
@@ -354,7 +354,7 @@ static int load_data_file(struct rrdengine_datafile *datafile)
354
datafile->file = file;
355
datafile->pos = file_size;
356
357
- info("DBENGINE: data file \"%s\" initialized (size:%"PRIu64").", path, file_size);
357
+ netdata_log_info("DBENGINE: data file \"%s\" initialized (size:%"PRIu64").", path, file_size);
358
return 0;
359
360
error:
@@ -398,7 +398,7 @@ static int scan_data_files(struct rrdengine_instance *ctx)
398
ctx_fs_error(ctx);
399
return ret;
400
}
401
- info("DBENGINE: found %d files in path %s", ret, ctx->config.dbfiles_path);
401
+ netdata_log_info("DBENGINE: found %d files in path %s", ret, ctx->config.dbfiles_path);
402
403
datafiles = callocz(MIN(ret, MAX_DATAFILES), sizeof(*datafiles));
404
for (matched_files = 0 ; UV_EOF != uv_fs_scandir_next(&req, &dent) && matched_files < MAX_DATAFILES ; ) {
@@ -445,12 +445,12 @@ static int scan_data_files(struct rrdengine_instance *ctx)
445
ret = journalfile_unlink(journalfile);
446
if (!ret) {
447
journalfile_v1_generate_path(datafile, path, sizeof(path));
448
- info("DBENGINE: deleted journal file \"%s\".", path);
448
+ netdata_log_info("DBENGINE: deleted journal file \"%s\".", path);
449
}
450
ret = unlink_data_file(datafile);
451
if (!ret) {
452
generate_datafilepath(datafile, path, sizeof(path));
453
- info("DBENGINE: deleted data file \"%s\".", path);
453
+ netdata_log_info("DBENGINE: deleted data file \"%s\".", path);
454
}
455
freez(journalfile);
456
freez(datafile);
@@ -479,14 +479,14 @@ int create_new_datafile_pair(struct rrdengine_instance *ctx, bool having_lock)
479
int ret;
480
char path[RRDENG_PATH_MAX];
481
482
- info("DBENGINE: creating new data and journal files in path %s", ctx->config.dbfiles_path);
482
+ netdata_log_info("DBENGINE: creating new data and journal files in path %s", ctx->config.dbfiles_path);
483
datafile = datafile_alloc_and_init(ctx, 1, fileno);
484
ret = create_data_file(datafile);
485
if(ret)
486
goto error_after_datafile;
487
488
generate_datafilepath(datafile, path, sizeof(path));
489
- info("DBENGINE: created data file \"%s\".", path);
489
+ netdata_log_info("DBENGINE: created data file \"%s\".", path);
490
491
journalfile = journalfile_alloc_and_init(datafile);
492
ret = journalfile_create(journalfile, datafile);
@@ -494,7 +494,7 @@ int create_new_datafile_pair(struct rrdengine_instance *ctx, bool having_lock)
494
goto error_after_journalfile;
495
496
journalfile_v1_generate_path(datafile, path, sizeof(path));
497
- info("DBENGINE: created journal file \"%s\".", path);
497
+ netdata_log_info("DBENGINE: created journal file \"%s\".", path);
498
499
ctx_current_disk_space_increase(ctx, datafile->pos + journalfile->unsafe.pos);
500
datafile_list_insert(ctx, datafile, having_lock);
@@ -524,7 +524,7 @@ int init_data_files(struct rrdengine_instance *ctx)
524
error("DBENGINE: failed to scan path \"%s\".", ctx->config.dbfiles_path);
525
return ret;
526
} else if (0 == ret) {
527
- info("DBENGINE: data files not found, creating in path \"%s\".", ctx->config.dbfiles_path);
527
+ netdata_log_info("DBENGINE: data files not found, creating in path \"%s\".", ctx->config.dbfiles_path);
528
ctx->atomic.last_fileno = 0;
529
ret = create_new_datafile_pair(ctx, false);
530
if (ret) {
@@ -552,7 +552,7 @@ void finalize_data_files(struct rrdengine_instance *ctx)
552
logged = false;
553
while(__atomic_load_n(&ctx->atomic.extents_currently_being_flushed, __ATOMIC_RELAXED)) {
554
if(!logged) {
555
- info("Waiting for inflight flush to finish on tier %d...", ctx->config.tier);
555
+ netdata_log_info("Waiting for inflight flush to finish on tier %d...", ctx->config.tier);
556
logged = true;
557
}
558
sleep_usec(100 * USEC_PER_MS);
@@ -566,7 +566,7 @@ void finalize_data_files(struct rrdengine_instance *ctx)
566
size_t iterations = 100;
567
while(!datafile_acquire_for_deletion(datafile) && datafile != ctx->datafiles.first->prev && --iterations > 0) {
568
if(!logged) {
569
- info("Waiting to acquire data file %u of tier %d to close it...", datafile->fileno, ctx->config.tier);
569
+ netdata_log_info("Waiting to acquire data file %u of tier %d to close it...", datafile->fileno, ctx->config.tier);
570
logged = true;
571
}
572
sleep_usec(100 * USEC_PER_MS);
@@ -583,7 +583,7 @@ void finalize_data_files(struct rrdengine_instance *ctx)
583
spinlock_unlock(&datafile->writers.spinlock);
584
uv_rwlock_wrunlock(&ctx->datafiles.rwlock);
585
if(!logged) {
586
- info("Waiting for writers to data file %u of tier %d to finish...", datafile->fileno, ctx->config.tier);
586
+ netdata_log_info("Waiting for writers to data file %u of tier %d to finish...", datafile->fileno, ctx->config.tier);
587
logged = true;
588
}
589
sleep_usec(100 * USEC_PER_MS);
database/engine/journalfile.c
+13
-13
@@ -926,7 +926,7 @@ static int journalfile_v2_validate(void *data_start, size_t journal_v2_file_size
926
unsigned entries;
927
unsigned total_pages = 0;
928
929
- info("DBENGINE: checking %u metrics that exist in the journal", j2_header->metric_count);
929
+ netdata_log_info("DBENGINE: checking %u metrics that exist in the journal", j2_header->metric_count);
930
for (entries = 0; entries < j2_header->metric_count; entries++) {
931
932
char uuid_str[UUID_STR_LEN];
@@ -957,16 +957,16 @@ static int journalfile_v2_validate(void *data_start, size_t journal_v2_file_size
957
958
metric++;
959
if ((uint32_t)((uint8_t *) metric - (uint8_t *) data_start) > (uint32_t) journal_v2_file_size) {
960
- info("DBENGINE: verification failed EOF reached -- total entries %u, verified %u", entries, verified);
960
+ netdata_log_info("DBENGINE: verification failed EOF reached -- total entries %u, verified %u", entries, verified);
961
return 1;
962
}
963
}
964
965
if (entries != verified) {
966
- info("DBENGINE: verification failed -- total entries %u, verified %u", entries, verified);
966
+ netdata_log_info("DBENGINE: verification failed -- total entries %u, verified %u", entries, verified);
967
return 1;
968
}
969
- info("DBENGINE: verification succeeded -- total entries %u, verified %u (%u total pages)", entries, verified, total_pages);
969
+ netdata_log_info("DBENGINE: verification succeeded -- total entries %u, verified %u (%u total pages)", entries, verified, total_pages);
970
971
return 0;
972
}
@@ -1007,7 +1007,7 @@ void journalfile_v2_populate_retention_to_mrg(struct rrdengine_instance *ctx, st
1007
journalfile_v2_data_release(journalfile);
1008
usec_t ended_ut = now_monotonic_usec();
1009
1010
- info("DBENGINE: journal v2 of tier %d, datafile %u populated, size: %0.2f MiB, metrics: %0.2f k, %0.2f ms"
1010
+ netdata_log_info("DBENGINE: journal v2 of tier %d, datafile %u populated, size: %0.2f MiB, metrics: %0.2f k, %0.2f ms"
1011
, ctx->config.tier, journalfile->datafile->fileno
1012
, (double)data_size / 1024 / 1024
1013
, (double)entries / 1000
@@ -1061,7 +1061,7 @@ int journalfile_v2_load(struct rrdengine_instance *ctx, struct rrdengine_journal
1061
return 1;
1062
}
1063
1064
- info("DBENGINE: checking integrity of '%s'", path_v2);
1064
+ netdata_log_info("DBENGINE: checking integrity of '%s'", path_v2);
1065
usec_t validation_start_ut = now_monotonic_usec();
1066
int rc = journalfile_v2_validate(data_start, journal_v2_file_size, journal_v1_file_size);
1067
if (unlikely(rc)) {
@@ -1092,7 +1092,7 @@ int journalfile_v2_load(struct rrdengine_instance *ctx, struct rrdengine_journal
1092
1093
usec_t finished_ut = now_monotonic_usec();
1094
1095
- info("DBENGINE: journal v2 '%s' loaded, size: %0.2f MiB, metrics: %0.2f k, "
1095
+ netdata_log_info("DBENGINE: journal v2 '%s' loaded, size: %0.2f MiB, metrics: %0.2f k, "
1096
"mmap: %0.2f ms, validate: %0.2f ms"
1097
, path_v2
1098
, (double)journal_v2_file_size / 1024 / 1024
@@ -1268,7 +1268,7 @@ void journalfile_migrate_to_v2_callback(Word_t section, unsigned datafile_fileno
1268
1269
journalfile_v2_generate_path(datafile, path, sizeof(path));
1270
1271
- info("DBENGINE: indexing file '%s': extents %zu, metrics %zu, pages %zu",
1271
+ netdata_log_info("DBENGINE: indexing file '%s': extents %zu, metrics %zu, pages %zu",
1272
path,
1273
number_of_extents,
1274
number_of_metrics,
@@ -1439,7 +1439,7 @@ void journalfile_migrate_to_v2_callback(Word_t section, unsigned datafile_fileno
1439
1440
internal_error(true, "DBENGINE: FILE COMPLETED --------> %llu", (now_monotonic_usec() - start_loading) / USEC_PER_MS);
1441
1442
- info("DBENGINE: migrated journal file '%s', file size %zu", path, total_file_size);
1442
+ netdata_log_info("DBENGINE: migrated journal file '%s', file size %zu", path, total_file_size);
1443
1444
// msync(data_start, total_file_size, MS_SYNC);
1445
journalfile_v2_data_set(journalfile, fd_v2, data_start, total_file_size);
@@ -1450,7 +1450,7 @@ void journalfile_migrate_to_v2_callback(Word_t section, unsigned datafile_fileno
1450
return;
1451
}
1452
else {
1453
- info("DBENGINE: failed to build index '%s', file will be skipped", path);
1453
+ netdata_log_info("DBENGINE: failed to build index '%s', file will be skipped", path);
1454
j2_header.data = NULL;
1455
j2_header.magic = JOURVAL_V2_SKIP_MAGIC;
1456
memcpy(data_start, &j2_header, sizeof(j2_header));
@@ -1517,19 +1517,19 @@ int journalfile_load(struct rrdengine_instance *ctx, struct rrdengine_journalfil
1517
1518
ret = journalfile_check_superblock(file);
1519
if (ret) {
1520
- info("DBENGINE: invalid journal file '%s' ; superblock check failed.", path);
1520
+ netdata_log_info("DBENGINE: invalid journal file '%s' ; superblock check failed.", path);
1521
error = ret;
1522
goto cleanup;
1523
}
1524
ctx_io_read_op_bytes(ctx, sizeof(struct rrdeng_jf_sb));
1525
1526
- info("DBENGINE: loading journal file '%s'", path);
1526
+ netdata_log_info("DBENGINE: loading journal file '%s'", path);
1527
1528
max_id = journalfile_iterate_transactions(ctx, journalfile);
1529
1530
__atomic_store_n(&ctx->atomic.transaction_id, MAX(__atomic_load_n(&ctx->atomic.transaction_id, __ATOMIC_RELAXED), max_id + 1), __ATOMIC_RELAXED);
1531
1532
- info("DBENGINE: journal file '%s' loaded (size:%"PRIu64").", path, file_size);
1532
+ netdata_log_info("DBENGINE: journal file '%s' loaded (size:%"PRIu64").", path, file_size);
1533
1534
bool is_last_file = (ctx_last_fileno_get(ctx) == journalfile->datafile->fileno);
1535
if (is_last_file && journalfile->datafile->pos <= rrdeng_target_data_file_size(ctx) / 3) {
database/engine/metric.c
+6
-6
@@ -867,7 +867,7 @@ int mrg_unittest(void) {
867
size_t threads = mrg->partitions / 3 + 1;
868
size_t tiers = 3;
869
size_t run_for_secs = 5;
870
- info("preparing stress test of %zu entries...", entries);
870
+ netdata_log_info("preparing stress test of %zu entries...", entries);
871
struct mrg_stress t = {
872
.mrg = mrg,
873
.entries = entries,
@@ -880,7 +880,7 @@ int mrg_unittest(void) {
880
t.array[i].after = now / 3;
881
t.array[i].before = now / 2;
882
}
883
- info("stress test is populating MRG with 3 tiers...");
883
+ netdata_log_info("stress test is populating MRG with 3 tiers...");
884
for(size_t i = 0; i < entries ;i++) {
885
struct mrg_stress_entry *e = &t.array[i];
886
for(size_t tier = 1; tier <= tiers ;tier++) {
@@ -893,7 +893,7 @@ int mrg_unittest(void) {
893
e->before);
894
}
895
}
896
- info("stress test ready to run...");
896
+ netdata_log_info("stress test ready to run...");
897
898
usec_t started_ut = now_monotonic_usec();
899
@@ -920,7 +920,7 @@ int mrg_unittest(void) {
920
struct mrg_statistics stats;
921
mrg_get_statistics(mrg, &stats);
922
923
- info("DBENGINE METRIC: did %zu additions, %zu duplicate additions, "
923
+ netdata_log_info("DBENGINE METRIC: did %zu additions, %zu duplicate additions, "
924
"%zu deletions, %zu wrong deletions, "
925
"%zu successful searches, %zu wrong searches, "
926
"in %llu usecs",
@@ -929,13 +929,13 @@ int mrg_unittest(void) {
929
stats.search_hits, stats.search_misses,
930
ended_ut - started_ut);
931
932
- info("DBENGINE METRIC: updates performance: %0.2fk/sec total, %0.2fk/sec/thread",
932
+ netdata_log_info("DBENGINE METRIC: updates performance: %0.2fk/sec total, %0.2fk/sec/thread",
933
(double)t.updates / (double)((ended_ut - started_ut) / USEC_PER_SEC) / 1000.0,
934
(double)t.updates / (double)((ended_ut - started_ut) / USEC_PER_SEC) / 1000.0 / threads);
935
936
mrg_destroy(mrg);
937
938
- info("DBENGINE METRIC: all tests passed!");
938
+ netdata_log_info("DBENGINE METRIC: all tests passed!");
939
940
return 0;
941
}
database/engine/rrdengine.c
+13
-13
@@ -1174,7 +1174,7 @@ static void update_metrics_first_time_s(struct rrdengine_instance *ctx, struct r
1174
added++;
1175
}
1176
1177
- info("DBENGINE: recalculating tier %d retention for %zu metrics starting with datafile %u",
1177
+ netdata_log_info("DBENGINE: recalculating tier %d retention for %zu metrics starting with datafile %u",
1178
ctx->config.tier, count, first_datafile_remaining->fileno);
1179
1180
journalfile_v2_data_release(journalfile);
@@ -1189,7 +1189,7 @@ static void update_metrics_first_time_s(struct rrdengine_instance *ctx, struct r
1189
if(worker)
1190
worker_is_busy(UV_EVENT_DBENGINE_POPULATE_MRG);
1191
1192
- info("DBENGINE: updating tier %d metrics registry retention for %zu metrics",
1192
+ netdata_log_info("DBENGINE: updating tier %d metrics registry retention for %zu metrics",
1193
ctx->config.tier, added);
1194
1195
size_t deleted_metrics = 0, zero_retention_referenced = 0, zero_disk_retention = 0, zero_disk_but_live = 0;
@@ -1243,7 +1243,7 @@ void datafile_delete(struct rrdengine_instance *ctx, struct rrdengine_datafile *
1243
datafile_got_for_deletion = datafile_acquire_for_deletion(datafile);
1244
1245
if (!datafile_got_for_deletion) {
1246
- info("DBENGINE: waiting for data file '%s/"
1246
+ netdata_log_info("DBENGINE: waiting for data file '%s/"
1247
DATAFILE_PREFIX RRDENG_FILE_NUMBER_PRINT_TMPL DATAFILE_EXTENSION
1248
"' to be available for deletion, "
1249
"it is in use currently by %u users.",
@@ -1255,7 +1255,7 @@ void datafile_delete(struct rrdengine_instance *ctx, struct rrdengine_datafile *
1255
}
1256
1257
__atomic_add_fetch(&rrdeng_cache_efficiency_stats.datafile_deletion_started, 1, __ATOMIC_RELAXED);
1258
- info("DBENGINE: deleting data file '%s/"
1258
+ netdata_log_info("DBENGINE: deleting data file '%s/"
1259
DATAFILE_PREFIX RRDENG_FILE_NUMBER_PRINT_TMPL DATAFILE_EXTENSION
1260
"'.",
1261
ctx->config.dbfiles_path, ctx->datafiles.first->tier, ctx->datafiles.first->fileno);
@@ -1277,26 +1277,26 @@ void datafile_delete(struct rrdengine_instance *ctx, struct rrdengine_datafile *
1277
journal_file_bytes = journalfile_current_size(journal_file);
1278
deleted_bytes = journalfile_v2_data_size_get(journal_file);
1279
1280
- info("DBENGINE: deleting data and journal files to maintain disk quota");
1280
+ netdata_log_info("DBENGINE: deleting data and journal files to maintain disk quota");
1281
ret = journalfile_destroy_unsafe(journal_file, datafile);
1282
if (!ret) {
1283
journalfile_v1_generate_path(datafile, path, sizeof(path));
1284
- info("DBENGINE: deleted journal file \"%s\".", path);
1284
+ netdata_log_info("DBENGINE: deleted journal file \"%s\".", path);
1285
journalfile_v2_generate_path(datafile, path, sizeof(path));
1286
- info("DBENGINE: deleted journal file \"%s\".", path);
1286
+ netdata_log_info("DBENGINE: deleted journal file \"%s\".", path);
1287
deleted_bytes += journal_file_bytes;
1288
}
1289
ret = destroy_data_file_unsafe(datafile);
1290
if (!ret) {
1291
generate_datafilepath(datafile, path, sizeof(path));
1292
- info("DBENGINE: deleted data file \"%s\".", path);
1292
+ netdata_log_info("DBENGINE: deleted data file \"%s\".", path);
1293
deleted_bytes += datafile_bytes;
1294
}
1295
freez(journal_file);
1296
freez(datafile);
1297
1298
ctx_current_disk_space_decrease(ctx, deleted_bytes);
1299
- info("DBENGINE: reclaimed %u bytes of disk space.", deleted_bytes);
1299
+ netdata_log_info("DBENGINE: reclaimed %u bytes of disk space.", deleted_bytes);
1300
}
1301
1302
static void *database_rotate_tp_worker(struct rrdengine_instance *ctx __maybe_unused, void *data __maybe_unused, struct completion *completion __maybe_unused, uv_work_t *uv_work_req __maybe_unused) {
@@ -1376,7 +1376,7 @@ static void *ctx_shutdown_tp_worker(struct rrdengine_instance *ctx __maybe_unuse
1376
__atomic_load_n(&ctx->atomic.inflight_queries, __ATOMIC_RELAXED)) {
1377
if(!logged) {
1378
logged = true;
1379
- info("DBENGINE: waiting for %zu inflight queries to finish to shutdown tier %d...",
1379
+ netdata_log_info("DBENGINE: waiting for %zu inflight queries to finish to shutdown tier %d...",
1380
__atomic_load_n(&ctx->atomic.inflight_queries, __ATOMIC_RELAXED),
1381
(ctx->config.legacy) ? -1 : ctx->config.tier);
1382
}
@@ -1501,12 +1501,12 @@ static void *journal_v2_indexing_tp_worker(struct rrdengine_instance *ctx __mayb
1501
spinlock_unlock(&datafile->writers.spinlock);
1502
1503
if(!available) {
1504
- info("DBENGINE: journal file %u needs to be indexed, but it has writers working on it - skipping it for now", datafile->fileno);
1504
+ netdata_log_info("DBENGINE: journal file %u needs to be indexed, but it has writers working on it - skipping it for now", datafile->fileno);
1505
datafile = datafile->next;
1506
continue;
1507
}
1508
1509
- info("DBENGINE: journal file %u is ready to be indexed", datafile->fileno);
1509
+ netdata_log_info("DBENGINE: journal file %u is ready to be indexed", datafile->fileno);
1510
pgc_open_cache_to_journal_v2(open_cache, (Word_t) ctx, (int) datafile->fileno, ctx->config.page_type,
1511
journalfile_migrate_to_v2_callback, (void *) datafile->journalfile);
1512
@@ -1860,7 +1860,7 @@ void dbengine_event_loop(void* arg) {
1860
}
1861
1862
/* cleanup operations of the event loop */
1863
- info("DBENGINE: shutting down dbengine thread");
1863
+ netdata_log_info("DBENGINE: shutting down dbengine thread");
1864
1865
/*
1866
* uv_async_send after uv_close does not seem to crash in linux at the moment,
database/engine/rrdengineapi.c
+5
-5
@@ -1085,7 +1085,7 @@ static void rrdeng_populate_mrg(struct rrdengine_instance *ctx) {
1085
if(cpus < 1)
1086
cpus = 1;
1087
1088
- info("DBENGINE: populating retention to MRG from %zu journal files of tier %d, using %zd threads...", datafiles, ctx->config.tier, cpus);
1088
+ netdata_log_info("DBENGINE: populating retention to MRG from %zu journal files of tier %d, using %zd threads...", datafiles, ctx->config.tier, cpus);
1089
1090
if(datafiles > 2) {
1091
struct rrdengine_datafile *datafile;
@@ -1126,7 +1126,7 @@ void rrdeng_readiness_wait(struct rrdengine_instance *ctx) {
1126
ctx->loading.populate_mrg.array = NULL;
1127
ctx->loading.populate_mrg.size = 0;
1128
1129
- info("DBENGINE: tier %d is ready for data collection and queries", ctx->config.tier);
1129
+ netdata_log_info("DBENGINE: tier %d is ready for data collection and queries", ctx->config.tier);
1130
}
1131
1132
bool rrdeng_is_legacy(STORAGE_INSTANCE *db_instance) {
@@ -1218,16 +1218,16 @@ int rrdeng_exit(struct rrdengine_instance *ctx) {
1218
bool logged = false;
1219
while(__atomic_load_n(&ctx->atomic.collectors_running, __ATOMIC_RELAXED) && !unittest_running) {
1220
if(!logged) {
1221
- info("DBENGINE: waiting for collectors to finish on tier %d...", (ctx->config.legacy) ? -1 : ctx->config.tier);
1221
+ netdata_log_info("DBENGINE: waiting for collectors to finish on tier %d...", (ctx->config.legacy) ? -1 : ctx->config.tier);
1222
logged = true;
1223
}
1224
sleep_usec(100 * USEC_PER_MS);
1225
}
1226
1227
- info("DBENGINE: flushing main cache for tier %d", (ctx->config.legacy) ? -1 : ctx->config.tier);
1227
+ netdata_log_info("DBENGINE: flushing main cache for tier %d", (ctx->config.legacy) ? -1 : ctx->config.tier);
1228
pgc_flush_all_hot_and_dirty_pages(main_cache, (Word_t)ctx);
1229
1230
- info("DBENGINE: shutting down tier %d", (ctx->config.legacy) ? -1 : ctx->config.tier);
1230
+ netdata_log_info("DBENGINE: shutting down tier %d", (ctx->config.legacy) ? -1 : ctx->config.tier);
1231
struct completion completion = {};
1232
completion_init(&completion);
1233
rrdeng_enq_cmd(ctx, RRDENG_OPCODE_CTX_SHUTDOWN, NULL, &completion, STORAGE_PRIORITY_BEST_EFFORT, NULL, NULL);
database/engine/rrdenginelib.c
+4
-4
@@ -65,7 +65,7 @@ int open_file_for_io(char *path, int flags, uv_file *file, int direct)
65
fatal_assert(req.result >= 0);
66
*file = req.result;
67
#ifdef __APPLE__
68
- info("Disabling OS X caching for file \"%s\".", path);
68
+ netdata_log_info("Disabling OS X caching for file \"%s\".", path);
69
fcntl(fd, F_NOCACHE, 1);
70
#endif
71
--direct; /* break the loop */
@@ -90,7 +90,7 @@ int is_legacy_child(const char *machine_guid)
90
snprintfz(dbengine_file, FILENAME_MAX, "%s/%s/dbengine", netdata_configured_cache_dir, machine_guid);
91
int rc = uv_fs_stat(NULL, &stat_req, dbengine_file, NULL);
92
if (likely(rc == 0 && ((stat_req.statbuf.st_mode & S_IFMT) == S_IFDIR))) {
93
- //info("Found legacy engine folder \"%s\"", dbengine_file);
93
+ //netdata_log_info("Found legacy engine folder \"%s\"", dbengine_file);
94
return 1;
95
}
96
}
@@ -143,12 +143,12 @@ int compute_multidb_diskspace()
143
int rc = count_legacy_children(netdata_configured_cache_dir);
144
if (likely(rc >= 0)) {
145
computed_multidb_disk_quota_mb = (rc + 1) * default_rrdeng_disk_quota_mb;
146
- info("Found %d legacy dbengines, setting multidb diskspace to %dMB", rc, computed_multidb_disk_quota_mb);
146
+ netdata_log_info("Found %d legacy dbengines, setting multidb diskspace to %dMB", rc, computed_multidb_disk_quota_mb);
147
148
fp = fopen(multidb_disk_space_file, "w");
149
if (likely(fp)) {
150
fprintf(fp, "%d", computed_multidb_disk_quota_mb);
151
- info("Created file '%s' to store the computed value", multidb_disk_space_file);
151
+ netdata_log_info("Created file '%s' to store the computed value", multidb_disk_space_file);
152
fclose(fp);
153
} else
154
error("Failed to store the default multidb disk quota size on '%s'", multidb_disk_space_file);
database/ram/rrddim_mem.c
+1
-1
@@ -353,7 +353,7 @@ void rrddim_query_init(STORAGE_METRIC_HANDLE *db_metric_handle, struct storage_e
353
h->slot_timestamp = rrddim_slot2time(db_metric_handle, h->slot);
354
h->last_timestamp = rrddim_slot2time(db_metric_handle, h->last_slot);
355
356
- // info("RRDDIM QUERY INIT: start %ld, end %ld, next %ld, first %ld, last %ld, dt %ld", start_time, end_time, h->next_timestamp, h->slot_timestamp, h->last_timestamp, h->dt);
356
+ // netdata_log_info("RRDDIM QUERY INIT: start %ld, end %ld, next %ld, first %ld, last %ld, dt %ld", start_time, end_time, h->next_timestamp, h->slot_timestamp, h->last_timestamp, h->dt);
357
358
__atomic_add_fetch(&rrddim_db_memory_size, sizeof(struct mem_query_handle), __ATOMIC_RELAXED);
359
handle->handle = (STORAGE_QUERY_HANDLE *)h;
database/rrdcalctemplate.c
+1
-1
@@ -246,7 +246,7 @@ void rrdcalctemplate_add_from_config(RRDHOST *host, RRDCALCTEMPLATE *rt) {
246
if(added)
247
freez(rt);
248
else {
249
- info("Health configuration template '%s' already exists for host '%s'.", rrdcalctemplate_name(rt), rrdhost_hostname(host));
249
+ netdata_log_info("Health configuration template '%s' already exists for host '%s'.", rrdcalctemplate_name(rt), rrdhost_hostname(host));
250
rrdcalctemplate_free_unused_rrdcalctemplate_loaded_from_config(rt);
251
}
252
}
database/rrddim.c
+9
-9
@@ -53,7 +53,7 @@ static void rrddim_insert_callback(const DICTIONARY_ITEM *item __maybe_unused, v
53
54
if(ctr->memory_mode == RRD_MEMORY_MODE_MAP || ctr->memory_mode == RRD_MEMORY_MODE_SAVE) {
55
if(!rrddim_memory_load_or_create_map_save(st, rd, ctr->memory_mode)) {
56
- info("Failed to use memory mode %s for chart '%s', dimension '%s', falling back to ram", (ctr->memory_mode == RRD_MEMORY_MODE_MAP)?"map":"save", rrdset_name(st), rrddim_name(rd));
56
+ netdata_log_info("Failed to use memory mode %s for chart '%s', dimension '%s', falling back to ram", (ctr->memory_mode == RRD_MEMORY_MODE_MAP)?"map":"save", rrdset_name(st), rrddim_name(rd));
57
ctr->memory_mode = RRD_MEMORY_MODE_RAM;
58
}
59
}
@@ -64,7 +64,7 @@ static void rrddim_insert_callback(const DICTIONARY_ITEM *item __maybe_unused, v
64
65
rd->db.data = netdata_mmap(NULL, entries * sizeof(storage_number), MAP_PRIVATE, 1, false, NULL);
66
if(!rd->db.data) {
67
- info("Failed to use memory mode ram for chart '%s', dimension '%s', falling back to alloc", rrdset_name(st), rrddim_name(rd));
67
+ netdata_log_info("Failed to use memory mode ram for chart '%s', dimension '%s', falling back to alloc", rrdset_name(st), rrddim_name(rd));
68
ctr->memory_mode = RRD_MEMORY_MODE_ALLOC;
69
}
70
else {
@@ -133,7 +133,7 @@ static void rrddim_insert_callback(const DICTIONARY_ITEM *item __maybe_unused, v
133
if(td && (td->algorithm != rd->algorithm || ABS(td->multiplier) != ABS(rd->multiplier) || ABS(td->divisor) != ABS(rd->divisor))) {
134
if(!rrdset_flag_check(st, RRDSET_FLAG_HETEROGENEOUS)) {
135
#ifdef NETDATA_INTERNAL_CHECKS
136
- info("Dimension '%s' added on chart '%s' of host '%s' is not homogeneous to other dimensions already "
136
+ netdata_log_info("Dimension '%s' added on chart '%s' of host '%s' is not homogeneous to other dimensions already "
137
"present (algorithm is '%s' vs '%s', multiplier is %d vs %d, "
138
"divisor is %d vs %d).",
139
rrddim_name(rd),
@@ -536,7 +536,7 @@ inline void rrddim_is_obsolete(RRDSET *st, RRDDIM *rd) {
536
debug(D_RRD_CALLS, "rrddim_is_obsolete() for chart %s, dimension %s", rrdset_name(st), rrddim_name(rd));
537
538
if(unlikely(rrddim_flag_check(rd, RRDDIM_FLAG_ARCHIVED))) {
539
- info("Cannot obsolete already archived dimension %s from chart %s", rrddim_name(rd), rrdset_name(st));
539
+ netdata_log_info("Cannot obsolete already archived dimension %s from chart %s", rrddim_name(rd), rrdset_name(st));
540
return;
541
}
542
rrddim_flag_set(rd, RRDDIM_FLAG_OBSOLETE);
@@ -706,7 +706,7 @@ bool rrddim_memory_load_or_create_map_save(RRDSET *st, RRDDIM *rd, RRD_MEMORY_MO
706
int reset = 0;
707
rd_on_file->magic[sizeof(RRDDIMENSION_MAGIC_V019)] = '\0';
708
if(strcmp(rd_on_file->magic, RRDDIMENSION_MAGIC_V019) != 0) {
709
- info("Initializing file %s.", fullfilename);
709
+ netdata_log_info("Initializing file %s.", fullfilename);
710
memset(rd_on_file, 0, size);
711
reset = 1;
712
}
@@ -721,7 +721,7 @@ bool rrddim_memory_load_or_create_map_save(RRDSET *st, RRDDIM *rd, RRD_MEMORY_MO
721
reset = 1;
722
}
723
else if(dt_usec(&now, &rd_on_file->last_collected_time) > (rd_on_file->entries * rd_on_file->update_every * USEC_PER_SEC)) {
724
- info("File %s is too old (last collected %llu seconds ago, but the database is %ld seconds). Clearing it.", fullfilename, dt_usec(&now, &rd_on_file->last_collected_time) / USEC_PER_SEC, rd_on_file->entries * rd_on_file->update_every);
724
+ netdata_log_info("File %s is too old (last collected %llu seconds ago, but the database is %ld seconds). Clearing it.", fullfilename, dt_usec(&now, &rd_on_file->last_collected_time) / USEC_PER_SEC, rd_on_file->entries * rd_on_file->update_every);
725
memset(rd_on_file, 0, size);
726
reset = 1;
727
}
@@ -730,15 +730,15 @@ bool rrddim_memory_load_or_create_map_save(RRDSET *st, RRDDIM *rd, RRD_MEMORY_MO
730
rd->last_collected_value = rd_on_file->last_collected_value;
731
732
if(rd_on_file->algorithm != rd->algorithm)
733
- info("File %s does not have the expected algorithm (expected %u '%s', found %u '%s'). Previous values may be wrong.",
733
+ netdata_log_info("File %s does not have the expected algorithm (expected %u '%s', found %u '%s'). Previous values may be wrong.",
734
fullfilename, rd->algorithm, rrd_algorithm_name(rd->algorithm), rd_on_file->algorithm, rrd_algorithm_name(rd_on_file->algorithm));
735
736
if(rd_on_file->multiplier != rd->multiplier)
737
- info("File %s does not have the expected multiplier (expected %d, found %ld). "
737
+ netdata_log_info("File %s does not have the expected multiplier (expected %d, found %ld). "
738
"Previous values may be wrong.", fullfilename, rd->multiplier, (long)rd_on_file->multiplier);
739
740
if(rd_on_file->divisor != rd->divisor)
741
- info("File %s does not have the expected divisor (expected %d, found %ld). "
741
+ netdata_log_info("File %s does not have the expected divisor (expected %d, found %ld). "
742
"Previous values may be wrong.", fullfilename, rd->divisor, (long)rd_on_file->divisor);
743
}
744
database/rrdhost.c
+16
-16
@@ -521,7 +521,7 @@ int is_legacy = 1;
521
522
// ------------------------------------------------------------------------
523
524
- info("Host '%s' (at registry as '%s') with guid '%s' initialized"
524
+ netdata_log_info("Host '%s' (at registry as '%s') with guid '%s' initialized"
525
", os '%s'"
526
", timezone '%s'"
527
", tags '%s'"
@@ -612,21 +612,21 @@ static void rrdhost_update(RRDHOST *host
612
host->registry_hostname = string_strdupz((registry_hostname && *registry_hostname)?registry_hostname:hostname);
613
614
if(strcmp(rrdhost_hostname(host), hostname) != 0) {
615
- info("Host '%s' has been renamed to '%s'. If this is not intentional it may mean multiple hosts are using the same machine_guid.", rrdhost_hostname(host), hostname);
615
+ netdata_log_info("Host '%s' has been renamed to '%s'. If this is not intentional it may mean multiple hosts are using the same machine_guid.", rrdhost_hostname(host), hostname);
616
rrdhost_init_hostname(host, hostname, true);
617
} else {
618
rrdhost_index_add_hostname(host);
619
}
620
621
if(strcmp(rrdhost_program_name(host), program_name) != 0) {
622
- info("Host '%s' switched program name from '%s' to '%s'", rrdhost_hostname(host), rrdhost_program_name(host), program_name);
622
+ netdata_log_info("Host '%s' switched program name from '%s' to '%s'", rrdhost_hostname(host), rrdhost_program_name(host), program_name);
623
STRING *t = host->program_name;
624
host->program_name = string_strdupz(program_name);
625
string_freez(t);
626
}
627
628
if(strcmp(rrdhost_program_version(host), program_version) != 0) {
629
- info("Host '%s' switched program version from '%s' to '%s'", rrdhost_hostname(host), rrdhost_program_version(host), program_version);
629
+ netdata_log_info("Host '%s' switched program version from '%s' to '%s'", rrdhost_hostname(host), rrdhost_program_version(host), program_version);
630
STRING *t = host->program_version;
631
host->program_version = string_strdupz(program_version);
632
string_freez(t);
@@ -685,7 +685,7 @@ static void rrdhost_update(RRDHOST *host
685
ml_host_new(host);
686
687
rrdhost_load_rrdcontext_data(host);
688
- info("Host %s is not in archived mode anymore", rrdhost_hostname(host));
688
+ netdata_log_info("Host %s is not in archived mode anymore", rrdhost_hostname(host));
689
}
690
691
spinlock_unlock(&host->rrdhost_update_lock);
@@ -973,7 +973,7 @@ int rrd_init(char *hostname, struct rrdhost_system_info *system_info, bool unitt
973
set_late_global_environment(system_info);
974
fatal("Failed to initialize SQLite");
975
}
976
- info("Skipping SQLITE metadata initialization since memory mode is not dbengine");
976
+ netdata_log_info("Skipping SQLITE metadata initialization since memory mode is not dbengine");
977
}
978
979
if (unlikely(sql_init_context_database(system_info ? 0 : 1))) {
@@ -988,11 +988,11 @@ int rrd_init(char *hostname, struct rrdhost_system_info *system_info, bool unitt
988
rrdpush_init();
989
990
if (default_rrd_memory_mode == RRD_MEMORY_MODE_DBENGINE || rrdpush_receiver_needs_dbengine()) {
991
- info("DBENGINE: Initializing ...");
991
+ netdata_log_info("DBENGINE: Initializing ...");
992
dbengine_init(hostname);
993
}
994
else {
995
- info("DBENGINE: Not initializing ...");
995
+ netdata_log_info("DBENGINE: Not initializing ...");
996
storage_tiers = 1;
997
}
998
@@ -1153,7 +1153,7 @@ void rrdhost_free___while_having_rrd_wrlock(RRDHOST *host, bool force) {
1153
if(!host) return;
1154
1155
if (netdata_exit || force) {
1156
- info("RRD: 'host:%s' freeing memory...", rrdhost_hostname(host));
1156
+ netdata_log_info("RRD: 'host:%s' freeing memory...", rrdhost_hostname(host));
1157
1158
// ------------------------------------------------------------------------
1159
// first remove it from the indexes, so that it will not be discoverable
@@ -1213,7 +1213,7 @@ void rrdhost_free___while_having_rrd_wrlock(RRDHOST *host, bool force) {
1213
#endif
1214
1215
if (!netdata_exit && !force) {
1216
- info("RRD: 'host:%s' is now in archive mode...", rrdhost_hostname(host));
1216
+ netdata_log_info("RRD: 'host:%s' is now in archive mode...", rrdhost_hostname(host));
1217
rrdhost_flag_set(host, RRDHOST_FLAG_ARCHIVED | RRDHOST_FLAG_ORPHAN);
1218
return;
1219
}
@@ -1283,7 +1283,7 @@ void rrd_finalize_collection_for_all_hosts(void) {
1283
void rrdhost_save_charts(RRDHOST *host) {
1284
if(!host) return;
1285
1286
- info("RRD: 'host:%s' saving / closing database...", rrdhost_hostname(host));
1286
+ netdata_log_info("RRD: 'host:%s' saving / closing database...", rrdhost_hostname(host));
1287
1288
RRDSET *st;
1289
@@ -1470,7 +1470,7 @@ void reload_host_labels(void) {
1470
}
1471
1472
void rrdhost_finalize_collection(RRDHOST *host) {
1473
- info("RRD: 'host:%s' stopping data collection...", rrdhost_hostname(host));
1473
+ netdata_log_info("RRD: 'host:%s' stopping data collection...", rrdhost_hostname(host));
1474
1475
RRDSET *st;
1476
rrdset_foreach_read(st, host)
@@ -1484,7 +1484,7 @@ void rrdhost_finalize_collection(RRDHOST *host) {
1484
void rrdhost_delete_charts(RRDHOST *host) {
1485
if(!host) return;
1486
1487
- info("RRD: 'host:%s' deleting disk files...", rrdhost_hostname(host));
1487
+ netdata_log_info("RRD: 'host:%s' deleting disk files...", rrdhost_hostname(host));
1488
1489
RRDSET *st;
1490
@@ -1506,7 +1506,7 @@ void rrdhost_delete_charts(RRDHOST *host) {
1506
void rrdhost_cleanup_charts(RRDHOST *host) {
1507
if(!host) return;
1508
1509
- info("RRD: 'host:%s' cleaning up disk files...", rrdhost_hostname(host));
1509
+ netdata_log_info("RRD: 'host:%s' cleaning up disk files...", rrdhost_hostname(host));
1510
1511
RRDSET *st;
1512
uint32_t rrdhost_delete_obsolete_charts = rrdhost_option_check(host, RRDHOST_OPTION_DELETE_OBSOLETE_CHARTS);
@@ -1533,7 +1533,7 @@ void rrdhost_cleanup_charts(RRDHOST *host) {
1533
// RRDHOST - save all hosts to disk
1534
1535
void rrdhost_save_all(void) {
1536
- info("RRD: saving databases [%zu hosts(s)]...", rrdhost_hosts_available());
1536
+ netdata_log_info("RRD: saving databases [%zu hosts(s)]...", rrdhost_hosts_available());
1537
1538
rrd_rdlock();
1539
@@ -1548,7 +1548,7 @@ void rrdhost_save_all(void) {
1548
// RRDHOST - save or delete all hosts from disk
1549
1550
void rrdhost_cleanup_all(void) {
1551
- info("RRD: cleaning up database [%zu hosts(s)]...", rrdhost_hosts_available());
1551
+ netdata_log_info("RRD: cleaning up database [%zu hosts(s)]...", rrdhost_hosts_available());
1552
1553
rrd_rdlock();
1554
database/rrdset.c
+17
-17
@@ -64,7 +64,7 @@ static STRING *rrdset_fix_name(RRDHOST *host, const char *chart_full_id, const c
64
i++;
65
} while (rrdset_index_find_name(host, new_name));
66
67
- info("RRDSET: using name '%s' for chart '%s' on host '%s'.", new_name, full_name, rrdhost_hostname(host));
67
+ netdata_log_info("RRDSET: using name '%s' for chart '%s' on host '%s'.", new_name, full_name, rrdhost_hostname(host));
68
}
69
else
70
return NULL;
@@ -147,7 +147,7 @@ static void rrdset_insert_callback(const DICTIONARY_ITEM *item __maybe_unused, v
147
148
if(st->rrd_memory_mode == RRD_MEMORY_MODE_SAVE || st->rrd_memory_mode == RRD_MEMORY_MODE_MAP) {
149
if(!rrdset_memory_load_or_create_map_save(st, st->rrd_memory_mode)) {
150
- info("Failed to use db mode %s for chart '%s', falling back to ram mode.", (st->rrd_memory_mode == RRD_MEMORY_MODE_MAP)?"map":"save", rrdset_name(st));
150
+ netdata_log_info("Failed to use db mode %s for chart '%s', falling back to ram mode.", (st->rrd_memory_mode == RRD_MEMORY_MODE_MAP)?"map":"save", rrdset_name(st));
151
st->rrd_memory_mode = RRD_MEMORY_MODE_RAM;
152
}
153
}
@@ -660,7 +660,7 @@ void rrdset_get_retention_of_tier_for_collected_chart(RRDSET *st, time_t *first_
660
661
inline void rrdset_is_obsolete(RRDSET *st) {
662
if(unlikely(rrdset_flag_check(st, RRDSET_FLAG_ARCHIVED))) {
663
- info("Cannot obsolete already archived chart %s", rrdset_name(st));
663
+ netdata_log_info("Cannot obsolete already archived chart %s", rrdset_name(st));
664
return;
665
}
666
@@ -717,7 +717,7 @@ inline void rrdset_update_heterogeneous_flag(RRDSET *st) {
717
if(algorithm != rd->algorithm || multiplier != ABS(rd->multiplier) || divisor != ABS(rd->divisor)) {
718
if(!rrdset_flag_check(st, RRDSET_FLAG_HETEROGENEOUS)) {
719
#ifdef NETDATA_INTERNAL_CHECKS
720
- info("Dimension '%s' added on chart '%s' of host '%s' is not homogeneous to other dimensions already present "
720
+ netdata_log_info("Dimension '%s' added on chart '%s' of host '%s' is not homogeneous to other dimensions already present "
721
"(algorithm is '%s' vs '%s', multiplier is %d vs %d, "
722
"divisor is %d vs %d).",
723
rrddim_name(rd),
@@ -835,12 +835,12 @@ void rrdset_save(RRDSET *st) {
835
void rrdset_delete_files(RRDSET *st) {
836
RRDDIM *rd;
837
838
- info("Deleting chart '%s' ('%s') from disk...", rrdset_id(st), rrdset_name(st));
838
+ netdata_log_info("Deleting chart '%s' ('%s') from disk...", rrdset_id(st), rrdset_name(st));
839
840
if(st->rrd_memory_mode == RRD_MEMORY_MODE_SAVE || st->rrd_memory_mode == RRD_MEMORY_MODE_MAP) {
841
const char *cache_filename = rrdset_cache_filename(st);
842
if(cache_filename) {
843
- info("Deleting chart header file '%s'.", cache_filename);
843
+ netdata_log_info("Deleting chart header file '%s'.", cache_filename);
844
if (unlikely(unlink(cache_filename) == -1))
845
error("Cannot delete chart header file '%s'", cache_filename);
846
}
@@ -852,7 +852,7 @@ void rrdset_delete_files(RRDSET *st) {
852
const char *cache_filename = rrddim_cache_filename(rd);
853
if(!cache_filename) continue;
854
855
- info("Deleting dimension file '%s'.", cache_filename);
855
+ netdata_log_info("Deleting dimension file '%s'.", cache_filename);
856
if(unlikely(unlink(cache_filename) == -1))
857
error("Cannot delete dimension file '%s'", cache_filename);
858
}
@@ -865,13 +865,13 @@ void rrdset_delete_files(RRDSET *st) {
865
void rrdset_delete_obsolete_dimensions(RRDSET *st) {
866
RRDDIM *rd;
867
868
- info("Deleting dimensions of chart '%s' ('%s') from disk...", rrdset_id(st), rrdset_name(st));
868
+ netdata_log_info("Deleting dimensions of chart '%s' ('%s') from disk...", rrdset_id(st), rrdset_name(st));
869
870
rrddim_foreach_read(rd, st) {
871
if(rrddim_flag_check(rd, RRDDIM_FLAG_OBSOLETE)) {
872
const char *cache_filename = rrddim_cache_filename(rd);
873
if(!cache_filename) continue;
874
- info("Deleting dimension file '%s'.", cache_filename);
874
+ netdata_log_info("Deleting dimension file '%s'.", cache_filename);
875
if(unlikely(unlink(cache_filename) == -1))
876
error("Cannot delete dimension file '%s'", cache_filename);
877
}
@@ -1001,7 +1001,7 @@ void rrdset_timed_next(RRDSET *st, struct timeval now, usec_t duration_since_las
1001
if(unlikely(since_last_usec < 0)) {
1002
// oops! the database is in the future
1003
#ifdef NETDATA_INTERNAL_CHECKS
1004
- info("RRD database for chart '%s' on host '%s' is %0.5" NETDATA_DOUBLE_MODIFIER
1004
+ netdata_log_info("RRD database for chart '%s' on host '%s' is %0.5" NETDATA_DOUBLE_MODIFIER
1005
" secs in the future (counter #%u, update #%u). Adjusting it to current time."
1006
, rrdset_id(st)
1007
, rrdhost_hostname(st->rrdhost)
@@ -1020,7 +1020,7 @@ void rrdset_timed_next(RRDSET *st, struct timeval now, usec_t duration_since_las
1020
else if(unlikely((usec_t)since_last_usec > (usec_t)(st->update_every * 5 * USEC_PER_SEC))) {
1021
// oops! the database is too far behind
1022
#ifdef NETDATA_INTERNAL_CHECKS
1023
- info("RRD database for chart '%s' on host '%s' is %0.5" NETDATA_DOUBLE_MODIFIER
1023
+ netdata_log_info("RRD database for chart '%s' on host '%s' is %0.5" NETDATA_DOUBLE_MODIFIER
1024
" secs in the past (counter #%u, update #%u). Adjusting it to current time.",
1025
rrdset_id(st), rrdhost_hostname(st->rrdhost), (NETDATA_DOUBLE)since_last_usec / USEC_PER_SEC,
1026
st->counter, st->counter_done);
@@ -1048,7 +1048,7 @@ void rrdset_timed_next(RRDSET *st, struct timeval now, usec_t duration_since_las
1048
last_time_s = now.tv_sec;
1049
1050
if(min_delta > permanent_min_delta) {
1051
- info("MINIMUM MICROSECONDS DELTA of thread %d increased from %lld to %lld (+%lld)", gettid(), permanent_min_delta, min_delta, min_delta - permanent_min_delta);
1051
+ netdata_log_info("MINIMUM MICROSECONDS DELTA of thread %d increased from %lld to %lld (+%lld)", gettid(), permanent_min_delta, min_delta, min_delta - permanent_min_delta);
1052
permanent_min_delta = min_delta;
1053
}
1054
@@ -1544,7 +1544,7 @@ void rrdset_timed_done(RRDSET *st, struct timeval now, bool pending_rrdset_next)
1544
1545
// check if the chart has a long time to be updated
1546
if(unlikely(st->usec_since_last_update > MAX(st->db.entries, 60) * update_every_ut)) {
1547
- info("host '%s', chart '%s': took too long to be updated (counter #%u, update #%u, %0.3" NETDATA_DOUBLE_MODIFIER
1547
+ netdata_log_info("host '%s', chart '%s': took too long to be updated (counter #%u, update #%u, %0.3" NETDATA_DOUBLE_MODIFIER
1548
" secs). Resetting it.", rrdhost_hostname(st->rrdhost), rrdset_id(st), st->counter, st->counter_done,
1549
(NETDATA_DOUBLE)st->usec_since_last_update / USEC_PER_SEC);
1550
rrdset_reset(st);
@@ -1586,7 +1586,7 @@ void rrdset_timed_done(RRDSET *st, struct timeval now, bool pending_rrdset_next)
1586
// check if we will re-write the entire data set
1587
if(unlikely(dt_usec(&st->last_collected_time, &st->last_updated) > st->db.entries * update_every_ut &&
1588
st->rrd_memory_mode != RRD_MEMORY_MODE_DBENGINE)) {
1589
- info(
1589
+ netdata_log_info(
1590
"'%s': too old data (last updated at %"PRId64".%"PRId64", last collected at %"PRId64".%"PRId64"). "
1591
"Resetting it. Will not store the next entry.",
1592
rrdset_id(st),
@@ -1888,7 +1888,7 @@ void rrdset_timed_done(RRDSET *st, struct timeval now, bool pending_rrdset_next)
1888
// if(unlikely(now_collect_ut < next_store_ut && st->counter_done > 1)) {
1889
// // this is collected in the same interpolation point
1890
// rrdset_debug(st, "THIS IS IN THE SAME INTERPOLATION POINT");
1891
-// info("INTERNAL CHECK: host '%s', chart '%s' collection %zu is in the same interpolation point: short by %llu microseconds", st->rrdhost->hostname, rrdset_name(st), st->counter_done, next_store_ut - now_collect_ut);
1891
+// netdata_log_info("INTERNAL CHECK: host '%s', chart '%s' collection %zu is in the same interpolation point: short by %llu microseconds", st->rrdhost->hostname, rrdset_name(st), st->counter_done, next_store_ut - now_collect_ut);
1892
// }
1893
// #endif
1894
@@ -2162,7 +2162,7 @@ bool rrdset_memory_load_or_create_map_save(RRDSET *st, RRD_MEMORY_MODE memory_mo
2162
2163
st_on_file->magic[sizeof(RRDSET_MAGIC_V019)] = '\0';
2164
if(strcmp(st_on_file->magic, RRDSET_MAGIC_V019) != 0) {
2165
- info("Initializing file '%s'.", fullfilename);
2165
+ netdata_log_info("Initializing file '%s'.", fullfilename);
2166
memset(st_on_file, 0, size);
2167
}
2168
else if(strncmp(st_on_file->id, rrdset_id(st), RRD_ID_LENGTH_MAX_V019) != 0) {
@@ -2178,7 +2178,7 @@ bool rrdset_memory_load_or_create_map_save(RRDSET *st, RRD_MEMORY_MODE memory_mo
2178
memset(st_on_file, 0, size);
2179
}
2180
else if((now_s - st_on_file->last_updated.tv_sec) > (long)st->update_every * (long)st->db.entries) {
2181
- info("File '%s' is too old. Clearing it.", fullfilename);
2181
+ netdata_log_info("File '%s' is too old. Clearing it.", fullfilename);
2182
memset(st_on_file, 0, size);
2183
}
2184
else if(st_on_file->last_updated.tv_sec > now_s + st->update_every) {
database/sqlite/sqlite_aclk.c
+5
-5
@@ -385,7 +385,7 @@ static void aclk_synchronization(void *arg __maybe_unused)
385
config->timer_req.data = config;
386
fatal_assert(0 == uv_timer_start(&config->timer_req, timer_cb, TIMER_PERIOD_MS, TIMER_PERIOD_MS));
387
388
- info("Starting ACLK synchronization thread");
388
+ netdata_log_info("Starting ACLK synchronization thread");
389
390
config->cleanup_after = now_realtime_sec() + ACLK_DATABASE_CLEANUP_FIRST;
391
config->initialized = true;
@@ -462,7 +462,7 @@ static void aclk_synchronization(void *arg __maybe_unused)
462
463
worker_unregister();
464
service_exits();
465
- info("ACLK SYNC: Shutting down ACLK synchronization event loop");
465
+ netdata_log_info("ACLK SYNC: Shutting down ACLK synchronization event loop");
466
}
467
468
static void aclk_synchronization_init(void)
@@ -543,7 +543,7 @@ void sql_aclk_sync_init(void)
543
return;
544
}
545
546
- info("Creating archived hosts");
546
+ netdata_log_info("Creating archived hosts");
547
int number_of_children = 0;
548
rc = sqlite3_exec_monitored(db_meta, SQL_FETCH_ALL_HOSTS, create_host_callback, &number_of_children, &err_msg);
549
@@ -552,7 +552,7 @@ void sql_aclk_sync_init(void)
552
sqlite3_free(err_msg);
553
}
554
555
- info("Created %d archived hosts", number_of_children);
555
+ netdata_log_info("Created %d archived hosts", number_of_children);
556
// Trigger host context load for hosts that have been created
557
metadata_queue_load_host_context(NULL);
558
@@ -568,7 +568,7 @@ void sql_aclk_sync_init(void)
568
}
569
aclk_synchronization_init();
570
571
- info("ACLK sync initialization completed");
571
+ netdata_log_info("ACLK sync initialization completed");
572
#endif
573
}
574
database/sqlite/sqlite_aclk_node.c
+1
-1
@@ -172,7 +172,7 @@ void aclk_check_node_info_and_collectors(void)
172
dfe_done(host);
173
174
if(pending)
175
- info("ACLK: %zu nodes are pending for contexts to load, skipped sending node info for them", pending);
175
+ netdata_log_info("ACLK: %zu nodes are pending for contexts to load, skipped sending node info for them", pending);
176
}
177
178
#endif
database/sqlite/sqlite_context.c
+22
-22
@@ -43,7 +43,7 @@ int sql_init_context_database(int memory)
43
return 1;
44
}
45
46
- info("SQLite database %s initialization", sqlite_database);
46
+ netdata_log_info("SQLite database %s initialization", sqlite_database);
47
48
char buf[1024 + 1] = "";
49
const char *list[2] = { buf, NULL };
@@ -112,7 +112,7 @@ void sql_close_context_database(void)
112
if (unlikely(!db_context_meta))
113
return;
114
115
- info("Closing context SQLite database");
115
+ netdata_log_info("Closing context SQLite database");
116
117
rc = sqlite3_close_v2(db_context_meta);
118
if (unlikely(rc != SQLITE_OK))
@@ -431,7 +431,7 @@ int ctx_delete_context(uuid_t *host_uuid, VERSIONED_CONTEXT_DATA *context_data)
431
else {
432
char host_uuid_str[UUID_STR_LEN];
433
uuid_unparse_lower(*host_uuid, host_uuid_str);
434
- info("%s: Deleted context %s under host %s", __FUNCTION__, context_data->id, host_uuid_str);
434
+ netdata_log_info("%s: Deleted context %s under host %s", __FUNCTION__, context_data->id, host_uuid_str);
435
}
436
#endif
437
@@ -463,7 +463,7 @@ int sql_context_cache_stats(int op)
463
static void dict_ctx_get_context_list_cb(VERSIONED_CONTEXT_DATA *context_data, void *data)
464
{
465
(void)data;
466
- info(" Context id = %s "
466
+ netdata_log_info(" Context id = %s "
467
"version = %"PRIu64" "
468
"title = %s "
469
"chart_type = %s "
@@ -512,48 +512,48 @@ int ctx_unittest(void)
512
context_data.version = now_realtime_usec();
513
514
if (likely(!ctx_store_context(&host_uuid, &context_data)))
515
- info("Entry %s inserted", context_data.id);
515
+ netdata_log_info("Entry %s inserted", context_data.id);
516
else
517
- info("Entry %s not inserted", context_data.id);
517
+ netdata_log_info("Entry %s not inserted", context_data.id);
518
519
if (likely(!ctx_store_context(&host_uuid, &context_data)))
520
- info("Entry %s inserted", context_data.id);
520
+ netdata_log_info("Entry %s inserted", context_data.id);
521
else
522
- info("Entry %s not inserted", context_data.id);
522
+ netdata_log_info("Entry %s not inserted", context_data.id);
523
524
// This will change end time
525
context_data.first_time_s = 1657781000;
526
context_data.last_time_s = 1657782001;
527
if (likely(!ctx_update_context(&host_uuid, &context_data)))
528
- info("Entry %s updated", context_data.id);
528
+ netdata_log_info("Entry %s updated", context_data.id);
529
else
530
- info("Entry %s not updated", context_data.id);
531
- info("List context start after insert");
530
+ netdata_log_info("Entry %s not updated", context_data.id);
531
+ netdata_log_info("List context start after insert");
532
ctx_get_context_list(&host_uuid, dict_ctx_get_context_list_cb, NULL);
533
- info("List context end after insert");
533
+ netdata_log_info("List context end after insert");
534
535
// This will change start time
536
context_data.first_time_s = 1657782000;
537
context_data.last_time_s = 1657782001;
538
if (likely(!ctx_update_context(&host_uuid, &context_data)))
539
- info("Entry %s updated", context_data.id);
539
+ netdata_log_info("Entry %s updated", context_data.id);
540
else
541
- info("Entry %s not updated", context_data.id);
541
+ netdata_log_info("Entry %s not updated", context_data.id);
542
543
// This will list one entry
544
- info("List context start after insert");
544
+ netdata_log_info("List context start after insert");
545
ctx_get_context_list(&host_uuid, dict_ctx_get_context_list_cb, NULL);
546
- info("List context end after insert");
546
+ netdata_log_info("List context end after insert");
547
548
- info("List context start after insert");
548
+ netdata_log_info("List context start after insert");
549
ctx_get_context_list(&host_uuid, dict_ctx_get_context_list_cb, NULL);
550
- info("List context end after insert");
550
+ netdata_log_info("List context end after insert");
551
552
// This will delete the entry
553
if (likely(!ctx_delete_context(&host_uuid, &context_data)))
554
- info("Entry %s deleted", context_data.id);
554
+ netdata_log_info("Entry %s deleted", context_data.id);
555
else
556
- info("Entry %s not deleted", context_data.id);
556
+ netdata_log_info("Entry %s not deleted", context_data.id);
557
558
freez((void *)context_data.id);
559
freez((void *)context_data.title);
@@ -562,9 +562,9 @@ int ctx_unittest(void)
562
freez((void *)context_data.units);
563
564
// The list should be empty
565
- info("List context start after delete");
565
+ netdata_log_info("List context start after delete");
566
ctx_get_context_list(&host_uuid, dict_ctx_get_context_list_cb, NULL);
567
- info("List context end after delete");
567
+ netdata_log_info("List context end after delete");
568
569
sql_close_context_database();
570
database/sqlite/sqlite_db_migration.c
+14
-14
@@ -22,7 +22,7 @@ int table_exists_in_database(const char *table)
22
23
int rc = sqlite3_exec_monitored(db_meta, sql, return_int_cb, (void *) &exists, &err_msg);
24
if (rc != SQLITE_OK) {
25
- info("Error checking table existence; %s", err_msg);
25
+ netdata_log_info("Error checking table existence; %s", err_msg);
26
sqlite3_free(err_msg);
27
}
28
@@ -40,7 +40,7 @@ static int column_exists_in_table(const char *table, const char *column)
40
41
int rc = sqlite3_exec_monitored(db_meta, sql, return_int_cb, (void *) &exists, &err_msg);
42
if (rc != SQLITE_OK) {
43
- info("Error checking column existence; %s", err_msg);
43
+ netdata_log_info("Error checking column existence; %s", err_msg);
44
sqlite3_free(err_msg);
45
}
46
@@ -82,7 +82,7 @@ const char *database_migrate_v5_v6[] = {
82
static int do_migration_v1_v2(sqlite3 *database, const char *name)
83
{
84
UNUSED(name);
85
- info("Running \"%s\" database migration", name);
85
+ netdata_log_info("Running \"%s\" database migration", name);
86
87
if (table_exists_in_database("host") && !column_exists_in_table("host", "hops"))
88
return init_database_batch(database, DB_CHECK_NONE, 0, &database_migrate_v1_v2[0]);
@@ -92,7 +92,7 @@ static int do_migration_v1_v2(sqlite3 *database, const char *name)
92
static int do_migration_v2_v3(sqlite3 *database, const char *name)
93
{
94
UNUSED(name);
95
- info("Running \"%s\" database migration", name);
95
+ netdata_log_info("Running \"%s\" database migration", name);
96
97
if (table_exists_in_database("host") && !column_exists_in_table("host", "memory_mode"))
98
return init_database_batch(database, DB_CHECK_NONE, 0, &database_migrate_v2_v3[0]);
@@ -102,7 +102,7 @@ static int do_migration_v2_v3(sqlite3 *database, const char *name)
102
static int do_migration_v3_v4(sqlite3 *database, const char *name)
103
{
104
UNUSED(name);
105
- info("Running database migration %s", name);
105
+ netdata_log_info("Running database migration %s", name);
106
107
char sql[256];
108
@@ -134,7 +134,7 @@ static int do_migration_v3_v4(sqlite3 *database, const char *name)
134
static int do_migration_v4_v5(sqlite3 *database, const char *name)
135
{
136
UNUSED(name);
137
- info("Running \"%s\" database migration", name);
137
+ netdata_log_info("Running \"%s\" database migration", name);
138
139
return init_database_batch(database, DB_CHECK_NONE, 0, &database_migrate_v4_v5[0]);
140
}
@@ -142,7 +142,7 @@ static int do_migration_v4_v5(sqlite3 *database, const char *name)
142
static int do_migration_v5_v6(sqlite3 *database, const char *name)
143
{
144
UNUSED(name);
145
- info("Running \"%s\" database migration", name);
145
+ netdata_log_info("Running \"%s\" database migration", name);
146
147
return init_database_batch(database, DB_CHECK_NONE, 0, &database_migrate_v5_v6[0]);
148
}
@@ -150,7 +150,7 @@ static int do_migration_v5_v6(sqlite3 *database, const char *name)
150
static int do_migration_v6_v7(sqlite3 *database, const char *name)
151
{
152
UNUSED(name);
153
- info("Running \"%s\" database migration", name);
153
+ netdata_log_info("Running \"%s\" database migration", name);
154
155
char sql[256];
156
@@ -184,7 +184,7 @@ static int do_migration_v6_v7(sqlite3 *database, const char *name)
184
static int do_migration_v7_v8(sqlite3 *database, const char *name)
185
{
186
UNUSED(name);
187
- info("Running database migration %s", name);
187
+ netdata_log_info("Running database migration %s", name);
188
189
char sql[256];
190
@@ -215,7 +215,7 @@ static int do_migration_v7_v8(sqlite3 *database, const char *name)
215
216
static int do_migration_v8_v9(sqlite3 *database, const char *name)
217
{
218
- info("Running database migration %s", name);
218
+ netdata_log_info("Running database migration %s", name);
219
220
char sql[2048];
221
int rc;
@@ -291,7 +291,7 @@ static int do_migration_noop(sqlite3 *database, const char *name)
291
{
292
UNUSED(database);
293
UNUSED(name);
294
- info("Running database migration %s", name);
294
+ netdata_log_info("Running database migration %s", name);
295
return 0;
296
}
297
@@ -308,16 +308,16 @@ static int migrate_database(sqlite3 *database, int target_version, char *db_name
308
309
int rc = sqlite3_exec_monitored(database, "PRAGMA user_version;", return_int_cb, (void *) &user_version, &err_msg);
310
if (rc != SQLITE_OK) {
311
- info("Error checking the %s database version; %s", db_name, err_msg);
311
+ netdata_log_info("Error checking the %s database version; %s", db_name, err_msg);
312
sqlite3_free(err_msg);
313
}
314
315
if (likely(user_version == target_version)) {
316
- info("%s database version is %d (no migration needed)", db_name, target_version);
316
+ netdata_log_info("%s database version is %d (no migration needed)", db_name, target_version);
317
return target_version;
318
}
319
320
- info("Database version is %d, current version is %d. Running migration for %s ...", user_version, target_version, db_name);
320
+ netdata_log_info("Database version is %d, current version is %d. Running migration for %s ...", user_version, target_version, db_name);
321
for (int i = user_version; i < target_version && migration_list[i].func; i++) {
322
rc = (migration_list[i].func)(database, migration_list[i].name);
323
if (unlikely(rc)) {
database/sqlite/sqlite_functions.c
+19
-19
@@ -149,9 +149,9 @@ static void add_stmt_to_list(sqlite3_stmt *res)
149
150
if (unlikely(!res)) {
151
if (idx)
152
- info("Finilizing %d statements", idx);
152
+ netdata_log_info("Finilizing %d statements", idx);
153
else
154
- info("No statements pending to finalize");
154
+ netdata_log_info("No statements pending to finalize");
155
while (idx > 0) {
156
int rc;
157
rc = sqlite3_finalize(statements[--idx]);
@@ -169,7 +169,7 @@ static void release_statement(void *statement)
169
{
170
int rc;
171
#ifdef NETDATA_DEV_MODE
172
- info("Thread %d: Cleaning prepared statement on %p", gettid(), statement);
172
+ netdata_log_info("Thread %d: Cleaning prepared statement on %p", gettid(), statement);
173
#endif
174
if (unlikely(rc = sqlite3_finalize((sqlite3_stmt *) statement) != SQLITE_OK))
175
error_report("Failed to finalize statement, rc = %d", rc);
@@ -196,7 +196,7 @@ int prepare_statement(sqlite3 *database, const char *query, sqlite3_stmt **state
196
if (likely(key)) {
197
ret = pthread_setspecific(*key, *statement);
198
#ifdef NETDATA_DEV_MODE
199
- info("Thread %d: Using key %u on statement %p", gettid(), keys_used, *statement);
199
+ netdata_log_info("Thread %d: Using key %u on statement %p", gettid(), keys_used, *statement);
200
#endif
201
}
202
if (ret)
@@ -210,7 +210,7 @@ static int check_table_integrity_cb(void *data, int argc, char **argv, char **co
210
int *status = data;
211
UNUSED(argc);
212
UNUSED(column);
213
- info("---> %s", argv[0]);
213
+ netdata_log_info("---> %s", argv[0]);
214
*status = (strcmp(argv[0], "ok") != 0);
215
return 0;
216
}
@@ -223,11 +223,11 @@ static int check_table_integrity(char *table)
223
char wstr[255];
224
225
if (table) {
226
- info("Checking table %s", table);
226
+ netdata_log_info("Checking table %s", table);
227
snprintfz(wstr, 254, "PRAGMA integrity_check(%s);", table);
228
}
229
else {
230
- info("Checking entire database");
230
+ netdata_log_info("Checking entire database");
231
strcpy(wstr,"PRAGMA integrity_check;");
232
}
233
@@ -261,9 +261,9 @@ static void rebuild_chart()
261
{
262
int rc;
263
char *err_msg = NULL;
264
- info("Rebuilding chart table");
264
+ netdata_log_info("Rebuilding chart table");
265
for (int i = 0; rebuild_chart_commands[i]; i++) {
266
- info("Executing %s", rebuild_chart_commands[i]);
266
+ netdata_log_info("Executing %s", rebuild_chart_commands[i]);
267
rc = sqlite3_exec_monitored(db_meta, rebuild_chart_commands[i], 0, 0, &err_msg);
268
if (rc != SQLITE_OK) {
269
error_report("SQLite error during database setup, rc = %d (%s)", rc, err_msg);
@@ -293,9 +293,9 @@ void rebuild_dimension()
293
int rc;
294
char *err_msg = NULL;
295
296
- info("Rebuilding dimension table");
296
+ netdata_log_info("Rebuilding dimension table");
297
for (int i = 0; rebuild_dimension_commands[i]; i++) {
298
- info("Executing %s", rebuild_dimension_commands[i]);
298
+ netdata_log_info("Executing %s", rebuild_dimension_commands[i]);
299
rc = sqlite3_exec_monitored(db_meta, rebuild_dimension_commands[i], 0, 0, &err_msg);
300
if (rc != SQLITE_OK) {
301
error_report("SQLite error during database setup, rc = %d (%s)", rc, err_msg);
@@ -307,11 +307,11 @@ void rebuild_dimension()
307
308
static int attempt_database_fix()
309
{
310
- info("Closing database and attempting to fix it");
310
+ netdata_log_info("Closing database and attempting to fix it");
311
int rc = sqlite3_close(db_meta);
312
if (rc != SQLITE_OK)
313
error_report("Failed to close database, rc = %d", rc);
314
- info("Attempting to fix database");
314
+ netdata_log_info("Attempting to fix database");
315
db_meta = NULL;
316
return sql_init_database(DB_CHECK_FIX_DB | DB_CHECK_CONT, 0);
317
}
@@ -408,7 +408,7 @@ int sql_init_database(db_check_action_type_t rebuild, int memory)
408
if (rebuild & (DB_CHECK_INTEGRITY | DB_CHECK_FIX_DB)) {
409
int errors_detected = 0;
410
if (!(rebuild & DB_CHECK_CONT))
411
- info("Running database check on %s", sqlite_database);
411
+ netdata_log_info("Running database check on %s", sqlite_database);
412
413
if (check_table_integrity("chart")) {
414
errors_detected++;
@@ -434,7 +434,7 @@ int sql_init_database(db_check_action_type_t rebuild, int memory)
434
435
if (rebuild & DB_CHECK_RECLAIM_SPACE) {
436
if (!(rebuild & DB_CHECK_CONT))
437
- info("Reclaiming space of %s", sqlite_database);
437
+ netdata_log_info("Reclaiming space of %s", sqlite_database);
438
rc = sqlite3_exec_monitored(db_meta, "VACUUM;", 0, 0, &err_msg);
439
if (rc != SQLITE_OK) {
440
error_report("Failed to execute VACUUM rc = %d (%s)", rc, err_msg);
@@ -445,7 +445,7 @@ int sql_init_database(db_check_action_type_t rebuild, int memory)
445
if (rebuild && !(rebuild & DB_CHECK_CONT))
446
return 1;
447
448
- info("SQLite database %s initialization", sqlite_database);
448
+ netdata_log_info("SQLite database %s initialization", sqlite_database);
449
450
char buf[1024 + 1] = "";
451
const char *list[2] = { buf, NULL };
@@ -507,7 +507,7 @@ int sql_init_database(db_check_action_type_t rebuild, int memory)
507
if (init_database_batch(db_meta, rebuild, 0, &database_cleanup[0]))
508
return 1;
509
510
- info("SQLite database initialization completed");
510
+ netdata_log_info("SQLite database initialization completed");
511
512
initialize_thread_key_pool();
513
@@ -524,7 +524,7 @@ void sql_close_database(void)
524
if (unlikely(!db_meta))
525
return;
526
527
- info("Closing SQLite database");
527
+ netdata_log_info("Closing SQLite database");
528
529
add_stmt_to_list(NULL);
530
@@ -825,7 +825,7 @@ struct node_instance_list *get_node_list(void)
825
uuid_unparse_lower(*host_id, host_guid);
826
RRDHOST *host = rrdhost_find_by_guid(host_guid);
827
if (rrdhost_flag_check(host, RRDHOST_FLAG_PENDING_CONTEXT_LOAD)) {
828
- info("ACLK: 'host:%s' skipping get node list because context is initializing", rrdhost_hostname(host));
828
+ netdata_log_info("ACLK: 'host:%s' skipping get node list because context is initializing", rrdhost_hostname(host));
829
continue;
830
}
831
uuid_copy(node_list[row].host_id, *host_id);
database/sqlite/sqlite_health.c
+1
-1
@@ -387,7 +387,7 @@ void sql_health_alarm_log_count(RRDHOST *host) {
387
if (unlikely(rc != SQLITE_OK))
388
error_report("Failed to finalize the prepared statement to count health log entries from db");
389
390
- info("HEALTH [%s]: Table health_log_detail contains %lu entries.", rrdhost_hostname(host), (unsigned long int) host->health.health_log_entries_written);
390
+ netdata_log_info("HEALTH [%s]: Table health_log_detail contains %lu entries.", rrdhost_hostname(host), (unsigned long int) host->health.health_log_entries_written);
391
}
392
393
/* Health related SQL queries
database/sqlite/sqlite_metadata.c
+12
-12
@@ -665,7 +665,7 @@ static void check_dimension_metadata(struct metadata_wc *wc)
665
uint32_t total_deleted= 0;
666
uint64_t last_row_id = wc->row_id;
667
668
- info("METADATA: Checking dimensions starting after row %"PRIu64, wc->row_id);
668
+ netdata_log_info("METADATA: Checking dimensions starting after row %"PRIu64, wc->row_id);
669
670
while (sqlite3_step_monitored(res) == SQLITE_ROW && total_deleted < MAX_METADATA_CLEANUP) {
671
if (unlikely(metadata_flag_check(wc, METADATA_FLAG_SHUTDOWN)))
@@ -685,7 +685,7 @@ static void check_dimension_metadata(struct metadata_wc *wc)
685
wc->check_metadata_after = now + METADATA_MAINTENANCE_RETRY;
686
} else
687
wc->row_id = 0;
688
- info("METADATA: Checked %u, deleted %u -- will resume after row %"PRIu64" in %lld seconds", total_checked, total_deleted, wc->row_id,
688
+ netdata_log_info("METADATA: Checked %u, deleted %u -- will resume after row %"PRIu64" in %lld seconds", total_checked, total_deleted, wc->row_id,
689
(long long)(wc->check_metadata_after - now));
690
691
skip_run:
@@ -1244,7 +1244,7 @@ static void metadata_event_loop(void *arg)
1244
wc->timer_req.data = wc;
1245
fatal_assert(0 == uv_timer_start(&wc->timer_req, timer_cb, TIMER_INITIAL_PERIOD_MS, TIMER_REPEAT_PERIOD_MS));
1246
1247
- info("Starting metadata sync thread with %d entries command queue", METADATA_CMD_Q_MAX_SIZE);
1247
+ netdata_log_info("Starting metadata sync thread with %d entries command queue", METADATA_CMD_Q_MAX_SIZE);
1248
1249
struct metadata_cmd cmd;
1250
memset(&cmd, 0, sizeof(cmd));
@@ -1394,7 +1394,7 @@ static void metadata_event_loop(void *arg)
1394
freez(loop);
1395
worker_unregister();
1396
1397
- info("METADATA: Shutting down event loop");
1397
+ netdata_log_info("METADATA: Shutting down event loop");
1398
completion_mark_complete(&wc->init_complete);
1399
return;
1400
@@ -1415,15 +1415,15 @@ void metadata_sync_shutdown(void)
1415
1416
struct metadata_cmd cmd;
1417
memset(&cmd, 0, sizeof(cmd));
1418
- info("METADATA: Sending a shutdown command");
1418
+ netdata_log_info("METADATA: Sending a shutdown command");
1419
cmd.opcode = METADATA_SYNC_SHUTDOWN;
1420
metadata_enq_cmd(&metasync_worker, &cmd);
1421
1422
/* wait for metadata thread to shut down */
1423
- info("METADATA: Waiting for shutdown ACK");
1423
+ netdata_log_info("METADATA: Waiting for shutdown ACK");
1424
completion_wait_for(&metasync_worker.init_complete);
1425
completion_destroy(&metasync_worker.init_complete);
1426
- info("METADATA: Shutdown complete");
1426
+ netdata_log_info("METADATA: Shutdown complete");
1427
}
1428
1429
void metadata_sync_shutdown_prepare(void)
@@ -1437,11 +1437,11 @@ void metadata_sync_shutdown_prepare(void)
1437
struct completion compl;
1438
completion_init(&compl);
1439
1440
- info("METADATA: Sending a scan host command");
1440
+ netdata_log_info("METADATA: Sending a scan host command");
1441
uint32_t max_wait_iterations = 2000;
1442
while (unlikely(metadata_flag_check(&metasync_worker, METADATA_FLAG_SCANNING_HOSTS)) && max_wait_iterations--) {
1443
if (max_wait_iterations == 1999)
1444
- info("METADATA: Current worker is running; waiting to finish");
1444
+ netdata_log_info("METADATA: Current worker is running; waiting to finish");
1445
sleep_usec(1000);
1446
}
1447
@@ -1449,10 +1449,10 @@ void metadata_sync_shutdown_prepare(void)
1449
cmd.completion = &compl;
1450
metadata_enq_cmd(&metasync_worker, &cmd);
1451
1452
- info("METADATA: Waiting for host scan completion");
1452
+ netdata_log_info("METADATA: Waiting for host scan completion");
1453
completion_wait_for(&compl);
1454
completion_destroy(&compl);
1455
- info("METADATA: Host scan complete; can continue with shutdown");
1455
+ netdata_log_info("METADATA: Host scan complete; can continue with shutdown");
1456
}
1457
1458
// -------------------------------------------------------------
@@ -1471,7 +1471,7 @@ void metadata_sync_init(void)
1471
completion_wait_for(&wc->init_complete);
1472
completion_destroy(&wc->init_complete);
1473
1474
- info("SQLite metadata sync initialization complete");
1474
+ netdata_log_info("SQLite metadata sync initialization complete");
1475
}
1476
1477
exporting/aws_kinesis/aws_kinesis.c
+2
-2
@@ -7,7 +7,7 @@
7
*/
8
void aws_kinesis_cleanup(struct instance *instance)
9
{
10
- info("EXPORTING: cleaning up instance %s ...", instance->config.name);
10
+ netdata_log_info("EXPORTING: cleaning up instance %s ...", instance->config.name);
11
kinesis_shutdown(instance->connector_specific_data);
12
13
freez(instance->connector_specific_data);
@@ -21,7 +21,7 @@ void aws_kinesis_cleanup(struct instance *instance)
21
freez(connector_specific_config);
22
}
23
24
- info("EXPORTING: instance %s exited", instance->config.name);
24
+ netdata_log_info("EXPORTING: instance %s exited", instance->config.name);
25
instance->exited = 1;
26
}
27
exporting/check_filters.c
+2
-2
@@ -29,10 +29,10 @@ int rrdhost_is_exportable(struct instance *instance, RRDHOST *host)
29
30
if (!instance->config.hosts_pattern || simple_pattern_matches(instance->config.hosts_pattern, host_name)) {
31
*flags |= RRDHOST_FLAG_EXPORTING_SEND;
32
- info("enabled exporting of host '%s' for instance '%s'", host_name, instance->config.name);
32
+ netdata_log_info("enabled exporting of host '%s' for instance '%s'", host_name, instance->config.name);
33
} else {
34
*flags |= RRDHOST_FLAG_EXPORTING_DONT_SEND;
35
- info("disabled exporting of host '%s' for instance '%s'", host_name, instance->config.name);
35
+ netdata_log_info("disabled exporting of host '%s' for instance '%s'", host_name, instance->config.name);
36
}
37
}
38
exporting/clean_connectors.c
+2
-2
@@ -46,7 +46,7 @@ void clean_instance(struct instance *instance)
46
*/
47
void simple_connector_cleanup(struct instance *instance)
48
{
49
- info("EXPORTING: cleaning up instance %s ...", instance->config.name);
49
+ netdata_log_info("EXPORTING: cleaning up instance %s ...", instance->config.name);
50
51
struct simple_connector_data *simple_connector_data =
52
(struct simple_connector_data *)instance->connector_specific_data;
@@ -77,6 +77,6 @@ void simple_connector_cleanup(struct instance *instance)
77
(struct simple_connector_config *)instance->config.connector_specific_config;
78
freez(simple_connector_config);
79
80
- info("EXPORTING: instance %s exited", instance->config.name);
80
+ netdata_log_info("EXPORTING: instance %s exited", instance->config.name);
81
instance->exited = 1;
82
}
exporting/exporting_engine.c
+5
-5
@@ -124,7 +124,7 @@ static void exporting_main_cleanup(void *ptr)
124
struct netdata_static_thread *static_thread = (struct netdata_static_thread *)ptr;
125
static_thread->enabled = NETDATA_MAIN_THREAD_EXITING;
126
127
- info("cleaning up...");
127
+ netdata_log_info("cleaning up...");
128
129
if (!engine) {
130
static_thread->enabled = NETDATA_MAIN_THREAD_EXITED;
@@ -139,17 +139,17 @@ static void exporting_main_cleanup(void *ptr)
139
for (struct instance *instance = engine->instance_root; instance; instance = instance->next) {
140
if (!instance->exited) {
141
found++;
142
- info("stopping worker for instance %s", instance->config.name);
142
+ netdata_log_info("stopping worker for instance %s", instance->config.name);
143
uv_mutex_unlock(&instance->mutex);
144
instance->data_is_ready = 1;
145
uv_cond_signal(&instance->cond_var);
146
} else
147
- info("found stopped worker for instance %s", instance->config.name);
147
+ netdata_log_info("found stopped worker for instance %s", instance->config.name);
148
}
149
150
while (found && max > 0) {
151
max -= step;
152
- info("Waiting %d exporting connectors to finish...", found);
152
+ netdata_log_info("Waiting %d exporting connectors to finish...", found);
153
sleep_usec(step);
154
found = 0;
155
@@ -178,7 +178,7 @@ void *exporting_main(void *ptr)
178
179
engine = read_exporting_config();
180
if (!engine) {
181
- info("EXPORTING: no exporting connectors configured");
181
+ netdata_log_info("EXPORTING: no exporting connectors configured");
182
goto cleanup;
183
}
184
exporting/mongodb/mongodb.c
+2
-2
@@ -229,7 +229,7 @@ int format_batch_mongodb(struct instance *instance)
229
*/
230
void mongodb_cleanup(struct instance *instance)
231
{
232
- info("EXPORTING: cleaning up instance %s ...", instance->config.name);
232
+ netdata_log_info("EXPORTING: cleaning up instance %s ...", instance->config.name);
233
234
struct mongodb_specific_data *connector_specific_data =
235
(struct mongodb_specific_data *)instance->connector_specific_data;
@@ -261,7 +261,7 @@ void mongodb_cleanup(struct instance *instance)
261
freez(connector_specific_config->collection);
262
freez(connector_specific_config);
263
264
- info("EXPORTING: instance %s exited", instance->config.name);
264
+ netdata_log_info("EXPORTING: instance %s exited", instance->config.name);
265
instance->exited = 1;
266
267
return;
exporting/prometheus/prometheus.c
+1
-1
@@ -244,7 +244,7 @@ inline char *prometheus_units_copy(char *d, const char *s, size_t usable, int sh
244
uint32_t hash = simple_hash(s);
245
for (i = 0; units[i].newunit; i++) {
246
if (unlikely(hash == units[i].hash && !strcmp(s, units[i].newunit))) {
247
- // info("matched extension for filename '%s': '%s'", filename, last_dot);
247
+ // netdata_log_info("matched extension for filename '%s': '%s'", filename, last_dot);
248
s = units[i].oldunit;
249
sorig = s;
250
break;
exporting/pubsub/pubsub.c
+2
-2
@@ -64,7 +64,7 @@ int init_pubsub_instance(struct instance *instance)
64
*/
65
void clean_pubsub_instance(struct instance *instance)
66
{
67
- info("EXPORTING: cleaning up instance %s ...", instance->config.name);
67
+ netdata_log_info("EXPORTING: cleaning up instance %s ...", instance->config.name);
68
69
struct pubsub_specific_data *connector_specific_data =
70
(struct pubsub_specific_data *)instance->connector_specific_data;
@@ -80,7 +80,7 @@ void clean_pubsub_instance(struct instance *instance)
80
freez(connector_specific_config->topic_id);
81
freez(connector_specific_config);
82
83
- info("EXPORTING: instance %s exited", instance->config.name);
83
+ netdata_log_info("EXPORTING: instance %s exited", instance->config.name);
84
instance->exited = 1;
85
86
return;
exporting/read_config.c
+9
-9
@@ -211,13 +211,13 @@ struct engine *read_exporting_config()
211
212
exporting_config_exists = appconfig_load(&exporting_config, filename, 0, NULL);
213
if (!exporting_config_exists) {
214
- info("CONFIG: cannot load user exporting config '%s'. Will try the stock version.", filename);
214
+ netdata_log_info("CONFIG: cannot load user exporting config '%s'. Will try the stock version.", filename);
215
freez(filename);
216
217
filename = strdupz_path_subpath(netdata_configured_stock_config_dir, EXPORTING_CONF);
218
exporting_config_exists = appconfig_load(&exporting_config, filename, 0, NULL);
219
if (!exporting_config_exists)
220
- info("CONFIG: cannot load stock exporting config '%s'. Running with internal defaults.", filename);
220
+ netdata_log_info("CONFIG: cannot load stock exporting config '%s'. Running with internal defaults.", filename);
221
}
222
223
freez(filename);
@@ -276,10 +276,10 @@ struct engine *read_exporting_config()
276
}
277
278
while (get_connector_instance(&local_ci)) {
279
- info("Processing connector instance (%s)", local_ci.instance_name);
279
+ netdata_log_info("Processing connector instance (%s)", local_ci.instance_name);
280
281
if (exporter_get_boolean(local_ci.instance_name, "enabled", 0)) {
282
- info(
282
+ netdata_log_info(
283
"Instance (%s) on connector (%s) is enabled and scheduled for activation",
284
local_ci.instance_name, local_ci.connector_name);
285
@@ -290,11 +290,11 @@ struct engine *read_exporting_config()
290
tmp_ci_list_prev = tmp_ci_list;
291
instances_to_activate++;
292
} else
293
- info("Instance (%s) on connector (%s) is not enabled", local_ci.instance_name, local_ci.connector_name);
293
+ netdata_log_info("Instance (%s) on connector (%s) is not enabled", local_ci.instance_name, local_ci.connector_name);
294
}
295
296
if (unlikely(!instances_to_activate)) {
297
- info("No connector instances to activate");
297
+ netdata_log_info("No connector instances to activate");
298
return NULL;
299
}
300
@@ -313,7 +313,7 @@ struct engine *read_exporting_config()
313
char *instance_name;
314
char *default_destination = "localhost";
315
316
- info("Instance %s on %s", tmp_ci_list->local_ci.instance_name, tmp_ci_list->local_ci.connector_name);
316
+ netdata_log_info("Instance %s on %s", tmp_ci_list->local_ci.instance_name, tmp_ci_list->local_ci.connector_name);
317
318
if (tmp_ci_list->exporting_type == EXPORTING_CONNECTOR_TYPE_UNKNOWN) {
319
error("Unknown exporting connector type");
@@ -381,7 +381,7 @@ struct engine *read_exporting_config()
381
tmp_instance->config.options = exporting_parse_data_source(data_source, tmp_instance->config.options);
382
if (EXPORTING_OPTIONS_DATA_SOURCE(tmp_instance->config.options) != EXPORTING_SOURCE_DATA_AS_COLLECTED &&
383
tmp_instance->config.update_every % localhost->rrd_update_every)
384
- info(
384
+ netdata_log_info(
385
"The update interval %d for instance %s is not a multiple of the database update interval %d. "
386
"Metric values will deviate at different points in time.",
387
tmp_instance->config.update_every, tmp_instance->config.name, localhost->rrd_update_every);
@@ -488,7 +488,7 @@ struct engine *read_exporting_config()
488
#endif
489
490
#ifdef NETDATA_INTERNAL_CHECKS
491
- info(
491
+ netdata_log_info(
492
" Dest=[%s], upd=[%d], buffer=[%d] timeout=[%ld] options=[%u]",
493
tmp_instance->config.destination,
494
tmp_instance->config.update_every,
exporting/send_data.c
+1
-1
@@ -303,7 +303,7 @@ void simple_connector_worker(void *instance_p)
303
304
if(netdata_ssl_open(&connector_specific_data->ssl, netdata_ssl_exporting_ctx, sock)) {
305
if(netdata_ssl_connect(&connector_specific_data->ssl)) {
306
- info("Exporting established a SSL connection.");
306
+ netdata_log_info("Exporting established a SSL connection.");
307
308
struct timeval tv;
309
tv.tv_sec = timeout.tv_sec / 4;
health/health.c
+4
-4
@@ -287,7 +287,7 @@ static void health_silencers_init(void) {
287
if (copied == (length* sizeof(char))) {
288
str[length] = 0x00;
289
json_parse(str, NULL, health_silencers_json_read_callback);
290
- info("Parsed health silencers file %s", silencers_filename);
290
+ netdata_log_info("Parsed health silencers file %s", silencers_filename);
291
} else {
292
error("Cannot read the data from health silencers file %s", silencers_filename);
293
}
@@ -302,7 +302,7 @@ static void health_silencers_init(void) {
302
}
303
fclose(fd);
304
} else {
305
- info("Cannot open the file %s, so Netdata will work with the default health configuration.",silencers_filename);
305
+ netdata_log_info("Cannot open the file %s, so Netdata will work with the default health configuration.",silencers_filename);
306
}
307
}
308
@@ -775,7 +775,7 @@ static void health_main_cleanup(void *ptr) {
775
776
struct netdata_static_thread *static_thread = (struct netdata_static_thread *)ptr;
777
static_thread->enabled = NETDATA_MAIN_THREAD_EXITING;
778
- info("cleaning up...");
778
+ netdata_log_info("cleaning up...");
779
static_thread->enabled = NETDATA_MAIN_THREAD_EXITED;
780
781
log_health("Health thread ended.");
@@ -915,7 +915,7 @@ static int update_disabled_silenced(RRDHOST *host, RRDCALC *rc) {
915
}
916
917
if (rrdcalc_flags_old != rc->run_flags) {
918
- info("Alarm silencing changed for host '%s' alarm '%s': Disabled %s->%s Silenced %s->%s",
918
+ netdata_log_info("Alarm silencing changed for host '%s' alarm '%s': Disabled %s->%s Silenced %s->%s",
919
rrdhost_hostname(host),
920
rrdcalc_name(rc),
921
(rrdcalc_flags_old & RRDCALC_FLAG_DISABLED)?"true":"false",
httpd/http_server.c
+1
-1
@@ -88,7 +88,7 @@ static int ssl_init()
88
89
h2o_ssl_register_alpn_protocols(accept_ctx.ssl_ctx, h2o_http2_alpn_protocols);
90
91
- info("SSL support enabled");
91
+ netdata_log_info("SSL support enabled");
92
93
return 0;
94
}
libnetdata/adaptive_resortable_list/adaptive_resortable_list.c
+4
-4
@@ -78,16 +78,16 @@ void arl_begin(ARL_BASE *base) {
78
// do these checks after the ARL has been sorted
79
80
if(unlikely(base->relinkings > (base->expected + base->allocated)))
81
- info("ARL '%s' has %zu relinkings with %zu expected and %zu allocated entries. Is the source changing so fast?"
81
+ netdata_log_info("ARL '%s' has %zu relinkings with %zu expected and %zu allocated entries. Is the source changing so fast?"
82
, base->name, base->relinkings, base->expected, base->allocated);
83
84
if(unlikely(base->slow > base->fast))
85
- info("ARL '%s' has %zu fast searches and %zu slow searches. Is the source really changing so fast?"
85
+ netdata_log_info("ARL '%s' has %zu fast searches and %zu slow searches. Is the source really changing so fast?"
86
, base->name, base->fast, base->slow);
87
88
/*
89
if(unlikely(base->iteration % 60 == 0)) {
90
- info("ARL '%s' statistics: iteration %zu, expected %zu, wanted %zu, allocated %zu, fred %zu, relinkings %zu, found %zu, added %zu, fast %zu, slow %zu"
90
+ netdata_log_info("ARL '%s' statistics: iteration %zu, expected %zu, wanted %zu, allocated %zu, fred %zu, relinkings %zu, found %zu, added %zu, fast %zu, slow %zu"
91
, base->name
92
, base->iteration
93
, base->expected
@@ -242,7 +242,7 @@ int arl_find_or_create_and_relink(ARL_BASE *base, const char *s, const char *val
242
243
#ifdef NETDATA_INTERNAL_CHECKS
244
if(unlikely(base->iteration % 60 == 0 && e->flags & ARL_ENTRY_FLAG_FOUND))
245
- info("ARL '%s': entry '%s' is already found. Did you forget to call arl_begin()?", base->name, s);
245
+ netdata_log_info("ARL '%s': entry '%s' is already found. Did you forget to call arl_begin()?", base->name, s);
246
#endif
247
248
e->flags |= ARL_ENTRY_FLAG_FOUND;
libnetdata/adaptive_resortable_list/adaptive_resortable_list.h
+1
-1
@@ -94,7 +94,7 @@ static inline int arl_check(ARL_BASE *base, const char *keyword, const char *val
94
95
#ifdef NETDATA_INTERNAL_CHECKS
96
if(unlikely((base->fast + base->slow) % (base->expected + base->allocated) == 0 && (base->fast + base->slow) > (base->expected + base->allocated) * base->iteration))
97
- info("ARL '%s': Did you forget to call arl_begin()?", base->name);
97
+ netdata_log_info("ARL '%s': Did you forget to call arl_begin()?", base->name);
98
#endif
99
100
// it should be the first entry (pointed by base->next_keyword)
libnetdata/aral/aral.c
+3
-3
@@ -192,7 +192,7 @@ static void aral_delete_leftover_files(const char *name, const char *path, const
192
continue;
193
194
snprintfz(full_path, FILENAME_MAX, "%s/%s", path, de->d_name);
195
- info("ARAL: '%s' removing left-over file '%s'", name, full_path);
195
+ netdata_log_info("ARAL: '%s' removing left-over file '%s'", name, full_path);
196
if(unlikely(unlink(full_path) == -1))
197
error("ARAL: '%s' cannot delete file '%s'", name, full_path);
198
}
@@ -756,7 +756,7 @@ ARAL *aral_create(const char *name, size_t element_size, size_t initial_page_ele
756
ar->config.name, ar->config.requested_element_size, sizeof(uintptr_t), ARAL_NATURAL_ALIGNMENT,
757
ar->config.element_size, ar->config.page_ptr_offset);
758
759
- //info("ARAL: element size %zu, sizeof(uintptr_t) %zu, natural alignment %zu, final element size %zu, page_ptr_offset %zu",
759
+ //netdata_log_info("ARAL: element size %zu, sizeof(uintptr_t) %zu, natural alignment %zu, final element size %zu, page_ptr_offset %zu",
760
// ar->element_size, sizeof(uintptr_t), ARAL_NATURAL_ALIGNMENT, ar->internal.element_size, ar->internal.page_ptr_offset);
761
762
@@ -1056,7 +1056,7 @@ int aral_stress_test(size_t threads, size_t elements, size_t seconds) {
1056
__atomic_add_fetch(&auc.errors, 1, __ATOMIC_RELAXED);
1057
}
1058
1059
- info("ARAL: did %zu malloc, %zu free, "
1059
+ netdata_log_info("ARAL: did %zu malloc, %zu free, "
1060
"using %zu threads, in %llu usecs",
1061
auc.ar->aral_lock.user_malloc_operations,
1062
auc.ar->aral_lock.user_free_operations,
libnetdata/clocks/clocks.c
+2
-2
@@ -433,11 +433,11 @@ inline collected_number uptime_msec(char *filename){
433
434
if(delta <= 1000 && uptime_boottime != 0) {
435
procfile_close(read_proc_uptime_ff);
436
- info("Using now_boottime_usec() for uptime (dt is %lld ms)", delta);
436
+ netdata_log_info("Using now_boottime_usec() for uptime (dt is %lld ms)", delta);
437
use_boottime = 1;
438
}
439
else if(uptime_proc != 0) {
440
- info("Using /proc/uptime for uptime (dt is %lld ms)", delta);
440
+ netdata_log_info("Using /proc/uptime for uptime (dt is %lld ms)", delta);
441
use_boottime = 0;
442
}
443
else {
libnetdata/config/appconfig.c
+1
-1
@@ -653,7 +653,7 @@ int appconfig_load(struct config *root, char *filename, int overwrite_used, cons
653
654
FILE *fp = fopen(filename, "r");
655
if(!fp) {
656
- // info("CONFIG: cannot open file '%s'. Using internal defaults.", filename);
656
+ // netdata_log_info("CONFIG: cannot open file '%s'. Using internal defaults.", filename);
657
return 0;
658
}
659
libnetdata/ebpf/ebpf.c
+8
-8
@@ -183,7 +183,7 @@ static int kernel_is_rejected()
183
if (read_file("/proc/version", version_string, VERSION_STRING_LEN)) {
184
struct utsname uname_buf;
185
if (!uname(&uname_buf)) {
186
- info("Cannot check kernel version");
186
+ netdata_log_info("Cannot check kernel version");
187
return 0;
188
}
189
version_string_len =
@@ -230,7 +230,7 @@ static int kernel_is_rejected()
230
while ((reject_string_len = getline(&reject_string, &buf_len, kernel_reject_list) - 1) > 0) {
231
if (version_string_len >= reject_string_len) {
232
if (!strncmp(version_string, reject_string, reject_string_len)) {
233
- info("A buggy kernel is detected");
233
+ netdata_log_info("A buggy kernel is detected");
234
fclose(kernel_reject_list);
235
freez(reject_string);
236
return 1;
@@ -496,7 +496,7 @@ void ebpf_update_kernel_memory(ebpf_plugin_stats_t *report, ebpf_local_maps_t *m
496
report->memlock_kern += memsize;
497
report->hash_tables += 1;
498
#ifdef NETDATA_DEV_MODE
499
- info("Hash table %u: %s (FD = %d) is consuming %lu bytes totalizing %lu bytes",
499
+ netdata_log_info("Hash table %u: %s (FD = %d) is consuming %lu bytes totalizing %lu bytes",
500
report->hash_tables, map->name, map->map_fd, memsize, report->memlock_kern);
501
#endif
502
break;
@@ -505,7 +505,7 @@ void ebpf_update_kernel_memory(ebpf_plugin_stats_t *report, ebpf_local_maps_t *m
505
report->memlock_kern -= memsize;
506
report->hash_tables -= 1;
507
#ifdef NETDATA_DEV_MODE
508
- info("Hash table %s (FD = %d) was removed releasing %lu bytes, now we have %u tables loaded totalizing %lu bytes.",
508
+ netdata_log_info("Hash table %s (FD = %d) was removed releasing %lu bytes, now we have %u tables loaded totalizing %lu bytes.",
509
map->name, map->map_fd, memsize, report->hash_tables, report->memlock_kern);
510
#endif
511
break;
@@ -570,7 +570,7 @@ void ebpf_update_map_size(struct bpf_map *map, ebpf_local_maps_t *lmap, ebpf_mod
570
if (lmap->user_input && lmap->user_input != lmap->internal_input) {
571
define_size = lmap->internal_input;
572
#ifdef NETDATA_INTERNAL_CHECKS
573
- info("Changing map %s from size %u to %u ", map_name, lmap->internal_input, lmap->user_input);
573
+ netdata_log_info("Changing map %s from size %u to %u ", map_name, lmap->internal_input, lmap->user_input);
574
#endif
575
} else if (((lmap->type & apps_type) == apps_type) && (!em->apps_charts) && (!em->cgroup_charts)) {
576
lmap->user_input = ND_EBPF_DEFAULT_MIN_PID;
@@ -878,7 +878,7 @@ struct bpf_link **ebpf_load_program(char *plugins_dir, ebpf_module_t *em, int kv
878
size_t count_programs = ebpf_count_programs(*obj);
879
880
#ifdef NETDATA_INTERNAL_CHECKS
881
- info("eBPF program %s loaded with success!", lpath);
881
+ netdata_log_info("eBPF program %s loaded with success!", lpath);
882
#endif
883
884
return ebpf_attach_programs(*obj, count_programs, em->names);
@@ -1107,7 +1107,7 @@ struct btf *ebpf_load_btf_file(char *path, char *filename)
1107
snprintfz(fullpath, PATH_MAX, "%s/%s", path, filename);
1108
struct btf *ret = ebpf_parse_btf_file(fullpath);
1109
if (!ret)
1110
- info("Your environment does not have BTF file %s/%s. The plugin will work with 'legacy' code.",
1110
+ netdata_log_info("Your environment does not have BTF file %s/%s. The plugin will work with 'legacy' code.",
1111
path, filename);
1112
1113
return ret;
@@ -1259,7 +1259,7 @@ void ebpf_update_module_using_config(ebpf_module_t *modules, netdata_ebpf_load_m
1259
modules->maps_per_core = CONFIG_BOOLEAN_NO;
1260
1261
#ifdef NETDATA_DEV_MODE
1262
- info("The thread %s was configured with: mode = %s; update every = %d; apps = %s; cgroup = %s; ebpf type format = %s; ebpf co-re tracing = %s; collect pid = %s; maps per core = %s",
1262
+ netdata_log_info("The thread %s was configured with: mode = %s; update every = %d; apps = %s; cgroup = %s; ebpf type format = %s; ebpf co-re tracing = %s; collect pid = %s; maps per core = %s",
1263
modules->thread_name,
1264
load_mode,
1265
modules->update_every,
libnetdata/json/json.c
+2
-2
@@ -124,7 +124,7 @@ int json_callback_print(JSON_ENTRY *e)
124
buffer_strcat(wb,"NULL");
125
break;
126
}
127
- info("JSON: %s", buffer_tostring(wb));
127
+ netdata_log_info("JSON: %s", buffer_tostring(wb));
128
buffer_free(wb);
129
return 0;
130
}
@@ -323,7 +323,7 @@ size_t json_walk_array(char *js, jsmntok_t *t, size_t nest, size_t start, JSON_E
323
for(i = 0; i < size ; i++) {
324
ne.pos = i;
325
if (strlen(e->name) > JSON_NAME_LEN - 24 || strlen(e->fullname) > JSON_FULLNAME_LEN -24) {
326
- info("JSON: JSON walk_array ignoring element with name:%s fullname:%s",e->name, e->fullname);
326
+ netdata_log_info("JSON: JSON walk_array ignoring element with name:%s fullname:%s",e->name, e->fullname);
327
continue;
328
}
329
snprintfz(ne.name, JSON_NAME_LEN, "%s[%lu]", e->name, i);
libnetdata/libnetdata.c
+8
-8
@@ -1043,7 +1043,7 @@ void netdata_fix_chart_id(char *s) {
1043
}
1044
1045
static int memory_file_open(const char *filename, size_t size) {
1046
- // info("memory_file_open('%s', %zu", filename, size);
1046
+ // netdata_log_info("memory_file_open('%s', %zu", filename, size);
1047
1048
int fd = open(filename, O_RDWR | O_CREAT | O_NOATIME, 0664);
1049
if (fd != -1) {
@@ -1127,7 +1127,7 @@ inline int madvise_mergeable(void *mem __maybe_unused, size_t len __maybe_unused
1127
1128
void *netdata_mmap(const char *filename, size_t size, int flags, int ksm, bool read_only, int *open_fd)
1129
{
1130
- // info("netdata_mmap('%s', %zu", filename, size);
1130
+ // netdata_log_info("netdata_mmap('%s', %zu", filename, size);
1131
1132
// MAP_SHARED is used in memory mode map
1133
// MAP_PRIVATE is used in memory mode ram and save
@@ -1177,9 +1177,9 @@ void *netdata_mmap(const char *filename, size_t size, int flags, int ksm, bool r
1177
if(fd != -1 && fd_for_mmap == -1) {
1178
if (lseek(fd, 0, SEEK_SET) == 0) {
1179
if (read(fd, mem, size) != (ssize_t) size)
1180
- info("Cannot read from file '%s'", filename);
1180
+ netdata_log_info("Cannot read from file '%s'", filename);
1181
}
1182
- else info("Cannot seek to beginning of file '%s'.", filename);
1182
+ else netdata_log_info("Cannot seek to beginning of file '%s'.", filename);
1183
}
1184
1185
// madvise_sequential(mem, size);
@@ -1321,14 +1321,14 @@ int recursively_delete_dir(const char *path, const char *reason) {
1321
continue;
1322
}
1323
1324
- info("Deleting %s file '%s'", reason?reason:"", fullpath);
1324
+ netdata_log_info("Deleting %s file '%s'", reason?reason:"", fullpath);
1325
if(unlikely(unlink(fullpath) == -1))
1326
error("Cannot delete %s file '%s'", reason?reason:"", fullpath);
1327
else
1328
ret++;
1329
}
1330
1331
- info("Deleting empty directory '%s'", path);
1331
+ netdata_log_info("Deleting empty directory '%s'", path);
1332
if(unlikely(rmdir(path) == -1))
1333
error("Cannot delete empty directory '%s'", path);
1334
else
@@ -1399,7 +1399,7 @@ int verify_netdata_host_prefix() {
1399
goto failed;
1400
1401
if(netdata_configured_host_prefix && *netdata_configured_host_prefix)
1402
- info("Using host prefix directory '%s'", netdata_configured_host_prefix);
1402
+ netdata_log_info("Using host prefix directory '%s'", netdata_configured_host_prefix);
1403
1404
return 0;
1405
@@ -1921,7 +1921,7 @@ void timing_action(TIMING_ACTION action, TIMING_STEP step) {
1921
);
1922
}
1923
1924
- info("TIMINGS REPORT:\n%sTIMINGS REPORT: total # %10zu, t %11.2f ms",
1924
+ netdata_log_info("TIMINGS REPORT:\n%sTIMINGS REPORT: total # %10zu, t %11.2f ms",
1925
buffer_tostring(wb), total_reqs, (double)total_usec / USEC_PER_MS);
1926
1927
memcpy(timings2, timings3, sizeof(timings2));
libnetdata/log/log.c
+1
-1
@@ -555,7 +555,7 @@ static FILE *open_log_file(int fd, FILE *fp, const char *filename, int *enabled_
555
if(fd_ptr) *fd_ptr = fd;
556
return fp;
557
}
558
- // info("dup2() new fd %d to old fd %d for '%s'", f, fd, filename);
558
+ // netdata_log_info("dup2() new fd %d to old fd %d for '%s'", f, fd, filename);
559
close(f);
560
}
561
else fd = f;
libnetdata/log/log.h
+1
-1
@@ -118,7 +118,7 @@ typedef struct error_with_limit {
118
#define internal_fatal(args...) debug_dummy()
119
#endif
120
121
-#define info(args...) info_int(0, __FILE__, __FUNCTION__, __LINE__, ##args)
121
+#define netdata_log_info(args...) info_int(0, __FILE__, __FUNCTION__, __LINE__, ##args)
122
#define collector_info(args...) info_int(1, __FILE__, __FUNCTION__, __LINE__, ##args)
123
#define infoerr(args...) error_int(0, "INFO", __FILE__, __FUNCTION__, __LINE__, ##args)
124
#define error(args...) error_int(0, "ERROR", __FILE__, __FUNCTION__, __LINE__, ##args)
libnetdata/onewayalloc/onewayalloc.c
+1
-1
@@ -195,7 +195,7 @@ void onewayalloc_destroy(ONEWAYALLOC *owa) {
195
196
OWA_PAGE *head = (OWA_PAGE *)owa;
197
198
- //info("OWA: %zu allocations of %zu total bytes, in %zu pages of %zu total bytes",
198
+ //netdata_log_info("OWA: %zu allocations of %zu total bytes, in %zu pages of %zu total bytes",
199
// head->stats_mallocs_made, head->stats_mallocs_size,
200
// head->stats_pages, head->stats_pages_size);
201
libnetdata/popen/popen.c
+3
-3
@@ -140,7 +140,7 @@ static int popene_internal(volatile pid_t *pidptr, char **env, uint8_t flags, FI
140
// create a string to be logged about the command we are running
141
char command_to_be_logged[2048];
142
convert_argv_to_string(command_to_be_logged, sizeof(command_to_be_logged), spawn_argv);
143
- // info("custom_popene() running command: %s", command_to_be_logged);
143
+ // netdata_log_info("custom_popene() running command: %s", command_to_be_logged);
144
145
int ret = 0; // success by default
146
int attr_rc = 1; // failure by default
@@ -406,11 +406,11 @@ int netdata_pclose(FILE *fp_child_input, FILE *fp_child_output, pid_t pid) {
406
407
case CLD_KILLED:
408
if(info.si_status == SIGTERM) {
409
- info("child pid %d killed by SIGTERM", info.si_pid);
409
+ netdata_log_info("child pid %d killed by SIGTERM", info.si_pid);
410
return(0);
411
}
412
else if(info.si_status == SIGPIPE) {
413
- info("child pid %d killed by SIGPIPE.", info.si_pid);
413
+ netdata_log_info("child pid %d killed by SIGPIPE.", info.si_pid);
414
return(0);
415
}
416
else {
libnetdata/procfile/procfile.c
+3
-3
@@ -410,7 +410,7 @@ procfile *procfile_open(const char *filename, const char *separators, uint32_t f
410
return NULL;
411
}
412
413
- // info("PROCFILE: opened '%s' on fd %d", filename, fd);
413
+ // netdata_log_info("PROCFILE: opened '%s' on fd %d", filename, fd);
414
415
size_t size = (unlikely(procfile_adaptive_initial_allocation)) ? procfile_max_allocation : PROCFILE_INCREMENT_BUFFER;
416
procfile *ff = mallocz(sizeof(procfile) + size);
@@ -435,7 +435,7 @@ procfile *procfile_reopen(procfile *ff, const char *filename, const char *separa
435
if(unlikely(!ff)) return procfile_open(filename, separators, flags);
436
437
if(likely(ff->fd != -1)) {
438
- // info("PROCFILE: closing fd %d", ff->fd);
438
+ // netdata_log_info("PROCFILE: closing fd %d", ff->fd);
439
close(ff->fd);
440
}
441
@@ -445,7 +445,7 @@ procfile *procfile_reopen(procfile *ff, const char *filename, const char *separa
445
return NULL;
446
}
447
448
- // info("PROCFILE: opened '%s' on fd %d", filename, ff->fd);
448
+ // netdata_log_info("PROCFILE: opened '%s' on fd %d", filename, ff->fd);
449
450
//strncpyz(ff->filename, filename, FILENAME_MAX);
451
freez(ff->filename);
libnetdata/socket/security.c
+3
-3
@@ -585,7 +585,7 @@ void netdata_ssl_initialize_ctx(int selector) {
585
if(!netdata_ssl_web_server_ctx) {
586
struct stat statbuf;
587
if (stat(netdata_ssl_security_key, &statbuf) || stat(netdata_ssl_security_cert, &statbuf))
588
- info("To use encryption it is necessary to set \"ssl certificate\" and \"ssl key\" in [web] !\n");
588
+ netdata_log_info("To use encryption it is necessary to set \"ssl certificate\" and \"ssl key\" in [web] !\n");
589
else {
590
netdata_ssl_web_server_ctx = netdata_ssl_create_server_ctx(
591
SSL_MODE_ENABLE_PARTIAL_WRITE |
@@ -705,13 +705,13 @@ int ssl_security_location_for_context(SSL_CTX *ctx, char *file, char *path) {
705
int load_custom = 1, load_default = 1;
706
if (file || path) {
707
if(!SSL_CTX_load_verify_locations(ctx, file, path)) {
708
- info("Netdata can not verify custom CAfile or CApath for parent's SSL certificate, so it will use the default OpenSSL configuration to validate certificates!");
708
+ netdata_log_info("Netdata can not verify custom CAfile or CApath for parent's SSL certificate, so it will use the default OpenSSL configuration to validate certificates!");
709
load_custom = 0;
710
}
711
}
712
713
if(!SSL_CTX_set_default_verify_paths(ctx)) {
714
- info("Can not verify default OpenSSL configuration to validate certificates!");
714
+ netdata_log_info("Can not verify default OpenSSL configuration to validate certificates!");
715
load_default = 0;
716
}
717
libnetdata/socket/socket.c
+12
-12
@@ -588,7 +588,7 @@ static inline int bind_to_this(LISTEN_SOCKETS *sockets, const char *definition,
588
struct sockaddr_in *sin = (struct sockaddr_in *) rp->ai_addr;
589
inet_ntop(AF_INET, &sin->sin_addr, rip, INET_ADDRSTRLEN);
590
rport = ntohs(sin->sin_port);
591
- // info("Attempting to listen on IPv4 '%s' ('%s'), port %d ('%s'), socktype %d", rip, ip, rport, port, socktype);
591
+ // netdata_log_info("Attempting to listen on IPv4 '%s' ('%s'), port %d ('%s'), socktype %d", rip, ip, rport, port, socktype);
592
fd = create_listen_socket4(socktype, rip, rport, listen_backlog);
593
break;
594
}
@@ -597,7 +597,7 @@ static inline int bind_to_this(LISTEN_SOCKETS *sockets, const char *definition,
597
struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) rp->ai_addr;
598
inet_ntop(AF_INET6, &sin6->sin6_addr, rip, INET6_ADDRSTRLEN);
599
rport = ntohs(sin6->sin6_port);
600
- // info("Attempting to listen on IPv6 '%s' ('%s'), port %d ('%s'), socktype %d", rip, ip, rport, port, socktype);
600
+ // netdata_log_info("Attempting to listen on IPv6 '%s' ('%s'), port %d ('%s'), socktype %d", rip, ip, rport, port, socktype);
601
fd = create_listen_socket6(socktype, scope_id, rip, rport, listen_backlog);
602
break;
603
}
@@ -660,7 +660,7 @@ int listen_sockets_setup(LISTEN_SOCKETS *sockets) {
660
if(sockets->failed) {
661
size_t i;
662
for(i = 0; i < sockets->opened ;i++)
663
- info("LISTENER: Listen socket %s opened successfully.", sockets->fds_names[i]);
663
+ netdata_log_info("LISTENER: Listen socket %s opened successfully.", sockets->fds_names[i]);
664
}
665
666
return (int)sockets->opened;
@@ -810,7 +810,7 @@ int connect_to_this_ip46(int protocol, int socktype, const char *host, uint32_t
810
errno = 0;
811
if(connect(fd, ai->ai_addr, ai->ai_addrlen) < 0) {
812
if(errno == EALREADY || errno == EINPROGRESS) {
813
- info("Waiting for connection to ip %s port %s to be established", hostBfr, servBfr);
813
+ netdata_log_info("Waiting for connection to ip %s port %s to be established", hostBfr, servBfr);
814
815
// Convert 'struct timeval' to milliseconds for poll():
816
int timeout_milliseconds = timeout->tv_sec * 1000 + timeout->tv_usec / 1000;
@@ -824,7 +824,7 @@ int connect_to_this_ip46(int protocol, int socktype, const char *host, uint32_t
824
// poll() completed normally. We can check the revents to see what happened
825
if (fds[0].revents & POLLOUT) {
826
// connect() completed successfully, socket is writable.
827
- info("connect() to ip %s port %s completed successfully", hostBfr, servBfr);
827
+ netdata_log_info("connect() to ip %s port %s completed successfully", hostBfr, servBfr);
828
}
829
else {
830
// This means that the socket is in error. We will close it and set fd to -1
@@ -1349,7 +1349,7 @@ inline POLLINFO *poll_add_fd(POLLJOB *p
1349
if(unlikely(fd < 0)) return NULL;
1350
1351
//if(p->limit && p->used >= p->limit) {
1352
- // info("Max sockets limit reached (%zu sockets), dropping connection", p->used);
1352
+ // netdata_log_info("Max sockets limit reached (%zu sockets), dropping connection", p->used);
1353
// close(fd);
1354
// return NULL;
1355
//}
@@ -1533,7 +1533,7 @@ int poll_default_rcv_callback(POLLINFO *pi, short int *events) {
1533
}
1534
} else if (rc) {
1535
// data received
1536
- info("POLLFD: internal error: poll_default_rcv_callback() is discarding %zd bytes received on socket %d", rc, pi->fd);
1536
+ netdata_log_info("POLLFD: internal error: poll_default_rcv_callback() is discarding %zd bytes received on socket %d", rc, pi->fd);
1537
}
1538
} while (rc != -1);
1539
@@ -1543,7 +1543,7 @@ int poll_default_rcv_callback(POLLINFO *pi, short int *events) {
1543
int poll_default_snd_callback(POLLINFO *pi, short int *events) {
1544
*events &= ~POLLOUT;
1545
1546
- info("POLLFD: internal error: poll_default_snd_callback(): nothing to send on socket %d", pi->fd);
1546
+ netdata_log_info("POLLFD: internal error: poll_default_snd_callback(): nothing to send on socket %d", pi->fd);
1547
return 0;
1548
}
1549
@@ -1773,7 +1773,7 @@ void poll_events(LISTEN_SOCKETS *sockets
1773
);
1774
1775
pi->data = data;
1776
- info("POLLFD: LISTENER: listening on '%s'", (sockets->fds_names[i])?sockets->fds_names[i]:"UNKNOWN");
1776
+ netdata_log_info("POLLFD: LISTENER: listening on '%s'", (sockets->fds_names[i])?sockets->fds_names[i]:"UNKNOWN");
1777
}
1778
1779
int listen_sockets_active = 1;
@@ -1814,7 +1814,7 @@ void poll_events(LISTEN_SOCKETS *sockets
1814
// enable or disable the TCP listening sockets, based on the current number of sockets used and the limit set
1815
if((listen_sockets_active && (p.limit && p.used >= p.limit)) || (!listen_sockets_active && (!p.limit || p.used < p.limit))) {
1816
listen_sockets_active = !listen_sockets_active;
1817
- info("%s listening sockets (used TCP sockets %zu, max allowed for this worker %zu)", (listen_sockets_active)?"ENABLING":"DISABLING", p.used, p.limit);
1817
+ netdata_log_info("%s listening sockets (used TCP sockets %zu, max allowed for this worker %zu)", (listen_sockets_active)?"ENABLING":"DISABLING", p.used, p.limit);
1818
for (i = 0; i <= p.max; i++) {
1819
if(p.inf[i].flags & POLLINFO_FLAG_SERVER_SOCKET && p.inf[i].socktype == SOCK_STREAM) {
1820
p.fds[i].events = (short int) ((listen_sockets_active) ? POLLIN : 0);
@@ -1962,7 +1962,7 @@ void poll_events(LISTEN_SOCKETS *sockets
1962
1963
if(likely(pi->flags & POLLINFO_FLAG_CLIENT_SOCKET)) {
1964
if (unlikely(pi->send_count == 0 && p.complete_request_timeout > 0 && (now - pi->connected_t) >= p.complete_request_timeout)) {
1965
- info("POLLFD: LISTENER: client slot %zu (fd %d) from %s port %s has not sent a complete request in %zu seconds - closing it. "
1965
+ netdata_log_info("POLLFD: LISTENER: client slot %zu (fd %d) from %s port %s has not sent a complete request in %zu seconds - closing it. "
1966
, i
1967
, pi->fd
1968
, pi->client_ip ? pi->client_ip : "<undefined-ip>"
@@ -1972,7 +1972,7 @@ void poll_events(LISTEN_SOCKETS *sockets
1972
poll_close_fd(pi);
1973
}
1974
else if(unlikely(pi->recv_count && p.idle_timeout > 0 && now - ((pi->last_received_t > pi->last_sent_t) ? pi->last_received_t : pi->last_sent_t) >= p.idle_timeout )) {
1975
- info("POLLFD: LISTENER: client slot %zu (fd %d) from %s port %s is idle for more than %zu seconds - closing it. "
1975
+ netdata_log_info("POLLFD: LISTENER: client slot %zu (fd %d) from %s port %s is idle for more than %zu seconds - closing it. "
1976
, i
1977
, pi->fd
1978
, pi->client_ip ? pi->client_ip : "<undefined-ip>"
libnetdata/storage_number/storage_number.c
+3
-3
@@ -52,7 +52,7 @@ bool is_system_ieee754_double(void) {
52
53
if(*ptr != tests[i].i && (tests[i].original == tests[i].d || (isnan(tests[i].original) && isnan(tests[i].d)))) {
54
if(!logged)
55
- info("IEEE754: test #%zu, value " NETDATA_DOUBLE_FORMAT_G " is represented in this system as %lX, but it was expected as %lX",
55
+ netdata_log_info("IEEE754: test #%zu, value " NETDATA_DOUBLE_FORMAT_G " is represented in this system as %lX, but it was expected as %lX",
56
i+1, tests[i].original, *ptr, tests[i].i);
57
errors++;
58
}
@@ -60,14 +60,14 @@ bool is_system_ieee754_double(void) {
60
61
if(!errors && sizeof(NETDATA_DOUBLE) == sizeof(uint64_t)) {
62
if(!logged)
63
- info("IEEE754: system is using IEEE754 DOUBLE PRECISION values");
63
+ netdata_log_info("IEEE754: system is using IEEE754 DOUBLE PRECISION values");
64
65
logged = true;
66
return true;
67
}
68
else {
69
if(!logged)
70
- info("IEEE754: system is NOT compatible with IEEE754 DOUBLE PRECISION values");
70
+ netdata_log_info("IEEE754: system is NOT compatible with IEEE754 DOUBLE PRECISION values");
71
72
logged = true;
73
return false;
libnetdata/threads/threads.c
+5
-5
@@ -152,7 +152,7 @@ void netdata_threads_init_after_fork(size_t stacksize) {
152
if(i != 0)
153
error("pthread_attr_setstacksize() to %zu bytes, failed with code %d.", stacksize, i);
154
else
155
- info("Set threads stack size to %zu bytes", stacksize);
155
+ netdata_log_info("Set threads stack size to %zu bytes", stacksize);
156
}
157
else
158
error("Invalid pthread stacksize %zu", stacksize);
@@ -173,7 +173,7 @@ static void thread_cleanup(void *ptr) {
173
}
174
175
if(!(netdata_thread->options & NETDATA_THREAD_OPTION_DONT_LOG_CLEANUP))
176
- info("thread with task id %d finished", gettid());
176
+ netdata_log_info("thread with task id %d finished", gettid());
177
178
sender_thread_buffer_free();
179
rrdset_thread_rda_free();
@@ -207,7 +207,7 @@ static void thread_set_name_np(NETDATA_THREAD *nt) {
207
if (ret != 0)
208
error("cannot set pthread name of %d to %s. ErrCode: %d", gettid(), threadname, ret);
209
else
210
- info("set name of thread %d to %s", gettid(), threadname);
210
+ netdata_log_info("set name of thread %d to %s", gettid(), threadname);
211
212
}
213
}
@@ -230,7 +230,7 @@ void uv_thread_set_name_np(uv_thread_t ut, const char* name) {
230
thread_name_get(true);
231
232
if (ret)
233
- info("cannot set libuv thread name to %s. Err: %d", threadname, ret);
233
+ netdata_log_info("cannot set libuv thread name to %s. Err: %d", threadname, ret);
234
}
235
236
void os_thread_get_current_name_np(char threadname[NETDATA_THREAD_NAME_MAX + 1])
@@ -247,7 +247,7 @@ static void *netdata_thread_init(void *ptr) {
247
netdata_thread = (NETDATA_THREAD *)ptr;
248
249
if(!(netdata_thread->options & NETDATA_THREAD_OPTION_DONT_LOG_STARTUP))
250
- info("thread created with task id %d", gettid());
250
+ netdata_log_info("thread created with task id %d", gettid());
251
252
if(pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL) != 0)
253
error("cannot set pthread cancel type to DEFERRED.");
registry/registry_init.c
+1
-1
@@ -11,7 +11,7 @@ int registry_init(void) {
11
registry.enabled = config_get_boolean(CONFIG_SECTION_REGISTRY, "enabled", 0);
12
}
13
else {
14
- info("Registry is disabled - use the central netdata");
14
+ netdata_log_info("Registry is disabled - use the central netdata");
15
config_set_boolean(CONFIG_SECTION_REGISTRY, "enabled", 0);
16
registry.enabled = 0;
17
}
registry/registry_internals.c
+13
-13
@@ -13,7 +13,7 @@ struct registry registry;
13
int regenerate_guid(const char *guid, char *result) {
14
uuid_t uuid;
15
if(unlikely(uuid_parse(guid, uuid) == -1)) {
16
- info("Registry: GUID '%s' is not a valid GUID.", guid);
16
+ netdata_log_info("Registry: GUID '%s' is not a valid GUID.", guid);
17
return -1;
18
}
19
else {
@@ -21,7 +21,7 @@ int regenerate_guid(const char *guid, char *result) {
21
22
#ifdef NETDATA_INTERNAL_CHECKS
23
if(strcmp(guid, result) != 0)
24
- info("GUID '%s' and re-generated GUID '%s' differ!", guid, result);
24
+ netdata_log_info("GUID '%s' and re-generated GUID '%s' differ!", guid, result);
25
#endif /* NETDATA_INTERNAL_CHECKS */
26
}
27
@@ -84,7 +84,7 @@ REGISTRY_PERSON_URL *registry_verify_request(char *person_guid, char *machine_gu
84
char pbuf[GUID_LEN + 1], mbuf[GUID_LEN + 1];
85
86
if(!person_guid || !*person_guid || !machine_guid || !*machine_guid || !url || !*url) {
87
- info("Registry Request Verification: invalid request! person: '%s', machine '%s', url '%s'", person_guid?person_guid:"UNSET", machine_guid?machine_guid:"UNSET", url?url:"UNSET");
87
+ netdata_log_info("Registry Request Verification: invalid request! person: '%s', machine '%s', url '%s'", person_guid?person_guid:"UNSET", machine_guid?machine_guid:"UNSET", url?url:"UNSET");
88
return NULL;
89
}
90
@@ -93,14 +93,14 @@ REGISTRY_PERSON_URL *registry_verify_request(char *person_guid, char *machine_gu
93
94
// make sure the person GUID is valid
95
if(regenerate_guid(person_guid, pbuf) == -1) {
96
- info("Registry Request Verification: invalid person GUID, person: '%s', machine '%s', url '%s'", person_guid, machine_guid, url);
96
+ netdata_log_info("Registry Request Verification: invalid person GUID, person: '%s', machine '%s', url '%s'", person_guid, machine_guid, url);
97
return NULL;
98
}
99
person_guid = pbuf;
100
101
// make sure the machine GUID is valid
102
if(regenerate_guid(machine_guid, mbuf) == -1) {
103
- info("Registry Request Verification: invalid machine GUID, person: '%s', machine '%s', url '%s'", person_guid, machine_guid, url);
103
+ netdata_log_info("Registry Request Verification: invalid machine GUID, person: '%s', machine '%s', url '%s'", person_guid, machine_guid, url);
104
return NULL;
105
}
106
machine_guid = mbuf;
@@ -108,7 +108,7 @@ REGISTRY_PERSON_URL *registry_verify_request(char *person_guid, char *machine_gu
108
// make sure the machine exists
109
REGISTRY_MACHINE *m = registry_machine_find(machine_guid);
110
if(!m) {
111
- info("Registry Request Verification: machine not found, person: '%s', machine '%s', url '%s'", person_guid, machine_guid, url);
111
+ netdata_log_info("Registry Request Verification: machine not found, person: '%s', machine '%s', url '%s'", person_guid, machine_guid, url);
112
return NULL;
113
}
114
if(mm) *mm = m;
@@ -116,18 +116,18 @@ REGISTRY_PERSON_URL *registry_verify_request(char *person_guid, char *machine_gu
116
// make sure the person exist
117
REGISTRY_PERSON *p = registry_person_find(person_guid);
118
if(!p) {
119
- info("Registry Request Verification: person not found, person: '%s', machine '%s', url '%s'", person_guid, machine_guid, url);
119
+ netdata_log_info("Registry Request Verification: person not found, person: '%s', machine '%s', url '%s'", person_guid, machine_guid, url);
120
return NULL;
121
}
122
if(pp) *pp = p;
123
124
REGISTRY_PERSON_URL *pu = registry_person_url_index_find(p, url);
125
if(!pu) {
126
- info("Registry Request Verification: URL not found for person, person: '%s', machine '%s', url '%s'", person_guid, machine_guid, url);
126
+ netdata_log_info("Registry Request Verification: URL not found for person, person: '%s', machine '%s', url '%s'", person_guid, machine_guid, url);
127
return NULL;
128
}
129
//else if (pu->machine != m) {
130
- // info("Registry Request Verification: Machine mismatch: person: '%s', machine requested='%s' <> loaded='%s', url '%s'", person_guid, machine_guid, pu->machine->guid, url);
130
+ // netdata_log_info("Registry Request Verification: Machine mismatch: person: '%s', machine requested='%s' <> loaded='%s', url '%s'", person_guid, machine_guid, pu->machine->guid, url);
131
// return NULL;
132
//}
133
@@ -178,7 +178,7 @@ REGISTRY_PERSON *registry_request_delete(char *person_guid, char *machine_guid,
178
// make sure the user is not deleting the url it uses
179
/*
180
if(!strcmp(delete_url, pu->url->url)) {
181
- info("Registry Delete Request: delete URL is the one currently accessed, person: '%s', machine '%s', url '%s', delete url '%s'"
181
+ netdata_log_info("Registry Delete Request: delete URL is the one currently accessed, person: '%s', machine '%s', url '%s', delete url '%s'"
182
, p->guid, m->guid, pu->url->url, delete_url);
183
return NULL;
184
}
@@ -186,7 +186,7 @@ REGISTRY_PERSON *registry_request_delete(char *person_guid, char *machine_guid,
186
187
REGISTRY_PERSON_URL *dpu = registry_person_url_index_find(p, delete_url);
188
if(!dpu) {
189
- info("Registry Delete Request: URL not found for person: '%s', machine '%s', url '%s', delete url '%s'", p->guid
189
+ netdata_log_info("Registry Delete Request: URL not found for person: '%s', machine '%s', url '%s', delete url '%s'", p->guid
190
, m->guid, pu->url->url, delete_url);
191
return NULL;
192
}
@@ -230,7 +230,7 @@ REGISTRY_MACHINE *registry_request_machine(char *person_guid, char *machine_guid
230
231
// make sure the machine GUID is valid
232
if(regenerate_guid(request_machine, mbuf) == -1) {
233
- info("Registry Machine URLs request: invalid machine GUID, person: '%s', machine '%s', url '%s', request machine '%s'", p->guid, m->guid, pu->url->url, request_machine);
233
+ netdata_log_info("Registry Machine URLs request: invalid machine GUID, person: '%s', machine '%s', url '%s', request machine '%s'", p->guid, m->guid, pu->url->url, request_machine);
234
return NULL;
235
}
236
request_machine = mbuf;
@@ -238,7 +238,7 @@ REGISTRY_MACHINE *registry_request_machine(char *person_guid, char *machine_guid
238
// make sure the machine exists
239
m = registry_machine_find(request_machine);
240
if(!m) {
241
- info("Registry Machine URLs request: machine not found, person: '%s', machine '%s', url '%s', request machine '%s'", p->guid, machine_guid, pu->url->url, request_machine);
241
+ netdata_log_info("Registry Machine URLs request: machine not found, person: '%s', machine '%s', url '%s', request machine '%s'", p->guid, machine_guid, pu->url->url, request_machine);
242
return NULL;
243
}
244
registry/registry_machine.c
+1
-1
@@ -67,7 +67,7 @@ REGISTRY_MACHINE *registry_machine_get(const char *machine_guid, time_t when) {
67
// validate it is a GUID
68
char buf[GUID_LEN + 1];
69
if(unlikely(regenerate_guid(machine_guid, buf) == -1))
70
- info("Registry: machine guid '%s' is not a valid guid. Ignoring it.", machine_guid);
70
+ netdata_log_info("Registry: machine guid '%s' is not a valid guid. Ignoring it.", machine_guid);
71
else {
72
machine_guid = buf;
73
m = registry_machine_find(machine_guid);
registry/registry_person.c
+2
-2
@@ -153,7 +153,7 @@ REGISTRY_PERSON *registry_person_allocate(const char *person_guid, time_t when)
153
break;
154
}
155
else
156
- info("Registry: generated person guid '%s' found in the registry. Retrying...", p->guid);
156
+ netdata_log_info("Registry: generated person guid '%s' found in the registry. Retrying...", p->guid);
157
}
158
}
159
else
@@ -187,7 +187,7 @@ REGISTRY_PERSON *registry_person_get(const char *person_guid, time_t when) {
187
char buf[GUID_LEN + 1];
188
// validate it is a GUID
189
if(unlikely(regenerate_guid(person_guid, buf) == -1))
190
- info("Registry: person guid '%s' is not a valid guid. Ignoring it.", person_guid);
190
+ netdata_log_info("Registry: person guid '%s' is not a valid guid. Ignoring it.", person_guid);
191
else {
192
person_guid = buf;
193
p = registry_person_find(person_guid);
spawn/spawn.c
+4
-4
@@ -235,7 +235,7 @@ void spawn_init(void)
235
struct completion completion;
236
int error;
237
238
- info("Initializing spawn client.");
238
+ netdata_log_info("Initializing spawn client.");
239
240
init_spawn_cmd_queue();
241
@@ -268,15 +268,15 @@ void spawn_init(void)
268
char cmd[64];
269
sprintf(cmd, "echo CONCURRENT_STRESS_TEST %d 1>&2", j * CONCURRENT_SPAWNS + i + 1);
270
serial[i] = spawn_enq_cmd(cmd);
271
- info("Queued command %s for spawning.", cmd);
271
+ netdata_log_info("Queued command %s for spawning.", cmd);
272
}
273
int exit_status;
274
time_t exec_run_timestamp;
275
for (int i = 0; i < CONCURRENT_SPAWNS; ++i) {
276
- info("Started waiting for serial %llu exit status %d run timestamp %llu.", serial[i], exit_status,
276
+ netdata_log_info("Started waiting for serial %llu exit status %d run timestamp %llu.", serial[i], exit_status,
277
exec_run_timestamp);
278
spawn_wait_cmd(serial[i], &exit_status, &exec_run_timestamp);
279
- info("Finished waiting for serial %llu exit status %d run timestamp %llu.", serial[i], exit_status,
279
+ netdata_log_info("Finished waiting for serial %llu exit status %d run timestamp %llu.", serial[i], exit_status,
280
exec_run_timestamp);
281
}
282
}
spawn/spawn_client.c
+10
-10
@@ -19,7 +19,7 @@ static void after_pipe_write(uv_write_t* req, int status)
19
{
20
(void)status;
21
#ifdef SPAWN_DEBUG
22
- info("CLIENT %s called status=%d", __func__, status);
22
+ netdata_log_info("CLIENT %s called status=%d", __func__, status);
23
#endif
24
void **data = req->data;
25
freez(data[0]);
@@ -59,7 +59,7 @@ static void client_parse_spawn_protocol(unsigned source_len, char *source)
59
cmdinfo->pid = spawn_result->exec_pid;
60
if (0 == cmdinfo->pid) { /* Failed to spawn */
61
#ifdef SPAWN_DEBUG
62
- info("CLIENT %s SPAWN_PROT_SPAWN_RESULT failed to spawn.", __func__);
62
+ netdata_log_info("CLIENT %s SPAWN_PROT_SPAWN_RESULT failed to spawn.", __func__);
63
#endif
64
cmdinfo->flags |= SPAWN_CMD_FAILED_TO_SPAWN | SPAWN_CMD_DONE;
65
uv_cond_signal(&cmdinfo->cond);
@@ -67,7 +67,7 @@ static void client_parse_spawn_protocol(unsigned source_len, char *source)
67
cmdinfo->exec_run_timestamp = spawn_result->exec_run_timestamp;
68
cmdinfo->flags |= SPAWN_CMD_IN_PROGRESS;
69
#ifdef SPAWN_DEBUG
70
- info("CLIENT %s SPAWN_PROT_SPAWN_RESULT in progress.", __func__);
70
+ netdata_log_info("CLIENT %s SPAWN_PROT_SPAWN_RESULT in progress.", __func__);
71
#endif
72
}
73
uv_mutex_unlock(&cmdinfo->mutex);
@@ -84,7 +84,7 @@ static void client_parse_spawn_protocol(unsigned source_len, char *source)
84
uv_mutex_lock(&cmdinfo->mutex);
85
cmdinfo->exit_status = exit_status->exec_exit_status;
86
#ifdef SPAWN_DEBUG
87
- info("CLIENT %s SPAWN_PROT_CMD_EXIT_STATUS %d.", __func__, exit_status->exec_exit_status);
87
+ netdata_log_info("CLIENT %s SPAWN_PROT_CMD_EXIT_STATUS %d.", __func__, exit_status->exec_exit_status);
88
#endif
89
cmdinfo->flags |= SPAWN_CMD_DONE;
90
uv_cond_signal(&cmdinfo->cond);
@@ -102,9 +102,9 @@ static void client_parse_spawn_protocol(unsigned source_len, char *source)
102
static void on_pipe_read(uv_stream_t* pipe, ssize_t nread, const uv_buf_t* buf)
103
{
104
if (0 == nread) {
105
- info("%s: Zero bytes read from spawn pipe.", __func__);
105
+ netdata_log_info("%s: Zero bytes read from spawn pipe.", __func__);
106
} else if (UV_EOF == nread) {
107
- info("EOF found in spawn pipe.");
107
+ netdata_log_info("EOF found in spawn pipe.");
108
} else if (nread < 0) {
109
error("%s: %s", __func__, uv_strerror(nread));
110
}
@@ -113,7 +113,7 @@ static void on_pipe_read(uv_stream_t* pipe, ssize_t nread, const uv_buf_t* buf)
113
(void)uv_read_stop((uv_stream_t *)pipe);
114
} else if (nread) {
115
#ifdef SPAWN_DEBUG
116
- info("CLIENT %s read %u", __func__, (unsigned)nread);
116
+ netdata_log_info("CLIENT %s read %u", __func__, (unsigned)nread);
117
#endif
118
client_parse_spawn_protocol(nread, buf->base);
119
}
@@ -162,7 +162,7 @@ static void spawn_process_cmd(struct spawn_cmd_info *cmdinfo)
162
writebuf[2] = uv_buf_init((char *)cmdinfo->command_to_run, write_ctx->payload.command_length);
163
164
#ifdef SPAWN_DEBUG
165
- info("CLIENT %s SPAWN_PROT_EXEC_CMD %u", __func__, (unsigned)cmdinfo->serial);
165
+ netdata_log_info("CLIENT %s SPAWN_PROT_EXEC_CMD %u", __func__, (unsigned)cmdinfo->serial);
166
#endif
167
ret = uv_write(&write_ctx->write_req, (uv_stream_t *)&spawn_channel, writebuf, 3, after_pipe_write);
168
fatal_assert(ret == 0);
@@ -223,12 +223,12 @@ void spawn_client(void *arg)
223
}
224
}
225
/* cleanup operations of the event loop */
226
- info("Shutting down spawn client event loop.");
226
+ netdata_log_info("Shutting down spawn client event loop.");
227
uv_close((uv_handle_t *)&spawn_channel, NULL);
228
uv_close((uv_handle_t *)&spawn_async, NULL);
229
uv_run(loop, UV_RUN_DEFAULT); /* flush all libuv handles */
230
231
- info("Shutting down spawn client loop complete.");
231
+ netdata_log_info("Shutting down spawn client loop complete.");
232
fatal_assert(0 == uv_loop_close(loop));
233
234
return;
streaming/receiver.c
+5
-5
@@ -533,7 +533,7 @@ void rrdpush_receive_log_status(struct receiver_state *rpt, const char *msg, con
533
(rpt->hostname && *rpt->hostname) ? rpt->hostname : "-",
534
status);
535
536
- info("STREAM '%s' [receive from [%s]:%s]: "
536
+ netdata_log_info("STREAM '%s' [receive from [%s]:%s]: "
537
"%s. "
538
"STATUS: %s%s%s%s"
539
, rpt->hostname
@@ -671,7 +671,7 @@ static void rrdpush_receive(struct receiver_state *rpt)
671
}
672
673
#ifdef NETDATA_INTERNAL_CHECKS
674
- info("STREAM '%s' [receive from [%s]:%s]: "
674
+ netdata_log_info("STREAM '%s' [receive from [%s]:%s]: "
675
"client willing to stream metrics for host '%s' with machine_guid '%s': "
676
"update every = %d, history = %d, memory mode = %s, health %s,%s tags '%s'"
677
, rpt->hostname
@@ -717,7 +717,7 @@ static void rrdpush_receive(struct receiver_state *rpt)
717
#endif
718
719
{
720
- // info("STREAM %s [receive from [%s]:%s]: initializing communication...", rrdhost_hostname(rpt->host), rpt->client_ip, rpt->client_port);
720
+ // netdata_log_info("STREAM %s [receive from [%s]:%s]: initializing communication...", rrdhost_hostname(rpt->host), rpt->client_ip, rpt->client_port);
721
char initial_response[HTTP_HEADER_SIZE];
722
if (stream_has_capability(rpt, STREAM_CAP_VCAPS)) {
723
log_receiver_capabilities(rpt);
@@ -817,7 +817,7 @@ static void rrdpush_receiver_thread_cleanup(void *ptr) {
817
818
rrdhost_clear_receiver(rpt);
819
820
- info("STREAM '%s' [receive from [%s]:%s]: "
820
+ netdata_log_info("STREAM '%s' [receive from [%s]:%s]: "
821
"receive thread ended (task id %d)"
822
, rpt->hostname ? rpt->hostname : "-"
823
, rpt->client_ip ? rpt->client_ip : "-", rpt->client_port ? rpt->client_port : "-"
@@ -838,7 +838,7 @@ void *rrdpush_receiver_thread(void *ptr) {
838
839
struct receiver_state *rpt = (struct receiver_state *)ptr;
840
rpt->tid = gettid();
841
- info("STREAM %s [%s]:%s: receive thread created (task id %d)", rpt->hostname, rpt->client_ip, rpt->client_port, rpt->tid);
841
+ netdata_log_info("STREAM %s [%s]:%s: receive thread created (task id %d)", rpt->hostname, rpt->client_ip, rpt->client_port, rpt->tid);
842
843
rrdpush_receive(rpt);
844
streaming/replication.c
+1
-1
@@ -1606,7 +1606,7 @@ static void verify_all_hosts_charts_are_streaming_now(void) {
1606
dfe_done(host);
1607
1608
size_t executed = __atomic_load_n(&replication_globals.atomic.executed, __ATOMIC_RELAXED);
1609
- info("REPLICATION SUMMARY: finished, executed %zu replication requests, %zu charts pending replication",
1609
+ netdata_log_info("REPLICATION SUMMARY: finished, executed %zu replication requests, %zu charts pending replication",
1610
executed - replication_globals.main_thread.last_executed, errors);
1611
replication_globals.main_thread.last_executed = executed;
1612
}
streaming/rrdpush.c
+10
-10
@@ -57,12 +57,12 @@ static void load_stream_conf() {
57
errno = 0;
58
char *filename = strdupz_path_subpath(netdata_configured_user_config_dir, "stream.conf");
59
if(!appconfig_load(&stream_config, filename, 0, NULL)) {
60
- info("CONFIG: cannot load user config '%s'. Will try stock config.", filename);
60
+ netdata_log_info("CONFIG: cannot load user config '%s'. Will try stock config.", filename);
61
freez(filename);
62
63
filename = strdupz_path_subpath(netdata_configured_stock_config_dir, "stream.conf");
64
if(!appconfig_load(&stream_config, filename, 0, NULL))
65
- info("CONFIG: cannot load stock config '%s'. Running with internal defaults.", filename);
65
+ netdata_log_info("CONFIG: cannot load stock config '%s'. Running with internal defaults.", filename);
66
}
67
freez(filename);
68
}
@@ -156,7 +156,7 @@ int rrdpush_init() {
156
netdata_ssl_validate_certificate_sender = !appconfig_get_boolean(&stream_config, CONFIG_SECTION_STREAM, "ssl skip certificate verification", !netdata_ssl_validate_certificate);
157
158
if(!netdata_ssl_validate_certificate_sender)
159
- info("SSL: streaming senders will skip SSL certificates verification.");
159
+ netdata_log_info("SSL: streaming senders will skip SSL certificates verification.");
160
161
netdata_ssl_ca_path = appconfig_get(&stream_config, CONFIG_SECTION_STREAM, "CApath", NULL);
162
netdata_ssl_ca_file = appconfig_get(&stream_config, CONFIG_SECTION_STREAM, "CAfile", NULL);
@@ -485,7 +485,7 @@ RRDSET_STREAM_BUFFER rrdset_push_metric_initialize(RRDSET *st, time_t wall_clock
485
return (RRDSET_STREAM_BUFFER) { .wb = NULL, };
486
}
487
else if(unlikely(host_flags & RRDHOST_FLAG_RRDPUSH_SENDER_LOGGED_STATUS)) {
488
- info("STREAM %s [send]: sending metrics to parent...", rrdhost_hostname(host));
488
+ netdata_log_info("STREAM %s [send]: sending metrics to parent...", rrdhost_hostname(host));
489
rrdhost_flag_clear(host, RRDHOST_FLAG_RRDPUSH_SENDER_LOGGED_STATUS);
490
}
491
@@ -588,7 +588,7 @@ int connect_to_one_of_destinations(
588
if(d->postpone_reconnection_until > now)
589
continue;
590
591
- info(
591
+ netdata_log_info(
592
"STREAM %s: connecting to '%s' (default port: %d)...",
593
rrdhost_hostname(host),
594
string2str(d->destination),
@@ -645,7 +645,7 @@ bool destinations_init_add_one(char *entry, void *data) {
645
DOUBLE_LINKED_LIST_APPEND_ITEM_UNSAFE(t->list, d, prev, next);
646
647
t->count++;
648
- info("STREAM: added streaming destination No %d: '%s' to host '%s'", t->count, string2str(d->destination), rrdhost_hostname(t->host));
648
+ netdata_log_info("STREAM: added streaming destination No %d: '%s' to host '%s'", t->count, string2str(d->destination), rrdhost_hostname(t->host));
649
650
return false; // we return false, so that we will get all defined destinations
651
}
@@ -882,7 +882,7 @@ int rrdpush_receiver_thread_spawn(struct web_client *w, char *decoded_query_stri
882
rpt->capabilities = convert_stream_version_to_capabilities(1, NULL, false);
883
884
if (unlikely(rrdhost_set_system_info_variable(rpt->system_info, name, value))) {
885
- info("STREAM '%s' [receive from [%s]:%s]: "
885
+ netdata_log_info("STREAM '%s' [receive from [%s]:%s]: "
886
"request has parameter '%s' = '%s', which is not used."
887
, (rpt->hostname && *rpt->hostname) ? rpt->hostname : "-"
888
, rpt->client_ip, rpt->client_port
@@ -1155,7 +1155,7 @@ int rrdpush_receiver_thread_spawn(struct web_client *w, char *decoded_query_stri
1155
// we can proceed with this connection
1156
receiver_stale = false;
1157
1158
- info("STREAM '%s' [receive from [%s]:%s]: "
1158
+ netdata_log_info("STREAM '%s' [receive from [%s]:%s]: "
1159
"stopped previous stale receiver to accept this one."
1160
, rpt->hostname
1161
, rpt->client_ip, rpt->client_port
@@ -1310,7 +1310,7 @@ void log_receiver_capabilities(struct receiver_state *rpt) {
1310
BUFFER *wb = buffer_create(100, NULL);
1311
stream_capabilities_to_string(wb, rpt->capabilities);
1312
1313
- info("STREAM %s [receive from [%s]:%s]: established link with negotiated capabilities: %s",
1313
+ netdata_log_info("STREAM %s [receive from [%s]:%s]: established link with negotiated capabilities: %s",
1314
rrdhost_hostname(rpt->host), rpt->client_ip, rpt->client_port, buffer_tostring(wb));
1315
1316
buffer_free(wb);
@@ -1320,7 +1320,7 @@ void log_sender_capabilities(struct sender_state *s) {
1320
BUFFER *wb = buffer_create(100, NULL);
1321
stream_capabilities_to_string(wb, s->capabilities);
1322
1323
- info("STREAM %s [send to %s]: established link with negotiated capabilities: %s",
1323
+ netdata_log_info("STREAM %s [send to %s]: established link with negotiated capabilities: %s",
1324
rrdhost_hostname(s->host), s->connected_to, buffer_tostring(wb));
1325
1326
buffer_free(wb);
streaming/sender.c
+5
-5
@@ -111,7 +111,7 @@ void sender_commit(struct sender_state *s, BUFFER *wb, STREAM_TRAFFIC_TYPE type)
111
// fclose(fp);
112
113
if(unlikely(s->buffer->max_size < (src_len + 1) * SENDER_BUFFER_ADAPT_TO_TIMES_MAX_SIZE)) {
114
- info("STREAM %s [send to %s]: max buffer size of %zu is too small for a data message of size %zu. Increasing the max buffer size to %d times the max data message size.",
114
+ netdata_log_info("STREAM %s [send to %s]: max buffer size of %zu is too small for a data message of size %zu. Increasing the max buffer size to %d times the max data message size.",
115
rrdhost_hostname(s->host), s->connected_to, s->buffer->max_size, buffer_strlen(wb) + 1, SENDER_BUFFER_ADAPT_TO_TIMES_MAX_SIZE);
116
117
s->buffer->max_size = (src_len + 1) * SENDER_BUFFER_ADAPT_TO_TIMES_MAX_SIZE;
@@ -585,7 +585,7 @@ static bool rrdpush_sender_thread_connect_to_parent(RRDHOST *host, int default_p
585
return false;
586
}
587
588
- // info("STREAM %s [send to %s]: initializing communication...", rrdhost_hostname(host), s->connected_to);
588
+ // netdata_log_info("STREAM %s [send to %s]: initializing communication...", rrdhost_hostname(host), s->connected_to);
589
590
// reset our capabilities to default
591
s->capabilities = stream_our_capabilities(host, true);
@@ -1165,7 +1165,7 @@ static void rrdpush_sender_thread_cleanup_callback(void *ptr) {
1165
RRDHOST *host = s->host;
1166
1167
sender_lock(host->sender);
1168
- info("STREAM %s [send]: sending thread exits %s",
1168
+ netdata_log_info("STREAM %s [send]: sending thread exits %s",
1169
rrdhost_hostname(host),
1170
host->sender->exit.reason != STREAM_HANDSHAKE_NEVER ? stream_handshake_error_to_string(host->sender->exit.reason) : "");
1171
@@ -1251,7 +1251,7 @@ void *rrdpush_sender_thread(void *ptr) {
1251
1252
rrdpush_initialize_ssl_ctx(s->host);
1253
1254
- info("STREAM %s [send]: thread created (task id %d)", rrdhost_hostname(s->host), gettid());
1254
+ netdata_log_info("STREAM %s [send]: thread created (task id %d)", rrdhost_hostname(s->host), gettid());
1255
1256
s->timeout = (int)appconfig_get_number(
1257
&stream_config, CONFIG_SECTION_STREAM, "timeout seconds", 600);
@@ -1324,7 +1324,7 @@ void *rrdpush_sender_thread(void *ptr) {
1324
s->replication.oldest_request_after_t = 0;
1325
1326
rrdhost_flag_set(s->host, RRDHOST_FLAG_RRDPUSH_SENDER_READY_4_METRICS);
1327
- info("STREAM %s [send to %s]: enabling metrics streaming...", rrdhost_hostname(s->host), s->connected_to);
1327
+ netdata_log_info("STREAM %s [send to %s]: enabling metrics streaming...", rrdhost_hostname(s->host), s->connected_to);
1328
1329
continue;
1330
}
web/api/formatters/csv/csv.c
+2
-2
@@ -4,7 +4,7 @@
4
#include "csv.h"
5
6
void rrdr2csv(RRDR *r, BUFFER *wb, uint32_t format, RRDR_OPTIONS options, const char *startline, const char *separator, const char *endline, const char *betweenlines) {
7
- //info("RRD2CSV(): %s: BEGIN", r->st->id);
7
+ //netdata_log_info("RRD2CSV(): %s: BEGIN", r->st->id);
8
long c, i;
9
const long used = (long)r->d;
10
@@ -104,5 +104,5 @@ void rrdr2csv(RRDR *r, BUFFER *wb, uint32_t format, RRDR_OPTIONS options, const
104
105
buffer_strcat(wb, endline);
106
}
107
- //info("RRD2CSV(): %s: END", r->st->id);
107
+ //netdata_log_info("RRD2CSV(): %s: END", r->st->id);
108
}
web/api/formatters/json/json.c
+2
-2
@@ -6,7 +6,7 @@
6
#define JSON_DATES_TIMESTAMP 2
7
8
void rrdr2json(RRDR *r, BUFFER *wb, RRDR_OPTIONS options, int datatable) {
9
- //info("RRD2JSON(): %s: BEGIN", r->st->id);
9
+ //netdata_log_info("RRD2JSON(): %s: BEGIN", r->st->id);
10
int row_annotations = 0, dates, dates_with_new = 0;
11
char kq[2] = "", // key quote
12
sq[2] = "", // string quote
@@ -241,7 +241,7 @@ void rrdr2json(RRDR *r, BUFFER *wb, RRDR_OPTIONS options, int datatable) {
241
}
242
243
buffer_strcat(wb, finish);
244
- //info("RRD2JSON(): %s: END", r->st->id);
244
+ //netdata_log_info("RRD2JSON(): %s: END", r->st->id);
245
}
246
247
void rrdr2json_v2(RRDR *r, BUFFER *wb) {
web/api/formatters/ssv/ssv.c
+2
-2
@@ -3,7 +3,7 @@
3
#include "ssv.h"
4
5
void rrdr2ssv(RRDR *r, BUFFER *wb, RRDR_OPTIONS options, const char *prefix, const char *separator, const char *suffix) {
6
- //info("RRD2SSV(): %s: BEGIN", r->st->id);
6
+ //netdata_log_info("RRD2SSV(): %s: BEGIN", r->st->id);
7
long i;
8
9
buffer_strcat(wb, prefix);
@@ -41,5 +41,5 @@ void rrdr2ssv(RRDR *r, BUFFER *wb, RRDR_OPTIONS options, const char *prefix, con
41
buffer_print_netdata_double(wb, v);
42
}
43
buffer_strcat(wb, suffix);
44
- //info("RRD2SSV(): %s: END", r->st->id);
44
+ //netdata_log_info("RRD2SSV(): %s: END", r->st->id);
45
}
web/api/health/health_cmdapi.c
+1
-1
@@ -96,7 +96,7 @@ void health_silencers2file(BUFFER *wb) {
96
if(fd) {
97
size_t written = (size_t)fprintf(fd, "%s", wb->buffer) ;
98
if (written == wb->len ) {
99
- info("Silencer changes written to %s", silencers_filename);
99
+ netdata_log_info("Silencer changes written to %s", silencers_filename);
100
}
101
fclose(fd);
102
return;
web/api/queries/query.c
+3
-3
@@ -1627,7 +1627,7 @@ static void rrd2rrdr_query_execute(RRDR *r, size_t dim_id_in_rrdr, QUERY_ENGINE_
1627
new_point.sp.start_time_s = last1_point.sp.end_time_s;
1628
new_point.sp.end_time_s = now_end_time;
1629
//
1630
-// if(debug_this) info("QUERY: is finished() returned true");
1630
+// if(debug_this) netdata_log_info("QUERY: is finished() returned true");
1631
//
1632
break;
1633
}
@@ -1687,7 +1687,7 @@ static void rrd2rrdr_query_execute(RRDR *r, size_t dim_id_in_rrdr, QUERY_ENGINE_
1687
query_point_set_id(new_point, ops->db_total_points_read);
1688
1689
// if(debug_this)
1690
-// info("QUERY: got point %zu, from time %ld to %ld // now from %ld to %ld // query from %ld to %ld",
1690
+// netdata_log_info("QUERY: got point %zu, from time %ld to %ld // now from %ld to %ld // query from %ld to %ld",
1691
// new_point.id, new_point.start_time, new_point.end_time, now_start_time, now_end_time, after_wanted, before_wanted);
1692
//
1693
// get the right value from the point we got
@@ -2158,7 +2158,7 @@ bool rrdr_relative_window_to_absolute(time_t *after, time_t *before, time_t *now
2158
#define query_debug_log_init() BUFFER *debug_log = buffer_create(1000)
2159
#define query_debug_log(args...) buffer_sprintf(debug_log, ##args)
2160
#define query_debug_log_fin() { \
2161
- info("QUERY: '%s', after:%ld, before:%ld, duration:%ld, points:%zu, res:%ld - wanted => after:%ld, before:%ld, points:%zu, group:%zu, granularity:%ld, resgroup:%ld, resdiv:" NETDATA_DOUBLE_FORMAT_AUTO " %s", qt->id, after_requested, before_requested, before_requested - after_requested, points_requested, resampling_time_requested, after_wanted, before_wanted, points_wanted, group, query_granularity, resampling_group, resampling_divisor, buffer_tostring(debug_log)); \
2161
+ netdata_log_info("QUERY: '%s', after:%ld, before:%ld, duration:%ld, points:%zu, res:%ld - wanted => after:%ld, before:%ld, points:%zu, group:%zu, granularity:%ld, resgroup:%ld, resdiv:" NETDATA_DOUBLE_FORMAT_AUTO " %s", qt->id, after_requested, before_requested, before_requested - after_requested, points_requested, resampling_time_requested, after_wanted, before_wanted, points_wanted, group, query_granularity, resampling_group, resampling_divisor, buffer_tostring(debug_log)); \
2162
buffer_free(debug_log); \
2163
debug_log = NULL; \
2164
}
web/api/queries/weights.c
+1
-1
@@ -1447,7 +1447,7 @@ static void rrdset_metric_correlations_volume(
1447
merge_query_value_to_stats(&highlight_countif, stats, 1);
1448
1449
if(!netdata_double_isnumber(highlight_countif.value)) {
1450
- info("WEIGHTS: highlighted countif query failed, but highlighted average worked - strange...");
1450
+ netdata_log_info("WEIGHTS: highlighted countif query failed, but highlighted average worked - strange...");
1451
return;
1452
}
1453
web/api/tests/valid_urls.c
+1
-1
@@ -46,7 +46,7 @@ void repr(char *result, int result_size, char const *buf, int size)
46
47
ssize_t send(int sockfd, const void *buf, size_t len, int flags)
48
{
49
- info("Mocking send: %zu bytes\n", len);
49
+ netdata_log_info("Mocking send: %zu bytes\n", len);
50
(void)sockfd;
51
(void)buf;
52
(void)flags;
web/api/tests/web_api.c
+3
-3
@@ -46,7 +46,7 @@ void repr(char *result, int result_size, char const *buf, int size)
46
47
ssize_t send(int sockfd, const void *buf, size_t len, int flags)
48
{
49
- info("Mocking send: %zu bytes\n", len);
49
+ netdata_log_info("Mocking send: %zu bytes\n", len);
50
(void)sockfd;
51
(void)buf;
52
(void)flags;
@@ -85,7 +85,7 @@ int __wrap_web_client_api_request_v1(RRDHOST *host, struct web_client *w, char *
85
{
86
char url_repr[160];
87
repr(url_repr, sizeof(url_repr), url, strlen(url));
88
- info("web_client_api_request_v1(url=\"%s\")\n", url_repr);
88
+ netdata_log_info("web_client_api_request_v1(url=\"%s\")\n", url_repr);
89
check_expected_ptr(host);
90
check_expected_ptr(w);
91
check_expected_ptr(url_repr);
@@ -302,7 +302,7 @@ static void api_info(void **state)
302
303
char buffer_repr[1024];
304
repr(buffer_repr, sizeof(buffer_repr), def->instance->response.data->buffer,def->prefix_len);
305
- info("Buffer contains: %s [first %zu]", buffer_repr,def->prefix_len);
305
+ netdata_log_info("Buffer contains: %s [first %zu]", buffer_repr,def->prefix_len);
306
if (def->prefix_len == def->full_len) {
307
expect_value(__wrap_web_client_api_request_v1, host, localhost);
308
expect_value(__wrap_web_client_api_request_v1, w, def->instance);
web/api/web_api_v1.c
+1
-1
@@ -200,7 +200,7 @@ char *get_mgmt_api_key(void) {
200
return guid;
201
202
temp_key:
203
- info("You can still continue to use the alarm management API using the authorization token %s during this Netdata session only.", guid);
203
+ netdata_log_info("You can still continue to use the alarm management API using the authorization token %s during this Netdata session only.", guid);
204
return guid;
205
}
206
web/rtc/webrtc.c
+1
-1
@@ -25,7 +25,7 @@ static void webrtc_log(rtcLogLevel level, const char *message) {
25
break;
26
27
case RTC_LOG_INFO:
28
- info("WEBRTC: %s", message);
28
+ netdata_log_info("WEBRTC: %s", message);
29
break;
30
31
default:
web/server/static/static-threaded.c
+10
-10
@@ -394,7 +394,7 @@ cleanup:
394
static void socket_listen_main_static_threaded_worker_cleanup(void *ptr) {
395
worker_private = (struct web_server_static_threaded_worker *)ptr;
396
397
- info("stopped after %zu connects, %zu disconnects (max concurrent %zu), %zu receptions and %zu sends",
397
+ netdata_log_info("stopped after %zu connects, %zu disconnects (max concurrent %zu), %zu receptions and %zu sends",
398
worker_private->connected,
399
worker_private->disconnected,
400
worker_private->max_concurrent,
@@ -462,16 +462,16 @@ static void socket_listen_main_static_threaded_cleanup(void *ptr) {
462
// for(i = 1; i < static_threaded_workers_count; i++) {
463
// if(static_workers_private_data[i].running) {
464
// found++;
465
-// info("stopping worker %d", i + 1);
465
+// netdata_log_info("stopping worker %d", i + 1);
466
// netdata_thread_cancel(static_workers_private_data[i].thread);
467
// }
468
// else
469
-// info("found stopped worker %d", i + 1);
469
+// netdata_log_info("found stopped worker %d", i + 1);
470
// }
471
//
472
// while(found && max > 0) {
473
// max -= step;
474
-// info("Waiting %d static web threads to finish...", found);
474
+// netdata_log_info("Waiting %d static web threads to finish...", found);
475
// sleep_usec(step);
476
// found = 0;
477
//
@@ -485,10 +485,10 @@ static void socket_listen_main_static_threaded_cleanup(void *ptr) {
485
// if(found)
486
// error("%d static web threads are taking too long to finish. Giving up.", found);
487
488
- info("closing all web server sockets...");
488
+ netdata_log_info("closing all web server sockets...");
489
listen_sockets_close(&api_sockets);
490
491
- info("all static web threads stopped.");
491
+ netdata_log_info("all static web threads stopped.");
492
static_thread->enabled = NETDATA_MAIN_THREAD_EXITED;
493
}
494
@@ -502,7 +502,7 @@ void *socket_listen_main_static_threaded(void *ptr) {
502
netdata_ssl_validate_certificate = !config_get_boolean(CONFIG_SECTION_WEB, "ssl skip certificate verification", !netdata_ssl_validate_certificate);
503
504
if(!netdata_ssl_validate_certificate_sender)
505
- info("SSL: web server will skip SSL certificates verification.");
505
+ netdata_log_info("SSL: web server will skip SSL certificates verification.");
506
507
#ifdef ENABLE_HTTPS
508
netdata_ssl_initialize_ctx(NETDATA_SSL_WEB_SERVER_CTX);
@@ -514,7 +514,7 @@ void *socket_listen_main_static_threaded(void *ptr) {
514
int def_thread_count = MIN(get_netdata_cpus(), 6);
515
516
if (!strcmp(config_get(CONFIG_SECTION_WEB, "mode", ""),"single-threaded")) {
517
- info("Running web server with one thread, because mode is single-threaded");
517
+ netdata_log_info("Running web server with one thread, because mode is single-threaded");
518
config_set(CONFIG_SECTION_WEB, "mode", "static-threaded");
519
def_thread_count = 1;
520
}
@@ -526,7 +526,7 @@ void *socket_listen_main_static_threaded(void *ptr) {
526
// See https://github.com/netdata/netdata/issues/11081#issuecomment-831998240 for more details
527
if (OPENSSL_VERSION_NUMBER < OPENSSL_VERSION_110) {
528
static_threaded_workers_count = 1;
529
- info("You are running an OpenSSL older than 1.1.0, web server will not enable multithreading.");
529
+ netdata_log_info("You are running an OpenSSL older than 1.1.0, web server will not enable multithreading.");
530
}
531
#endif
532
@@ -546,7 +546,7 @@ void *socket_listen_main_static_threaded(void *ptr) {
546
char tag[50 + 1];
547
snprintfz(tag, 50, "WEB[%d]", i+1);
548
549
- info("starting worker %d", i+1);
549
+ netdata_log_info("starting worker %d", i+1);
550
netdata_thread_create(&static_workers_private_data[i].thread, tag, NETDATA_THREAD_OPTION_DEFAULT,
551
socket_listen_main_static_threaded_worker, (void *)&static_workers_private_data[i]);
552
}
web/server/web_client.c
+6
-6
@@ -285,7 +285,7 @@ static struct {
285
};
286
287
static inline uint8_t contenttype_for_filename(const char *filename) {
288
- // info("checking filename '%s'", filename);
288
+ // netdata_log_info("checking filename '%s'", filename);
289
290
static int initialized = 0;
291
int i;
@@ -306,22 +306,22 @@ static inline uint8_t contenttype_for_filename(const char *filename) {
306
}
307
308
if(unlikely(!last_dot || !*last_dot || !last_dot[1])) {
309
- // info("no extension for filename '%s'", filename);
309
+ // netdata_log_info("no extension for filename '%s'", filename);
310
return CT_APPLICATION_OCTET_STREAM;
311
}
312
last_dot++;
313
314
- // info("extension for filename '%s' is '%s'", filename, last_dot);
314
+ // netdata_log_info("extension for filename '%s' is '%s'", filename, last_dot);
315
316
uint32_t hash = simple_hash(last_dot);
317
for(i = 0; mime_types[i].extension ; i++) {
318
if(unlikely(hash == mime_types[i].hash && !strcmp(last_dot, mime_types[i].extension))) {
319
- // info("matched extension for filename '%s': '%s'", filename, last_dot);
319
+ // netdata_log_info("matched extension for filename '%s': '%s'", filename, last_dot);
320
return mime_types[i].contenttype;
321
}
322
}
323
324
- // info("not matched extension for filename '%s': '%s'", filename, last_dot);
324
+ // netdata_log_info("not matched extension for filename '%s': '%s'", filename, last_dot);
325
return CT_APPLICATION_OCTET_STREAM;
326
}
327
@@ -1017,7 +1017,7 @@ static inline HTTP_VALIDATION http_request_validate(struct web_client *w) {
1017
is_it_valid = url_is_request_complete(s, &s[last_pos], w->header_parse_last_size, &w->post_payload, &w->post_payload_size);
1018
if(!is_it_valid) {
1019
if(w->header_parse_tries > HTTP_REQ_MAX_HEADER_FETCH_TRIES) {
1020
- info("Disabling slow client after %zu attempts to read the request (%zu bytes received)", w->header_parse_tries, buffer_strlen(w->response.data));
1020
+ netdata_log_info("Disabling slow client after %zu attempts to read the request (%zu bytes received)", w->header_parse_tries, buffer_strlen(w->response.data));
1021
w->header_parse_tries = 0;
1022
w->header_parse_last_size = 0;
1023
web_client_disable_wait_receive(w);