diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2019-05-24 16:54:19 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2019-06-05 12:50:38 +0200 |
commit | 4456b6f132437a95833e3a3d3353836331b9c8a0 (patch) | |
tree | d23d18e603643d08d821e4ba14a5519b77b379de /Transceiver52M/device/common/radioDevice.h | |
parent | 76a5013c914a152cd3f7a80488953946ad353441 (diff) |
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
Diffstat (limited to 'Transceiver52M/device/common/radioDevice.h')
-rw-r--r-- | Transceiver52M/device/common/radioDevice.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Transceiver52M/device/common/radioDevice.h b/Transceiver52M/device/common/radioDevice.h index 30e0f43..cd378a8 100644 --- a/Transceiver52M/device/common/radioDevice.h +++ b/Transceiver52M/device/common/radioDevice.h @@ -23,6 +23,7 @@ extern "C" { #include "config_defs.h" +#include "osmo_signal.h" } #ifdef HAVE_CONFIG_H @@ -168,13 +169,20 @@ class RadioDevice { size_t chans; double lo_offset; std::vector<std::string> tx_paths, rx_paths; + std::vector<struct device_counters> m_ctr; RadioDevice(size_t tx_sps, size_t rx_sps, InterfaceType type, size_t chans, double offset, const std::vector<std::string>& tx_paths, const std::vector<std::string>& rx_paths): tx_sps(tx_sps), rx_sps(rx_sps), iface(type), chans(chans), lo_offset(offset), tx_paths(tx_paths), rx_paths(rx_paths) - { } + { + m_ctr.resize(chans); + for (size_t i = 0; i < chans; i++) { + memset(&m_ctr[i], 0, sizeof(m_ctr[i])); + m_ctr[i].chan = i; + } + } bool set_antennas() { unsigned int i; |