[PATCH] openbsc[master]: Improve OML failure report

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/.

Max gerrit-no-reply at lists.osmocom.org
Wed Jan 11 12:37:40 UTC 2017


Hello Jenkins Builder,

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

    https://gerrit.osmocom.org/1568

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

Improve OML failure report

* clearly separate report parts
* use textual representation for failure cause if possible

Change-Id: I7a98a77011463021d0edd6ecfab1680e211f7e16
Related: OS#1615
---
M openbsc/src/libbsc/abis_nm.c
1 file changed, 14 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/68/1568/2

diff --git a/openbsc/src/libbsc/abis_nm.c b/openbsc/src/libbsc/abis_nm.c
index 0c723e8..306e779 100644
--- a/openbsc/src/libbsc/abis_nm.c
+++ b/openbsc/src/libbsc/abis_nm.c
@@ -37,6 +37,7 @@
 #include <openbsc/gsm_data.h>
 #include <openbsc/debug.h>
 #include <osmocom/core/msgb.h>
+#include <osmocom/gsm/protocol/gsm_12_21.h>
 #include <osmocom/gsm/tlv.h>
 #include <osmocom/gsm/abis_nm.h>
 #include <osmocom/core/talloc.h>
@@ -280,25 +281,32 @@
 	const uint8_t *p_val;
 	char *p_text;
 
-	LOGPC(DNM, LOGL_ERROR, "Failure Event Report ");
-	
+	LOGPC(DNM, LOGL_ERROR, "Failure Event Report: ");
+
 	abis_nm_tlv_parse(&tp, sign_link->trx->bts, foh->data, oh->length-sizeof(*foh));
 
 	if (TLVP_PRESENT(&tp, NM_ATT_EVENT_TYPE))
-		LOGPC(DNM, LOGL_ERROR, "Type=%s ",
+		LOGPC(DNM, LOGL_ERROR, "Type=%s, ",
 		      abis_nm_event_type_name(*TLVP_VAL(&tp, NM_ATT_EVENT_TYPE)));
 	if (TLVP_PRESENT(&tp, NM_ATT_SEVERITY))
-		LOGPC(DNM, LOGL_ERROR, "Severity=%s ",
+		LOGPC(DNM, LOGL_ERROR, "Severity=%s, ",
 		      abis_nm_severity_name(*TLVP_VAL(&tp, NM_ATT_SEVERITY)));
 	if (TLVP_PRESENT(&tp, NM_ATT_PROB_CAUSE)) {
 		p_val = TLVP_VAL(&tp, NM_ATT_PROB_CAUSE);
-		LOGPC(DNM, LOGL_ERROR, "Probable cause= %02X %02X %02X ", p_val[0], p_val[1], p_val[2]);
+		LOGPC(DNM, LOGL_ERROR, "Probable cause=%s: ",
+		      get_value_string(abis_nm_pcause_type_names, p_val[0]));
+		if (p_val[0] == NM_PCAUSE_T_MANUF)
+			LOGPC(DNM, LOGL_ERROR, "%s, ",
+			      get_value_string(abis_mm_event_cause_names,
+					       osmo_load16be(p_val + 1)));
+		else
+			LOGPC(DNM, LOGL_ERROR, "%02X %02X ", p_val[1], p_val[2]);
 	}
 	if (TLVP_PRESENT(&tp, NM_ATT_ADD_TEXT)) {
 		p_val = TLVP_VAL(&tp, NM_ATT_ADD_TEXT);
 		p_text = talloc_strndup(tall_bsc_ctx, (const char *) p_val, TLVP_LEN(&tp, NM_ATT_ADD_TEXT));
 		if (p_text) {
-			LOGPC(DNM, LOGL_ERROR, "Additional Text=%s ", p_text);
+			LOGPC(DNM, LOGL_ERROR, "Additional Text=%s. ", p_text);
 			talloc_free(p_text);
 		}
 	}

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I7a98a77011463021d0edd6ecfab1680e211f7e16
Gerrit-PatchSet: 2
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list