\doxysection{Cpu\+\_\+sched\+\_\+vty}
\label{group__cpu__sched__vty}\index{Cpu\_sched\_vty@{Cpu\_sched\_vty}}


CPU Scheduling related VTY API.  


\doxysubsection*{Files}
\begin{DoxyCompactItemize}
\item 
file \textbf{ cpu\+\_\+sched\+\_\+vty.\+c}
\begin{DoxyCompactList}\small\item\em Implementation to CPU / Threading / Scheduler properties from VTY configuration. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ cpu\+\_\+affinity\+\_\+it}
\item 
struct \textbf{ sched\+\_\+vty\+\_\+opts}
\end{DoxyCompactItemize}
\doxysubsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
enum \textbf{ sched\+\_\+vty\+\_\+thread\+\_\+id} \{ \newline
\textbf{ SCHED\+\_\+\+VTY\+\_\+\+THREAD\+\_\+\+SELF}
, \newline
\textbf{ SCHED\+\_\+\+VTY\+\_\+\+THREAD\+\_\+\+ALL}
, \newline
\textbf{ SCHED\+\_\+\+VTY\+\_\+\+THREAD\+\_\+\+ID}
, \newline
\textbf{ SCHED\+\_\+\+VTY\+\_\+\+THREAD\+\_\+\+NAME}
, \newline
\textbf{ SCHED\+\_\+\+VTY\+\_\+\+THREAD\+\_\+\+UNKNOWN}
 \}
\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
static int \textbf{ get\+\_\+num\+\_\+cpus} (void)
\item 
static int \textbf{ parse\+\_\+cpu\+\_\+hex\+\_\+mask} (const char $\ast$str, cpu\+\_\+set\+\_\+t $\ast$cpuset, size\+\_\+t cpuset\+\_\+size)
\item 
static int \textbf{ generate\+\_\+cpu\+\_\+hex\+\_\+mask} (char $\ast$str, size\+\_\+t str\+\_\+buf\+\_\+size, cpu\+\_\+set\+\_\+t $\ast$cpuset, size\+\_\+t cpuset\+\_\+size)
\item 
static bool \textbf{ proc\+\_\+tid\+\_\+exists} (pid\+\_\+t tid)
\item 
static bool \textbf{ proc\+\_\+name\+\_\+exists} (const char $\ast$\textbf{ name}, pid\+\_\+t $\ast$res\+\_\+pid)
\item 
static enum \textbf{ sched\+\_\+vty\+\_\+thread\+\_\+id} \textbf{ procname2pid} (pid\+\_\+t $\ast$res\+\_\+pid, const char $\ast$str, bool applynow)
\item 
static int \textbf{ my\+\_\+sched\+\_\+setaffinity} (enum \textbf{ sched\+\_\+vty\+\_\+thread\+\_\+id} tid\+\_\+type, pid\+\_\+t \textbf{ pid}, cpu\+\_\+set\+\_\+t $\ast$cpuset, size\+\_\+t cpuset\+\_\+size)
\item 
\textbf{ DEFUN\+\_\+\+ATTR} (cfg\+\_\+sched\+\_\+cpu\+\_\+affinity, cfg\+\_\+sched\+\_\+cpu\+\_\+affinity\+\_\+cmd, \char`\"{}cpu-\/affinity (self$\vert$all$\vert$$<$0-\/4294967295$>$$\vert$THREADNAME) CPUHEXMASK [delay]\char`\"{}, \char`\"{}Set CPU affinity mask on a (group of) thread(s)\textbackslash{}\textbf{ n}\char`\"{} \char`\"{}Set CPU affinity mask on thread running the \textbf{ VTY\textbackslash{}n}\char`\"{} \char`\"{}Set CPU affinity mask on all process\textquotesingle{} \textbf{ threads\textbackslash{}n}\char`\"{} \char`\"{}Set CPU affinity mask on a thread with specified \textbf{ PID\textbackslash{}n}\char`\"{} \char`\"{}Set CPU affinity mask on a thread with specified thread \textbf{ name\textbackslash{}n}\char`\"{} \char`\"{}CPU affinity \textbf{ mask\textbackslash{}n}\char`\"{} \char`\"{}If set, delay applying the affinity mask now and let the app handle it at a later \textbf{ point\textbackslash{}n}\char`\"{}, CMD\+\_\+\+ATTR\+\_\+\+IMMEDIATE)
\item 
static int \textbf{ set\+\_\+sched\+\_\+rr} (unsigned int prio)
\item 
\textbf{ DEFUN\+\_\+\+ATTR} (cfg\+\_\+sched\+\_\+policy, cfg\+\_\+sched\+\_\+policy\+\_\+cmd, \char`\"{}policy rr $<$1-\/32$>$\char`\"{}, \char`\"{}Set the scheduling policy to use \textbf{ for} the \textbf{ process\textbackslash{}n}\char`\"{} \char`\"{}Use the SCHED\+\_\+\+RR real-\/\textbf{ time} scheduling \textbf{ algorithm\textbackslash{}n}\char`\"{} \char`\"{}Set the SCHED\+\_\+\+RR real-\/\textbf{ time} \textbf{ priority\textbackslash{}n}\char`\"{}, CMD\+\_\+\+ATTR\+\_\+\+IMMEDIATE)
\item 
\textbf{ DEFUN} (cfg\+\_\+sched, cfg\+\_\+sched\+\_\+cmd, \char`\"{}cpu-\/sched\char`\"{}, \char`\"{}Configure CPU Scheduler related settings\char`\"{})
\item 
\textbf{ DEFUN} (show\+\_\+sched\+\_\+threads, show\+\_\+sched\+\_\+threads\+\_\+cmd, \char`\"{}show cpu-\/sched threads\char`\"{}, SHOW\+\_\+\+STR \char`\"{}Show Sched section \textbf{ information\textbackslash{}n}\char`\"{} \char`\"{}Show information about running threads)\textbackslash{}\textbf{ n}\char`\"{})
\item 
static int \textbf{ config\+\_\+write\+\_\+sched} (struct \textbf{ vty} $\ast$\textbf{ vty})
\item 
int \textbf{ osmo\+\_\+cpu\+\_\+sched\+\_\+vty\+\_\+init} (void $\ast$tall\+\_\+ctx)
\begin{DoxyCompactList}\small\item\em Initialize sched VTY nodes. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+cpu\+\_\+sched\+\_\+vty\+\_\+apply\+\_\+localthread} (void)
\begin{DoxyCompactList}\small\item\em Apply cpu-\/affinity on calling thread based on VTY configuration. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
static struct \textbf{ sched\+\_\+vty\+\_\+opts} $\ast$ \textbf{ sched\+\_\+vty\+\_\+opts}
\item 
static struct \textbf{ cmd\+\_\+node} \textbf{ sched\+\_\+node}
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
CPU Scheduling related VTY API. 



\doxysubsection{Enumeration Type Documentation}
\mbox{\label{group__cpu__sched__vty_ga242cd669789bffc6ac6f1782472e29e7}} 
\index{Cpu\_sched\_vty@{Cpu\_sched\_vty}!sched\_vty\_thread\_id@{sched\_vty\_thread\_id}}
\index{sched\_vty\_thread\_id@{sched\_vty\_thread\_id}!Cpu\_sched\_vty@{Cpu\_sched\_vty}}
\doxysubsubsection{sched\_vty\_thread\_id}
{\footnotesize\ttfamily enum \textbf{ sched\+\_\+vty\+\_\+thread\+\_\+id}}

\begin{DoxyEnumFields}{Enumerator}
\raisebox{\heightof{T}}[0pt][0pt]{\index{SCHED\_VTY\_THREAD\_SELF@{SCHED\_VTY\_THREAD\_SELF}!Cpu\_sched\_vty@{Cpu\_sched\_vty}}\index{Cpu\_sched\_vty@{Cpu\_sched\_vty}!SCHED\_VTY\_THREAD\_SELF@{SCHED\_VTY\_THREAD\_SELF}}}\mbox{\label{group__cpu__sched__vty_gga242cd669789bffc6ac6f1782472e29e7ac638dc8e7d284fe60931af20cf2d086c}} 
SCHED\+\_\+\+VTY\+\_\+\+THREAD\+\_\+\+SELF&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{SCHED\_VTY\_THREAD\_ALL@{SCHED\_VTY\_THREAD\_ALL}!Cpu\_sched\_vty@{Cpu\_sched\_vty}}\index{Cpu\_sched\_vty@{Cpu\_sched\_vty}!SCHED\_VTY\_THREAD\_ALL@{SCHED\_VTY\_THREAD\_ALL}}}\mbox{\label{group__cpu__sched__vty_gga242cd669789bffc6ac6f1782472e29e7a3fb84aead89492628138cd0dba489681}} 
SCHED\+\_\+\+VTY\+\_\+\+THREAD\+\_\+\+ALL&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{SCHED\_VTY\_THREAD\_ID@{SCHED\_VTY\_THREAD\_ID}!Cpu\_sched\_vty@{Cpu\_sched\_vty}}\index{Cpu\_sched\_vty@{Cpu\_sched\_vty}!SCHED\_VTY\_THREAD\_ID@{SCHED\_VTY\_THREAD\_ID}}}\mbox{\label{group__cpu__sched__vty_gga242cd669789bffc6ac6f1782472e29e7a643739f715b5eeb90852335a40fada8e}} 
SCHED\+\_\+\+VTY\+\_\+\+THREAD\+\_\+\+ID&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{SCHED\_VTY\_THREAD\_NAME@{SCHED\_VTY\_THREAD\_NAME}!Cpu\_sched\_vty@{Cpu\_sched\_vty}}\index{Cpu\_sched\_vty@{Cpu\_sched\_vty}!SCHED\_VTY\_THREAD\_NAME@{SCHED\_VTY\_THREAD\_NAME}}}\mbox{\label{group__cpu__sched__vty_gga242cd669789bffc6ac6f1782472e29e7a6b078bd43cf2ce61069df1c684c72ab6}} 
SCHED\+\_\+\+VTY\+\_\+\+THREAD\+\_\+\+NAME&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{SCHED\_VTY\_THREAD\_UNKNOWN@{SCHED\_VTY\_THREAD\_UNKNOWN}!Cpu\_sched\_vty@{Cpu\_sched\_vty}}\index{Cpu\_sched\_vty@{Cpu\_sched\_vty}!SCHED\_VTY\_THREAD\_UNKNOWN@{SCHED\_VTY\_THREAD\_UNKNOWN}}}\mbox{\label{group__cpu__sched__vty_gga242cd669789bffc6ac6f1782472e29e7a0d47ad09b3c4894354f1fef52a205852}} 
SCHED\+\_\+\+VTY\+\_\+\+THREAD\+\_\+\+UNKNOWN&\\
\hline

\end{DoxyEnumFields}


\doxysubsection{Function Documentation}
\mbox{\label{group__cpu__sched__vty_ga54487e84b95e80d808151f36c1f03218}} 
\index{Cpu\_sched\_vty@{Cpu\_sched\_vty}!config\_write\_sched@{config\_write\_sched}}
\index{config\_write\_sched@{config\_write\_sched}!Cpu\_sched\_vty@{Cpu\_sched\_vty}}
\doxysubsubsection{config\_write\_sched()}
{\footnotesize\ttfamily static int config\+\_\+write\+\_\+sched (\begin{DoxyParamCaption}\item[{struct \textbf{ vty} $\ast$}]{vty }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ cpu\+\_\+affinity\+\_\+it\+::bufname}, \textbf{ CMD\+\_\+\+SUCCESS}, \textbf{ sched\+\_\+vty\+\_\+opts\+::cpu\+\_\+affinity\+\_\+li}, \textbf{ cpu\+\_\+affinity\+\_\+it\+::cpuset}, \textbf{ cpu\+\_\+affinity\+\_\+it\+::cpuset\+\_\+size}, \textbf{ cpu\+\_\+affinity\+\_\+it\+::delay}, \textbf{ entry}, \textbf{ generate\+\_\+cpu\+\_\+hex\+\_\+mask()}, \textbf{ llist\+\_\+empty()}, \textbf{ llist\+\_\+for\+\_\+each\+\_\+entry}, \textbf{ OSMO\+\_\+\+STRLCPY\+\_\+\+ARRAY}, \textbf{ sched\+\_\+vty\+\_\+opts\+::sched\+\_\+rr\+\_\+prio}, \textbf{ VTY\+\_\+\+NEWLINE}, and \textbf{ vty\+\_\+out()}.



Referenced by \textbf{ osmo\+\_\+cpu\+\_\+sched\+\_\+vty\+\_\+init()}.

\mbox{\label{group__cpu__sched__vty_ga92039946155ce45618a07d721db4b73b}} 
\index{Cpu\_sched\_vty@{Cpu\_sched\_vty}!DEFUN@{DEFUN}}
\index{DEFUN@{DEFUN}!Cpu\_sched\_vty@{Cpu\_sched\_vty}}
\doxysubsubsection{DEFUN()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily DEFUN (\begin{DoxyParamCaption}\item[{cfg\+\_\+sched}]{,  }\item[{cfg\+\_\+sched\+\_\+cmd}]{,  }\item[{\char`\"{}cpu-\/sched\char`\"{}}]{,  }\item[{\char`\"{}Configure CPU Scheduler related settings\char`\"{}}]{ }\end{DoxyParamCaption})}



References \textbf{ CMD\+\_\+\+SUCCESS}, \textbf{ vty\+::index}, \textbf{ L\+\_\+\+CPU\+\_\+\+SCHED\+\_\+\+NODE}, and \textbf{ vty\+::node}.

\mbox{\label{group__cpu__sched__vty_ga23de11deb5e1413427b393f992ca744d}} 
\index{Cpu\_sched\_vty@{Cpu\_sched\_vty}!DEFUN@{DEFUN}}
\index{DEFUN@{DEFUN}!Cpu\_sched\_vty@{Cpu\_sched\_vty}}
\doxysubsubsection{DEFUN()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily DEFUN (\begin{DoxyParamCaption}\item[{show\+\_\+sched\+\_\+threads}]{,  }\item[{show\+\_\+sched\+\_\+threads\+\_\+cmd}]{,  }\item[{\char`\"{}show cpu-\/sched threads\char`\"{}}]{,  }\item[{\textbf{ SHOW\+\_\+\+STR} \char`\"{}Show Sched section \textbf{ information\textbackslash{}n}\char`\"{} \char`\"{}Show information about running}]{threads }\end{DoxyParamCaption})}



References \textbf{ CMD\+\_\+\+SUCCESS}, \textbf{ CMD\+\_\+\+WARNING}, \textbf{ entry}, \textbf{ fd}, \textbf{ generate\+\_\+cpu\+\_\+hex\+\_\+mask()}, \textbf{ get\+\_\+num\+\_\+cpus()}, \textbf{ name}, \textbf{ VTY\+\_\+\+NEWLINE}, and \textbf{ vty\+\_\+out()}.

\mbox{\label{group__cpu__sched__vty_ga3b45dca14e63cfbb59fb4291f884f223}} 
\index{Cpu\_sched\_vty@{Cpu\_sched\_vty}!DEFUN\_ATTR@{DEFUN\_ATTR}}
\index{DEFUN\_ATTR@{DEFUN\_ATTR}!Cpu\_sched\_vty@{Cpu\_sched\_vty}}
\doxysubsubsection{DEFUN\_ATTR()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily DEFUN\+\_\+\+ATTR (\begin{DoxyParamCaption}\item[{cfg\+\_\+sched\+\_\+cpu\+\_\+affinity}]{,  }\item[{cfg\+\_\+sched\+\_\+cpu\+\_\+affinity\+\_\+cmd}]{,  }\item[{\char`\"{}cpu-\/affinity (self$\vert$all$\vert$$<$0-\/4294967295$>$$\vert$THREADNAME) CPUHEXMASK \char`\"{}}]{[delay],  }\item[{\char`\"{}Set CPU affinity mask on a (group of) thread(s)\textbackslash{}\textbf{ n}\char`\"{} \char`\"{}Set CPU affinity mask on thread running the \textbf{ VTY\textbackslash{}n}\char`\"{} \char`\"{}Set CPU affinity mask on all process\textquotesingle{} \textbf{ threads\textbackslash{}n}\char`\"{} \char`\"{}Set CPU affinity mask on a thread with specified \textbf{ PID\textbackslash{}n}\char`\"{} \char`\"{}Set CPU affinity mask on a thread with specified thread \textbf{ name\textbackslash{}n}\char`\"{} \char`\"{}CPU affinity \textbf{ mask\textbackslash{}n}\char`\"{} \char`\"{}If}]{set,  }\item[{delay applying the affinity mask now and let the app handle it at a later \textbf{ point\textbackslash{}n}\char`\"{}}]{,  }\item[{\textbf{ CMD\+\_\+\+ATTR\+\_\+\+IMMEDIATE}}]{ }\end{DoxyParamCaption})}



References \textbf{ argc}, \textbf{ argv}, \textbf{ cpu\+\_\+affinity\+\_\+it\+::bufname}, \textbf{ CMD\+\_\+\+SUCCESS}, \textbf{ CMD\+\_\+\+WARNING}, \textbf{ sched\+\_\+vty\+\_\+opts\+::cpu\+\_\+affinity\+\_\+li}, \textbf{ sched\+\_\+vty\+\_\+opts\+::cpu\+\_\+affinity\+\_\+li\+\_\+mutex}, \textbf{ cpu\+\_\+affinity\+\_\+it\+::cpuset}, \textbf{ cpu\+\_\+affinity\+\_\+it\+::cpuset\+\_\+size}, \textbf{ cpu\+\_\+affinity\+\_\+it\+::delay}, \textbf{ entry}, \textbf{ cpu\+\_\+affinity\+\_\+it\+::entry}, \textbf{ get\+\_\+num\+\_\+cpus()}, \textbf{ llist\+\_\+add\+\_\+tail()}, \textbf{ llist\+\_\+del()}, \textbf{ llist\+\_\+for\+\_\+each\+\_\+entry\+\_\+safe}, \textbf{ my\+\_\+sched\+\_\+setaffinity()}, \textbf{ OSMO\+\_\+\+STRLCPY\+\_\+\+ARRAY}, \textbf{ parse\+\_\+cpu\+\_\+hex\+\_\+mask()}, \textbf{ pid}, \textbf{ procname2pid()}, \textbf{ SCHED\+\_\+\+VTY\+\_\+\+THREAD\+\_\+\+ALL}, \textbf{ SCHED\+\_\+\+VTY\+\_\+\+THREAD\+\_\+\+ID}, \textbf{ SCHED\+\_\+\+VTY\+\_\+\+THREAD\+\_\+\+NAME}, \textbf{ SCHED\+\_\+\+VTY\+\_\+\+THREAD\+\_\+\+SELF}, \textbf{ SCHED\+\_\+\+VTY\+\_\+\+THREAD\+\_\+\+UNKNOWN}, \textbf{ sched\+\_\+vty\+\_\+opts\+::tall\+\_\+ctx}, \textbf{ cpu\+\_\+affinity\+\_\+it\+::tid\+\_\+type}, \textbf{ VTY\+\_\+\+NEWLINE}, and \textbf{ vty\+\_\+out()}.

\mbox{\label{group__cpu__sched__vty_ga67eff342bcf23ef638ea1b6b70dbc1f7}} 
\index{Cpu\_sched\_vty@{Cpu\_sched\_vty}!DEFUN\_ATTR@{DEFUN\_ATTR}}
\index{DEFUN\_ATTR@{DEFUN\_ATTR}!Cpu\_sched\_vty@{Cpu\_sched\_vty}}
\doxysubsubsection{DEFUN\_ATTR()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily DEFUN\+\_\+\+ATTR (\begin{DoxyParamCaption}\item[{cfg\+\_\+sched\+\_\+policy}]{,  }\item[{cfg\+\_\+sched\+\_\+policy\+\_\+cmd}]{,  }\item[{\char`\"{}policy rr $<$1-\/32$>$\char`\"{}}]{,  }\item[{\char`\"{}Set the scheduling policy to use \textbf{ for} the \textbf{ process\textbackslash{}n}\char`\"{} \char`\"{}Use the SCHED\+\_\+\+RR real-\/\textbf{ time} scheduling \textbf{ algorithm\textbackslash{}n}\char`\"{} \char`\"{}Set the SCHED\+\_\+\+RR real-\/\textbf{ time} \textbf{ priority\textbackslash{}n}\char`\"{}}]{,  }\item[{\textbf{ CMD\+\_\+\+ATTR\+\_\+\+IMMEDIATE}}]{ }\end{DoxyParamCaption})}



References \textbf{ argv}, \textbf{ CMD\+\_\+\+SUCCESS}, \textbf{ CMD\+\_\+\+WARNING}, \textbf{ sched\+\_\+vty\+\_\+opts\+::sched\+\_\+rr\+\_\+prio}, \textbf{ set\+\_\+sched\+\_\+rr()}, \textbf{ VTY\+\_\+\+NEWLINE}, and \textbf{ vty\+\_\+out()}.

\mbox{\label{group__cpu__sched__vty_ga67590c21d081349bd82718c34b3cc479}} 
\index{Cpu\_sched\_vty@{Cpu\_sched\_vty}!generate\_cpu\_hex\_mask@{generate\_cpu\_hex\_mask}}
\index{generate\_cpu\_hex\_mask@{generate\_cpu\_hex\_mask}!Cpu\_sched\_vty@{Cpu\_sched\_vty}}
\doxysubsubsection{generate\_cpu\_hex\_mask()}
{\footnotesize\ttfamily static int generate\+\_\+cpu\+\_\+hex\+\_\+mask (\begin{DoxyParamCaption}\item[{char $\ast$}]{str,  }\item[{size\+\_\+t}]{str\+\_\+buf\+\_\+size,  }\item[{cpu\+\_\+set\+\_\+t $\ast$}]{cpuset,  }\item[{size\+\_\+t}]{cpuset\+\_\+size }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Referenced by \textbf{ config\+\_\+write\+\_\+sched()}, \textbf{ DEFUN()}, \textbf{ my\+\_\+sched\+\_\+setaffinity()}, and \textbf{ osmo\+\_\+cpu\+\_\+sched\+\_\+vty\+\_\+apply\+\_\+localthread()}.

\mbox{\label{group__cpu__sched__vty_ga2a48eb0ae3b7ef524ca63d66afda1e50}} 
\index{Cpu\_sched\_vty@{Cpu\_sched\_vty}!get\_num\_cpus@{get\_num\_cpus}}
\index{get\_num\_cpus@{get\_num\_cpus}!Cpu\_sched\_vty@{Cpu\_sched\_vty}}
\doxysubsubsection{get\_num\_cpus()}
{\footnotesize\ttfamily static int get\+\_\+num\+\_\+cpus (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ DLGLOBAL}, \textbf{ LOGL\+\_\+\+ERROR}, and \textbf{ LOGP}.



Referenced by \textbf{ DEFUN()}, \textbf{ DEFUN\+\_\+\+ATTR()}, and \textbf{ osmo\+\_\+cpu\+\_\+sched\+\_\+vty\+\_\+init()}.

\mbox{\label{group__cpu__sched__vty_gae3524adc0b504745178efefb1a284e3e}} 
\index{Cpu\_sched\_vty@{Cpu\_sched\_vty}!my\_sched\_setaffinity@{my\_sched\_setaffinity}}
\index{my\_sched\_setaffinity@{my\_sched\_setaffinity}!Cpu\_sched\_vty@{Cpu\_sched\_vty}}
\doxysubsubsection{my\_sched\_setaffinity()}
{\footnotesize\ttfamily static int my\+\_\+sched\+\_\+setaffinity (\begin{DoxyParamCaption}\item[{enum \textbf{ sched\+\_\+vty\+\_\+thread\+\_\+id}}]{tid\+\_\+type,  }\item[{pid\+\_\+t}]{pid,  }\item[{cpu\+\_\+set\+\_\+t $\ast$}]{cpuset,  }\item[{size\+\_\+t}]{cpuset\+\_\+size }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ DLGLOBAL}, \textbf{ entry}, \textbf{ generate\+\_\+cpu\+\_\+hex\+\_\+mask()}, \textbf{ LOGL\+\_\+\+NOTICE}, \textbf{ LOGP}, \textbf{ pid}, and \textbf{ SCHED\+\_\+\+VTY\+\_\+\+THREAD\+\_\+\+ALL}.



Referenced by \textbf{ DEFUN\+\_\+\+ATTR()}, and \textbf{ osmo\+\_\+cpu\+\_\+sched\+\_\+vty\+\_\+apply\+\_\+localthread()}.

\mbox{\label{group__cpu__sched__vty_ga5eb944998ac87f1fed307eefdaa25a00}} 
\index{Cpu\_sched\_vty@{Cpu\_sched\_vty}!osmo\_cpu\_sched\_vty\_apply\_localthread@{osmo\_cpu\_sched\_vty\_apply\_localthread}}
\index{osmo\_cpu\_sched\_vty\_apply\_localthread@{osmo\_cpu\_sched\_vty\_apply\_localthread}!Cpu\_sched\_vty@{Cpu\_sched\_vty}}
\doxysubsubsection{osmo\_cpu\_sched\_vty\_apply\_localthread()}
{\footnotesize\ttfamily int osmo\+\_\+cpu\+\_\+sched\+\_\+vty\+\_\+apply\+\_\+localthread (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



Apply cpu-\/affinity on calling thread based on VTY configuration. 

\begin{DoxyReturn}{Returns}
0 on success, non-\/zero on error. 
\end{DoxyReturn}


References \textbf{ cpu\+\_\+affinity\+\_\+it\+::bufname}, \textbf{ sched\+\_\+vty\+\_\+opts\+::cpu\+\_\+affinity\+\_\+li}, \textbf{ sched\+\_\+vty\+\_\+opts\+::cpu\+\_\+affinity\+\_\+li\+\_\+mutex}, \textbf{ cpu\+\_\+affinity\+\_\+it\+::cpuset}, \textbf{ cpu\+\_\+affinity\+\_\+it\+::cpuset\+\_\+size}, \textbf{ DLGLOBAL}, \textbf{ entry}, \textbf{ generate\+\_\+cpu\+\_\+hex\+\_\+mask()}, \textbf{ llist\+\_\+for\+\_\+each\+\_\+entry}, \textbf{ LOGL\+\_\+\+FATAL}, \textbf{ LOGP}, \textbf{ my\+\_\+sched\+\_\+setaffinity()}, \textbf{ name}, \textbf{ OSMO\+\_\+\+ASSERT}, \textbf{ SCHED\+\_\+\+VTY\+\_\+\+THREAD\+\_\+\+ALL}, \textbf{ SCHED\+\_\+\+VTY\+\_\+\+THREAD\+\_\+\+NAME}, \textbf{ SCHED\+\_\+\+VTY\+\_\+\+THREAD\+\_\+\+SELF}, and \textbf{ cpu\+\_\+affinity\+\_\+it\+::tid\+\_\+type}.

\mbox{\label{group__cpu__sched__vty_gadc133d63fa1bd8535201dcaa78a4d800}} 
\index{Cpu\_sched\_vty@{Cpu\_sched\_vty}!osmo\_cpu\_sched\_vty\_init@{osmo\_cpu\_sched\_vty\_init}}
\index{osmo\_cpu\_sched\_vty\_init@{osmo\_cpu\_sched\_vty\_init}!Cpu\_sched\_vty@{Cpu\_sched\_vty}}
\doxysubsubsection{osmo\_cpu\_sched\_vty\_init()}
{\footnotesize\ttfamily int osmo\+\_\+cpu\+\_\+sched\+\_\+vty\+\_\+init (\begin{DoxyParamCaption}\item[{void $\ast$}]{tall\+\_\+ctx }\end{DoxyParamCaption})}



Initialize sched VTY nodes. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em tall\+\_\+ctx} & Talloc context to use internally by vty\+\_\+sched subsystem. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success, non-\/zero on error. 
\end{DoxyReturn}


References \textbf{ CONFIG\+\_\+\+NODE}, \textbf{ config\+\_\+write\+\_\+sched()}, \textbf{ sched\+\_\+vty\+\_\+opts\+::cpu\+\_\+affinity\+\_\+li}, \textbf{ sched\+\_\+vty\+\_\+opts\+::cpu\+\_\+affinity\+\_\+li\+\_\+mutex}, \textbf{ get\+\_\+num\+\_\+cpus()}, \textbf{ INIT\+\_\+\+LLIST\+\_\+\+HEAD}, \textbf{ install\+\_\+lib\+\_\+element()}, \textbf{ install\+\_\+lib\+\_\+element\+\_\+ve()}, \textbf{ install\+\_\+node()}, \textbf{ L\+\_\+\+CPU\+\_\+\+SCHED\+\_\+\+NODE}, \textbf{ OSMO\+\_\+\+ASSERT}, \textbf{ sched\+\_\+node}, and \textbf{ sched\+\_\+vty\+\_\+opts\+::tall\+\_\+ctx}.

\mbox{\label{group__cpu__sched__vty_ga78130134449a8c8bbf91cbf52f641abd}} 
\index{Cpu\_sched\_vty@{Cpu\_sched\_vty}!parse\_cpu\_hex\_mask@{parse\_cpu\_hex\_mask}}
\index{parse\_cpu\_hex\_mask@{parse\_cpu\_hex\_mask}!Cpu\_sched\_vty@{Cpu\_sched\_vty}}
\doxysubsubsection{parse\_cpu\_hex\_mask()}
{\footnotesize\ttfamily static int parse\+\_\+cpu\+\_\+hex\+\_\+mask (\begin{DoxyParamCaption}\item[{const char $\ast$}]{str,  }\item[{cpu\+\_\+set\+\_\+t $\ast$}]{cpuset,  }\item[{size\+\_\+t}]{cpuset\+\_\+size }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ c}, and \textbf{ len()}.



Referenced by \textbf{ DEFUN\+\_\+\+ATTR()}.

\mbox{\label{group__cpu__sched__vty_ga7f3b1fcc27ef3d3bb08b3be01bdeffde}} 
\index{Cpu\_sched\_vty@{Cpu\_sched\_vty}!proc\_name\_exists@{proc\_name\_exists}}
\index{proc\_name\_exists@{proc\_name\_exists}!Cpu\_sched\_vty@{Cpu\_sched\_vty}}
\doxysubsubsection{proc\_name\_exists()}
{\footnotesize\ttfamily static bool proc\+\_\+name\+\_\+exists (\begin{DoxyParamCaption}\item[{const char $\ast$}]{name,  }\item[{pid\+\_\+t $\ast$}]{res\+\_\+pid }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ entry}, \textbf{ fd}, and \textbf{ name}.



Referenced by \textbf{ procname2pid()}.

\mbox{\label{group__cpu__sched__vty_ga5650afa5c8a80c131a95f4162b436fb8}} 
\index{Cpu\_sched\_vty@{Cpu\_sched\_vty}!proc\_tid\_exists@{proc\_tid\_exists}}
\index{proc\_tid\_exists@{proc\_tid\_exists}!Cpu\_sched\_vty@{Cpu\_sched\_vty}}
\doxysubsubsection{proc\_tid\_exists()}
{\footnotesize\ttfamily static bool proc\+\_\+tid\+\_\+exists (\begin{DoxyParamCaption}\item[{pid\+\_\+t}]{tid }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ entry}.



Referenced by \textbf{ procname2pid()}.

\mbox{\label{group__cpu__sched__vty_ga11dc1eb708ee1fe9807a50d00bf6bb01}} 
\index{Cpu\_sched\_vty@{Cpu\_sched\_vty}!procname2pid@{procname2pid}}
\index{procname2pid@{procname2pid}!Cpu\_sched\_vty@{Cpu\_sched\_vty}}
\doxysubsubsection{procname2pid()}
{\footnotesize\ttfamily static enum \textbf{ sched\+\_\+vty\+\_\+thread\+\_\+id} procname2pid (\begin{DoxyParamCaption}\item[{pid\+\_\+t $\ast$}]{res\+\_\+pid,  }\item[{const char $\ast$}]{str,  }\item[{bool}]{applynow }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ len()}, \textbf{ osmo\+\_\+str\+\_\+to\+\_\+int64()}, \textbf{ proc\+\_\+name\+\_\+exists()}, \textbf{ proc\+\_\+tid\+\_\+exists()}, \textbf{ SCHED\+\_\+\+VTY\+\_\+\+THREAD\+\_\+\+ALL}, \textbf{ SCHED\+\_\+\+VTY\+\_\+\+THREAD\+\_\+\+ID}, \textbf{ SCHED\+\_\+\+VTY\+\_\+\+THREAD\+\_\+\+NAME}, \textbf{ SCHED\+\_\+\+VTY\+\_\+\+THREAD\+\_\+\+SELF}, and \textbf{ SCHED\+\_\+\+VTY\+\_\+\+THREAD\+\_\+\+UNKNOWN}.



Referenced by \textbf{ DEFUN\+\_\+\+ATTR()}.

\mbox{\label{group__cpu__sched__vty_ga6a1d2a3e59195f13a0f1b66e9d9174aa}} 
\index{Cpu\_sched\_vty@{Cpu\_sched\_vty}!set\_sched\_rr@{set\_sched\_rr}}
\index{set\_sched\_rr@{set\_sched\_rr}!Cpu\_sched\_vty@{Cpu\_sched\_vty}}
\doxysubsubsection{set\_sched\_rr()}
{\footnotesize\ttfamily static int set\+\_\+sched\+\_\+rr (\begin{DoxyParamCaption}\item[{unsigned int}]{prio }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ DLGLOBAL}, \textbf{ LOGL\+\_\+\+ERROR}, \textbf{ LOGL\+\_\+\+NOTICE}, and \textbf{ LOGP}.



Referenced by \textbf{ DEFUN\+\_\+\+ATTR()}.



\doxysubsection{Variable Documentation}
\mbox{\label{group__cpu__sched__vty_gad47890ac2571eda8005f0ff90ef09e8d}} 
\index{Cpu\_sched\_vty@{Cpu\_sched\_vty}!sched\_node@{sched\_node}}
\index{sched\_node@{sched\_node}!Cpu\_sched\_vty@{Cpu\_sched\_vty}}
\doxysubsubsection{sched\_node}
{\footnotesize\ttfamily struct \textbf{ cmd\+\_\+node} sched\+\_\+node\hspace{0.3cm}{\ttfamily [static]}}

{\bfseries Initial value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{= \{}
\DoxyCodeLine{        L\_CPU\_SCHED\_NODE,}
\DoxyCodeLine{        \textcolor{stringliteral}{"{}\%s(config-\/cpu-\/sched)\# "{}},}
\DoxyCodeLine{        1,}
\DoxyCodeLine{\}}

\end{DoxyCode}


Referenced by \textbf{ osmo\+\_\+cpu\+\_\+sched\+\_\+vty\+\_\+init()}.

\mbox{\label{group__cpu__sched__vty_ga98e08a5e7196da28aa5509b609852eec}} 
\index{Cpu\_sched\_vty@{Cpu\_sched\_vty}!sched\_vty\_opts@{sched\_vty\_opts}}
\index{sched\_vty\_opts@{sched\_vty\_opts}!Cpu\_sched\_vty@{Cpu\_sched\_vty}}
\doxysubsubsection{sched\_vty\_opts}
{\footnotesize\ttfamily struct \textbf{ sched\+\_\+vty\+\_\+opts}$\ast$ \textbf{ sched\+\_\+vty\+\_\+opts}\hspace{0.3cm}{\ttfamily [static]}}

