diff --git a/src/bq_common/bq_common.h b/src/bq_common/bq_common.h index 60107fe..2cb4c04 100644 --- a/src/bq_common/bq_common.h +++ b/src/bq_common/bq_common.h @@ -46,4 +46,8 @@ extern bq::platform::atomic cccc3; extern bq::platform::atomic cccc4; extern bq::platform::atomic cccc5; extern bq::platform::atomic cccc6; -extern bq::platform::atomic cccc7; \ No newline at end of file + +extern bq::platform::atomic ccc_continue; +extern bq::platform::atomic cccc7; +extern bq::platform::atomic cccc8; +extern bq::platform::atomic cccc9; \ No newline at end of file diff --git a/src/bq_common/utils/util.cpp b/src/bq_common/utils/util.cpp index 48b2df6..0788650 100644 --- a/src/bq_common/utils/util.cpp +++ b/src/bq_common/utils/util.cpp @@ -341,4 +341,9 @@ bq::platform::atomic cccc3 = 0; bq::platform::atomic cccc4 = 0; bq::platform::atomic cccc5 = 0; bq::platform::atomic cccc6 = 0; -bq::platform::atomic cccc7 = 0; \ No newline at end of file + + +bq::platform::atomic ccc_continue = false; +bq::platform::atomic cccc7 = 0; +bq::platform::atomic cccc8 = 0; +bq::platform::atomic cccc9 = 0; \ No newline at end of file diff --git a/src/bq_log/log/log_snapshot.cpp b/src/bq_log/log/log_snapshot.cpp index 7bc1cae..5bf2179 100644 --- a/src/bq_log/log/log_snapshot.cpp +++ b/src/bq_log/log/log_snapshot.cpp @@ -69,12 +69,18 @@ namespace bq { new_buffer->set_thread_check_enable(false); write_success = true; snapshot_text_continuous_ = false; + if (cccc.load()) { + cccc8.fetch_add(1); + } } else { new_buffer->commit_write_chunk(write_handle); new_buffer->begin_read(); new_buffer->read(); new_buffer->end_read(); snapshot_text_continuous_ = false; + if (cccc.load()) { + cccc9.fetch_add(1); + } } } @@ -87,6 +93,9 @@ namespace bq { snapshot_buffer_->set_thread_check_enable(false); } } else { + if (cccc.load()) { + cccc7.fetch_add(1); + } if (snapshot_buffer_) { delete snapshot_buffer_; snapshot_buffer_ = nullptr; @@ -150,6 +159,9 @@ namespace bq { snapshot_text_index_ = (snapshot_text_index_ + 1) & 0x01; bq::string& text = snapshot_text_[snapshot_text_index_]; text.clear(); + if (cccc.load()) { + ccc_continue.store(snapshot_text_continuous_); + } if (!snapshot_buffer_) { bq::util::log_device_console_plain_text(log_level::warning, "calling take_snapshot without enable snapshot"); if (cccc.load()) { diff --git a/test/test_log_3.cpp b/test/test_log_3.cpp index e8ce504..7075d4e 100644 --- a/test/test_log_3.cpp +++ b/test/test_log_3.cpp @@ -891,7 +891,7 @@ namespace bq { snapshot_idx_mode = (snapshot_idx_mode % 1024) + 1; } - 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()); + bq::util::log_device_console(bq::log_level::fatal, "%s, 一:%d, 二:%d, 三:%d, 四:%d, 五:%d, 六:%d, 七:%d, 八:%d, 九:%d", ccc_continue.load() ? "Y" : "X", cccc1.load(), cccc2.load(), cccc3.load(), cccc4.load(), cccc5.load(), cccc6.load(), cccc7.load(), cccc8.load(), cccc9.load()); size_t new_percent = (size_t)(current_tested_num * 100 / total_test_num); if (new_percent != current_tested_percent) {