Display system information (QNX)
sin [options] sin [options] args|dir|env|family|flags|memory| registers|root|rtimers|signals| times|users sin [options] format format_str sin [options] fds|filesObtain 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|treeObtain general system information:
sin [-n node] [-h] net|versions sin [-n node] info
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.
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).
The format_str argument to sin format determines the categories of information that will be reported about each process. These categories are as follows:
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 |
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 |
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). |
//node/dir1/dir2/dir3/namewould be truncated to:
//node/*/dir3/name
NOTE: a name of (zombie) indicates this process has terminated and its parent hasn't wait()ed for its exit status yet. |
Char | Meaning |
---|---|
r | round robin |
f | FIFO |
o | other (adaptive) |
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).
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. |
The UTIME, STIME and CUTIME fields will be zero if the process manager (Proc) has been started with the -a option.
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) |
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.
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".
The second class of queries supported by sin reports on most of the major operating system objects, such as interrupt handlers and proxies.
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.
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.
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.
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.
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 |
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 |
The vcs query displays information about the virtual circuits (VC) of a node. Each VC has 2 ends, LOCAL and REMOTE.
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 |
The third class gives reports on important but more general information, for example, the versions of the major System Manager processes running.
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.
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.
The info query displays information about a node's hardware and configuration. The following headings are displayed:
D3P+-------AEE8Pwhere 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 |
The irqs query displays which interrupts are in use and by which processes. The following headings are displayed:
The net query displays information about each node on the network (that can be reached). The following headings are displayed:
SPEED, MEMORY, and HARD values are totalled for the network and are displayed on the last line of output.
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).
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.
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