Commit Graph

17 Commits

Author SHA1 Message Date
Vadim Yanitskiy 5e40d92400 trx_rate_ctr: use thread safe strerror() in device_sig_cb()
Change-Id: Ibd52af22bbe99652f402ada87410de167a124b73
2021-10-25 12:56:44 +03:00
Pau Espin 0a038223d0 Use new stat item/ctr getter APIs
Change-Id: I1fdfdae2810c3c82ff62fe725ffa364df4ebeff5
2021-06-04 17:21:42 +02:00
Pau Espin 1d165a043e Transceiver: Add several rate_ctr for rx error conditions
Since there's now a rate counter, we can drop log level for those events
which can be bursty and hence print lots of output in short periods of
time, which may affect performance. This way setting them to INFO it's
enough to avoid getting them in stderr unless explicitly configured by
the user (for instance to debug stuff), while still allowing a good
enough level to be enabled for other targets such as gsmtap.

Related: OS#4679
Change-Id: I000f7112e35ac68d3d922444f78468b1ea74cbba
2020-07-27 11:52:46 +02:00
Pau Espin 761da1a08a Introduce CTR log category
This way i most usual rate_ctr related internal logging is disabled by default
(notice), and it can b eeasily enabled by switching the category to info
or debug.

Change-Id: Id6c36432da7e7ce673c585bcae6772a695028ec5
2020-07-17 18:29:26 +02:00
Pau Espin 9032c87d80 trx_rate_ctr: Lower some log levels
Change-Id: I1b5a63e6cc09ac02305c31ea7e94aff53ac0e5c2
2020-07-17 18:22:18 +02:00
Pau Espin 1d0c6fe752 Add rate counter for missing Txbursts when scheduled towards the radioInterface
Related: OS#4487
Change-Id: Ibb2c492b3c67cbab11fbb936ae3a090fb5756aa8
2020-07-10 17:32:03 +02:00
Pau Espin c0d6fd27ff Introduce rate counters to detect issues in received Dl bursts from TRXD
This ones together with rate counters already available in lower layers
allows to understand better the source of the problem with stalled tx
bursts.

Change-Id: Ia34f7e7d780ad1e12f24638a07f05fe91f2afea5
2020-07-10 17:32:03 +02:00
Pau Espin 032c1d8da9 trx_rate_ctr: Fix locking wrong mutex
It was notcied due to sometimes causing deadlock at shutdown time.

Fixes: 92ba59dacf
Change-Id: I49bea4b0ae469794b5c80ee8fa4f275914a5194c
2020-07-10 17:31:10 +02:00
Pau Espin 92ba59dacf Introduce rate counter tx_stale_bursts
This allows checking if there's timing issues on the downlink side
between osmo-bts-trx and osmo-trx. This counter is useful to find
information about osmo-bts-trx 'fn-advance' setting, since this counter
basically counts if burstrs from it arrived too late to osmo-trx.

Change-Id: Id6df00da81f6d6884f4dddc5a2c4b354dca3af97
2020-06-29 17:08:37 +02:00
Pau Espin 6a3a2b8647 Rename device specific rate counter multi-thread helpers
RadioInterface ones will be added in next commit, so let's differentiate
the structs required for each one.

Change-Id: Ib0e142a1dd4bedefdb4c5f15c34132da872c0975
2020-06-29 16:51:08 +02:00
Pau Espin fb96767ac5 trx_rate_ctr: Fix immediate rescheduling on per-sec thresholds
For instance, use in VTY:
"ctr-error-threshold tx_underruns 5 per-second"

If the condition becomes true (eg 5 underruns happened in one sec), the
statement inside OSMO_MAX would become -1, but it was being handled as
an unsigned when doing the OSMO_MAX internal comparison. As a result,
OSMO_MAX((unsigned)-1, 1) was returning -1 (unsigned) stored in
threshold_timer_sched_secs which then became and int -1, which was
handled by osmo_timer_schedule as a 0, hence having an immediate
trigerring all the time.

While at it, make threshold_timer_sched_secs unsigned since it doesn't
make sense to have it as signed anyway.

Change-Id: I6ea3d64dff189a5bc924e72d846e02d50536a8ea
2020-06-29 16:51:08 +02:00
Pau Espin 394053e599 cosmetic: trx_rate_ctr: Fix whitespace
Change-Id: I4dc8220a6813d6ff30f1b241cc46b801adec4057
2020-06-29 16:51:08 +02:00
Martin Hauke 066fd04f47 Fix common misspellings and typos
Change-Id: I4ec7accb1912c052b446be7c399bed32a8c62253
2019-10-17 08:06:19 +00:00
Pau Espin 68a78099a0 lms: Drop rx_underruns rate ctr, add tx_drop_* rate ctr
After discussion in [1] and further look at the code, it became obvios
rx_underrun events are not happening in general for any SDR (don't
exist), so let's drop that counter. Instead, add Tx Dropped Packet counters,
which were not accounted prior to this commit.

[1] bde55afd29

Change-Id: Iff1535c219a4695a511d383d7c4b06ef6eff959d
2019-08-01 13:45:55 +02:00
Pau Espin e9ce77b871 trx_{vty,rate_ctr}: Set proper license AGPLv3+
Take the chance to improve text with author, SPDX tag and fix incorrect
copyright dates.

Related: OS#3515
Change-Id: Ic745312ed07db205b1cdc0f2fa130000319354c5
2019-06-25 12:40:17 +02:00
Pau Espin 6a305feb0f Add VTY commands to set error ctr thresholds
osmo-trx will validate over time that those thresholds are not reached.
If they are reached, osmo-trx will die. As a result, osmo-bts-trx will
notice and will end up notifying the BSC about it (for instance because
it will also restart its process).

For instance:
"""
ctr-error-threshold rx_drop_events 2 minute
ctr-error-threshold rx_underruns 10 second
"""

In those cases above, osmo-trx will die if rate_ctr rx_drop_events went
to a value higher than 2 per minute, or it will die to if rx_underruns
went higher than 10 per second.

Change-Id: I4bcf44dbf064e2e86dfc3b8a2ad18fea76fbd51a
2019-06-11 14:28:17 +00:00
Pau Espin 4456b6f132 Add rate_ctr support to store/retrieve SDR errors through VTY
Introduce a unified implementation-agnostic interface for radioDevice to
signal SDR error counters to upper layers and manage them.
This patch only implements counters for osmo-trx-lms (other devices will
show all counters unchanged during time).

Sample use through VTY:
"""
OsmoTRX> show rate-counters
osmo-trx statistics 0:
   device:rx_underruns:          0 (0/s 0/m 0/h 0/d) Number of Rx underruns
    device:rx_overruns:          0 (0/s 0/m 0/h 0/d) Number of Rx overruns
   device:tx_underruns:          0 (0/s 0/m 0/h 0/d) Number of Tx underruns
 device:rx_drop_events:          4 (0/s 2/m 3/h 0/d) Number of times Rx samples were dropped by HW
device:rx_drop_samples:        513 (0/s 196/m 425/h 0/d) Number of Rx samples dropped by HW
"""

Change-Id: I78b158141697e5714d04db8b9ccc96f31f34f439
2019-06-05 12:50:38 +02:00