Loading...
Searching...
No Matches
Tnnn timer VTY configuration

CPU Scheduling related VTY API. More...

## Files

file | tdef_vty.h
| API to configure osmo_tdef Tnnn timers from VTY configuration.
file | cpu_sched_vty.c
| Implementation to CPU / Threading / Scheduler properties from VTY configuration.
file | tdef_vty.c
| Implementation to configure osmo_tdef Tnnn timers from VTY configuration.

## Data Structures

struct | cpu_affinity_it
struct | sched_vty_opts

## Macros

#define | OSMO_TDEF_VTY_ARG_T "TNNNN"
#define | OSMO_TDEF_VTY_DOC_T
#define | OSMO_TDEF_VTY_ARG_T_OPTIONAL "[" OSMO_TDEF_VTY_ARG_T "]"
#define | OSMO_TDEF_VTY_ARG_VAL "(<0-2147483647>|default)"
#define | OSMO_TDEF_VTY_DOC_VAL "New timer value\n" "Set to default timer value\n"
#define | OSMO_TDEF_VTY_ARG_VAL_OPTIONAL "[" OSMO_TDEF_VTY_ARG_VAL "]"
#define | OSMO_TDEF_VTY_ARG_SET OSMO_TDEF_VTY_ARG_T " " OSMO_TDEF_VTY_ARG_VAL
#define | OSMO_TDEF_VTY_DOC_SET OSMO_TDEF_VTY_DOC_T OSMO_TDEF_VTY_DOC_VAL
#define | OSMO_TDEF_VTY_ARG_SET_OPTIONAL OSMO_TDEF_VTY_ARG_T_OPTIONAL " " OSMO_TDEF_VTY_ARG_VAL_OPTIONAL

## Enumerations

enum | sched_vty_thread_id { SCHED_VTY_THREAD_SELF , SCHED_VTY_THREAD_ALL , SCHED_VTY_THREAD_ID , SCHED_VTY_THREAD_NAME , SCHED_VTY_THREAD_UNKNOWN }

## Functions

int | osmo_tdef_vty_set_cmd (struct vty *vty, struct osmo_tdef *tdefs, const char **args)
| Apply a timer configuration from VTY argument strings.
int | osmo_tdef_vty_show_cmd (struct vty *vty, struct osmo_tdef *tdefs, const char *T_arg, const char *prefix_fmt,...)
| Output one or all timers to the VTY, as for a VTY command like 'show timer [TNNNN]'.
void | osmo_tdef_vty_write (struct vty *vty, struct osmo_tdef *tdefs, const char *prefix_fmt,...)
| Write current timer configuration arguments to the vty.
void | osmo_tdef_vty_out_one (struct vty *vty, struct osmo_tdef *t, const char *prefix_fmt,...)
| Write to VTY the current status of one timer.
void | osmo_tdef_vty_out_all (struct vty *vty, struct osmo_tdef *tdefs, const char *prefix_fmt,...)
| Write to VTY the current status of all given timers.
void | osmo_tdef_vty_out_one_va (struct vty *vty, struct osmo_tdef *t, const char *prefix_fmt, va_list va)
| Write to VTY the current status of one timer.
void | osmo_tdef_vty_out_all_va (struct vty *vty, struct osmo_tdef *tdefs, const char *prefix_fmt, va_list va)
| Write to VTY the current status of all given timers.
struct osmo_tdef * | osmo_tdef_vty_parse_T_arg (struct vty *vty, struct osmo_tdef *tdefs, const char *T_str)
| Parse an argument like "1234", "T1234", "t1234", or "X1234", "x1234", as from OSMO_TDEF_VTY_ARG_T.
unsigned long | osmo_tdef_vty_parse_val_arg (const char *val_arg, unsigned long default_val)
| Parse an argument of the form "(0-2147483647|default)", as from OSMO_TDEF_VTY_ARG_VAL.
void | osmo_tdef_vty_groups_init (unsigned int parent_cfg_node, struct osmo_tdef_group *groups)
| Convenience implementation for keeping a fixed set of timer groups in a program.
void | osmo_tdef_vty_groups_write (struct vty *vty, const char *indent)
| Write the global osmo_tdef_group configuration to VTY, as previously passed to osmo_tdef_vty_groups_init().
static int | get_num_cpus (void)
static int | parse_cpu_hex_mask (const char *str, cpu_set_t *cpuset, size_t cpuset_size)
static int | generate_cpu_hex_mask (char *str, size_t str_buf_size, cpu_set_t *cpuset, size_t cpuset_size)
static bool | proc_tid_exists (pid_t tid)
static bool | proc_name_exists (const char *name, pid_t *res_pid)
static enum sched_vty_thread_id | procname2pid (pid_t *res_pid, const char *str, bool applynow)
static int | my_sched_setaffinity (enum sched_vty_thread_id tid_type, pid_t pid, cpu_set_t *cpuset, size_t cpuset_size)

DEFUN_ATTR (cfg_sched_cpu_affinity, cfg_sched_cpu_affinity_cmd, "cpu-affinity (self|all|<0-4294967295>|THREADNAME) CPUHEXMASK [delay]", "Set CPU affinity mask on a (group of) thread(s)\n" "Set CPU affinity mask on thread running the VTY\n" "Set CPU affinity mask on all process' threads\n" "Set CPU affinity mask on a thread with specified PID\n" "Set CPU affinity mask on a thread with specified thread name\n" "CPU affinity mask\n" "If set, delay applying the affinity mask now and let the app handle it at a later point\n", CMD_ATTR_IMMEDIATE)

static int | set_sched_rr (unsigned int prio)
| DEFUN_ATTR (cfg_sched_policy, cfg_sched_policy_cmd, "policy rr <1-32>", "Set the scheduling policy to use for the process\n" "Use the SCHED_RR real-time scheduling algorithm\n" "Set the SCHED_RR real-time priority\n", CMD_ATTR_IMMEDIATE)
| DEFUN (cfg_sched, cfg_sched_cmd, "cpu-sched", "Configure CPU Scheduler related settings")
| DEFUN (show_sched_threads, show_sched_threads_cmd, "show cpu-sched threads", SHOW_STR "Show Sched section information\n" "Show information about running threads)\n")
static int | config_write_sched (struct vty *vty)
int | osmo_cpu_sched_vty_init (void *tall_ctx)
| Initialize sched VTY nodes.
int | osmo_cpu_sched_vty_apply_localthread (void)
| Apply cpu-affinity on calling thread based on VTY configuration.
| osmo_tdef_groups_for_each (g, global_tdef_groups)
| if (argc< 3) return show_timer(self
return | osmo_tdef_vty_set_cmd (vty, tdefs, timer_args)
static char * | add_group_args (void *talloc_ctx, char *dest)
static char * | add_group_docs (void *talloc_ctx, char *dest)
static char * | timer_command_string (const char *prefix, const char *suffix)
static char * | timer_doc_string (const char *prefix, const char *suffix)

## Variables

static struct sched_vty_opts * | sched_vty_opts
static struct cmd_node | sched_node
static struct osmo_tdef_group * | global_tdef_groups
| Singleton Tnnn groups definition as set by osmo_tdef_vty_groups_init().
const char * | T_arg = argc > 1 ? argv[1] : NULL
struct osmo_tdef_group * | g = NULL
return | CMD_SUCCESS
const char ** | timer_args
struct osmo_tdef * | tdefs = NULL
| vty
| argc
| argv
| group_arg = argv[0]

## Detailed Description

CPU Scheduling related VTY API.

VTY API for Tnnn timer configuration.

## Macro Definition Documentation

## OSMO_TDEF_VTY_ARG_SET

#define OSMO_TDEF_VTY_ARG_SET OSMO_TDEF_VTY_ARG_T " " OSMO_TDEF_VTY_ARG_VAL

## OSMO_TDEF_VTY_ARG_SET_OPTIONAL

#define OSMO_TDEF_VTY_ARG_SET_OPTIONAL OSMO_TDEF_VTY_ARG_T_OPTIONAL " " OSMO_TDEF_VTY_ARG_VAL_OPTIONAL

Referenced by osmo_tdef_vty_groups_init().

## OSMO_TDEF_VTY_ARG_T

#define OSMO_TDEF_VTY_ARG_T "TNNNN"

## OSMO_TDEF_VTY_ARG_T_OPTIONAL

#define OSMO_TDEF_VTY_ARG_T_OPTIONAL "[" OSMO_TDEF_VTY_ARG_T "]"

Referenced by osmo_tdef_vty_groups_init().

## OSMO_TDEF_VTY_ARG_VAL

#define OSMO_TDEF_VTY_ARG_VAL "(<0-2147483647>|default)"

## OSMO_TDEF_VTY_ARG_VAL_OPTIONAL

#define OSMO_TDEF_VTY_ARG_VAL_OPTIONAL "[" OSMO_TDEF_VTY_ARG_VAL "]"

## OSMO_TDEF_VTY_DOC_SET

#define OSMO_TDEF_VTY_DOC_SET OSMO_TDEF_VTY_DOC_T OSMO_TDEF_VTY_DOC_VAL

Referenced by osmo_tdef_vty_groups_init().

## OSMO_TDEF_VTY_DOC_T

#define OSMO_TDEF_VTY_DOC_T

Value:
"T- or X-timer-number -- 3GPP compliant timer number of the format '1234' or 'T1234' or 't1234';" \
" Osmocom-specific timer number of the format: 'X1234' or 'x1234'.\n"

Referenced by osmo_tdef_vty_groups_init().

## OSMO_TDEF_VTY_DOC_VAL

#define OSMO_TDEF_VTY_DOC_VAL "New timer value\n" "Set to default timer value\n"

## Enumeration Type Documentation

## sched_vty_thread_id

enum sched_vty_thread_id

Enumerator
SCHED_VTY_THREAD_SELF |
SCHED_VTY_THREAD_ALL |
SCHED_VTY_THREAD_ID |
SCHED_VTY_THREAD_NAME |
SCHED_VTY_THREAD_UNKNOWN |

## Function Documentation

## add_group_args()

char * add_group_args | ( | void * | talloc_ctx,
|  | char * | dest )

static

References g, global_tdef_groups, and osmo_tdef_groups_for_each().

Referenced by timer_command_string().

## add_group_docs()

char * add_group_docs | ( | void * | talloc_ctx,
|  | char * | dest )

static

References g, global_tdef_groups, and osmo_tdef_groups_for_each().

Referenced by timer_doc_string().

## config_write_sched()

int config_write_sched | ( | struct vty * | vty | ) |

static

References cpu_affinity_it::bufname, CMD_SUCCESS, sched_vty_opts::cpu_affinity_li, cpu_affinity_it::cpuset, cpu_affinity_it::cpuset_size, cpu_affinity_it::delay, cpu_affinity_it::entry, generate_cpu_hex_mask(), sched_vty_opts::sched_rr_prio, VTY_NEWLINE, and vty_out().

Referenced by osmo_cpu_sched_vty_init().

## DEFUN() [1/2]

DEFUN | ( | cfg_sched | ,
|  | cfg_sched_cmd | ,
|  | "cpu-sched" | ,
|  | "Configure CPU Scheduler related settings" | )

References CMD_SUCCESS, vty::index, L_CPU_SCHED_NODE, and vty::node.

## DEFUN() [2/2]

DEFUN | ( | show_sched_threads | ,
|  | show_sched_threads_cmd | ,
|  | "show cpu-sched threads" | ,
|  | SHOW_STR "Show Sched section information\n" "Show information about running | threads )

References CMD_SUCCESS, CMD_WARNING, generate_cpu_hex_mask(), get_num_cpus(), SHOW_STR, VTY_NEWLINE, and vty_out().

## DEFUN_ATTR() [1/2]

DEFUN_ATTR | ( | cfg_sched_cpu_affinity | ,
|  | cfg_sched_cpu_affinity_cmd | ,
|  | "cpu-affinity (self|all|<0-4294967295>|THREADNAME) CPUHEXMASK " | [delay],
|  | "Set CPU affinity mask on a (group of) thread(s)\n" "Set CPU affinity mask on thread running the VTY\n" "Set CPU affinity mask on all process' threads\n" "Set CPU affinity mask on a thread with specified PID\n" "Set CPU affinity mask on a thread with specified thread name\n" "CPU affinity mask\n" "If | set,
|  | delay applying the affinity mask now and let the app handle it at a later point\n" | ,
|  | CMD_ATTR_IMMEDIATE | )

References argc, argv, cpu_affinity_it::bufname, CMD_ATTR_IMMEDIATE, CMD_SUCCESS, CMD_WARNING, sched_vty_opts::cpu_affinity_li, sched_vty_opts::cpu_affinity_li_mutex, cpu_affinity_it::cpuset, cpu_affinity_it::cpuset_size, cpu_affinity_it::delay, cpu_affinity_it::entry, get_num_cpus(), my_sched_setaffinity(), parse_cpu_hex_mask(), procname2pid(), SCHED_VTY_THREAD_ALL, SCHED_VTY_THREAD_ID, SCHED_VTY_THREAD_NAME, SCHED_VTY_THREAD_SELF, SCHED_VTY_THREAD_UNKNOWN, sched_vty_opts::tall_ctx, cpu_affinity_it::tid_type, VTY_NEWLINE, and vty_out().

## DEFUN_ATTR() [2/2]

DEFUN_ATTR | ( | cfg_sched_policy | ,
|  | cfg_sched_policy_cmd | ,
|  | "policy rr <1-32>" | ,
|  | "Set the scheduling policy to use for the process\n" "Use the SCHED_RR real-time scheduling algorithm\n" "Set the SCHED_RR real-time priority\n" | ,
|  | CMD_ATTR_IMMEDIATE | )

References argv, CMD_ATTR_IMMEDIATE, CMD_SUCCESS, CMD_WARNING, sched_vty_opts::sched_rr_prio, set_sched_rr(), VTY_NEWLINE, and vty_out().

## generate_cpu_hex_mask()

int generate_cpu_hex_mask | ( | char * | str,
|  | size_t | str_buf_size,
|  | cpu_set_t * | cpuset,
|  | size_t | cpuset_size )

static

Referenced by config_write_sched(), DEFUN(), my_sched_setaffinity(), and osmo_cpu_sched_vty_apply_localthread().

## get_num_cpus()

int get_num_cpus | ( | void |  | ) |

static

Referenced by DEFUN(), DEFUN_ATTR(), and osmo_cpu_sched_vty_init().

## if()

if | ( |  | ) |

References argc.

## my_sched_setaffinity()

int my_sched_setaffinity | ( | enum sched_vty_thread_id | tid_type,
|  | pid_t | pid,
|  | cpu_set_t * | cpuset,
|  | size_t | cpuset_size )

static

References generate_cpu_hex_mask(), and SCHED_VTY_THREAD_ALL.

Referenced by DEFUN_ATTR(), and osmo_cpu_sched_vty_apply_localthread().

## osmo_cpu_sched_vty_apply_localthread()

int osmo_cpu_sched_vty_apply_localthread | ( | void |  | ) |

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

Returns
  0 on success, non-zero on error.

References cpu_affinity_it::bufname, sched_vty_opts::cpu_affinity_li, sched_vty_opts::cpu_affinity_li_mutex, cpu_affinity_it::cpuset, cpu_affinity_it::cpuset_size, cpu_affinity_it::entry, generate_cpu_hex_mask(), my_sched_setaffinity(), SCHED_VTY_THREAD_ALL, SCHED_VTY_THREAD_NAME, SCHED_VTY_THREAD_SELF, and cpu_affinity_it::tid_type.

## osmo_cpu_sched_vty_init()

int osmo_cpu_sched_vty_init | ( | void * | tall_ctx | ) |

Initialize sched VTY nodes.

Parameters

  [in] | tall_ctx | Talloc context to use internally by vty_sched subsystem.

Returns
  0 on success, non-zero on error.

References CONFIG_NODE, config_write_sched(), sched_vty_opts::cpu_affinity_li, sched_vty_opts::cpu_affinity_li_mutex, get_num_cpus(), install_lib_element(), install_lib_element_ve(), install_node(), L_CPU_SCHED_NODE, sched_node, and sched_vty_opts::tall_ctx.

## osmo_tdef_groups_for_each()

osmo_tdef_groups_for_each | ( | g | ,
|  | global_tdef_groups | )

References g, global_tdef_groups, group_arg, osmo_tdef_groups_for_each(), osmo_tdef_vty_show_cmd(), and T_arg.

Referenced by add_group_args(), add_group_docs(), osmo_tdef_groups_for_each(), osmo_tdef_vty_groups_init(), and osmo_tdef_vty_groups_write().

## osmo_tdef_vty_groups_init()

void osmo_tdef_vty_groups_init | ( | unsigned int | parent_cfg_node,
|  | struct osmo_tdef_group * | groups )

Convenience implementation for keeping a fixed set of timer groups in a program.

Install a 'timer [(group|names|...)] [TNNN] [(<val>|default)]' command under the given parent_node, and install a 'show timer...' command on VIEW_NODE and ENABLE_NODE. For a usage example, see tdef_test_config_root.c. The given timer definitions group is stored in a global pointer, so this can be done only once per main() scope. It would also be possible to have distinct timer groups on separate VTY subnodes, with a "manual" implementation, but not with this API.

Parameters

  [in] | parent_cfg_node | VTY node at which to add the timer configuration commands, e.g. CONFIG_NODE.
  [in] | groups | Global timer groups definition.

References g, global_tdef_groups, install_lib_element(), install_lib_element_ve(), osmo_tdef_groups_for_each(), OSMO_TDEF_VTY_ARG_SET_OPTIONAL, OSMO_TDEF_VTY_ARG_T_OPTIONAL, OSMO_TDEF_VTY_DOC_SET, OSMO_TDEF_VTY_DOC_T, SHOW_STR, timer_command_string(), and timer_doc_string().

## osmo_tdef_vty_groups_write()

void osmo_tdef_vty_groups_write | ( | struct vty * | vty,
|  | const char * | indent )

Write the global osmo_tdef_group configuration to VTY, as previously passed to osmo_tdef_vty_groups_init().

Parameters

  [in] | vty | VTY context.
  [in] | indent | String to print before each line.

References g, global_tdef_groups, osmo_tdef_groups_for_each(), and osmo_tdef_vty_write().

## osmo_tdef_vty_out_all()

void osmo_tdef_vty_out_all | ( | struct vty * | vty,
|  | struct osmo_tdef * | tdefs,
|  | const char * | prefix_fmt,
|  |  | ... )

Write to VTY the current status of all given timers.

Parameters

  [in] | vty | VTY context for vty_out().
  [in] | tdefs | Array of timers to print, ended with a fully zero-initialized entry.
  [in] | prefix_fmt | Arbitrary string to start each line with, with variable printf like arguments.

References osmo_tdef_vty_out_all_va(), and tdefs.

## osmo_tdef_vty_out_all_va()

void osmo_tdef_vty_out_all_va | ( | struct vty * | vty,
|  | struct osmo_tdef * | tdefs,
|  | const char * | prefix_fmt,
|  | va_list | va )

Write to VTY the current status of all given timers.

Parameters

  [in] | vty | VTY context for vty_out().
  [in] | tdefs | Array of timers to print, ended with a fully zero-initialized entry.
  [in] | prefix_fmt | Arbitrary string to start each line with, with variable vprintf like arguments.
  [in] | va | va_list instance. As always, call va_start() before, and va_end() after this call.

References osmo_tdef_vty_out_one_va(), tdefs, VTY_NEWLINE, and vty_out().

Referenced by osmo_tdef_vty_out_all(), and osmo_tdef_vty_show_cmd().

## osmo_tdef_vty_out_one()

void osmo_tdef_vty_out_one | ( | struct vty * | vty,
|  | struct osmo_tdef * | t,
|  | const char * | prefix_fmt,
|  |  | ... )

Write to VTY the current status of one timer.

Parameters

  [in] | vty | VTY context for vty_out().
  [in] | t | The timer to print.
  [in] | prefix_fmt | Arbitrary string to start each line with, with variable printf like arguments.

References osmo_tdef_vty_out_one_va().

## osmo_tdef_vty_out_one_va()

void osmo_tdef_vty_out_one_va | ( | struct vty * | vty,
|  | struct osmo_tdef * | t,
|  | const char * | prefix_fmt,
|  | va_list | va )

Write to VTY the current status of one timer.

Parameters

  [in] | vty | VTY context for vty_out().
  [in] | t | The timer to print.
  [in] | prefix_fmt | Arbitrary string to start each line with, with variable vprintf like arguments.
  [in] | va | va_list instance. As always, call va_start() before, and va_end() after this call.

References osmo_tdef::default_val, osmo_tdef::desc, osmo_tdef::max_val, osmo_tdef::min_val, osmo_tdef::T, osmo_tdef::unit, osmo_tdef::val, VTY_NEWLINE, vty_out(), and vty_out_va().

Referenced by osmo_tdef_vty_out_all_va(), osmo_tdef_vty_out_one(), and osmo_tdef_vty_show_cmd().

## osmo_tdef_vty_parse_T_arg()

struct osmo_tdef * osmo_tdef_vty_parse_T_arg | ( | struct vty * | vty,
|  | struct osmo_tdef * | tdefs,
|  | const char * | T_str )

Parse an argument like "1234", "T1234", "t1234", or "X1234", "x1234", as from OSMO_TDEF_VTY_ARG_T.

Parameters

  [in] | vty | VTY context for vty_out() of error messages.
  [in] | tdefs | Array of timer definitions to look up T timer.
  [in] | T_str | Argument string. It is not validated, expected to be checked by VTY input.

Returns
  the corresponding osmo_tdef entry from the tdefs array, or NULL if no such entry exists.

References osmo_tdef::T, tdefs, VTY_NEWLINE, and vty_out().

Referenced by osmo_tdef_vty_set_cmd(), and osmo_tdef_vty_show_cmd().

## osmo_tdef_vty_parse_val_arg()

unsigned long osmo_tdef_vty_parse_val_arg | ( | const char * | val_arg,
|  | unsigned long | default_val )

Parse an argument of the form "(0-2147483647|default)", as from OSMO_TDEF_VTY_ARG_VAL.

Parameters

  [in] | val_arg | Argument string (not format checked).
  [in] | default_val | Value to return in case of val_arg being "default".

Returns
  Parsed value or default_val.

References osmo_tdef::default_val.

Referenced by osmo_tdef_vty_set_cmd().

## osmo_tdef_vty_set_cmd() [1/2]

int osmo_tdef_vty_set_cmd | ( | struct vty * | vty,
|  | struct osmo_tdef * | tdefs,
|  | const char ** | args )

Apply a timer configuration from VTY argument strings.

Employ both osmo_tdef_vty_parse_T_arg() and osmo_tdef_vty_parse_val_arg() to configure a T timer in an array of tdefs. Evaluate two arguments, a "T1234" argument and a "(0-2147483647|default)" argument, as from OSMO_TDEF_VTY_ARGS. If the T timer given in the first argument is found in tdefs, set it to the value given in the second argument.

Parameters

  [in] | vty | VTY context for vty_out() of error messages.
  [in] | tdefs | Array of timer definitions to look up T timer.
  [in] | args | Array of string arguments like { "T1234", "23" }.

Returns
  CMD_SUCCESS, or CMD_WARNING if no such timer is found in tdefs.

References CMD_SUCCESS, CMD_WARNING, osmo_tdef::default_val, osmo_tdef_vty_parse_T_arg(), osmo_tdef_vty_parse_val_arg(), osmo_tdef::T, T_arg, tdefs, osmo_tdef::val, VTY_NEWLINE, and vty_out().

## osmo_tdef_vty_set_cmd() [2/2]

return osmo_tdef_vty_set_cmd | ( | vty | ,
|  | tdefs | ,
|  | timer_args | )

References tdefs, and timer_args.

## osmo_tdef_vty_show_cmd()

int osmo_tdef_vty_show_cmd | ( | struct vty * | vty,
|  | struct osmo_tdef * | tdefs,
|  | const char * | T_arg,
|  | const char * | prefix_fmt,
|  |  | ... )

Output one or all timers to the VTY, as for a VTY command like 'show timer [TNNNN]'.

If T_arg is NULL, print all timers in tdefs to the VTY. If T_arg is not NULL, employ osmo_tdef_vty_parse_T_arg() to select one timer from tdefs and print only that to the VTY.

Parameters

  [in] | vty | VTY context for vty_out() of error messages.
  [in] | tdefs | Array of timer definitions.
  [in] | T_arg | Argument string like "T1234", or NULL.
  [in] | prefix_fmt | Arbitrary string to start each line with, with variable printf like arguments.

Returns
  CMD_SUCCESS, or CMD_WARNING if no such timer is found in tdefs.

References CMD_SUCCESS, CMD_WARNING, osmo_tdef_vty_out_all_va(), osmo_tdef_vty_out_one_va(), osmo_tdef_vty_parse_T_arg(), T_arg, and tdefs.

Referenced by osmo_tdef_groups_for_each().

## osmo_tdef_vty_write()

void osmo_tdef_vty_write | ( | struct vty * | vty,
|  | struct osmo_tdef * | tdefs,
|  | const char * | prefix_fmt,
|  |  | ... )

Write current timer configuration arguments to the vty.

Skip all entries that reflect their default value. The passed prefix string must contain both necessary indent and the VTY command the specific implementation is using. See tdef_vty_config_subnode_test.c and tdef_vty_dynamic_test.c for examples.

Parameters

  [in] | vty | VTY context.
  [in] | tdefs | Array of timers to print, ended with a fully zero-initialized entry.
  [in] | prefix_fmt | Arbitrary string to start each line with, with variable printf like arguments.

References osmo_tdef::default_val, osmo_tdef::T, tdefs, osmo_tdef::val, VTY_NEWLINE, vty_out(), and vty_out_va().

Referenced by osmo_tdef_vty_groups_write().

## parse_cpu_hex_mask()

int parse_cpu_hex_mask | ( | const char * | str,
|  | cpu_set_t * | cpuset,
|  | size_t | cpuset_size )

static

Referenced by DEFUN_ATTR().

## proc_name_exists()

bool proc_name_exists | ( | const char * | name,
|  | pid_t * | res_pid )

static

Referenced by procname2pid().

## proc_tid_exists()

bool proc_tid_exists | ( | pid_t | tid | ) |

static

Referenced by procname2pid().

## procname2pid()

enum sched_vty_thread_id procname2pid | ( | pid_t * | res_pid,
|  | const char * | str,
|  | bool | applynow )

static

References proc_name_exists(), proc_tid_exists(), SCHED_VTY_THREAD_ALL, SCHED_VTY_THREAD_ID, SCHED_VTY_THREAD_NAME, SCHED_VTY_THREAD_SELF, and SCHED_VTY_THREAD_UNKNOWN.

Referenced by DEFUN_ATTR().

## set_sched_rr()

int set_sched_rr | ( | unsigned int | prio | ) |

static

Referenced by DEFUN_ATTR().

## timer_command_string()

char * timer_command_string | ( | const char * | prefix,
|  | const char * | suffix )

static

References add_group_args(), and tall_vty_cmd_ctx.

Referenced by osmo_tdef_vty_groups_init().

## timer_doc_string()

char * timer_doc_string | ( | const char * | prefix,
|  | const char * | suffix )

static

References add_group_docs(), and tall_vty_cmd_ctx.

Referenced by osmo_tdef_vty_groups_init().

## Variable Documentation

## argc

argc

Referenced by ALIAS(), argv_concat(), cmd_execute_command_real(), cmd_execute_command_strict(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN_ATTR(), DEFUN_HIDDEN(), gDEFUN(), gDEFUN(), if(), and log_deprecated_func().

## argv

argv

Referenced by ALIAS(), argv_concat(), cmd_execute_command_real(), cmd_execute_command_strict(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN_ATTR(), DEFUN_ATTR(), DEFUN_HIDDEN(), gDEFUN(), gDEFUN(), and log_deprecated_func().

## CMD_SUCCESS

return CMD_SUCCESS

## g

struct osmo_tdef_group * g = NULL

Referenced by add_group_args(), add_group_docs(), osmo_tdef_groups_for_each(), osmo_tdef_vty_groups_init(), and osmo_tdef_vty_groups_write().

## global_tdef_groups

struct osmo_tdef_group* global_tdef_groups

static

Singleton Tnnn groups definition as set by osmo_tdef_vty_groups_init().

Referenced by add_group_args(), add_group_docs(), osmo_tdef_groups_for_each(), osmo_tdef_vty_groups_init(), and osmo_tdef_vty_groups_write().

## group_arg

group_arg = argv[0]

Referenced by osmo_tdef_groups_for_each().

## sched_node

struct cmd_node sched_node

static

Initial value:
= {
L_CPU_SCHED_NODE,
"%s(config-cpu-sched)# ",
1,
}
L_CPU_SCHED_NODE
@ L_CPU_SCHED_NODE
CPU Sched related options node.
Definition command.h:102

Referenced by osmo_cpu_sched_vty_init().

## sched_vty_opts

struct sched_vty_opts* sched_vty_opts

static

## T_arg

const char* T_arg = argc > 1 ? argv[1] : NULL

Referenced by osmo_tdef_groups_for_each(), osmo_tdef_vty_set_cmd(), and osmo_tdef_vty_show_cmd().

## tdefs

struct osmo_tdef* tdefs = NULL

Referenced by osmo_tdef_vty_out_all(), osmo_tdef_vty_out_all_va(), osmo_tdef_vty_parse_T_arg(), osmo_tdef_vty_set_cmd(), osmo_tdef_vty_set_cmd(), osmo_tdef_vty_show_cmd(), and osmo_tdef_vty_write().

## timer_args

timer_args

Initial value:
{
const char *group_arg
group_arg
group_arg
Definition tdef_vty.c:299

Referenced by osmo_tdef_vty_set_cmd().

## vty

vty