Skip to content

Commit

Permalink
snapshot multithread test 8
Browse files Browse the repository at this point in the history
  • Loading branch information
pippocao committed Oct 9, 2024
1 parent 8d61387 commit 78b92d6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
5 changes: 4 additions & 1 deletion src/bq_log/log/log_snapshot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ namespace bq {
text.clear();
if (!snapshot_buffer_) {
bq::util::log_device_console_plain_text(log_level::warning, "calling take_snapshot without enable snapshot");
if (cccc.load()) {
cccc5.fetch_add(1);
}
return snapshot_text_[snapshot_text_index_];
}
snapshot_buffer_->begin_read();
Expand All @@ -161,7 +164,7 @@ namespace bq {
break;
}
if (cccc.load()) {
cccc5.fetch_add(1);
cccc6.fetch_add(1);
}
bq::log_entry_handle item(snapshot_read_handle.data_addr, snapshot_read_handle.data_size);
snapshot_layout_.do_layout(item, use_gmt_time, &parent_log_->get_categories_name());
Expand Down
9 changes: 2 additions & 7 deletions test/test_log_3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -890,13 +890,8 @@ namespace bq {
}
snapshot_idx_mode = (snapshot_idx_mode % 1024) + 1;
}
if (cccc1.load() != cccc2.load()
|| cccc1.load() != cccc3.load()
|| cccc4.load() != cccc5.load()
|| cccc3.load() < cccc4.load()
) {
bq::util::log_device_console(bq::log_level::fatal, "%d, %d, %d, %d, %d", cccc1.load(), cccc2.load(), cccc3.load(), cccc4.load(), cccc5.load());
}

bq::util::log_device_console(bq::log_level::fatal, "%d, %d, %d, %d, %d, %d", cccc1.load(), cccc2.load(), cccc3.load(), cccc4.load(), cccc5.load(), cccc6.load());

size_t new_percent = (size_t)(current_tested_num * 100 / total_test_num);
if (new_percent != current_tested_percent) {
Expand Down

0 comments on commit 78b92d6

Please sign in to comment.