[PATCH] openbsc[master]: logging fixup: shorter names for LOGGING_FILTER_* and LOGGIN...

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Thu Feb 23 17:13:31 UTC 2017


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

logging fixup: shorter names for LOGGING_FILTER_* and LOGGING_CTX_*

In libosmocore, my patch was merged to master a bit too soon. To accomodate the
request for naming that matches the general "LOG" prefix instead of "LOGGING",
a fixup was committed to libosmocore. Adjust for that.

Original patch: change-id I5c343630020f4b108099696fd96c2111614c8067
The fixup: change-id I424fe3f12ea620338902b2bb8230544bde3f1a93

Change-Id: Ib2ec5e4884aa90f48051ee2f832af557aa525991
---
M openbsc/src/libbsc/abis_rsl.c
M openbsc/src/libbsc/paging.c
M openbsc/src/libcommon/debug.c
M openbsc/src/libmsc/gsm_04_08.c
M openbsc/src/libmsc/smpp_openbsc.c
5 files changed, 26 insertions(+), 26 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/79/1879/1

diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c
index 58fdaa3..1cae832 100644
--- a/openbsc/src/libbsc/abis_rsl.c
+++ b/openbsc/src/libbsc/abis_rsl.c
@@ -159,7 +159,7 @@
 		     gsm_ts_and_pchan_name(lchan->ts), log_name, chan_nr);
 
 	if (lchan->conn)
-		log_set_context(LOGGING_CTX_VLR_SUBSCR, lchan->conn->subscr);
+		log_set_context(LOG_CTX_VLR_SUBSCR, lchan->conn->subscr);
 
 	return lchan;
 }
diff --git a/openbsc/src/libbsc/paging.c b/openbsc/src/libbsc/paging.c
index 816d7a6..eb37a33 100644
--- a/openbsc/src/libbsc/paging.c
+++ b/openbsc/src/libbsc/paging.c
@@ -77,7 +77,7 @@
 	if (!bts->oml_link)
 		return;
 
-	log_set_context(LOGGING_CTX_VLR_SUBSCR, request->subscr);
+	log_set_context(LOG_CTX_VLR_SUBSCR, request->subscr);
 
 	LOGP(DPAG, LOGL_INFO, "Going to send paging commands: imsi: %s tmsi: "
 	     "0x%x for ch. type %d (attempt %d)\n", request->subscr->imsi,
@@ -91,7 +91,7 @@
 	page_group = gsm0502_calc_paging_group(&bts->si_common.chan_desc,
 						str_to_imsi(request->subscr->imsi));
 	gsm0808_page(bts, page_group, mi_len, mi, request->chan_type);
-	log_set_context(LOGGING_CTX_VLR_SUBSCR, NULL);
+	log_set_context(LOG_CTX_VLR_SUBSCR, NULL);
 }
 
 static void paging_schedule_if_needed(struct gsm_bts_paging_state *paging_bts)
@@ -255,7 +255,7 @@
 	gsm_cbfn *cbfn;
 	int msg;
 
-	log_set_context(LOGGING_CTX_VLR_SUBSCR, req->subscr);
+	log_set_context(LOG_CTX_VLR_SUBSCR, req->subscr);
 
 	LOGP(DPAG, LOGL_INFO, "T3113 expired for request %p (%s)\n",
 		req, req->subscr->imsi);
@@ -394,7 +394,7 @@
 {
 	struct gsm_bts *bts;
 
-	log_set_context(LOGGING_CTX_VLR_SUBSCR, subscr);
+	log_set_context(LOG_CTX_VLR_SUBSCR, subscr);
 
 	/* Stop this first and dispatch the request */
 	if (_bts)
diff --git a/openbsc/src/libcommon/debug.c b/openbsc/src/libcommon/debug.c
index 3f3232c..4d7bfed 100644
--- a/openbsc/src/libcommon/debug.c
+++ b/openbsc/src/libcommon/debug.c
@@ -179,22 +179,22 @@
 
 static int filter_fn(const struct log_context *ctx, struct log_target *tar)
 {
-	const struct gsm_subscriber *subscr = ctx->ctx[LOGGING_CTX_VLR_SUBSCR];
-	const struct gprs_nsvc *nsvc = ctx->ctx[LOGGING_CTX_GB_NSVC];
-	const struct gprs_nsvc *bvc = ctx->ctx[LOGGING_CTX_GB_BVC];
+	const struct gsm_subscriber *subscr = ctx->ctx[LOG_CTX_VLR_SUBSCR];
+	const struct gprs_nsvc *nsvc = ctx->ctx[LOG_CTX_GB_NSVC];
+	const struct gprs_nsvc *bvc = ctx->ctx[LOG_CTX_GB_BVC];
 
-	if ((tar->filter_map & (1 << LOGGING_FILTER_VLR_SUBSCR)) != 0
-	    && subscr && subscr == tar->filter_data[LOGGING_FILTER_VLR_SUBSCR])
+	if ((tar->filter_map & (1 << LOG_FLT_VLR_SUBSCR)) != 0
+	    && subscr && subscr == tar->filter_data[LOG_FLT_VLR_SUBSCR])
 		return 1;
 
 	/* Filter on the NS Virtual Connection */
-	if ((tar->filter_map & (1 << LOGGING_FILTER_GB_NSVC)) != 0
-	    && nsvc && (nsvc == tar->filter_data[LOGGING_FILTER_GB_NSVC]))
+	if ((tar->filter_map & (1 << LOG_FLT_GB_NSVC)) != 0
+	    && nsvc && (nsvc == tar->filter_data[LOG_FLT_GB_NSVC]))
 		return 1;
 
 	/* Filter on the NS Virtual Connection */
-	if ((tar->filter_map & (1 << LOGGING_FILTER_GB_BVC)) != 0
-	    && bvc && (bvc == tar->filter_data[LOGGING_FILTER_GB_BVC]))
+	if ((tar->filter_map & (1 << LOG_FLT_GB_BVC)) != 0
+	    && bvc && (bvc == tar->filter_data[LOG_FLT_GB_BVC]))
 		return 1;
 
 	return 0;
@@ -208,7 +208,7 @@
 
 void log_set_imsi_filter(struct log_target *target, struct gsm_subscriber *subscr)
 {
-	struct gsm_subscriber **fsub = (void*)&target->filter_data[LOGGING_FILTER_VLR_SUBSCR];
+	struct gsm_subscriber **fsub = (void*)&target->filter_data[LOG_FLT_VLR_SUBSCR];
 
 	/* free the old data */
 	if (*fsub) {
@@ -217,8 +217,8 @@
 	}
 
 	if (subscr) {
-		target->filter_map |= (1 << LOGGING_FILTER_VLR_SUBSCR);
+		target->filter_map |= (1 << LOG_FLT_VLR_SUBSCR);
 		*fsub = subscr_get(subscr);
 	} else
-		target->filter_map &= ~(1 << LOGGING_FILTER_VLR_SUBSCR);
+		target->filter_map &= ~(1 << LOG_FLT_VLR_SUBSCR);
 }
diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c
index 10e2b31..be43956 100644
--- a/openbsc/src/libmsc/gsm_04_08.c
+++ b/openbsc/src/libmsc/gsm_04_08.c
@@ -1457,7 +1457,7 @@
 		/* FIXME: request id? close channel? */
 		return -EINVAL;
 	}
-	log_set_context(LOGGING_CTX_VLR_SUBSCR, subscr);
+	log_set_context(LOG_CTX_VLR_SUBSCR, subscr);
 	DEBUGP(DRR, "<- Channel was requested by %s\n",
 		subscr->name && strlen(subscr->name) ? subscr->name : subscr->imsi);
 
@@ -1982,7 +1982,7 @@
 		return -EIO;
 
 	/* Which subscriber do we want to track trans1 or trans2? */
-	log_set_context(LOGGING_CTX_VLR_SUBSCR, trans1->subscr);
+	log_set_context(LOG_CTX_VLR_SUBSCR, trans1->subscr);
 
 	/* through-connect channel */
 	return tch_map(trans1->conn->lchan, trans2->conn->lchan);
@@ -2003,7 +2003,7 @@
 	if (!trans->conn)
 		return 0;
 
-	log_set_context(LOGGING_CTX_VLR_SUBSCR, trans->subscr);
+	log_set_context(LOG_CTX_VLR_SUBSCR, trans->subscr);
 	lchan = trans->conn->lchan;
 	bts = lchan->ts->trx->bts;
 
@@ -3339,7 +3339,7 @@
 		mncc_recv_rtp_err(net, callref, MNCC_RTP_CREATE);
 		return -EIO;
 	}
-	log_set_context(LOGGING_CTX_VLR_SUBSCR, trans->subscr);
+	log_set_context(LOG_CTX_VLR_SUBSCR, trans->subscr);
 	if (!trans->conn) {
 		LOGP(DMNCC, LOGL_NOTICE, "RTP create for trans without conn\n");
 		mncc_recv_rtp_err(net, callref, MNCC_RTP_CREATE);
@@ -3395,7 +3395,7 @@
 		mncc_recv_rtp_err(net, rtp->callref, MNCC_RTP_CONNECT);
 		return -EIO;
 	}
-	log_set_context(LOGGING_CTX_VLR_SUBSCR, trans->subscr);
+	log_set_context(LOG_CTX_VLR_SUBSCR, trans->subscr);
 	if (!trans->conn) {
 		LOGP(DMNCC, LOGL_ERROR, "RTP connect for trans without conn\n");
 		mncc_recv_rtp_err(net, rtp->callref, MNCC_RTP_CONNECT);
@@ -3572,7 +3572,7 @@
 			LOGP(DMNCC, LOGL_ERROR, "TCH frame for non-existing trans\n");
 			return -EIO;
 		}
-		log_set_context(LOGGING_CTX_VLR_SUBSCR, trans->subscr);
+		log_set_context(LOG_CTX_VLR_SUBSCR, trans->subscr);
 		if (!trans->conn) {
 			LOGP(DMNCC, LOGL_NOTICE, "TCH frame for trans without conn\n");
 			return 0;
@@ -3646,7 +3646,7 @@
 						    data->imsi);
 
 		/* update the subscriber we deal with */
-		log_set_context(LOGGING_CTX_VLR_SUBSCR, subscr);
+		log_set_context(LOG_CTX_VLR_SUBSCR, subscr);
 
 		/* If subscriber is not found */
 		if (!subscr) {
@@ -3724,7 +3724,7 @@
 		subscr_put(subscr);
 	} else {
 		/* update the subscriber we deal with */
-		log_set_context(LOGGING_CTX_VLR_SUBSCR, trans->subscr);
+		log_set_context(LOG_CTX_VLR_SUBSCR, trans->subscr);
 	}
 
 	if (trans->conn)
diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c
index fdafa16..2703a24 100644
--- a/openbsc/src/libmsc/smpp_openbsc.c
+++ b/openbsc/src/libmsc/smpp_openbsc.c
@@ -67,7 +67,7 @@
 	}
 
 	/* tag the context in case we know it */
-	log_set_context(LOGGING_CTX_VLR_SUBSCR, subscr);
+	log_set_context(LOG_CTX_VLR_SUBSCR, subscr);
 	return subscr;
 }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib2ec5e4884aa90f48051ee2f832af557aa525991
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list