[PATCH] openbsc[master]: only log actual access control class ramping changes

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

Stefan Sperling gerrit-no-reply at lists.osmocom.org
Mon Apr 16 11:24:49 UTC 2018


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

only log actual access control class ramping changes

Silence log messages about no-op changes to access granted to access
control classes. For example, these always occur while configuration
files are being loaded.

This is a port of osmo-bsc commit 53d40e078e9df20103b7ed26daa936720c9dec83
Related: OS#2591

Change-Id: I2f892b998eb8119e623c1d87ffe865b48f7d5a87
---
M openbsc/src/libbsc/acc_ramp.c
1 file changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/18/7818/1

diff --git a/openbsc/src/libbsc/acc_ramp.c b/openbsc/src/libbsc/acc_ramp.c
index 08810b5..9b3f90b 100644
--- a/openbsc/src/libbsc/acc_ramp.c
+++ b/openbsc/src/libbsc/acc_ramp.c
@@ -42,14 +42,16 @@
 static void allow_one_acc(struct acc_ramp *acc_ramp, unsigned int acc)
 {
 	OSMO_ASSERT(acc >= 0 && acc <= 9);
-	LOGP(DRSL, LOGL_DEBUG, "(bts=%d) ACC RAMP: allowing Access Control Class %u\n", acc_ramp->bts->nr, acc);
+	if (acc_ramp->barred_accs & (1 << acc))
+		LOGP(DRSL, LOGL_DEBUG, "(bts=%d) ACC RAMP: allowing Access Control Class %u\n", acc_ramp->bts->nr, acc);
 	acc_ramp->barred_accs &= ~(1 << acc);
 }
 
 static void barr_one_acc(struct acc_ramp *acc_ramp, unsigned int acc)
 {
 	OSMO_ASSERT(acc >= 0 && acc <= 9);
-	LOGP(DRSL, LOGL_DEBUG, "(bts=%d) ACC RAMP: barring Access Control Class %u\n", acc_ramp->bts->nr, acc);
+	if ((acc_ramp->barred_accs & (1 << acc)) == 0)
+		LOGP(DRSL, LOGL_DEBUG, "(bts=%d) ACC RAMP: barring Access Control Class %u\n", acc_ramp->bts->nr, acc);
 	acc_ramp->barred_accs |= (1 << acc);
 }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2f892b998eb8119e623c1d87ffe865b48f7d5a87
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Stefan Sperling <ssperling at sysmocom.de>



More information about the gerrit-log mailing list