[PATCH] osmo-bts[master]: l1sap/osmo-bts-sysmo: Improve logging

2017-08-09 Thread Harald Welte
Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

https://gerrit.osmocom.org/3038

to look at the new patch set (#2).

l1sap/osmo-bts-sysmo: Improve logging

Change-Id: I339db0e5f3fd5e44bac974f2447afc80388802af
---
M src/common/l1sap.c
1 file changed, 23 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/38/3038/2

diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 97cbac1..21d9dc6 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -500,12 +500,16 @@
struct bts_ul_meas ulm;
struct gsm_lchan *lchan;
 
-   DEBUGP(DL1P, "MPH_INFO meas ind chan_nr=0x%02x\n",
-   info_meas_ind->chan_nr);
-
lchan = get_active_lchan_by_chan_nr(trx, info_meas_ind->chan_nr);
-   if (!lchan)
+   if (!lchan) {
+   LOGP(DL1P, LOGL_ERROR, "No lchan for MPH INFO MEAS IND 
(chan_nr=%u)\n",
+info_meas_ind->chan_nr);
return 0;
+   }
+
+   DEBUGP(DL1P, "%s MPH_INFO meas ind, ta_offs_qbits=%d, ber10k=%d, 
inv_rssi=%u\n",
+   gsm_lchan_name(lchan), info_meas_ind->ta_offs_qbits,
+   info_meas_ind->ber10k, info_meas_ind->inv_rssi);
 
/* in the GPRS case we are not interested in measurement
 * processing.  The PCU will take care of it */
@@ -727,8 +731,10 @@
memcpy(p, fill_frame, GSM_MACBLOCK_LEN);
} else if (!(chan_nr & 0x80)) { /* only TCH/F, TCH/H, SDCCH/4 and 
SDCCH/8 have C5 bit cleared */
lchan = get_active_lchan_by_chan_nr(trx, chan_nr);
-   if (!lchan)
+   if (!lchan) {
+   LOGP(DL1P, LOGL_ERROR, "No lchan for PH-RTS.ind 
(chan_nr=%u)\n", chan_nr);
return 0;
+   }
if (L1SAP_IS_LINK_SACCH(link_id)) {
p = msgb_put(msg, GSM_MACBLOCK_LEN);
/* L1-header, if not set/modified by layer 1 */
@@ -779,8 +785,8 @@
memcpy(p, fill_frame, GSM_MACBLOCK_LEN);
}
 
-   DEBUGP(DL1P, "Tx PH-DATA.req %02u/%02u/%02u chan_nr=%02x 
link_id=0x%02x\n",
-   g_time.t1, g_time.t2, g_time.t3, chan_nr, link_id);
+   DEBUGP(DL1P, "Tx PH-DATA.req %s chan_nr=0x%02x link_id=0x%02x\n",
+   osmo_dump_gsmtime(_time), chan_nr, link_id);
 
l1sap_down(trx, l1sap);
 
@@ -830,8 +836,10 @@
DEBUGP(DL1P, "Rx TCH-RTS.ind %s chan_nr=0x%02x\n", 
osmo_dump_gsmtime(_time), chan_nr);
 
lchan = get_active_lchan_by_chan_nr(trx, chan_nr);
-   if (!lchan)
+   if (!lchan) {
+   LOGP(DL1P, LOGL_ERROR, "No lchan for PH-RTS.ind 
(chan_nr=%u)\n", chan_nr);
return 0;
+   }
 
if (!lchan->loopback && lchan->abis_ip.rtp_socket) {
osmo_rtp_socket_poll(lchan->abis_ip.rtp_socket);
@@ -880,8 +888,7 @@
resp_l1sap->u.tch.fn = fn;
resp_l1sap->u.tch.marker = marker;
 
-   DEBUGP(DL1P, "Tx TCH.req %02u/%02u/%02u chan_nr=0x%02x\n",
-   g_time.t1, g_time.t2, g_time.t3, chan_nr);
+   DEBUGP(DL1P, "Tx TCH.req %s chan_nr=0x%02x\n", 
osmo_dump_gsmtime(_time), chan_nr);
 
l1sap_down(trx, resp_l1sap);
 
@@ -1024,8 +1031,10 @@
}
 
lchan = get_active_lchan_by_chan_nr(trx, chan_nr);
-   if (!lchan)
+   if (!lchan) {
+   LOGP(DL1P, LOGL_ERROR, "No lchan for chan_nr=%d\n", chan_nr);
return 0;
+   }
 
/* bad frame */
if (len == 0) {
@@ -1091,8 +1100,10 @@
DEBUGP(DL1P, "Rx TCH.ind %s chan_nr=0x%02x\n", 
osmo_dump_gsmtime(_time), chan_nr);
 
lchan = get_active_lchan_by_chan_nr(trx, chan_nr);
-   if (!lchan)
+   if (!lchan) {
+   LOGP(DL1P, LOGL_ERROR, "No lchan for TCH.ind (chan_nr=%u)\n", 
chan_nr);
return 0;
+   }
 
msgb_pull(msg, sizeof(*l1sap));
 

-- 
To view, visit https://gerrit.osmocom.org/3038
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I339db0e5f3fd5e44bac974f2447afc80388802af
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[PATCH] osmo-bts[master]: l1sap/osmo-bts-sysmo: Improve logging

2017-06-24 Thread Harald Welte

Review at  https://gerrit.osmocom.org/3038

l1sap/osmo-bts-sysmo: Improve logging

Change-Id: I339db0e5f3fd5e44bac974f2447afc80388802af
---
M src/common/l1sap.c
1 file changed, 28 insertions(+), 16 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/38/3038/1

diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index cb14a9f..82a636a 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -475,12 +475,16 @@
struct bts_ul_meas ulm;
struct gsm_lchan *lchan;
 
-   DEBUGP(DL1P, "MPH_INFO meas ind chan_nr=0x%02x\n",
-   info_meas_ind->chan_nr);
-
lchan = get_active_lchan_by_chan_nr(trx, info_meas_ind->chan_nr);
-   if (!lchan)
+   if (!lchan) {
+   LOGP(DL1P, LOGL_ERROR, "No lchan for MPH INFO MEAS IND 
(chan_nr=%u)\n",
+info_meas_ind->chan_nr);
return 0;
+   }
+
+   DEBUGP(DL1P, "%s MPH_INFO meas ind, ta_offs_qbits=%d, ber10k=%d, 
inv_rssi=%u\n",
+   gsm_lchan_name(lchan), info_meas_ind->ta_offs_qbits,
+   info_meas_ind->ber10k, info_meas_ind->inv_rssi);
 
/* in the GPRS case we are not interested in measurement
 * processing.  The PCU will take care of it */
@@ -702,8 +706,10 @@
memcpy(p, fill_frame, GSM_MACBLOCK_LEN);
} else if (!(chan_nr & 0x80)) { /* only TCH/F, TCH/H, SDCCH/4 and 
SDCCH/8 have C5 bit cleared */
lchan = get_active_lchan_by_chan_nr(trx, chan_nr);
-   if (!lchan)
+   if (!lchan) {
+   LOGP(DL1P, LOGL_ERROR, "No lchan for PH-RTS.ind 
(chan_nr=%u)\n", chan_nr);
return 0;
+   }
if (L1SAP_IS_LINK_SACCH(link_id)) {
p = msgb_put(msg, GSM_MACBLOCK_LEN);
/* L1-header, if not set/modified by layer 1 */
@@ -754,8 +760,8 @@
memcpy(p, fill_frame, GSM_MACBLOCK_LEN);
}
 
-   DEBUGP(DL1P, "Tx PH-DATA.req %02u/%02u/%02u chan_nr=%d link_id=%d\n",
-   g_time.t1, g_time.t2, g_time.t3, chan_nr, link_id);
+   DEBUGP(DL1P, "Tx PH-DATA.req %s chan_nr=%d link_id=%d\n",
+   dump_gsmtime(_time), chan_nr, link_id);
 
l1sap_down(trx, l1sap);
 
@@ -802,12 +808,14 @@
 
gsm_fn2gsmtime(_time, fn);
 
-   DEBUGP(DL1P, "Rx TCH-RTS.ind %02u/%02u/%02u chan_nr=%d\n",
-   g_time.t1, g_time.t2, g_time.t3, chan_nr);
+   DEBUGP(DL1P, "Rx TCH-RTS.ind %s chan_nr=%d\n",
+   dump_gsmtime(_time), chan_nr);
 
lchan = get_active_lchan_by_chan_nr(trx, chan_nr);
-   if (!lchan)
+   if (!lchan) {
+   LOGP(DL1P, LOGL_ERROR, "No lchan for PH-RTS.ind 
(chan_nr=%u)\n", chan_nr);
return 0;
+   }
 
if (!lchan->loopback && lchan->abis_ip.rtp_socket) {
osmo_rtp_socket_poll(lchan->abis_ip.rtp_socket);
@@ -856,8 +864,8 @@
resp_l1sap->u.tch.fn = fn;
resp_l1sap->u.tch.marker = marker;
 
-   DEBUGP(DL1P, "Tx TCH.req %02u/%02u/%02u chan_nr=%d\n",
-   g_time.t1, g_time.t2, g_time.t3, chan_nr);
+   DEBUGP(DL1P, "Tx TCH.req %s chan_nr=%d\n",
+   dump_gsmtime(_time), chan_nr);
 
l1sap_down(trx, resp_l1sap);
 
@@ -959,8 +967,8 @@
 
gsm_fn2gsmtime(_time, fn);
 
-   DEBUGP(DL1P, "Rx PH-DATA.ind %02u/%02u/%02u chan_nr=%d link_id=%d\n",
-   g_time.t1, g_time.t2, g_time.t3, chan_nr, link_id);
+   LOGP(DL1P, LOGL_INFO, "Rx PH-DATA.ind %s chan_nr=%d link_id=%d 
len=%d\n",
+   dump_gsmtime(_time), chan_nr, link_id, len);
 
if (ts_is_pdch(>ts[tn])) {
lchan = get_lchan_by_chan_nr(trx, chan_nr);
@@ -1000,8 +1008,10 @@
}
 
lchan = get_active_lchan_by_chan_nr(trx, chan_nr);
-   if (!lchan)
+   if (!lchan) {
+   LOGP(DL1P, LOGL_ERROR, "No lchan for chan_nr=%d\n", chan_nr);
return 0;
+   }
 
/* bad frame */
if (len == 0) {
@@ -1067,8 +1077,10 @@
g_time.t1, g_time.t2, g_time.t3, chan_nr);
 
lchan = get_active_lchan_by_chan_nr(trx, chan_nr);
-   if (!lchan)
+   if (!lchan) {
+   LOGP(DL1P, LOGL_ERROR, "No lchan for TCH.ind (chan_nr=%u)\n", 
chan_nr);
return 0;
+   }
 
msgb_pull(msg, sizeof(*l1sap));
 

-- 
To view, visit https://gerrit.osmocom.org/3038
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I339db0e5f3fd5e44bac974f2447afc80388802af
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte