chore(logging): trim firmware logs and remove runtime diagnostics scaffolding
This commit is contained in:
@@ -45,7 +45,6 @@ static void lifecycle_set_state_locked(control_plane_lifecycle_state_t state,
|
||||
s_status.last_error = last_error;
|
||||
s_status.last_transition_ms = esp_timer_get_time() / 1000;
|
||||
strlcpy(s_status.last_stage, stage != NULL ? stage : "unknown", sizeof(s_status.last_stage));
|
||||
domain_diag_set_gauge(DOMAIN_DIAG_GAUGE_LIFECYCLE_STATE, (int32_t)state);
|
||||
}
|
||||
|
||||
const char *control_plane_lifecycle_state_str(control_plane_lifecycle_state_t state) {
|
||||
@@ -125,7 +124,6 @@ static esp_err_t lifecycle_run_step_with_retry(const char *stage, lifecycle_step
|
||||
return rc;
|
||||
}
|
||||
|
||||
domain_diag_counter_add(DOMAIN_DIAG_COUNTER_LIFECYCLE_START_RETRY, 1);
|
||||
vTaskDelay(pdMS_TO_TICKS(domain_policy_lifecycle_retry_backoff_ms(attempt)));
|
||||
}
|
||||
|
||||
@@ -133,11 +131,8 @@ static esp_err_t lifecycle_run_step_with_retry(const char *stage, lifecycle_step
|
||||
}
|
||||
|
||||
esp_err_t control_plane_lifecycle_start(void) {
|
||||
domain_diag_counter_add(DOMAIN_DIAG_COUNTER_LIFECYCLE_START_ATTEMPT, 1);
|
||||
|
||||
if (!lifecycle_lock_take(1000)) {
|
||||
domain_diag_counter_add(DOMAIN_DIAG_COUNTER_LIFECYCLE_START_FAILED, 1);
|
||||
domain_diag_record_error("lifecycle_start", ESP_ERR_TIMEOUT, "lifecycle lock timeout");
|
||||
return ESP_ERR_TIMEOUT;
|
||||
}
|
||||
|
||||
@@ -188,7 +183,6 @@ esp_err_t control_plane_lifecycle_start(void) {
|
||||
xSemaphoreGive(s_lock);
|
||||
}
|
||||
|
||||
domain_diag_counter_add(DOMAIN_DIAG_COUNTER_LIFECYCLE_START_SUCCESS, 1);
|
||||
ESP_LOGI(TAG, "control-plane lifecycle started");
|
||||
return ESP_OK;
|
||||
|
||||
@@ -208,8 +202,6 @@ start_failed:
|
||||
xSemaphoreGive(s_lock);
|
||||
}
|
||||
|
||||
domain_diag_counter_add(DOMAIN_DIAG_COUNTER_LIFECYCLE_START_FAILED, 1);
|
||||
domain_diag_record_error("lifecycle_start", rc, failed_stage);
|
||||
ESP_LOGE(TAG,
|
||||
"control-plane lifecycle start failed at stage=%s, rc=0x%x",
|
||||
failed_stage,
|
||||
@@ -218,11 +210,8 @@ start_failed:
|
||||
}
|
||||
|
||||
esp_err_t control_plane_lifecycle_stop(void) {
|
||||
domain_diag_counter_add(DOMAIN_DIAG_COUNTER_LIFECYCLE_STOP_ATTEMPT, 1);
|
||||
|
||||
if (!lifecycle_lock_take(1000)) {
|
||||
domain_diag_counter_add(DOMAIN_DIAG_COUNTER_LIFECYCLE_STOP_FAILED, 1);
|
||||
domain_diag_record_error("lifecycle_stop", ESP_ERR_TIMEOUT, "lifecycle lock timeout");
|
||||
return ESP_ERR_TIMEOUT;
|
||||
}
|
||||
|
||||
@@ -266,11 +255,8 @@ esp_err_t control_plane_lifecycle_stop(void) {
|
||||
}
|
||||
|
||||
if (first_err == ESP_OK) {
|
||||
domain_diag_counter_add(DOMAIN_DIAG_COUNTER_LIFECYCLE_STOP_SUCCESS, 1);
|
||||
ESP_LOGI(TAG, "control-plane lifecycle stopped");
|
||||
} else {
|
||||
domain_diag_counter_add(DOMAIN_DIAG_COUNTER_LIFECYCLE_STOP_FAILED, 1);
|
||||
domain_diag_record_error("lifecycle_stop", first_err, "control-plane stop failed");
|
||||
ESP_LOGE(TAG, "control-plane lifecycle stop failed, rc=0x%x", (unsigned)first_err);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user