neels has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-msc/+/31701 )

 (

7 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted 
one.
 )Change subject: mncc_recvmsg(): log caller file,line
......................................................................

mncc_recvmsg(): log caller file,line

Change-Id: I3755eb35b504f2f2580e0ba43dfa41f16087decc
---
M include/osmocom/msc/transaction.h
M src/libmsc/gsm_04_08_cc.c
2 files changed, 35 insertions(+), 20 deletions(-)

Approvals:
  msuraev: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved
  Jenkins Builder: Verified




diff --git a/include/osmocom/msc/transaction.h 
b/include/osmocom/msc/transaction.h
index 0966627..d886f2a 100644
--- a/include/osmocom/msc/transaction.h
+++ b/include/osmocom/msc/transaction.h
@@ -17,15 +17,18 @@
 /* Used for late TID assignment */
 #define TRANS_ID_UNASSIGNED 0xff

+#define LOG_TRANS_CAT_SRC(trans, subsys, level, file, line, fmt, args...) \
+       LOGPSRC(subsys, level, file, line, \
+               "trans(%s %s callref-0x%x tid-%u%s) " fmt, \
+               (trans) ? trans_name(trans) : "NULL", \
+               (trans) ? ((trans)->msc_a ? (trans)->msc_a->c.fi->id : 
vlr_subscr_name((trans)->vsub)) : "NULL", \
+               (trans) ? (trans)->callref : 0, \
+               (trans) ? (trans)->transaction_id : 0, \
+               (trans) && (trans)->paging_request ? ",PAGING" : "", \
+               ##args)
+
 #define LOG_TRANS_CAT(trans, subsys, level, fmt, args...) \
-       LOGP(subsys, level, \
-            "trans(%s %s callref-0x%x tid-%u%s) " fmt, \
-            (trans) ? trans_name(trans) : "NULL", \
-            (trans) ? ((trans)->msc_a ? (trans)->msc_a->c.fi->id : 
vlr_subscr_name((trans)->vsub)) : "NULL", \
-            (trans) ? (trans)->callref : 0, \
-            (trans) ? (trans)->transaction_id : 0, \
-            (trans) && (trans)->paging_request ? ",PAGING" : "", \
-            ##args)
+       LOG_TRANS_CAT_SRC(trans, subsys, level, __FILE__, __LINE__, fmt, ##args)

 #define LOG_TRANS(trans, level, fmt, args...) \
             LOG_TRANS_CAT(trans, (trans) ? (trans)->log_subsys : DMSC, level, 
fmt, ##args)
diff --git a/src/libmsc/gsm_04_08_cc.c b/src/libmsc/gsm_04_08_cc.c
index 3154c2a..083e2d8 100644
--- a/src/libmsc/gsm_04_08_cc.c
+++ b/src/libmsc/gsm_04_08_cc.c
@@ -234,7 +234,9 @@
  * Depending on msg_type, also log whether RTP information is passed on.
  * (This is particularly interesting for the 
doc/sequence_charts/msc_log_to_ladder.py)
  */
-static void log_mncc_rx_tx(struct gsm_trans *trans, const char *rx_tx, const 
union mncc_msg *mncc)
+#define log_mncc_rx_tx(ARGS...) _log_mncc_rx_tx(__FILE__, __LINE__, ##ARGS)
+static void _log_mncc_rx_tx(const char *file, int line,
+                           struct gsm_trans *trans, const char *rx_tx, const 
union mncc_msg *mncc)
 {
        const char *sdp = NULL;
        struct sdp_msg sdp_msg = {};
@@ -268,26 +270,27 @@
        }

        if (sdp && sdp[0] && (sdp_msg_from_sdp_str(&sdp_msg, sdp) == 0)) {
-               LOG_TRANS_CAT(trans, DMNCC, LOGL_DEBUG, "%s %s (RTP=%s)\n",
-                             rx_tx,
-                             get_mncc_name(mncc->msg_type),
-                             sdp_msg_to_str(&sdp_msg));
+               LOG_TRANS_CAT_SRC(trans, DMNCC, LOGL_DEBUG, file, line, "%s %s 
(RTP=%s)\n",
+                                 rx_tx,
+                                 get_mncc_name(mncc->msg_type),
+                                 sdp_msg_to_str(&sdp_msg));
                return;
        }

        if (osmo_sockaddr_is_any(&addr) == 0) {
-               LOG_TRANS_CAT(trans, DMNCC, LOGL_DEBUG, "%s %s (RTP=%s)\n",
-                             rx_tx,
-                             get_mncc_name(mncc->msg_type),
-                             osmo_sockaddr_to_str_c(OTC_SELECT, &addr));
+               LOG_TRANS_CAT_SRC(trans, DMNCC, LOGL_DEBUG, file, line, "%s %s 
(RTP=%s)\n",
+                                 rx_tx,
+                                 get_mncc_name(mncc->msg_type),
+                                 osmo_sockaddr_to_str_c(OTC_SELECT, &addr));
                return;
        }

-       LOG_TRANS_CAT(trans, DMNCC, LOGL_DEBUG, "%s %s\n", rx_tx, 
get_mncc_name(mncc->msg_type));
+       LOG_TRANS_CAT_SRC(trans, DMNCC, LOGL_DEBUG, file, line, "%s %s\n", 
rx_tx, get_mncc_name(mncc->msg_type));
 }

-static int mncc_recvmsg(struct gsm_network *net, struct gsm_trans *trans,
-                       int msg_type, struct gsm_mncc *mncc)
+#define mncc_recvmsg(ARGS...) _mncc_recvmsg(__FILE__, __LINE__, ##ARGS)
+static int _mncc_recvmsg(const char *file, int line,
+                        struct gsm_network *net, struct gsm_trans *trans, int 
msg_type, struct gsm_mncc *mncc)
 {
        struct msgb *msg;
        unsigned char *data;

--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/31701
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I3755eb35b504f2f2580e0ba43dfa41f16087decc
Gerrit-Change-Number: 31701
Gerrit-PatchSet: 8
Gerrit-Owner: neels <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: msuraev <[email protected]>
Gerrit-Reviewer: neels <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-MessageType: merged

Reply via email to