From 050f2d3259bbde52eb4544ad312d5c38828cc869 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Thu, 31 May 2018 15:30:15 +0200 Subject: log: fsm: allow logging the timeout on state change Add a flag that adds timeout info to osmo_fsm_inst state change logging. To not affect unit testing, make this an opt-in feature that is disabled by default -- mostly because osmo_fsm_inst_state_chg_keep_timer() will produce non-deterministic logging depending on timing (logs remaining time). Unit tests that don't verify log output and those that use fake time may also enable this feature. Do so in fsm_test.c. The idea is that in due course we will add osmo_fsm_log_timeouts(true) calls to all of our production applications' main() initialization. Change-Id: I089b81021a1a4ada1205261470da032b82d57872 --- include/osmocom/core/fsm.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/osmocom') diff --git a/include/osmocom/core/fsm.h b/include/osmocom/core/fsm.h index df7e3486..ae1c8575 100644 --- a/include/osmocom/core/fsm.h +++ b/include/osmocom/core/fsm.h @@ -118,6 +118,7 @@ struct osmo_fsm_inst { }; void osmo_fsm_log_addr(bool log_addr); +void osmo_fsm_log_timeouts(bool log_timeouts); /*! Log using FSM instance's context, on explicit logging subsystem and level. * \param fi An osmo_fsm_inst. -- cgit v1.2.3