Log begin and end markers for scan and bucket listing

This commit is contained in:
Andrea Mazzoleni 2026-02-09 15:50:58 +01:00
parent 60010a4b32
commit 03fb7d3cff
5 changed files with 36 additions and 17 deletions

View file

@ -1467,7 +1467,9 @@ void bucket_to_list(tommy_hashdyn* bucket_hash, tommy_list* bucket_list, block_o
tommy_list_foreach(bucket_list, (tommy_foreach_func*)bucket_free);
tommy_list_init(bucket_list);
log_tag("content_info:bucket_count:%" PRIu64 "\n", (uint64_t)tommy_hashdyn_count(bucket_hash));
log_tag("list:bucket_begin\n");
log_tag("bucket:count:%" PRIu64 "\n", (uint64_t)tommy_hashdyn_count(bucket_hash));
tommy_hashdyn_to_list(bucket_hash, bucket_list);
@ -1477,8 +1479,13 @@ void bucket_to_list(tommy_hashdyn* bucket_hash, tommy_list* bucket_list, block_o
for (tommy_node* i = tommy_list_head(bucket_list); i != 0; i = i->next) {
struct snapraid_bucket* entry = i->data;
count += entry->count_scrubbed + entry->count_justsynced;
log_tag("content_info:bucket:%" PRIu64 ":%u:%u\n", (uint64_t)entry->time_at, entry->count_scrubbed, entry->count_justsynced);
log_tag("bucket:entry:%" PRIu64 ":%u:%u\n", (uint64_t)entry->time_at, entry->count_scrubbed, entry->count_justsynced);
}
log_tag("bucket:block_count:%u\n", count);
log_tag("list:bucket_end\n");
*bucketcount = count;
}

View file

@ -1640,6 +1640,8 @@ static int state_diffscan(struct snapraid_state* state, int is_diff)
else
msg_progress("Scanning...\n");
log_tag("list:scan_begin\n");
/* allocate all the scan data */
for (i = state->disklist; i != 0; i = i->next) {
struct snapraid_disk* disk = i->data;
@ -2005,6 +2007,7 @@ static int state_diffscan(struct snapraid_state* state, int is_diff)
log_tag("summary:moved:%u\n", total.count_move);
log_tag("summary:copied:%u\n", total.count_copy);
log_tag("summary:restored:%u\n", total.count_restore);
log_tag("list:scan_end\n");
no_difference = !total.count_move && !total.count_copy && !total.count_restore
&& !total.count_change && !total.count_remove && !total.count_insert;

View file

@ -339,12 +339,15 @@ The total counter of blocks.
.PD
.RE
.TP
.B content_info:bucket_count:<uint>
Total number of info records about past scrub and sync
operations stored in the content file.
.B bucket_count:<uint>
Total number of info records listed with \`bucket\`.
.TP
.B content_info:bucket:<time>:<count_scrubbed>:<count_new>
All the info records.
.B bucket_block_count:<uint>
Total number of info blocks listed with \`bucket\`. This is the
sum of all the counters listed.
.TP
.B bucket:<time>:<count_scrubbed>:<count_new>
The info records.
.RS 4
.PD 0
.HP 4

View file

@ -210,12 +210,15 @@ Content Tags
meaning their parity data is out of date.
block - The total counter of blocks.
=content_info:bucket_count:<uint>
Total number of info records about past scrub and sync
operations stored in the content file.
=bucket_count:<uint>
Total number of info records listed with `bucket`.
=content_info:bucket:<time>:<count_scrubbed>:<count_new>
All the info records.
=bucket_block_count:<uint>
Total number of info blocks listed with `bucket`. This is the
sum of all the counters listed.
=bucket:<time>:<count_scrubbed>:<count_new>
The info records.
<time> - Unix timestamp of the scrub/sync.
<count_scrubbed> - Number of blocks scrubbed at this timestamp.

View file

@ -220,12 +220,15 @@ These tags report the information stored in the content file.
meaning their parity data is out of date.
block - The total counter of blocks.
content_info:bucket_count:<uint>
Total number of info records about past scrub and sync
operations stored in the content file.
bucket_count:<uint>
Total number of info records listed with `bucket`.
content_info:bucket:<time>:<count_scrubbed>:<count_new>
All the info records.
bucket_block_count:<uint>
Total number of info blocks listed with `bucket`. This is the
sum of all the counters listed.
bucket:<time>:<count_scrubbed>:<count_new>
The info records.
<time> - Unix timestamp of the scrub/sync.
<count_scrubbed> - Number of blocks scrubbed at this timestamp.