Use new libosmovty cpu sched config features
Using the new libosmovty features allow for:
* Setting different cpu-affinity masks for each thread in the process,
both at startup through .cfg file as well as changing it at runtime.
* Unified VTY interface to change the scheduling policy of the process
inherited by all osmocom processes enabling the feature.
Depends: libosmocore.git Change-Id If76a4bd2cc7b3c7adf5d84790a944d78be70e10a
Depends: osmo-gsm-masnuals.git Change-Id Icd75769ef630c3fa985fc5e2154d5521689cdd3c
Related: SYS#4986
Change-Id: I3798603779b88ea37da03033cf7737a6e4751d6e
diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp
index 9fcbda5..4a92447 100644
--- a/Transceiver52M/osmo-trx.cpp
+++ b/Transceiver52M/osmo-trx.cpp
@@ -55,6 +55,7 @@
#include <osmocom/ctrl/control_if.h>
#include <osmocom/vty/stats.h>
#include <osmocom/vty/command.h>
+#include <osmocom/vty/cpu_sched_vty.h>
#include "convolve.h"
#include "convert.h"
@@ -435,7 +436,9 @@
int rc;
memset(¶m, 0, sizeof(param));
param.sched_priority = prio;
- LOG(INFO) << "Setting SCHED_RR priority " << param.sched_priority;
+ LOG(INFO) << "Setting SCHED_RR priority " << param.sched_priority
+ << ". This setting is DEPRECATED, please use 'policy rr " << param.sched_priority
+ << "' under the 'sched' VTY node instead.";
rc = sched_setscheduler(getpid(), SCHED_RR, ¶m);
if (rc != 0) {
LOG(ERROR) << "Config: Setting SCHED_RR failed";
@@ -589,6 +592,7 @@
vty_init(&g_vty_info);
logging_vty_add_cmds();
ctrl_vty_init(tall_trx_ctx);
+ osmo_cpu_sched_vty_init(tall_trx_ctx);
trx_vty_init(g_trx_ctx);
osmo_talloc_vty_add_cmds();