summaryrefslogtreecommitdiffstats
path: root/src/statistics.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-12-14 17:24:54 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-12-14 18:00:52 +0100
commit725698a4f15b9403620951961984b68ed4148992 (patch)
tree23cff9a72220210f33f47c736e7242fec69de3ee /src/statistics.c
parent6a13e7f563e3983c51363704bd2a65e691bafc3e (diff)
fsm: log caller's source for events and state changes, not fsm.c lines
When looking at log output, it is not interesting to see that a state transition's petty details are implemented in fsm.c. Rather log the *caller's* source file and line that caused an event, state change and cascading events. To that end, introduce LOGPSRC() absorbing the guts of LOGP(), to be able to explicitly pass the source file and line information. Prepend an underscore to the function names of osmo_fsm_inst_state_chg(), osmo_fsm_inst_dispatch() and osmo_fsm_inst_term(), and add file and line arguments to them. Provide the previous names as macros that insert the caller's __BASE_FILE__ and __LINE__ constants for the new arguments. Hence no calling code needs to be changed. In fsm.c, add LOGPFSMSRC to call LOGPSRC, and add LOGPFSMLSRC, and use them in above _osmo_fsm_inst_* functions. In addition, in _osmo_fsm_inst_term(), pass the caller's source file and line on to nested event dispatches, so showing where a cascade originated from. Change-Id: Iae72aba7bbf99e19dd584ccabea5867210650dcd
Diffstat (limited to 'src/statistics.c')
0 files changed, 0 insertions, 0 deletions