From 52d7eafceae67822c6a342bb0985c716f2845d34 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Wed, 12 Feb 2020 14:29:30 +0100 Subject: l1_if: Fix strange formatting of Meas info logging Some use LOGPC, but were used after a LOGP with a trailing newline. Let's simply add some defines/macros to be able to include it into a normal LOGP easily insted of having a function. Change-Id: Ie082b11c9d6d00ff2206184f03f6e3647c3da18c --- src/osmo-bts-litecell15/l1_if.c | 17 +++++++---------- src/osmo-bts-oc2g/l1_if.c | 18 ++++++++---------- src/osmo-bts-octphy/l1_if.c | 14 +++++--------- src/osmo-bts-sysmo/l1_if.c | 18 +++++++----------- 4 files changed, 27 insertions(+), 40 deletions(-) (limited to 'src') diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index d7e0cde5..989cc10a 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -936,12 +936,8 @@ empty_frame: goto tx; } -static void dump_meas_res(int ll, GsmL1_MeasParam_t *m) -{ - LOGPC(DL1C, ll, ", Meas: RSSI %-3.2f dBm, Qual %-3.2f dB, " - "BER %-3.2f, Timing %d\n", m->fRssi, m->fLinkQuality, - m->fBer, m->i16BurstTiming); -} +#define LOG_FMT_MEAS "Meas: RSSI %-3.2f dBm, Qual %-3.2f dB, BER %-3.2f, Timing %d" +#define LOG_PARAM_MEAS(meas_param) (meas_param)->fRssi, (meas_param)->fLinkQuality, (meas_param)->fBer, (meas_param)->i16BurstTiming static int process_meas_res(struct gsm_bts_trx *trx, uint8_t chan_nr, GsmL1_MeasParam_t *m, uint32_t fn) @@ -992,10 +988,10 @@ static int handle_ph_data_ind(struct lc15l1_hdl *fl1, GsmL1_PhDataInd_t *data_in process_meas_res(trx, chan_nr, &data_ind->measParam, fn); - DEBUGPGT(DL1P, &g_time, "Rx PH-DATA.ind %s (hL2 %08x): %s\n", + DEBUGPGT(DL1P, &g_time, "Rx PH-DATA.ind %s (hL2 %08x): %s, " LOG_FMT_MEAS "\n", get_value_string(lc15bts_l1sapi_names, data_ind->sapi), (uint32_t)data_ind->hLayer2, - osmo_hexdump(data_ind->msgUnitParam.u8Buffer, data_ind->msgUnitParam.u8Size)); - dump_meas_res(LOGL_DEBUG, &data_ind->measParam); + osmo_hexdump(data_ind->msgUnitParam.u8Buffer, data_ind->msgUnitParam.u8Size), + LOG_PARAM_MEAS(&data_ind->measParam)); /* check for TCH */ if (data_ind->sapi == GsmL1_Sapi_TchF @@ -1046,7 +1042,8 @@ static int handle_ph_ra_ind(struct lc15l1_hdl *fl1, GsmL1_PhRaInd_t *ra_ind, struct ph_rach_ind_param rach_ind_param; set_log_ctx_sapi(ra_ind->sapi); - dump_meas_res(LOGL_DEBUG, &ra_ind->measParam); + LOGPFN(DL1C, LOGL_DEBUG, ra_ind->u32Fn, "Rx PH-RA.ind, " LOG_FMT_MEAS "\n", + LOG_PARAM_MEAS(&ra_ind->measParam)); if ((ra_ind->msgUnitParam.u8Size != 1) && (ra_ind->msgUnitParam.u8Size != 2)) { diff --git a/src/osmo-bts-oc2g/l1_if.c b/src/osmo-bts-oc2g/l1_if.c index 425fd0d4..9816979f 100644 --- a/src/osmo-bts-oc2g/l1_if.c +++ b/src/osmo-bts-oc2g/l1_if.c @@ -992,12 +992,9 @@ empty_frame: goto tx; } -static void dump_meas_res(int ll, GsmL1_MeasParam_t *m) -{ - LOGPC(DL1C, ll, ", Meas: RSSI %-3.2f dBm, Qual %-3.2f dB, " - "BER %-3.2f, Timing %d\n", m->fRssi, m->fLinkQuality, - m->fBer, m->i16BurstTiming); -} + +#define LOG_FMT_MEAS "Meas: RSSI %-3.2f dBm, Qual %-3.2f dB, BER %-3.2f, Timing %d" +#define LOG_PARAM_MEAS(meas_param) (meas_param)->fRssi, (meas_param)->fLinkQuality, (meas_param)->fBer, (meas_param)->i16BurstTiming static int process_meas_res(struct gsm_bts_trx *trx, uint8_t chan_nr, GsmL1_MeasParam_t *m, uint32_t fn) @@ -1048,10 +1045,10 @@ static int handle_ph_data_ind(struct oc2gl1_hdl *fl1, GsmL1_PhDataInd_t *data_in process_meas_res(trx, chan_nr, &data_ind->measParam, fn); - DEBUGPGT(DL1P, &g_time, "Rx PH-DATA.ind %s (hL2 %08x): %s\n", + DEBUGPGT(DL1P, &g_time, "Rx PH-DATA.ind %s (hL2 %08x): %s, " LOG_FMT_MEAS "\n", get_value_string(oc2gbts_l1sapi_names, data_ind->sapi), (uint32_t)data_ind->hLayer2, - osmo_hexdump(data_ind->msgUnitParam.u8Buffer, data_ind->msgUnitParam.u8Size)); - dump_meas_res(LOGL_DEBUG, &data_ind->measParam); + osmo_hexdump(data_ind->msgUnitParam.u8Buffer, data_ind->msgUnitParam.u8Size), + LOG_PARAM_MEAS(&data_ind->measParam)); /* check for TCH */ if (data_ind->sapi == GsmL1_Sapi_TchF @@ -1102,7 +1099,8 @@ static int handle_ph_ra_ind(struct oc2gl1_hdl *fl1, GsmL1_PhRaInd_t *ra_ind, struct ph_rach_ind_param rach_ind_param; set_log_ctx_sapi(ra_ind->sapi); - dump_meas_res(LOGL_DEBUG, &ra_ind->measParam); + LOGPFN(DL1C, LOGL_DEBUG, ra_ind->u32Fn, "Rx PH-RA.ind, " LOG_FMT_MEAS "\n", + LOG_PARAM_MEAS(&ra_ind->measParam)); if ((ra_ind->msgUnitParam.u8Size != 1) && (ra_ind->msgUnitParam.u8Size != 2)) { diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c index 8f06b34e..bdf85ca7 100644 --- a/src/osmo-bts-octphy/l1_if.c +++ b/src/osmo-bts-octphy/l1_if.c @@ -906,14 +906,9 @@ static void process_meas_res(struct gsm_bts_trx *trx, uint8_t chan_nr, l1sap_up(trx, &l1sap); } -static void dump_meas_res(int ll, tOCTVC1_GSM_MEASUREMENT_INFO * m) -{ - LOGP(DMEAS, ll, - "Meas: RSSI %d dBm, Burst Timing %d Quarter of bits :%d, " - "BER Error Count %d , BER Toatal Bit count %d in last decoded frame\n", - m->sRSSIDbm, m->sBurstTiming, m->sBurstTiming4x, m->usBERCnt, - m->usBERTotalBitCnt); -} + +#define LOG_FMT_MEAS "Meas: RSSI %d dBm, Burst Timing %d Quarter of bits: %d, BER Error Count %d, BER Toatal Bit count %d in last decoded frame" +#define LOG_PARAM_MEAS(meas_param) (meas_param)->sRSSIDbm, (meas_param)->sBurstTiming, (meas_param)->sBurstTiming4x, (meas_param)->usBERCnt, (meas_param)->usBERTotalBitCnt static int handle_mph_time_ind(struct octphy_hdl *fl1, uint8_t trx_id, uint32_t fn) { @@ -1218,7 +1213,8 @@ static int handle_ph_rach_ind(struct octphy_hdl *fl1, set_log_ctx_sapi(ra_ind->LchId.bySAPI); - dump_meas_res(LOGL_DEBUG, &ra_ind->MeasurementInfo); + LOGPFN(DL1C, LOGL_DEBUG, ra_ind->ulFrameNumber, "Rx PH-RA.ind, " LOG_FMT_MEAS "\n", + LOG_PARAM_MEAS(&ra_ind->MeasurementInfo)); if (ra_ind->ulMsgLength != 1) { LOGPFN(DL1C, LOGL_ERROR, ra_ind->ulFrameNumber, diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 199d8bd4..db0dfb56 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -937,12 +937,8 @@ empty_frame: goto tx; } -static void dump_meas_res(int ll, GsmL1_MeasParam_t *m) -{ - LOGPC(DL1C, ll, ", Meas: RSSI %-3.2f dBm, Qual %-3.2f dB, " - "BER %-3.2f, Timing %d\n", m->fRssi, m->fLinkQuality, - m->fBer, m->i16BurstTiming); -} +#define LOG_FMT_MEAS "Meas: RSSI %-3.2f dBm, Qual %-3.2f dB, BER %-3.2f, Timing %d" +#define LOG_PARAM_MEAS(meas_param) (meas_param)->fRssi, (meas_param)->fLinkQuality, (meas_param)->fBer, (meas_param)->i16BurstTiming static int process_meas_res(struct gsm_bts_trx *trx, uint8_t chan_nr, uint32_t fn, GsmL1_MeasParam_t *m) @@ -991,10 +987,10 @@ static int handle_ph_data_ind(struct femtol1_hdl *fl1, GsmL1_PhDataInd_t *data_i gsm_fn2gsmtime(&g_time, fn); - DEBUGPGT(DL1P, &g_time, "Rx PH-DATA.ind %s (hL2 %08x): %s\n", + DEBUGPGT(DL1P, &g_time, "Rx PH-DATA.ind %s (hL2 %08x): %s, " LOG_FMT_MEAS "\n", get_value_string(femtobts_l1sapi_names, data_ind->sapi), data_ind->hLayer2, - osmo_hexdump(data_ind->msgUnitParam.u8Buffer, data_ind->msgUnitParam.u8Size)); - dump_meas_res(LOGL_DEBUG, &data_ind->measParam); + osmo_hexdump(data_ind->msgUnitParam.u8Buffer, data_ind->msgUnitParam.u8Size), + LOG_PARAM_MEAS(&data_ind->measParam)); /* check for TCH */ if (data_ind->sapi == GsmL1_Sapi_TchF @@ -1040,8 +1036,8 @@ static int handle_ph_ra_ind(struct femtol1_hdl *fl1, GsmL1_PhRaInd_t *ra_ind, struct ph_rach_ind_param rach_ind_param; set_log_ctx_sapi(ra_ind->sapi); - - dump_meas_res(LOGL_DEBUG, &ra_ind->measParam); + LOGPFN(DL1C, LOGL_DEBUG, ra_ind->u32Fn, "Rx PH-RA.ind, " LOG_FMT_MEAS "\n", + LOG_PARAM_MEAS(&ra_ind->measParam)); if ((ra_ind->msgUnitParam.u8Size != 1) && (ra_ind->msgUnitParam.u8Size != 2)) { -- cgit v1.2.3