diff options
author | Harald Welte <laforge@osmocom.org> | 2023-03-27 19:17:23 +0200 |
---|---|---|
committer | Harald Welte <laforge@osmocom.org> | 2023-03-28 15:12:10 +0200 |
commit | a563640f8690179ba882916f5c0fb081a263a450 (patch) | |
tree | a4184b9a2f41b85825a172eb69abfe5298ecca6b /src/osmo-bts-octphy | |
parent | 61b005193c78e8b415ff91daff445af5053d54de (diff) |
Introduce LOGPLCFN() for logging lchan-name + frame number
So far, we've had LOGPLCHAN() and LOGPFN(). This resulted in a number
of log lines containing frame numbers *not* containing the lchan
context, which makes it difficult to deterine which of potentially many
concurrently active lchans is logging.
Let's introduce LOGPLCFN() for a FN-extended version of LOGPLCHAN(),
and convert all callers that have the related context.
Change-Id: I214af0448652a9f321ccbab77977b67663ba28f9
Diffstat (limited to 'src/osmo-bts-octphy')
-rw-r--r-- | src/osmo-bts-octphy/l1_if.c | 2 | ||||
-rw-r--r-- | src/osmo-bts-octphy/l1_tch.c | 16 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c index 4898eb68..1488a9d6 100644 --- a/src/osmo-bts-octphy/l1_if.c +++ b/src/osmo-bts-octphy/l1_if.c @@ -589,7 +589,7 @@ static int ph_tch_req(struct gsm_bts_trx *trx, struct msgb *msg, if (msg) { nmsg = l1p_msgb_alloc(); if (!nmsg) { - LOGPFN(DL1C, LOGL_FATAL, u32Fn, "L1SAP PH-TCH.req msg alloc failed\n"); + LOGPLCFN(lchan, DL1C, LOGL_FATAL, u32Fn, "L1SAP PH-TCH.req msg alloc failed\n"); return -ENOMEM; } diff --git a/src/osmo-bts-octphy/l1_tch.c b/src/osmo-bts-octphy/l1_tch.c index bffa1e95..bce55f19 100644 --- a/src/osmo-bts-octphy/l1_tch.c +++ b/src/osmo-bts-octphy/l1_tch.c @@ -146,7 +146,7 @@ int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, &trx->ts[L1SAP_CHAN2TS(chan_nr)].lchan[l1sap_chan2ss(chan_nr)]; if (data_ind->Data.ulDataLength < 1) { - LOGPFN(DL1P, LOGL_DEBUG, fn, "chan_nr %d Rx Payload size 0\n", chan_nr); + LOGPLCFN(lchan, DL1P, LOGL_DEBUG, fn, "chan_nr %d Rx Payload size 0\n", chan_nr); /* Push empty payload to upper layers */ rmsg = msgb_alloc_headroom(256, 128, "L1P-to-RTP"); return add_l1sap_header(trx, rmsg, lchan, chan_nr, @@ -173,13 +173,13 @@ int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, goto err_payload_match; break; default: - LOGPFN(DL1P, LOGL_NOTICE, fn, "%s Rx Payload Type %d is unsupported\n", - gsm_lchan_name(lchan), payload_type); + LOGPLCFN(lchan, DL1P, LOGL_NOTICE, fn, "%s Rx Payload Type %d is unsupported\n", + gsm_lchan_name(lchan), payload_type); break; } - LOGPFN(DL1P, LOGL_DEBUG, fn, "%s Rx codec frame (%u): %s\n", gsm_lchan_name(lchan), - payload_len, osmo_hexdump(payload, payload_len)); + LOGPLCFN(lchan, DL1P, LOGL_DEBUG, fn, "%s Rx codec frame (%u): %s\n", gsm_lchan_name(lchan), + payload_len, osmo_hexdump(payload, payload_len)); switch (payload_type) { case cOCTVC1_GSM_PAYLOAD_TYPE_ENUM_FULL_RATE: @@ -201,7 +201,7 @@ int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, rmsg = l1_to_rtppayload_amr(payload, payload_len, &lchan->tch.amr_mr); #else - LOGPFN(DL1P, LOGL_ERROR, fn, "OctPHY only supports FR!\n"); + LOGPLCFN(lchan, DL1P, LOGL_ERROR, fn, "OctPHY only supports FR!\n"); return -1; #endif break; @@ -215,8 +215,8 @@ int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, return 0; err_payload_match: - LOGPFN(DL1P, LOGL_ERROR, fn, "%s Rx Payload Type %d incompatible with lchan\n", - gsm_lchan_name(lchan), payload_type); + LOGPLCFN(lchan, DL1P, LOGL_ERROR, fn, "%s Rx Payload Type %d incompatible with lchan\n", + gsm_lchan_name(lchan), payload_type); return -EINVAL; } |