aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2015-12-05 16:19:21 +0100
committerHarald Welte <laforge@gnumonks.org>2015-12-05 16:19:21 +0100
commitc696cc28d8e61a50717e3c2e68a7cfe2d08c8a48 (patch)
tree48720cfb718b652a14f2717364c010502f9bb530 /openbsc/include
parente1ba781f7b3d45b3e8f9ea87c3041e6980dcf946 (diff)
gsm_data_shared: compute/sprintf the lchan name only once
We now store the pre-printed lchan name in lchan->name to avoid having to call sprintf every time there is a debug statement somewhere, particularly as most of those debug statements are going to be inactive most of the time.
Diffstat (limited to 'openbsc/include')
-rw-r--r--openbsc/include/openbsc/gsm_data_shared.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h
index 1b7382d5c..000207dd9 100644
--- a/openbsc/include/openbsc/gsm_data_shared.h
+++ b/openbsc/include/openbsc/gsm_data_shared.h
@@ -233,6 +233,8 @@ struct gsm_lchan {
uint8_t rqd_ta;
+ char *name;
+
#ifdef ROLE_BSC
struct osmo_timer_list T3101;
struct osmo_timer_list T3109;
@@ -759,9 +761,13 @@ const char *gsm_lchant_name(enum gsm_chan_t c);
const char *gsm_chreq_name(enum gsm_chreq_reason_t c);
char *gsm_trx_name(const struct gsm_bts_trx *trx);
char *gsm_ts_name(const struct gsm_bts_trx_ts *ts);
-char *gsm_lchan_name(const struct gsm_lchan *lchan);
+char *gsm_lchan_name_compute(const struct gsm_lchan *lchan);
const char *gsm_lchans_name(enum gsm_lchan_state s);
+static inline char *gsm_lchan_name(const struct gsm_lchan *lchan)
+{
+ return lchan->name;
+}
void gsm_abis_mo_reset(struct gsm_abis_mo *mo);