@cryptotaxi247 / netdata-1 / commits / 21327b9f1

Print rrdcontexts versions with PRIu64 (#13511)

print with PRIu64

Emmanuel Vasilakis committed Aug 12, 2022 at 13:09 UTC 21327b9f1feadefcbdb412c01834202b1a7b8828
2 files changed +11 -11
database/rrdcontext.c
+7 -7
@@ -1381,7 +1381,7 @@ static void rrdcontext_message_send_unsafe(RRDCONTEXT *rc, bool snapshot __maybe
1381 }
1382 else {
1383 if (ctx_store_context(&rc->rrdhost->host_uuid, &rc->hub) != 0)
1384 - error("RRDCONTEXT: failed to save context '%s' version %lu to SQL.", rc->hub.id, rc->hub.version);
1384 + error("RRDCONTEXT: failed to save context '%s' version %"PRIu64" to SQL.", rc->hub.id, rc->hub.version);
1385 }
1386 }
1387
@@ -1425,7 +1425,7 @@ static bool check_if_cloud_version_changed_unsafe(RRDCONTEXT *rc, bool sending _
1425
1426 if(unlikely(id_changed || title_changed || units_changed || family_changed || chart_type_changed || priority_changed || first_time_changed || last_time_changed || deleted_changed)) {
1427
1428 - internal_error(true, "RRDCONTEXT: %s NEW VERSION '%s'%s, version %zu, title '%s'%s, units '%s'%s, family '%s'%s, chart type '%s'%s, priority %u%s, first_time_t %ld%s, last_time_t %ld%s, deleted '%s'%s, (queued for %llu ms, expected %llu ms)",
1428 + internal_error(true, "RRDCONTEXT: %s NEW VERSION '%s'%s, version %"PRIu64", title '%s'%s, units '%s'%s, family '%s'%s, chart type '%s'%s, priority %u%s, first_time_t %ld%s, last_time_t %ld%s, deleted '%s'%s, (queued for %llu ms, expected %llu ms)",
1429 sending?"SENDING":"QUEUE",
1430 string2str(rc->id), id_changed ? " (CHANGED)" : "",
1431 rc->version,
@@ -1458,7 +1458,7 @@ static void rrdcontext_insert_callback(const char *id, void *value, void *data)
1458 // we are loading data from the SQL database
1459
1460 if(rc->version)
1461 - error("RRDCONTEXT: context '%s' is already initialized with version %lu, but it is loaded again from SQL with version %lu", string2str(rc->id), rc->version, rc->hub.version);
1461 + error("RRDCONTEXT: context '%s' is already initialized with version %"PRIu64", but it is loaded again from SQL with version %"PRIu64"", string2str(rc->id), rc->version, rc->hub.version);
1462
1463 // IMPORTANT
1464 // replace all string pointers in rc->hub with our own versions
@@ -1942,7 +1942,7 @@ void rrdcontext_hub_checkpoint_command(void *ptr) {
1942 uint64_t our_version_hash = rrdcontext_version_hash(host);
1943
1944 if(cmd->version_hash != our_version_hash) {
1945 - error("RRDCONTEXT: received version hash %lu for host '%s', does not match our version hash %lu. Sending snapshot of all contexts.",
1945 + error("RRDCONTEXT: received version hash %"PRIu64" for host '%s', does not match our version hash %"PRIu64". Sending snapshot of all contexts.",
1946 cmd->version_hash, host->hostname, our_version_hash);
1947
1948 #ifdef ENABLE_ACLK
@@ -2339,8 +2339,8 @@ static inline int rrdcontext_to_json_callback(const char *id, void *value, void
2339 ",\n\t\t\t\"last_queued\":%llu"
2340 ",\n\t\t\t\"scheduled_dispatch\":%llu"
2341 ",\n\t\t\t\"last_dequeued\":%llu"
2342 - ",\n\t\t\t\"hub_version\":%lu"
2343 - ",\n\t\t\t\"version\":%lu"
2342 + ",\n\t\t\t\"hub_version\":%"PRIu64""
2343 + ",\n\t\t\t\"version\":%"PRIu64""
2344 , rc->queue.queued_ut / USEC_PER_SEC
2345 , rc->queue.scheduled_dispatch_ut / USEC_PER_SEC
2346 , rc->queue.dequeued_ut / USEC_PER_SEC
@@ -2702,7 +2702,7 @@ void rrdcontext_delete_from_sql_unsafe(RRDCONTEXT *rc) {
2702
2703 // delete it from SQL
2704 if(ctx_delete_context(&rc->rrdhost->host_uuid, &rc->hub) != 0)
2705 - error("RRDCONTEXT: failed to delete context '%s' version %lu from SQL.", rc->hub.id, rc->hub.version);
2705 + error("RRDCONTEXT: failed to delete context '%s' version %"PRIu64" from SQL.", rc->hub.id, rc->hub.version);
2706 }
2707
2708 static void rrdcontext_garbage_collect(void) {
database/sqlite/sqlite_context.c
+4 -4
@@ -445,13 +445,13 @@ static void dict_ctx_get_context_list_cb(VERSIONED_CONTEXT_DATA *context_data, v
445 {
446 (void)data;
447 info(" Context id = %s "
448 - "version = %lu "
448 + "version = %"PRIu64" "
449 "title = %s "
450 "chart_type = %s "
451 "units = %s "
452 - "priority = %lu "
453 - "first time = %lu "
454 - "last time = %lu "
452 + "priority = %"PRIu64" "
453 + "first time = %"PRIu64" "
454 + "last time = %"PRIu64" "
455 "deleted = %d "
456 "family = %s",
457 context_data->id,