VxWorks API Reference : OS Libraries

usrLib

NAME

usrLib - user interface subroutine library

ROUTINES

help( ) - print a synopsis of selected routines
netHelp( ) - print a synopsis of network routines
bootChange( ) - change the boot line
periodRun( ) - call a function periodically
period( ) - spawn a task to call a function periodically
repeatRun( ) - call a function repeatedly
repeat( ) - spawn a task to call a function repeatedly
sp( ) - spawn a task with default parameters
checkStack( ) - print a summary of each task's stack usage
i( ) - print a summary of each task's TCB
ti( ) - print complete information from a task's TCB
show( ) - print information on a specified object
ts( ) - suspend a task
tr( ) - resume a task
td( ) - delete a task
version( ) - print VxWorks version information
m( ) - modify memory
d( ) - display memory
ld( ) - load an object module into memory
devs( ) - list all system-known devices
lkup( ) - list symbols
lkAddr( ) - list symbols whose values are near a specified value
mRegs( ) - modify registers
pc( ) - return the contents of the program counter
printErrno( ) - print the definition of a specified error status value
printLogo( ) - print the VxWorks logo
logout( ) - log out of the VxWorks system
h( ) - display or set the size of shell history
spyReport( ) - display task activity data
spyTask( ) - run periodic task activity reports
spy( ) - begin periodic task activity reports
spyClkStart( ) - start collecting task activity data
spyClkStop( ) - stop collecting task activity data
spyStop( ) - stop spying and reporting
spyHelp( ) - display task monitoring help menu

DESCRIPTION

This library consists of routines meant to be executed from the VxWorks shell. It provides useful utilities for task monitoring and execution, system information, symbol table management, etc.

Many of the routines here are simply command-oriented interfaces to more general routines contained elsewhere in VxWorks. Users should feel free to modify or extend this library, and may find it preferable to customize capabilities by creating a new private library, using this one as a model, and appropriately linking the new one into the system.

Some routines here have optional parameters. If those parameters are zero, which is what the shell supplies if no argument is typed, default values are typically assumed.

A number of the routines in this module take an optional task name or ID as an argument. If this argument is omitted or zero, the "current" task is used. The current task (or "default" task) is the last task referenced. The usrLib library uses taskIdDefault( ) to set and get the last-referenced task ID, as do many other VxWorks routines.

INCLUDE FILES

usrLib.h

SEE ALSO

usrFsLib, tarLib, spyLib, VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell


OS Libraries : Routines

help( )

NAME

help( ) - print a synopsis of selected routines

SYNOPSIS

void help (void)

DESCRIPTION

This command prints the following list of the calling sequences for commonly used routines, mostly contained in usrLib.

help                       Print this list
ioHelp                     Print I/O utilities help info
dbgHelp                    Print debug help info
nfsHelp                    Print nfs help info
netHelp                    Print network help info
spyHelp                    Print task histogrammer help info
timexHelp                  Print execution timer help info
h         [n]              Print (or set) shell history
i         [task]           Summary of tasks' TCBs
ti        task             Complete info on TCB for task
sp        adr,args...      Spawn a task, pri=100, opt=0x19, stk=20000
taskSpawn name,pri,opt,stk,adr,args... Spawn a task
td        task             Delete a task
ts        task             Suspend a task
tr        task             Resume a task
d         [adr[,nunits[,width]]]   Display memory
m         adr[,width]      Modify memory
mRegs     [reg[,task]]     Modify a task's registers interactively
pc        [task]           Return task's program counter
version                    Print VxWorks version info, and boot line
iam     "user"[,"passwd"]  Set user name and passwd
whoami                     Print user name
devs                       List devices
ld        [syms[,noAbort][,"name"]] Load std in into memory
                             (syms = add symbols to table:
                              -1 = none, 0 = globals, 1 = all)
lkup      ["substr"]       List symbols in system symbol table
lkAddr    address          List symbol table entries near address
checkStack  [task]         List task stack sizes and usage
printErrno  value          Print the name of a status value
period    secs,adr,args... Spawn task to call function periodically
repeat    n,adr,args...    Spawn task to call function n times
                             (0=forever)
NOTE:  Arguments specifying <task> can be either task ID or name.

RETURNS

N/A

SEE ALSO

usrLib, VxWorks Programmer's Guide: Target Shell windsh, Tornado User's Guide: Shell


OS Libraries : Routines

netHelp( )

NAME

netHelp( ) - print a synopsis of network routines

SYNOPSIS

void netHelp (void)

DESCRIPTION

This command prints a brief synopsis of network facilities that are typically called from the shell.

hostAdd      "hostname","inetaddr" - add a host to remote host table;
                                     "inetaddr" must be in standard
                                     Internet address format e.g. "90.0.0.4"
hostShow                           - print current remote host table
netDevCreate "devname","hostname",protocol
                                   - create an I/O device to access
                                     files on the specified host
                                     (protocol 0=rsh, 1=ftp)
routeAdd     "destaddr","gateaddr" - add route to route table
routeDelete  "destaddr","gateaddr" - delete route from route table
routeShow                          - print current route table
iam          "usr"[,"passwd"]      - specify the user name by which
                                     you will be known to remote
                                     hosts (and optional password)
whoami                             - print the current remote ID
rlogin       "host"                - log in to a remote host;
                                     "host" can be inet address or
                                     host name in remote host table

ifShow       ["ifname"]            - show info about network interfaces
inetstatShow                       - show all Internet protocol sockets
tcpstatShow                        - show statistics for TCP
udpstatShow                        - show statistics for UDP
ipstatShow                         - show statistics for IP
icmpstatShow                       - show statistics for ICMP
arptabShow                         - show a list of known ARP entries
mbufShow                           - show mbuf statistics

EXAMPLE:  -> hostAdd "wrs", "90.0.0.2"
          -> netDevCreate "wrs:", "wrs", 0
          -> iam "fred"
          -> copy <wrs:/etc/passwd   /* copy file from host "wrs" */
          -> rlogin "wrs"            /* rlogin to host "wrs"      */

RETURNS

N/A

SEE ALSO

usrLib, VxWorks Programmer's Guide: Target Shell


OS Libraries : Routines

bootChange( )

NAME

bootChange( ) - change the boot line

SYNOPSIS

void bootChange (void)

DESCRIPTION

This command changes the boot line used in the boot ROMs. This is useful during a remote login session. After changing the boot parameters, you can reboot the target with the reboot( ) command, and then terminate your login ( ~. ) and remotely log in again. As soon as the system has rebooted, you will be logged in again.

This command stores the new boot line in non-volatile RAM, if the target has it.

RETURNS

N/A

SEE ALSO

usrLib, windsh, Tornado User's Guide: Shell


OS Libraries : Routines

periodRun( )

NAME

periodRun( ) - call a function periodically

SYNOPSIS

void periodRun
    (
    int     secs,             /* no. of seconds to delay between calls */
    FUNCPTR func,             /* function to call repeatedly */
    int     arg1,             /* first of eight args to pass to func */
    int     arg2,
    int     arg3,
    int     arg4,
    int     arg5,
    int     arg6,
    int     arg7,
    int     arg8
    )

DESCRIPTION

This command repeatedly calls a specified function, with up to eight of its arguments, delaying the specified number of seconds between calls.

Normally, this routine is called only by period( ), which spawns it as a task.

RETURNS

N/A

SEE ALSO

usrLib, period( ), VxWorks Programmer's Guide: Target Shell


OS Libraries : Routines

period( )

NAME

period( ) - spawn a task to call a function periodically

SYNOPSIS

int period
    (
    int     secs,             /* period in seconds */
    FUNCPTR func,             /* function to call repeatedly */
    int     arg1,             /* first of eight args to pass to func */
    int     arg2,
    int     arg3,
    int     arg4,
    int     arg5,
    int     arg6,
    int     arg7,
    int     arg8
    )

DESCRIPTION

This command spawns a task that repeatedly calls a specified function, with up to eight of its arguments, delaying the specified number of seconds between calls.

For example, to have i( ) display task information every 5 seconds, just type:

    -> period 5, i

NOTE

The task is spawned using the sp( ) routine. See the description of sp( ) for details about priority, options, stack size, and task ID.

RETURNS

A task ID, or ERROR if the task cannot be spawned.

SEE ALSO

usrLib, periodRun( ), sp( ), VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell


OS Libraries : Routines

repeatRun( )

NAME

repeatRun( ) - call a function repeatedly

SYNOPSIS

void repeatRun
    (
    int     n,                /* no. of times to call func (0=forever) */
    FUNCPTR func,             /* function to call repeatedly */
    int     arg1,             /* first of eight args to pass to func */
    int     arg2,
    int     arg3,
    int     arg4,
    int     arg5,
    int     arg6,
    int     arg7,
    int     arg8
    )

DESCRIPTION

This command calls a specified function n times, with up to eight of its arguments. If n is 0, the routine is called endlessly.

Normally, this routine is called only by repeat( ), which spawns it as a task.

RETURNS

N/A

SEE ALSO

usrLib, repeat( ), VxWorks Programmer's Guide: Target Shell


OS Libraries : Routines

repeat( )

NAME

repeat( ) - spawn a task to call a function repeatedly

SYNOPSIS

int repeat
    (
    int     n,                /* no. of times to call func (0=forever) */
    FUNCPTR func,             /* function to call repeatedly */
    int     arg1,             /* first of eight args to pass to func */
    int     arg2,
    int     arg3,
    int     arg4,
    int     arg5,
    int     arg6,
    int     arg7,
    int     arg8
    )

DESCRIPTION

This command spawns a task that calls a specified function n times, with up to eight of its arguments. If n is 0, the routine is called endlessly, or until the spawned task is deleted.

NOTE

The task is spawned using sp( ). See the description of sp( ) for details about priority, options, stack size, and task ID.

RETURNS

A task ID, or ERROR if the task cannot be spawned.

SEE ALSO

usrLib, repeatRun( ), sp( ), VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell


OS Libraries : Routines

sp( )

NAME

sp( ) - spawn a task with default parameters

SYNOPSIS

int sp
    (
    FUNCPTR func,             /* function to call */
    int     arg1,             /* first of nine args to pass to spawned task */
    int     arg2,
    int     arg3,
    int     arg4,
    int     arg5,
    int     arg6,
    int     arg7,
    int     arg8,
    int     arg9
    )

DESCRIPTION

This command spawns a specified function as a task with the following defaults:

priority:

100

stack size:
20,000 bytes
task ID:
highest not currently used
task options:
VX_FP_TASK - execute with floating-point coprocessor support.
task name:
A name of the form tN where N is an integer which increments as new tasks are spawned, e.g., t1, t2, t3, etc. The task ID is displayed after the task is spawned.

This command is a short form of the underlying taskSpawn( ) routine, convenient for spawning tasks in which the default parameters are satisfactory. If the default parameters are unacceptable, taskSpawn( ) should be called directly.

RETURNS

A task ID, or ERROR if the task cannot be spawned.

SEE ALSO

usrLib, taskLib, taskSpawn( ), VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell

VARARGS1


OS Libraries : Routines

checkStack( )

NAME

checkStack( ) - print a summary of each task's stack usage

SYNOPSIS

void checkStack
    (
    int taskNameOrId          /* task name or task ID; 0 = summarize all */
    )

DESCRIPTION

This command displays a summary of stack usage for a specified task, or for all tasks if no argument is given. The summary includes the total stack size (SIZE), the current number of stack bytes used (CUR), the maximum number of stack bytes used (HIGH), and the number of bytes never used at the top of the stack (MARGIN = SIZE - HIGH). For example:

    -> checkStack tShell

        NAME         ENTRY      TID    SIZE   CUR  HIGH  MARGIN
    ------------ ------------ -------- ----- ----- ----- ------
    tShell       _shell       23e1c78   9208   832  3632   5576
The maximum stack usage is determined by scanning down from the top of the stack for the first byte whose value is not 0xee. In VxWorks, when a task is spawned, all bytes of a task's stack are initialized to 0xee.

DEFICIENCIES

It is possible for a task to write beyond the end of its stack, but not write into the last part of its stack. This will not be detected by checkStack( ).

RETURNS

N/A

SEE ALSO

usrLib, taskSpawn( ), VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell


OS Libraries : Routines

i( )

NAME

i( ) - print a summary of each task's TCB

SYNOPSIS

void i
    (
    int taskNameOrId          /* task name or task ID, 0 = summarize all */
    )

DESCRIPTION

This command displays a synopsis of all the tasks in the system. The ti( ) routine provides more complete information on a specific task.

Both i( ) and ti( ) use taskShow( ); see the documentation for taskShow( ) for a description of the output format.

EXAMPLE

-> i

   NAME       ENTRY     TID    PRI   STATUS    PC       SP    ERRNO DELAY
---------- ---------- -------- --- --------- ------- -------- ----- -----
tExcTask   _excTask    20fcb00   0 PEND      200c5fc  20fca6c     0     0
tLogTask   _logTask    20fb5b8   0 PEND      200c5fc  20fb520     0     0
tShell     _shell      20efcac   1 READY     201dc90  20ef980     0     0
tRlogind   _rlogind    20f3f90   2 PEND      2038614  20f3db0     0     0
tTelnetd   _telnetd    20f2124   2 PEND      2038614  20f2070     0     0
tNetTask   _netTask    20f7398  50 PEND      2038614  20f7340     0     0
value = 57 = 0x39 = '9'

CAVEAT

This command should be used only as a debugging aid, since the information is obsolete by the time it is displayed.

RETURNS

N/A

SEE ALSO

usrLib, ti( ), taskShow( ), VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell


OS Libraries : Routines

ti( )

NAME

ti( ) - print complete information from a task's TCB

SYNOPSIS

void ti
    (
    int taskNameOrId          /* task name or task ID; 0 = use default */
    )

DESCRIPTION

This command prints the task control block (TCB) contents, including registers, for a specified task. If taskNameOrId is omitted or zero, the last task referenced is assumed.

The ti( ) routine uses taskShow( ); see the documentation for taskShow( ) for a description of the output format.

EXAMPLE

The following shows the TCB contents for the shell task:

-> ti

  NAME      ENTRY     TID    PRI  STATUS      PC       SP    ERRNO  DELAY
---------- --------- -------- --- --------- -------- -------- ------ -----
tShell     _shell     20efcac   1 READY      201dc90  20ef980      0     0

stack: base 0x20efcac  end 0x20ed59c  size 9532   high 1452   margin 8080

options: 0x1e
VX_UNBREAKABLE      VX_DEALLOC_STACK    VX_FP_TASK         VX_STDIO


D0 =       0   D4 =       0   A0 =       0   A4 =        0
D1 =       0   D5 =       0   A1 =       0   A5 =  203a084   SR =     3000
D2 =       0   D6 =       0   A2 =       0   A6 =  20ef9a0   PC =  2038614
D3 =       0   D7 =       0   A3 =       0   A7 =  20ef980
value = 34536868 = 0x20efda4

RETURNS

N/A

SEE ALSO

usrLib, taskShow( ), VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell


OS Libraries : Routines

show( )

NAME

show( ) - print information on a specified object

SYNOPSIS

void show
    (
    int objId,                /* object ID */
    int level                 /* information level */
    )

DESCRIPTION

This command prints information on the specified object. System objects include tasks, local and shared semaphores, local and shared message queues, local and shared memory partitions, watchdogs, and symbol tables. An information level is interpreted by the objects show routine on a class by class basis. Refer to the object's library manual page for more information.

RETURNS

N/A

SEE ALSO

usrLib, i( ), ti( ), lkup( ), VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell


OS Libraries : Routines

ts( )

NAME

ts( ) - suspend a task

SYNOPSIS

void ts
    (
    int taskNameOrId          /* task name or task ID */
    )

DESCRIPTION

This command suspends the execution of a specified task. It simply calls taskSuspend( ).

RETURNS

N/A

SEE ALSO

usrLib, tr( ), taskSuspend( ), VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell


OS Libraries : Routines

tr( )

NAME

tr( ) - resume a task

SYNOPSIS

void tr
    (
    int taskNameOrId          /* task name or task ID */
    )

DESCRIPTION

This command resumes the execution of a suspended task. It simply calls taskResume( ).

RETURNS

N/A

SEE ALSO

usrLib, ts( ), taskResume( ), VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell


OS Libraries : Routines

td( )

NAME

td( ) - delete a task

SYNOPSIS

void td
    (
    int taskNameOrId          /* task name or task ID */
    )

DESCRIPTION

This command deletes a specified task. It simply calls taskDelete( ).

RETURNS

N/A

SEE ALSO

usrLib, taskDelete( ), VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell


OS Libraries : Routines

version( )

NAME

version( ) - print VxWorks version information

SYNOPSIS

void version (void)

DESCRIPTION

This command prints the VxWorks version number, the date this copy of VxWorks was made, and other pertinent information.

EXAMPLE

-> version
VxWorks (for Mizar 7170) version 5.1
Kernel: WIND version 2.1.
Made on Tue Jul 27 20:26:23 CDT 1997.
Boot line:
enp(0,0)host:/usr/wpwr/target/config/mz7170/vxWorks e=90.0.0.50 h=90.0.0.4 u=target
value = 1 = 0x1

RETURNS

N/A

SEE ALSO

usrLib, VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell


OS Libraries : Routines

m( )

NAME

m( ) - modify memory

SYNOPSIS

void m
    (
    void * adrs,              /* address to change */
    int    width              /* width of unit to be modified (1, 2, 4, 8) */
    )

DESCRIPTION

This command prompts the user for modifications to memory in byte, short word, or long word specified by width, starting at the specified address. It prints each address and the current contents of that address, in turn. If adrs or width is zero or absent, it defaults to the previous value. The user can respond in one of several ways:

RETURN
Do not change this address, but continue, prompting at the next address.
number
Set the content of this address to number.
. (dot)
Do not change this address, and quit.
EOF
Do not change this address, and quit.
All numbers entered and displayed are in hexadecimal.

RETURNS

N/A

SEE ALSO

usrLib, mRegs( ), VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell


OS Libraries : Routines

d( )

NAME

d( ) - display memory

SYNOPSIS

void d
    (
    void * adrs,              /* address to display (if 0, display next block */
    int    nunits,            /* number of units to print (if 0, use default) */
    int    width              /* width of displaying unit (1, 2, 4, 8) */
    )

DESCRIPTION

This command displays the contents of memory, starting at adrs. If adrs is omitted or zero, d( ) displays the next memory block, starting from where the last d( ) command completed.

Memory is displayed in units specified by width. If nunits is omitted or zero, the number of units displayed defaults to last use. If nunits is non-zero, that number of units is displayed and that number then becomes the default. If width is omitted or zero, it defaults to the previous value. If width is an invalid number, it is set to 1. The valid values for width are 1, 2, 4, and 8. The number of units d( ) displays is rounded up to the nearest number of full lines.

RETURNS

N/A

SEE ALSO

usrLib, m( ), VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell


OS Libraries : Routines

ld( )

NAME

ld( ) - load an object module into memory

SYNOPSIS

MODULE_ID ld
    (
    int    syms,              /* -1, 0, or 1 */
    BOOL   noAbort,           /* TRUE = don't abort script on error */
    char * name               /* name of object module, NULL = standard input */
    )

DESCRIPTION

This command loads an object module from a file or from standard input. The object module must be in UNIX a.out format. External references in the module are resolved during loading. The syms parameter determines how symbols are loaded; possible values are:

    0 - Add global symbols to the system symbol table.
    1 - Add global and local symbols to the system symbol table.
   -1 - Add no symbols to the system symbol table.

If there is an error during loading (e.g., externals undefined, too many symbols, etc.), then shellScriptAbort( ) is called to stop any script that this routine was called from. If noAbort is TRUE, errors are noted but ignored.

The normal way of using ld( ) is to load all symbols (syms = 1) during debugging and to load only global symbols later.

The routine ld( ) is a shell command. That is, it is designed to be used only in the shell, and not in code running on the target. In future releases, calling ld( ) directly from code may not be supported.

COMMON SYMBOLS

On the target shell, for the ld command only, common symbol behavior is determined by the value of the global variable, ldCommonMatchAll. The reasoning for ldCommonMatchAll matches the purpose of the windsh environment variable, LD_COMMON_MATCH_ALL as explained below.

If ldCommonMatchAll is set to TRUE (equivalent to windsh "LD_COMMON_MATCH_ALL=on"), the loader trys to match a common symbol with an existing one. If a symbol with the same name is already defined, the loader takes its address. Otherwise, the loader creates a new entry. If set to FALSE (equivalent to windsh "LD_COMMON_MATCH_ALL=off"), the loader does not try to find an existing symbol. It creates an entry for each common symbol.

EXAMPLE

The following example loads the a.out file module from the default file device into memory, and adds any global symbols to the symbol table:

    -> ld <module
This example loads test.o with all symbols:
    -> ld 1,0,"test.o"

RETURNS

MODULE_ID, or NULL if there are too many symbols, the object file format is invalid, or there is an error reading the file.

SEE ALSO

usrLib, loadLib, VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell


OS Libraries : Routines

devs( )

NAME

devs( ) - list all system-known devices

SYNOPSIS

void devs (void)

DESCRIPTION

This command displays a list of all devices known to the I/O system.

RETURNS

N/A

SEE ALSO

usrLib, iosDevShow( ), VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell


OS Libraries : Routines

lkup( )

NAME

lkup( ) - list symbols

SYNOPSIS

void lkup
    (
    char * substr             /* substring to match */
    )

DESCRIPTION

This command lists all symbols in the system symbol table whose names contain the string substr. If substr is omitted or is 0, a short summary of symbol table statistics is printed. If substr is the empty string (""), all symbols in the table are listed.

This command also displays symbols that are local, i.e., symbols found in the system symbol table only because their module was loaded by ld( ).

By default, lkup( ) displays 22 symbols at a time. This can be changed by modifying the global variable symLkupPgSz. If this variable is set to 0, lkup( ) displays all the symbols without interruption.

RETURNS

N/A

SEE ALSO

usrLib, symLib, symEach( ), VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell


OS Libraries : Routines

lkAddr( )

NAME

lkAddr( ) - list symbols whose values are near a specified value

SYNOPSIS

void lkAddr
    (
    unsigned int addr         /* address around which to look */
    )

DESCRIPTION

This command lists the symbols in the system symbol table that are near a specified value. The symbols that are displayed include:

This command also displays symbols that are local, i.e., symbols found in the system symbol table only because their module was loaded by ld( ).

RETURNS

N/A

SEE ALSO

usrLib, symLib, symEach( ), VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell


OS Libraries : Routines

mRegs( )

NAME

mRegs( ) - modify registers

SYNOPSIS

STATUS mRegs
    (
    char * regName,           /* register name, NULL for all */
    int    taskNameOrId       /* task name or task ID, 0 = default task */
    )

DESCRIPTION

This command modifies the specified register for the specified task. If taskNameOrId is omitted or zero, the last task referenced is assumed. If the specified register is not found, it prints out the valid register list and returns ERROR. If no register is specified, it sequentially prompts the user for new values for a task's registers. It displays each register and the current contents of that register, in turn. The user can respond in one of several ways:

RETURN
Do not change this register, but continue, prompting at the next register.
number
Set this register to number.
. (dot)
Do not change this register, and quit.
EOF
Do not change this register, and quit.

All numbers are entered and displayed in hexadecimal, except floating-point values, which may be entered in double precision.

RETURNS

OK, or ERROR if the task or register does not exist.

SEE ALSO

usrLib, m( ), VxWorks Programmer's Guide: Target Shell windsh, Tornado User's Guide: Shell


OS Libraries : Routines

pc( )

NAME

pc( ) - return the contents of the program counter

SYNOPSIS

int pc
    (
    int task                  /* task ID */
    )

DESCRIPTION

This command extracts the contents of the program counter for a specified task from the task's TCB. If task is omitted or 0, the current task is used.

RETURNS

The contents of the program counter.

SEE ALSO

usrLib, ti( ), VxWorks Programmer's Guide: Target Shell


OS Libraries : Routines

printErrno( )

NAME

printErrno( ) - print the definition of a specified error status value

SYNOPSIS

void printErrno
    (
    int errNo                 /* status code whose name is to be printed */
    )

DESCRIPTION

This command displays the error-status string, corresponding to a specified error-status value. It is only useful if the error-status symbol table has been built and included in the system. If errNo is zero, then the current task status is used by calling errnoGet( ).

This facility is described in errnoLib.

RETURNS

N/A

SEE ALSO

usrLib, errnoLib, errnoGet( ), VxWorks Programmer's Guide: Target Shell windsh, Tornado User's Guide: Shell


OS Libraries : Routines

printLogo( )

NAME

printLogo( ) - print the VxWorks logo

SYNOPSIS

void printLogo (void)

DESCRIPTION

This command displays the VxWorks banner seen at boot time. It also displays the VxWorks version number and kernel version number.

RETURNS

N/A

SEE ALSO

usrLib, VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell


OS Libraries : Routines

logout( )

NAME

logout( ) - log out of the VxWorks system

SYNOPSIS

void logout (void)

DESCRIPTION

This command logs out of the VxWorks shell. If a remote login is active (via rlogin or telnet), it is stopped, and standard I/O is restored to the console.

SEE ALSO

usrLib, rlogin( ), telnet( ), shellLogout( ), VxWorks Programmer's Guide: Target Shell


OS Libraries : Routines

h( )

NAME

h( ) - display or set the size of shell history

SYNOPSIS

void h
    (
    int size                  /* 0 = display, >0 = set history to new size */
    )

DESCRIPTION

This command displays or sets the size of VxWorks shell history. If no argument is specified, shell history is displayed. If size is specified, that number of the most recent commands is saved for display. The value of size is initially 20.

RETURNS

N/A

SEE ALSO

usrLib, shellHistory( ), ledLib, VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell


OS Libraries : Routines

spyReport( )

NAME

spyReport( ) - display task activity data

SYNOPSIS

void spyReport (void)

DESCRIPTION

This routine reports on data gathered at interrupt level for the amount of CPU time utilized by each task, the amount of time spent at interrupt level, the amount of time spent in the kernel, and the amount of idle time. Time is displayed in ticks and as a percentage, and the data is shown since both the last call to spyClkStart( ) and the last spyReport( ). If no interrupts have occurred since the last spyReport( ), nothing is displayed.

RETURNS

N/A

SEE ALSO

usrLib, spyLib, spyClkStart( ), VxWorks Programmer's Guide: Target Shell


OS Libraries : Routines

spyTask( )

NAME

spyTask( ) - run periodic task activity reports

SYNOPSIS

void spyTask
    (
    int freq                  /* reporting frequency, in seconds */
    )

DESCRIPTION

This routine is spawned as a task by spy( ) to provide periodic task activity reports. It prints a report, delays for the specified number of seconds, and repeats.

RETURNS

N/A

SEE ALSO

usrLib, spyLib, spy( ), VxWorks Programmer's Guide: Target Shell


OS Libraries : Routines

spy( )

NAME

spy( ) - begin periodic task activity reports

SYNOPSIS

void spy
    (
    int freq,                 /* reporting freq in sec, 0 = default of 5 */
    int ticksPerSec           /* interrupt clock freq, 0 = default of 100 */
    )

DESCRIPTION

This routine collects task activity data and periodically runs spyReport( ). Data is gathered ticksPerSec times per second, and a report is made every freq seconds. If freq is zero, it defaults to 5 seconds. If ticksPerSec is omitted or zero, it defaults to 100.

This routine spawns spyTask( ) to do the actual reporting.

It is not necessary to call spyClkStart( ) before running spy( ).

RETURNS

N/A

SEE ALSO

usrLib, spyLib, spyClkStart( ), spyTask( ), VxWorks Programmer's Guide: Target Shell


OS Libraries : Routines

spyClkStart( )

NAME

spyClkStart( ) - start collecting task activity data

SYNOPSIS

STATUS spyClkStart
    (
    int intsPerSec            /* timer interrupt freq, 0 = default of 100 */
    )

DESCRIPTION

This routine begins data collection by enabling the auxiliary clock interrupts at a frequency of intsPerSec interrupts per second. If intsPerSec is omitted or zero, the frequency will be 100. Data from previous collections is cleared.

RETURNS

OK, or ERROR if the CPU has no auxiliary clock, or if task create and delete hooks cannot be installed.

SEE ALSO

usrLib, spyLib, sysAuxClkConnect( ), VxWorks Programmer's Guide: Target Shell


OS Libraries : Routines

spyClkStop( )

NAME

spyClkStop( ) - stop collecting task activity data

SYNOPSIS

void spyClkStop (void)

DESCRIPTION

This routine disables the auxiliary clock interrupts. Data collected remains valid until the next spyClkStart( ) call.

RETURNS

N/A

SEE ALSO

usrLib, spyLib, spyClkStart( ), VxWorks Programmer's Guide: Target Shell


OS Libraries : Routines

spyStop( )

NAME

spyStop( ) - stop spying and reporting

SYNOPSIS

void spyStop (void)

DESCRIPTION

This routine calls spyClkStop( ). Any periodic reporting by spyTask( ) is terminated.

RETURNS

N/A

SEE ALSO

usrLib, spyLib, spyClkStop( ), spyTask( ), VxWorks Programmer's Guide: Target Shell


OS Libraries : Routines

spyHelp( )

NAME

spyHelp( ) - display task monitoring help menu

SYNOPSIS

void spyHelp (void)

DESCRIPTION

This routine displays a summary of spyLib utilities:

spyHelp                       Print this list
spyClkStart [ticksPerSec]     Start task activity monitor running
                                at ticksPerSec ticks per second
spyClkStop                    Stop collecting data
spyReport                     Prints display of task activity
                                statistics
spyStop                       Stop collecting data and reports
spy     [freq[,ticksPerSec]]  Start spyClkStart and do a report
                                every freq seconds

ticksPerSec defaults to 100.  freq defaults to 5 seconds.

RETURNS

N/A

SEE ALSO

usrLib, spyLib, VxWorks Programmer's Guide: Target Shell