diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2019-05-24 19:58:20 +0200 |
---|---|---|
committer | pespin <pespin@sysmocom.de> | 2019-06-11 14:28:17 +0000 |
commit | 6a305feb0f7bdcae9d0552e5d2bca9c48ec2e63f (patch) | |
tree | 207ee632688a948568c6b31867b95baea1cafc3c /CommonLibs/trx_rate_ctr.h | |
parent | bde55afd29fc9aae10eb11f6515821afa39b772d (diff) |
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
Diffstat (limited to 'CommonLibs/trx_rate_ctr.h')
-rw-r--r-- | CommonLibs/trx_rate_ctr.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/CommonLibs/trx_rate_ctr.h b/CommonLibs/trx_rate_ctr.h index 48131e7..6e4fa4d 100644 --- a/CommonLibs/trx_rate_ctr.h +++ b/CommonLibs/trx_rate_ctr.h @@ -1,4 +1,29 @@ #pragma once +#include <osmocom/core/rate_ctr.h> +#include <osmocom/vty/command.h> + +enum TrxCtr { + TRX_CTR_RX_UNDERRUNS, + TRX_CTR_RX_OVERRUNS, + TRX_CTR_TX_UNDERRUNS, + TRX_CTR_RX_DROP_EV, + TRX_CTR_RX_DROP_SMPL, +}; + +struct ctr_threshold { + /*! Linked list of all counter groups in the system */ + struct llist_head list; + enum rate_ctr_intv intv; + enum TrxCtr ctr_id; + uint32_t val; +}; + +extern const struct value_string rate_ctr_intv[]; +extern const struct value_string trx_chan_ctr_names[]; + struct trx_ctx; void trx_rate_ctr_init(void *ctx, struct trx_ctx* trx_ctx); +void trx_rate_ctr_threshold_add(struct ctr_threshold *ctr); +int trx_rate_ctr_threshold_del(struct ctr_threshold *del_ctr); +void trx_rate_ctr_threshold_write_config(struct vty *vty, char *indent_prefix); |