Skip to content

Commit d2ea166

Browse files
committed
Tighten ConfigStore debug logging flow
Removes redundant `CONFIGSTORE_DEBUG_ENTRY/EXIT` calls from `StoreDevice::Write` and `ConfigStore::Timer` to reduce noisy tracing. It also stops logging state at the start of `Flash()` and instead logs it when a write successfully transitions back to `kIdle`, so debug output reflects the meaningful state change.
1 parent ad2d453 commit d2ea166

2 files changed

Lines changed: 1 addition & 10 deletions

File tree

lib-configstore/device/gd32/rom/storedevice.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,9 @@ bool StoreDevice::Erase(uint32_t offset, uint32_t length, storedevice::Result& r
8080
}
8181

8282
bool StoreDevice::Write(uint32_t offset, std::span<const uint8_t> buffer, storedevice::Result& result) {
83-
CONFIGSTORE_DEBUG_ENTRY();
84-
8583
flashcode::Result flashrom_result;
8684
const auto kState = FlashCode::Write(offset, buffer, flashrom_result);
8785

8886
result = static_cast<storedevice::Result>(flashrom_result);
89-
90-
CONFIGSTORE_DEBUG_EXIT();
9187
return kState;
9288
}

lib-configstore/include/configstore.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -518,16 +518,12 @@ class ConfigStore : StoreDevice {
518518
}
519519

520520
static void Timer([[maybe_unused]] TimerHandle_t timer_handle) {
521-
CONFIGSTORE_DEBUG_ENTRY();
522-
523521
if (!Instance().Commit()) {
524522
Instance().TimerStop();
525523

526524
CONFIGSTORE_DEBUG_EXIT();
527525
return;
528526
}
529-
530-
CONFIGSTORE_DEBUG_EXIT();
531527
}
532528

533529
void TimerStart() {
@@ -561,8 +557,6 @@ class ConfigStore : StoreDevice {
561557
}
562558

563559
bool Flash() {
564-
CONFIGSTORE_DEBUG_PUTS(kStateNames[static_cast<unsigned int>(s_state)]);
565-
566560
if (__builtin_expect((s_state == State::kIdle), 1)) {
567561
return false;
568562
}
@@ -596,6 +590,7 @@ class ConfigStore : StoreDevice {
596590
storedevice::Result result;
597591
if (StoreDevice::Write(s_start_address, std::span{s_store}.first<sizeof(ConfigurationStore)>(), result)) {
598592
s_state = State::kIdle;
593+
CONFIGSTORE_DEBUG_PUTS(kStateNames[static_cast<unsigned int>(s_state)]);
599594
return false;
600595
}
601596
assert(result == storedevice::Result::kOk);

0 commit comments

Comments
 (0)