From 411cf094f3867a8789329197a63e3bcf9f3aba77 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Thu, 15 Jun 2023 18:16:59 -0700 Subject: [PATCH] thermald: log duration of startup block (#28566) --- selfdrive/thermald/thermald.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/selfdrive/thermald/thermald.py b/selfdrive/thermald/thermald.py index f9000becf4..aab8020818 100755 --- a/selfdrive/thermald/thermald.py +++ b/selfdrive/thermald/thermald.py @@ -167,6 +167,7 @@ def thermald_thread(end_event, hw_queue): off_ts = None started_ts = None started_seen = False + startup_blocked_ts = None thermal_status = ThermalStatus.yellow last_hw_state = HardwareState( @@ -340,10 +341,16 @@ def thermald_thread(end_event, hw_queue): if started_ts is None: started_ts = sec_since_boot() started_seen = True + if startup_blocked_ts is not None: + cloudlog.event("Startup after block", block_duration=(sec_since_boot() - startup_blocked_ts), + startup_conditions=startup_conditions, onroad_conditions=onroad_conditions, + startup_conditions_prev=startup_conditions_prev, error=True) + startup_blocked_ts = None else: if onroad_conditions["ignition"] and (startup_conditions != startup_conditions_prev): cloudlog.event("Startup blocked", startup_conditions=startup_conditions, onroad_conditions=onroad_conditions, error=True) startup_conditions_prev = startup_conditions.copy() + startup_blocked_ts = sec_since_boot() started_ts = None if off_ts is None: