aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2022-08-07 02:43:15 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2022-08-09 02:28:32 +0200
commit219e5f53642abe27a7b261715aa663c8e5b5b547 (patch)
treee746d2818a544dda012af4d5007ba9d2dba59794
parent8d915845d6ba6a7d4d75ba9e304a9e80a26d376e (diff)
mncc_recvmsg(): log caller file,line
-rw-r--r--include/osmocom/msc/transaction.h19
-rw-r--r--src/libmsc/gsm_04_08_cc.c6
2 files changed, 15 insertions, 10 deletions
diff --git a/include/osmocom/msc/transaction.h b/include/osmocom/msc/transaction.h
index 0966627a3..8fae86a4e 100644
--- a/include/osmocom/msc/transaction.h
+++ b/include/osmocom/msc/transaction.h
@@ -17,15 +17,18 @@ struct vty;
/* Used for late TID assignment */
#define TRANS_ID_UNASSIGNED 0xff
+#define LOG_TRANS_CAT_SRC(trans, subsys, file, line, level, 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, __FILE__, __LINE__, level, 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 a0714beb5..fe5bf4ac7 100644
--- a/src/libmsc/gsm_04_08_cc.c
+++ b/src/libmsc/gsm_04_08_cc.c
@@ -229,13 +229,15 @@ static void gsm48_stop_cc_timer(struct gsm_trans *trans)
}
}
-static int mncc_recvmsg(struct gsm_network *net, struct gsm_trans *trans,
+#define mncc_recvmsg(net, trans, msg_type, mncc) \
+ _mncc_recvmsg(__FILE__, __LINE__, net, trans, msg_type, mncc)
+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;
- LOG_TRANS_CAT(trans, DMNCC, LOGL_DEBUG, "tx %s\n", get_mncc_name(msg_type));
+ LOG_TRANS_CAT_SRC(trans, DMNCC, file, line, LOGL_DEBUG, "tx %s\n", get_mncc_name(msg_type));
mncc->msg_type = msg_type;