add new DMEAS debug category for measurement reporting

disable it by default
diff --git a/openbsc/src/abis_rsl.c b/openbsc/src/abis_rsl.c
index 0488b9d..397d793 100644
--- a/openbsc/src/abis_rsl.c
+++ b/openbsc/src/abis_rsl.c
@@ -823,42 +823,42 @@
 	struct abis_rsl_dchan_hdr *dh = msgb_l2(msg);
 	struct tlv_parsed tp;
 
-	DEBUGPC(DRSL, "MEASUREMENT RESULT ");
+	DEBUGPC(DMEAS, "MEASUREMENT RESULT ");
 	rsl_tlv_parse(&tp, dh->data, msgb_l2len(msg)-sizeof(*dh));
 
 	if (TLVP_PRESENT(&tp, RSL_IE_MEAS_RES_NR))
-		DEBUGPC(DRSL, "NR=%d ", *TLVP_VAL(&tp, RSL_IE_MEAS_RES_NR));
+		DEBUGPC(DMEAS, "NR=%d ", *TLVP_VAL(&tp, RSL_IE_MEAS_RES_NR));
 	if (TLVP_PRESENT(&tp, RSL_IE_UPLINK_MEAS)) {
 		u_int8_t len = TLVP_LEN(&tp, RSL_IE_UPLINK_MEAS);
 		const u_int8_t *val = TLVP_VAL(&tp, RSL_IE_UPLINK_MEAS);
 		if (len >= 3) {
 			if (val[0] & 0x40)
-				DEBUGPC(DRSL, "DTXd ");
-			DEBUGPC(DRSL, "RXL-FULL-up=%d RXL-SUB-up=%d ",
+				DEBUGPC(DMEAS, "DTXd ");
+			DEBUGPC(DMEAS, "RXL-FULL-up=%d RXL-SUB-up=%d ",
 				val[0] & 0x3f, val[1] & 0x3f);
-			DEBUGPC(DRSL, "RXQ-FULL-up=%d RXQ-SUB-up=%d ",
+			DEBUGPC(DMEAS, "RXQ-FULL-up=%d RXQ-SUB-up=%d ",
 				val[2]>>3 & 0x7, val[2] & 0x7);
 		}
 	}
 	if (TLVP_PRESENT(&tp, RSL_IE_BS_POWER))
-		DEBUGPC(DRSL, "BS_POWER=%d ", *TLVP_VAL(&tp, RSL_IE_BS_POWER));
+		DEBUGPC(DMEAS, "BS_POWER=%d ", *TLVP_VAL(&tp, RSL_IE_BS_POWER));
 	if (TLVP_PRESENT(&tp, RSL_IE_MS_TIMING_OFFSET))
-		DEBUGPC(DRSL, "MS_TO=%d ", 
+		DEBUGPC(DMEAS, "MS_TO=%d ", 
 			*TLVP_VAL(&tp, RSL_IE_MS_TIMING_OFFSET));
 	if (TLVP_PRESENT(&tp, RSL_IE_L1_INFO)) {
 		u_int8_t *val = TLVP_VAL(&tp, RSL_IE_L1_INFO);
 		u_int8_t pwr_lvl = val[0] >> 3;
-		DEBUGPC(DRSL, "L1_MS_PWR=%ddBm ",
+		DEBUGPC(DMEAS, "L1_MS_PWR=%ddBm ",
 			ms_pwr_dbm(msg->trx->bts->band, pwr_lvl));
-		DEBUGPC(DRSL, "L1_FPC=%u ", val[0] & 0x04 ? 1 : 0);
-		DEBUGPC(DRSL, "L1_TA=%u ", val[1]);
+		DEBUGPC(DMEAS, "L1_FPC=%u ", val[0] & 0x04 ? 1 : 0);
+		DEBUGPC(DMEAS, "L1_TA=%u ", val[1]);
 	}
 	if (TLVP_PRESENT(&tp, RSL_IE_L3_INFO)) {
-		DEBUGPC(DRSL, "L3\n");
+		DEBUGPC(DMEAS, "L3\n");
 		msg->l3h = TLVP_VAL(&tp, RSL_IE_L3_INFO);
 		return gsm0408_rcvmsg(msg);
 	} else
-		DEBUGPC(DRSL, "\n");
+		DEBUGPC(DMEAS, "\n");
 
 	return 0;
 }
@@ -872,7 +872,8 @@
 	msg->lchan = lchan_lookup(msg->trx, rslh->chan_nr);
 	ts_name = gsm_ts_name(msg->lchan->ts);
 
-	DEBUGP(DRSL, "channel=%s chan_nr=0x%02x ", ts_name, rslh->chan_nr);
+	if (rslh->c.msg_type != RSL_MT_MEAS_RES)
+		DEBUGP(DRSL, "channel=%s chan_nr=0x%02x ", ts_name, rslh->chan_nr);
 
 	switch (rslh->c.msg_type) {
 	case RSL_MT_CHAN_ACTIV_ACK:
diff --git a/openbsc/src/debug.c b/openbsc/src/debug.c
index aeb9930..6483710 100644
--- a/openbsc/src/debug.c
+++ b/openbsc/src/debug.c
@@ -28,7 +28,7 @@
 
 #include <openbsc/debug.h>
 
-unsigned int debug_mask = 0xffffffff & ~(DMI|DMIB);
+unsigned int debug_mask = 0xffffffff & ~(DMI|DMIB|DMEAS);
 
 struct debug_info {
 	const char *name;
@@ -56,6 +56,7 @@
 	DEBUG_CATEGORY(DMI,  "DMI", "", "")
 	DEBUG_CATEGORY(DMIB,  "DMIB", "", "")
 	DEBUG_CATEGORY(DMUX,  "DMUX", "", "")
+	DEBUG_CATEGORY(DMEAS,  "DMEAS", "", "")
 };
 
 static int use_color = 1;
diff --git a/openbsc/src/gsm_04_08.c b/openbsc/src/gsm_04_08.c
index 6d8530b..56d3a1c 100644
--- a/openbsc/src/gsm_04_08.c
+++ b/openbsc/src/gsm_04_08.c
@@ -1697,20 +1697,20 @@
 	unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh);
 	static struct gsm_meas_rep meas_rep;
 
-	DEBUGP(DRR, "MEASUREMENT REPORT ");
+	DEBUGP(DMEAS, "MEASUREMENT REPORT ");
 	parse_meas_rep(&meas_rep, gh->data, payload_len);
 	if (meas_rep.flags & MEAS_REP_F_DTX)
-		DEBUGPC(DRR, "DTX ");
+		DEBUGPC(DMEAS, "DTX ");
 	if (meas_rep.flags & MEAS_REP_F_BA1)
-		DEBUGPC(DRR, "BA1 ");
+		DEBUGPC(DMEAS, "BA1 ");
 	if (!(meas_rep.flags & MEAS_REP_F_VALID))
-		DEBUGPC(DRR, "NOT VALID ");
+		DEBUGPC(DMEAS, "NOT VALID ");
 	else
-		DEBUGPC(DRR, "FULL(lev=%u, qual=%u) SUB(lev=%u, qual=%u) ",
+		DEBUGPC(DMEAS, "FULL(lev=%u, qual=%u) SUB(lev=%u, qual=%u) ",
 		meas_rep.rxlev_full, meas_rep.rxqual_full, meas_rep.rxlev_sub,
 		meas_rep.rxqual_sub);
 
-	DEBUGPC(DRR, "NUM_NEIGH=%u\n", meas_rep.num_cell);
+	DEBUGPC(DMEAS, "NUM_NEIGH=%u\n", meas_rep.num_cell);
 
 	/* FIXME: put the results somwhere */