laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-pcu/+/19697 )

Change subject: Support setting rt-prio and cpu-affinity mask through VTY
......................................................................

Support setting rt-prio and cpu-affinity mask through VTY

Change-Id: I92bfabd57fab28b23bd4494a577373106be1daec
Depends: libosmocore.git Change-Id If76a4bd2cc7b3c7adf5d84790a944d78be70e10a
Depends: osmo-gsm-masnuals.git Change-Id 
Icd75769ef630c3fa985fc5e2154d5521689cdd3c
Related: SYS#4986
---
A TODO-RELEASE
M configure.ac
M debian/control
M doc/manuals/osmopcu-usermanual.adoc
M doc/manuals/vty/osmo-pcu_vty_reference.xml
M src/pcu_main.cpp
6 files changed, 59 insertions(+), 5 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/TODO-RELEASE b/TODO-RELEASE
new file mode 100644
index 0000000..17c6a34
--- /dev/null
+++ b/TODO-RELEASE
@@ -0,0 +1,10 @@
+# When cleaning up this file: bump API version in corresponding Makefile.am 
and rename corresponding debian/lib*.install
+# according to 
https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info
+# In short:
+# LIBVERSION=c:r:a
+# If the library source code has changed at all since the last update, then 
increment revision: c:r + 1:a.
+# If any interfaces have been added, removed, or changed since the last 
update: c + 1:0:0.
+# If any interfaces have been added since the last public release: c:r:a + 1.
+# If any interfaces have been removed or changed since the last public 
release: c:r:0.
+#library        what            description / commit summary line
+osmo-pcu        update osmo-gsm-manuals dependency to > 0.3.0 for 
vty_cpu_sched.adoc include
diff --git a/configure.ac b/configure.ac
index 3f403b8..2e99a15 100644
--- a/configure.ac
+++ b/configure.ac
@@ -82,10 +82,10 @@
 fi

 dnl checks for libraries
-PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.3.0)
-PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.3.0)
-PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 1.3.0)
-PKG_CHECK_MODULES(LIBOSMOGB, libosmogb >= 1.3.0)
+PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.4.0)
+PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.4.0)
+PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 1.4.0)
+PKG_CHECK_MODULES(LIBOSMOGB, libosmogb >= 1.4.0)

 AC_MSG_CHECKING([whether to enable direct DSP access for PDCH of sysmocom-bts])
 AC_ARG_ENABLE(sysmocom-dsp,
diff --git a/debian/control b/debian/control
index b9dad0c..0d69a9a 100644
--- a/debian/control
+++ b/debian/control
@@ -7,7 +7,7 @@
                dh-systemd (>= 1.5),
                autotools-dev,
                pkg-config,
-               libosmocore-dev (>= 1.3.0),
+               libosmocore-dev (>= 1.4.0),
                osmo-gsm-manuals-dev
 Standards-Version: 3.9.8
 Homepage: http://osmocom.org/projects/osmopcu
diff --git a/doc/manuals/osmopcu-usermanual.adoc 
b/doc/manuals/osmopcu-usermanual.adoc
index bf25cfd..e202e33 100644
--- a/doc/manuals/osmopcu-usermanual.adoc
+++ b/doc/manuals/osmopcu-usermanual.adoc
@@ -21,6 +21,8 @@

 include::./common/chapters/gb.adoc[]

+include::./common/chapters/vty_cpu_sched.adoc[]
+
 include::./common/chapters/port_numbers.adoc[]

 include::./common/chapters/bibliography.adoc[]
diff --git a/doc/manuals/vty/osmo-pcu_vty_reference.xml 
b/doc/manuals/vty/osmo-pcu_vty_reference.xml
index 7b33cbb..afb9d47 100644
--- a/doc/manuals/vty/osmo-pcu_vty_reference.xml
+++ b/doc/manuals/vty/osmo-pcu_vty_reference.xml
@@ -440,6 +440,13 @@
         <param name='[TNNNN]' doc='T- or X-timer-number -- 3GPP compliant 
timer number of the format &apos;1234&apos; or &apos;T1234&apos; or 
&apos;t1234&apos;; Osmocom-specific timer number of the format: 
&apos;X1234&apos; or &apos;x1234&apos;.' />
       </params>
     </command>
+    <command id='show cpu-sched threads'>
+      <params>
+        <param name='show' doc='Show running system information' />
+        <param name='cpu-sched' doc='Show Sched section information' />
+        <param name='threads' doc='Show information about running threads)' />
+      </params>
+    </command>
     <command id='show ns'>
       <params>
         <param name='show' doc='Show running system information' />
@@ -912,6 +919,13 @@
         <param name='[TNNNN]' doc='T- or X-timer-number -- 3GPP compliant 
timer number of the format &apos;1234&apos; or &apos;T1234&apos; or 
&apos;t1234&apos;; Osmocom-specific timer number of the format: 
&apos;X1234&apos; or &apos;x1234&apos;.' />
       </params>
     </command>
+    <command id='show cpu-sched threads'>
+      <params>
+        <param name='show' doc='Show running system information' />
+        <param name='cpu-sched' doc='Show Sched section information' />
+        <param name='threads' doc='Show information about running threads)' />
+      </params>
+    </command>
     <command id='show ns'>
       <params>
         <param name='show' doc='Show running system information' />
@@ -1199,6 +1213,11 @@
         <param name='pcu' doc='BTS specific configure' />
       </params>
     </command>
+    <command id='cpu-sched'>
+      <params>
+        <param name='cpu-sched' doc='Configure CPU Scheduler related settings' 
/>
+      </params>
+    </command>
     <command id='ns'>
       <params>
         <param name='ns' doc='Configure the GPRS Network Service' />
@@ -1586,6 +1605,27 @@
       </params>
     </command>
   </node>
+  <node id='config-cpu-sched'>
+    <name>config-cpu-sched</name>
+    <command id='policy rr &lt;1-32&gt;'>
+      <params>
+        <param name='policy' doc='Set the scheduling policy to use for the 
process' />
+        <param name='rr' doc='Use the SCHED_RR real-time scheduling algorithm' 
/>
+        <param name='&lt;1-32&gt;' doc='Set the SCHED_RR real-time priority' />
+      </params>
+    </command>
+    <command id='cpu-affinity (self|all|&lt;0-4294967295&gt;|THREADNAME) 
CPUHEXMASK [delay]'>
+      <params>
+        <param name='cpu-affinity' doc='Set CPU affinity mask on a (group of) 
thread(s)' />
+        <param name='self' doc='Set CPU affinity mask on thread running the 
VTY' />
+        <param name='all' doc='Set CPU affinity mask on all process&apos; 
threads' />
+        <param name='&lt;0-4294967295&gt;' doc='Set CPU affinity mask on a 
thread with specified PID' />
+        <param name='THREADNAME' doc='Set CPU affinity mask on a thread with 
specified thread name' />
+        <param name='CPUHEXMASK' doc='CPU affinity mask' />
+        <param name='[delay]' doc='If set, delay applying the affinity mask 
now and let the app handle it at a later point' />
+      </params>
+    </command>
+  </node>
   <node id='config-pcu'>
     <name>config-pcu</name>
     <command id='egprs only'>
diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp
index 3912204..c5ff3dc 100644
--- a/src/pcu_main.cpp
+++ b/src/pcu_main.cpp
@@ -43,6 +43,7 @@
 #include <osmocom/vty/command.h>
 #include <osmocom/vty/vty.h>
 #include <osmocom/vty/ports.h>
+#include <osmocom/vty/cpu_sched_vty.h>
 #include <osmocom/core/rate_ctr.h>
 #include <osmocom/core/select.h>
 #include <osmocom/core/application.h>
@@ -272,6 +273,7 @@
        pcu_vty_info.tall_ctx = tall_pcu_ctx;
        vty_init(&pcu_vty_info);
        pcu_vty_init();
+       osmo_cpu_sched_vty_init(tall_pcu_ctx);

        handle_options(argc, argv);
        if ((!!spoof_mcc) + (!!spoof_mnc) == 1) {

--
To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/19697
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I92bfabd57fab28b23bd4494a577373106be1daec
Gerrit-Change-Number: 19697
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-MessageType: merged

Reply via email to