path: root/src/tbf.h
diff options
authorMax <msuraev@sysmocom.de>2017-12-15 17:36:45 +0100
committerMax <msuraev@sysmocom.de>2017-12-20 14:14:40 +0000
commitc21f007277713b15d9a48d0bcc6f28aa51b4f908 (patch)
tree775a15826b9aff9ddf11005057633d15cf4b8fbd /src/tbf.h
parentea9968f6854cbfe79506efedc43a953a7c38cdd6 (diff)
Introduce LOGTBF* for consistent logging
When troubleshooting complex issues with TBF lifecycle, it's much easier to follow the logs which are consistently formatted. Add LOGTBF*() macro similar to struct-specific log routines we use in other Osmocom project and use it to log TBF-related messages in a unified way. Tweak test output accordingly. Related: OS#2407 Change-Id: I388249afefc32d2f6e5cb5e5abc6daf4dbd284ea
Diffstat (limited to 'src/tbf.h')
1 files changed, 4 insertions, 0 deletions
diff --git a/src/tbf.h b/src/tbf.h
index 9a1b4c7..15d414d 100644
--- a/src/tbf.h
+++ b/src/tbf.h
@@ -134,6 +134,10 @@ enum tbf_egprs_ul_counters {
+#define LOGPTBF(tbf, level, fmt, args...) LOGP(DRLCMAC, level, "%s " fmt, tbf_name(tbf), ## args)
+#define LOGPTBFUL(tbf, level, fmt, args...) LOGP(DRLCMACUL, level, "%s " fmt, tbf_name(tbf), ## args)
+#define LOGPTBFDL(tbf, level, fmt, args...) LOGP(DRLCMACDL, level, "%s " fmt, tbf_name(tbf), ## args)
#define GPRS_RLCMAC_FLAG_CCCH 0 /* assignment on CCCH */
#define GPRS_RLCMAC_FLAG_PACCH 1 /* assignment on PACCH */
#define GPRS_RLCMAC_FLAG_UL_DATA 2 /* uplink data received */