fixeria has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-bts/+/40156?usp=email )
Change subject: osmo-bts-trx: trx_fn_timer_cb(): proper shutdown reason
......................................................................
osmo-bts-trx: trx_fn_timer_cb(): proper shutdown reason
If osmo-bts-trx exit()s due to the PC clock issues, it produces
rather confusing logging messages. For instance:
DL1C ERROR PC clock skew: elapsed_us=387574, error_us=382959
DOML NOTICE ... Shutting down BTS, exit 1, reason: No clock from osmo-trx
The second message suggests that the transceiver (osmo-trx) is the
culprit, but the first one reflects the actual reason (PC clock skew).
Let's pass proper shutdown reason to avoid confusion.
Change-Id: Ibbbbc4e919e6eb812882fc60de4be13fa77934b7
---
M src/osmo-bts-trx/scheduler_trx.c
1 file changed, 11 insertions(+), 7 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/56/40156/1
diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c
index 00143ab..2bae295 100644
--- a/src/osmo-bts-trx/scheduler_trx.c
+++ b/src/osmo-bts-trx/scheduler_trx.c
@@ -411,6 +411,7 @@
struct timespec tv_now;
uint64_t expire_count;
int64_t elapsed_us, error_us;
+ const char *reason;
int rc, i;
if (!(what & OSMO_FD_READ))
@@ -430,8 +431,9 @@
/* check if transceiver is still alive */
if (tcs->fn_without_clock_ind++ == TRX_LOSS_FRAMES) {
- LOGP(DL1C, LOGL_NOTICE, "No more clock from transceiver\n");
- goto no_clock;
+ reason = "No more clock from transceiver";
+ LOGP(DL1C, LOGL_ERROR, "%s\n", reason);
+ goto shutdown;
}
/* compute actual elapsed time and resulting OS scheduling error */
@@ -446,9 +448,11 @@
/* if someone played with clock, or if the process stalled */
if (elapsed_us > GSM_TDMA_FN_DURATION_uS * MAX_FN_SKEW || elapsed_us < 0) {
- LOGP(DL1C, LOGL_ERROR, "PC clock skew: elapsed_us=%" PRId64 ",
error_us=%" PRId64 "\n",
- elapsed_us, error_us);
- goto no_clock;
+ LOGP(DL1C, LOGL_ERROR,
+ "PC clock skew: elapsed_us=%" PRId64 ", error_us=%" PRId64
"\n",
+ elapsed_us, error_us);
+ reason = "PC clock skew";
+ goto shutdown;
}
/* call bts_sched_fn() for all expired FN */
@@ -457,9 +461,9 @@
return 0;
-no_clock:
+shutdown:
osmo_timerfd_disable(&tcs->fn_timer_ofd);
- bts_shutdown(bts, "No clock from osmo-trx");
+ bts_shutdown(bts, reason);
return -1;
}
--
To view, visit
https://gerrit.osmocom.org/c/osmo-bts/+/40156?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ibbbbc4e919e6eb812882fc60de4be13fa77934b7
Gerrit-Change-Number: 40156
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>