[Previous] [Contents] [Next]

sin

Display system information (QNX)

Syntax:

Obtain information about processes:
   sin [options]

   sin [options] args|dir|env|family|flags|memory|
               registers|root|rtimers|signals|
               times|users
                           
   sin [options] format format_str

   sin [options] fds|files
Obtain information about other OS resources:
   sin [-n node] [-h] gdt|idt|irqs|names|
                 gnames|proxies|sessions

   sin [-n node] [-h] [-l] vcs

   sin [-n node] freemem|tree
Obtain general system information:
   sin [-n node] [-h] net|versions

   sin [-n node] info

Options:

-g groupname
Get information on this group name only.
-h
Don't display headers. Works on all variations of the sin command except sin freemem, sin tree and sin info.
-l
Keep requests local. Has an effect only when used with sin vcs.
-m
Get information on processes in your own session only.
-n node
Get information from this node. Works for all variations of the sin command.
-p pid
Get information on this process ID only.
-P string
Get information on processes whose names contain string.
-s sid
Get information on this session ID only.
-S {U|b|g|i|n|p|s|t|u}
Sort on the specified format_str (see below). Only a single letter can be specified.
-u username
Get information on only this user name.

Description:

The sin utility lets you obtain a "snapshot" of the state of the system (system information). If present, the keyword after the command lets you select different types of information and different views of how the information is displayed. You need only type the first two characters of a keyword.

The information can be grouped into three classes as follows:

The -n node option may be used for any of the three classes of query to obtain information about another node on the network. The default is to obtain information on the current node.

The -gmpPsu options can be used only with the first class of queries (process information). Each option acts as a filter reducing the information displayed.

The -l ("el") option can be used only with the vcs query ("other OS resources"). It prevents sin from going off the current node to obtain the names of the processes on the remote end of a virtual circuit.

Process information queries

The first class gives reports on each process in the system. Since this information exceeds what can be displayed on a line, the format keyword allows you to select the components you wish displayed. A number of pre-specified reports have been provided to save typing in the various format options:

Command: Description:
sin format format_str Displays the requested info about each process.
sin same as sin format sinbpm
sin args same as sin format iLa
sin dir same as sin format iLnd
sin env same as sin format iLne
sin family same as sin format snpbif
sin flags same as sin format sinbF
sin registers same as sin format ir
sin root same as sin format iLnR
sin signals same as sin format sinpS
sin times same as sin format sinpt
sin users same as sin format signUu

Output from the first class of queries is sorted by process ID. This can be changed by specifying the -S option with an alternate format_str (e.g. session ID, or perhaps priority).

format_str; Categories of Process Information

The format_str argument to sin format determines the categories of information that will be reported about each process. These categories are as follows:

Character Represents
a Command-line arguments
b Process state/blocked on
d Current Directory
e Environment Variables
F Process Flags
f Family (Dad/Son/Brother relationships)
g Process Group ID
i Process ID
L Login Name
M Magic
m Size
N Session Node ID
n Process Name
P Memory Pass
p Priority
R Pathname Prefix Root
r Registers
S Signals
s Session ID
T File Time and Execution Start Time
t CPU Time Used
U Real User ID/Group ID
u Effective User ID/Group ID

Command-Line Arguments

a
The a format character causes an ARGUMENTS heading and the arguments of each process to be displayed. If you do not have appropriate permissions, a "Not available." message will be displayed under the ARGUMENTS heading. If the argument list exceeds 512 characters, sin will truncate the list and display a " ... " at the end to signify that truncation occurred. Unless you are root you can obtain command line arguments only for processes which are being run by your own user ID.

Process State/Blocked On

b
The b (for "blocked") format character causes two headings to be displayed. STATE is used to display the current state of each process. The second heading, BLK, gives the PID that the process is blocked on (if any).

Possible values of STATE are:

State Description
READY this process is ready (scheduled) to run
DEAD this process is unable to run, but still holds resources e.g. zombies and Debugger32
SEND this process has sent a message to another process which hasn't Receive()d it yet
REPLY this process has sent a message to another process which has Receive()d it, but not Reply()d to it
RECV this process has called Receive() and is waiting for a message
HELD this process was signalled with SIGHOLD and will not become READY until it is signalled with SIGCONT
WAIT this process is wait()ing for a death status of a child or waiting for a timer to expire (e.g. sleep()ing)
SIGBL this process has sent a system signal message (because it was signalled while REPLY blocked on a process which has the _PPF_SIGCATCH process flag set) which hasn't been Receive()d yet.
SEM this process is waiting to procure a semaphore

Current Directory

d
The d (for "directory") format character causes a CURRENT DIRECTORY heading and each process's $PWD environment variable to be displayed. A "Not available" message is displayed if you do not have appropriate permissions.

Environment Variables

e
The e format character causes an ENVIRONMENT heading and each process's environment to be displayed. If you do not have appropriate permissions, a "Not available" message will be displayed under the ENVIRONMENT heading. If the environment list exceeds 512 characters, sin will truncate the list and display a " ... " at the end to signify that truncation occurred.

Process Flags

F
The F format character causes a FLAGS heading and each process's process flags to be displayed. The following flags are currently defined: (see qnx_pflags() for more information)
  fSZHTLE mMVXF3 +    DSmcsfr FiI

 
 
Process flags which are not set will appear as dash (-) characters e.g.:

  -SZ----------3-------S------FiI

 
 

Char Meaning
f Forked
S Session leader
Z No-Zombie
H Held (or to be held)
T Terminating (or zombie)
L Loading
E Execing (transforming)
m Remote proxy
M Proxy
V Virtual circuit
X Execute-in-place
F Flat model
3 32-bit
+ Was 32 bit
D Rdos (Older versions of QNX only)
S Server
m Sig mask all
c Sigcatch
s SIGCHLD ignored
f Priority float
r Priority receive
F Fixed segments
i Informed
I Immortal

Family (Dad/Son/Brother Relationships)

f
The f format character causes a DAD, SON and BRO heading and each process's parent PID, a child PID, and another PID which has the same parent PID, respectively, to be displayed.

Process Group ID

g
The g format character causes a PGRP heading and each process's group ID (GID) number to be displayed.

Process ID

i
The i format character causes a PID heading and each process's ID number to be displayed.

Login Name

L
The L format character causes a USER NAME heading and the user that started the process for each process to be displayed.

Magic

M
The M format character causes a MAGIC heading and the magic data selector and offset of each process to be displayed.

Size

m
The m format character causes a CODE and DATA heading and the size of each process's code and data memory spaces to be displayed. The method sin uses to calculate these values was changed, and may change again. Currently, sin tries to determine the amount of memory unique to/or really used by each process. Overlaid and mapped (32-bit only) memory just gives access to "other" memory regions, and are not accounted for. Shared DATA is accounted for in the process which owns the segment, not a process which copies the selector.
Note: A CODE size of 0 indicates that this process is 16 bit and is sharing its CODE with another instance of the same process (e.g. ksh). The first instance of this process will have the full CODE size allocated to it. With 32-bit processes, code sharing causes CODE to become
 (total code size) / (number of instances).

Session node ID

N
The node ID the session was originally started in.

Process Name

n
The n format character causes a PROGRAM heading and the name of each process to be displayed. The sin utility formats the PROGRAM field to 23 characters. If the name is longer, the node prefix and as much of the basename as possible will be displayed. A * indicates that (middle) truncation occurred. For example,
    //node/dir1/dir2/dir3/name
    
would be truncated to:
    //node/*/dir3/name
    

Note: NOTE: a name of (zombie) indicates this process has terminated and its parent hasn't wait()ed for its exit status yet.

Memory Pass

P
The P format character causes the MPID MSEL and MFLG headings and the segment arming information of each process to be displayed. These headings directly map into the parameters to the qnx_segment_arm() library routine. e.g. qnx_segment_arm( MPID, MSEL, MFLG)

Priority

p (priority)
The p format character causes a PRI heading and the priority and scheduling algorithm of each process to be displayed. The scheduling algorithm is represented by one of the following 3 characters:
Char Meaning
r round robin
f FIFO
o other (adaptive)

Pathname Prefix Root

R
The R format character causes a ROOT heading and each process's root prefix to be displayed. Usually, this is simply the node ID. Unless you are logged in as root, you can obtain the pathname prefix roots only for processes being run by your own user ID.

Registers

r
The r format character causes each process's Intel registers to be displayed. For 32-bit processes, a second line of output is needed to display the most-significant part of each register.

Signals

S
The S format character causes the following headings to be displayed:
Heading Description
SIG IGN signals which are set to be handled by SIG_IGN
SIG MASK signals which are currently masked (blocked)
SIG PEND signals which are pending
SEG:OFF segment:offset of the signal table

There are 32 signals. Each signal is represented as a bit within the 4 byte field, with signal 1 being the LSB. For example, signals 1 and 5 would be represented by: (0x)00000011

The signal table consists of 2 unsigneds followed by 32 struct _sigaction structures (1 for each signal).

Session ID

s
The s format character causes a SID heading and each process's session ID to be displayed.

File Time and Execution Start Time

T
The T format character causes a FILE TIME and a START TIME heading to be displayed. FILE TIME is the time stamp on the process's executable file (ls -l file) and START TIME is the date/time when this process was started.

CPU Time Used

t
The t format character causes the following headings to be displayed:
Heading Description
START TIME date/time when this process was started
UTIME amount of CPU seconds this process has consumed
STIME amount of CPU seconds the system has consumed on behalf of this process (e.g. Proc)
CUTIME amount of CPU seconds children of this process have consumed.
CSTIME amount of CPU seconds the system has consumed on behalf of the children of this process.
Children times are added to CUTIME and CSTIME only after they terminate.

The UTIME, STIME and CUTIME fields will be zero if the process manager (Proc) has been started with the -a option.

Real User ID and Group ID

U
The U format character causes a RUID and a RGID heading to be displayed. RUID is the real user ID and RGID is the real group ID of each process.

Effective User ID and Group ID

u
The u format character causes an EUID and an EGID heading to be displayed. EUID is the effective user ID and EGID is the effective group ID of each process.

Other process information queries

File descriptors -- sin fds

The fds query is useful for displaying which files and devices a process has open. These are displayed under the process name and PID, 2 per line. The format for each fd is:

fd number - file path

If the fd number has an adjacent "C", the _FD_CLOSE_ON_EXEC flag is set for that fd. The sin utility determines the file path by using the dev_fdinfo() library routine first. If this call succeeds, the returned device path is used. If the path is not set, the returned device type is used and is displayed inside brackets (e.g. [con]). If the call to dev_fdinfo() fails, fsys_fdinfo() is called. If this call succeeds, the returned file path is used. If the fsys_fdinfo() call fails, the PID of the fd's manager is displayed inside parentheses (as a last resort).

There are some words which may appear in the place of a file path to indicate an unusual status of the file which prevents sin from obtaining a filename. These are:

A file path of: Indicates that:
unknown sin could not establish a VC to a remote manager.
unlinked the file has been removed (unlinked) but this process still holds it open.
pipe indicates the file is an unnamed FIFO (pipe)
[@1234567] etc. indicates the file is really a socket (Socket manager)

Files/pathnames in use -- sin files

The files query displays the following headings:

Heading Description
PROGRAM process name
PID process ID number
FD file descriptor number
MODE open mode flags
POSITION current position/size
FILE fullpath

The following mode flags are displayed if set:

Flag Meaning
E Exclusive
F File Sync
D Data Sync
A Append
W Write
R Read

If the flag is not set, a dash (-) will appear in its column instead.

Memory regions -- sin memory

The memory query displays each process's selectors 2 per line. The format is selector, address, limit and flags. The following flags may be displayed:

  
 LBS3+++GA+PMDCO

which mean, in order:

Flag Meaning
L Process is loading into this segment
B Borrowed, segment was taken from the free list
S Shared, more than one process owns this segment
3 Segment is code/stack segment in 32-bit mode
+ Segment is a link to an existing segment
+ Allow DMA requests above 16Meg
+ Disable caching if possible
G Global segment, is in GDT
A Align segment on a GET/PUT operation
+ Global segment and is owned by this process
P Huge segment, next segment continues this one
M Process can modify access rights
D DMA safe, will not cross 64k segment boundary
C Code readable/executable
O Data read only

Note: If both "Data read only" (O) and "Code readable/executable" (C) are shown, then this is really "Code execute only" (CO). Also, if neither "Data read only" nor "Code readable/executable" are shown, then this is really "Data readable/writable".

Other OS resource information queries

The second class of queries supported by sin reports on most of the major operating system objects, such as interrupt handlers and proxies.

Free memory -- sin freemem

The freemem query simply prints out each contiguous block of free memory. Note that for most memory requirements, physically contiguous blocks of memory are not required because each process operates in a virtual address space which is mapped into physical addresses through a page table.

Global names -- sin gnames

The gnames query displays all the registered global names and the node on which they were registered from. This information is returned from a nameloc process running on the network.

Registered names -- sin names

The names query displays all names registered on the node, as well as the PID and program name of the process which registered the name. These include not just local names, but also the global names registered on this node.

Proxies -- sin proxies

The proxies query displays the following headings:

Heading Meaning
PROXY the proxy ID (PID of the proxy)
PROGRAM the process name which owns the proxy
PRI the priority of the proxy
STATE the state of the proxy (READY or SEND)
COUNT the pending amount of triggers

Note that a proxy becomes SEND blocked when the COUNT becomes greater than 0, and the owning process hasn't Receive()d the proxy message yet.

Realtime timers -- sin rtimers

The rtimers query displays information about the realtime timers. The following headings are displayed:

Heading Meaning
ID the timer ID
PID the PID of the process which owns the timer
PROGRAM the name of the process which owns the timer
ACTION the "purpose" of the timer (what it does when expired). This will be one of sleep (meaning that the process is blocked until the timer expires), proxy PID (meaning that the proxy PID will be triggered on timer expiry), or signal SIG (meaning that the SIG signal will be raised on the process on timer expiry.)
TRIGGER the seconds before the timer expires
REPEAT the seconds between each TRIGGER

Sessions -- sin sessions

The sessions query displays information about the current sessions. The following headings are displayed:

Heading Meaning
SID the session ID
USERID the user which owns the session
DEVICE the controlling terminal of the session
PID the PID of the session leader
MEMBERS the number of processes in the session

Virtual circuits -- sin vcs

The vcs query displays information about the virtual circuits (VC) of a node. Each VC has 2 ends, LOCAL and REMOTE.

Under the LOCAL heading, the following headings are displayed:

VID
the VC ID
PID
the process which owns the VID
LK
the link count (when a PID has multiple open fds to the same remote manager, the VC is shared -- instead of a VC for each fd)
STATE
state/sub-state of this VC end. Possible values are:
State Meaning
READY/1 idle or txing reply
REPLY/2 initializing VC
REPLY/3 initializing existing VC for sharing
REPLY/4 growing on Send(), blocked on local Proc
REPLY/5 growing on Send(), blocked on Net
REPLY/6 sending, blocked on network
REPLY/7 growing on Reply(), blocked on local Proc
REPLY/8 growing on Reply(), blocked on Net
REPLY/9 growing on Writemsg(), blocked on local Proc
PROGRAM
the name of the process which owns the VID
Under the REMOTE heading, the following headings are displayed:

 

NID
the node ID of the remote end of the VC
VID
the VC ID on the remote node ( NID side )
PID
the process which owns the VID on NID
PROGRAM
the name of the process which owns the VID on NID

General system information

The third class gives reports on important but more general information, for example, the versions of the major System Manager processes running.

Global descriptor table -- sin gdt

The gdt query walks down the Global Descriptor Table and displays each entry. This information is very Intel-specific and is beyond the scope of this document. You must be root to use sin gdt.

Interrupt descriptor table -- sin idt

The idt query walks down the Interrupt Descriptor Table and displays each entry. Similar to the gdt query, this information is very Intel-specific and is beyond the scope of this document. You must be root to use sin idt.

General system information -- sin info

The info query displays information about a node's hardware and configuration. The following headings are displayed:

NODE
logical node number
CPU
type of CPU/FPU
MACHINE
type of machine (AT, PS/2, PCI,...)
SPEED
a benchmark result performed at boot up
MEMORY
available / total memory
TICKSIZE
current ticksize
DISPLAY
type of monitor (None, Monochrome, CGA, EGA Color, EGA Mono, PGS, VGA Mono, VGA Color, PS/2 30 Mono, PS/2 30 Color)
FLAGS
the following system flags:
 D3P+-------AEE8P
where the flags mean (in order):
Flag Meaning
D memory reserved for Rundos (older QNX only)
3 Supports 32-bit processes
P PCI Bios
+ 32-bit Kernel
- (unused)
A APM installed
E Emu32 installed
E Emu16 installed
8 NDP installed
P Protected
HEAPP
Proc's free heap space
HEAPF
Proc's free file descriptor heap space
HEAPL
Proc's free LDT/GDT heap space
HEAPN
Proc's free registered name space
HANDS
maximum number of interrupt handlers
NAMES
maximum number of names (local and global)
SESSIONS
maximum number of sessions
PROCS
maximum number of processes
TIMERS
maximum number of timers
NODES
number of QNX licenses
VIRTUAL
Free virtual memory/Total virtual memory
BOOT
date and origin of boot (a "*" indicates alternate boot)
LOCATORS
A list of nodes running nameloc from which global names, network alive lists and network licensing information will be fetched.

Interrupts used -- sin irqs

The irqs query displays which interrupts are in use and by which processes. The following headings are displayed:

IRQ
the hardware interrupt vector ( -1 means special 50 millisecond timer )
PID
the process which attached the interrupt handler to the IRQ
PROGRAM
the name of the process which attached the interrupt handler to the IRQ
CS:IP
the selector:offset of the interrupt handler
DS
the data selector used by the interrupt handler

Information about nodes on the network -- sin net

The net query displays information about each node on the network (that can be reached). The following headings are displayed:

NID
logical node ID
MACHINE
type of machine (AT, PS/2, PCI)
CPU
type of CPU
FPU
type of FPU
SPEED
a benchmark result performed at boot up
MEMORY
total memory
HARD
non-removable hard disk space present under /dev with a block-special filename consisting of an alphabetical name followed by a number (e.g. /dev/hd0 would be counted but /dev/hd0t77 would not).
FLOPPY
the size of /dev/fd0
OTHER
indicates the presence of some other facility, such as
TCP
the node has Socket running
cd
the node has a CD-ROM drive
rhd
the node has a removable hard disk drive
tp
the node has a tape drive
DISPLAY
type of monitor (None, Monochrome, CGA, EGA Color, EGA Mono, PGS, VGA Mono, VGA Color, PS/2 30 Mono, PS/2 30 Color)
FLAGS
system flags (see the info query)

SPEED, MEMORY, and HARD values are totalled for the network and are displayed on the last line of output.

Process family tree -- sin tree

The tree query displays a "family tree" of the processes. Children are shown to the right of their parents. Siblings are shown vertically (all connected to each other and their parent).

Server process versions -- sin versions

The versions query displays the version and date of each server process (process flag _PPF_SERVER set). This information is returned from a system version message sent to each server process.

Examples:

Show all processes running on the local node in default format:

    sin

Show process times for all processes in session 0 on the local node:

    sin -s 0 time

Show only those processes running in your own session:

    sin -m

Show general system information for node 4:

    sin -n 4 info

Show registers for process 4 on node 5:

    sin -n 5 -p 4 registers

For each process running on the local node show process ID, effective user ID and group ID, real user ID and group ID, and process name:

    sin format iuUn

Show all processes running on the local node in the default format, sorted by priority:

    sin -S p

See also:

ps, sac


[Previous] [Contents] [Next]