machine state
1.2.0Retrieve machine state information about CPU time, memory usage, etc.
Table of Contents
About machine-state
This library implements various functions to access status information about the machine, process, etc.
How To
Since this is a toolkit library, please simply refer to the symbol index for available functions and their behaviour. The following groups of functions are available:
Process
Threads
Implementation
GPU
Physical Machine
Storage Devices
Network Devices
Implementation Support
Fetching information about threads that aren't the current one, or GC related information requires implementation support. The following implementations are fully or partially supported:
CCL
Clasp
ECL
SBCL
Mezzano
Operating System Support
Fetching information about various hardware devices is, of course, OS dependent. The following systems are fully or partially supported:
BSDs (POSIX)
Linux
MacOS (darwin)
Mezzano
Windows
System Information
Definition Index
-
ORG.SHIRAKUMO.MACHINE-STATE
No documentation provided.-
EXTERNAL CONDITION QUERY-FAILED
Error signalled if a query should fail for some reason. This condition is *NOT* signalled if the function is simply unsupported. It is however signalled if an OS call failed for some reason such as lack of access permissions.
-
EXTERNAL FUNCTION GC-ROOM
Returns the GC's memory usage statistics. This does not include foreign memory usage. Returns two values: The number of free bytes The total number of bytes available If the function is unsupported a constant 0 is returned for both values. See MACHINE-ROOM See PROCESS-ROOM See GPU-ROOM See STATIC-ROOM See STACK-ROOM See STORAGE-ROOM
-
EXTERNAL FUNCTION GC-TIME
Returns the amount of processing time spent in the GC. If the function is unsupported a constant 0.0d0 is returned. See MACHINE-TIME See PROCESS-TIME See GC-TIME See GPU-TIME See THREAD-TIME
-
EXTERNAL FUNCTION GPU-ROOM
Returns the GPU's memory usage statistics. Returns two values: The number of free bytes The total number of bytes available If the function is unsupported a constant 0 is returned for both values. You may want to load the machine-state/opengl library to make this function useful. In that case, it will only work if an OpenGL context is current to this thread. See MACHINE-ROOM See PROCESS-ROOM See GC-ROOM See STATIC-ROOM See STACK-ROOM See STORAGE-ROOM
-
EXTERNAL FUNCTION GPU-TIME
Returns the amount of processing time spent on the GPU by this process. If the function is unsupported a constant 0.0d0 is returned. You may want to load the machine-state/opengl library to make this function useful. In that case, it will only work if an OpenGL context is current to this thread. See PROCESS-TIME See GC-TIME See MACHINE-TIME See THREAD-TIME
-
EXTERNAL FUNCTION MACHINE-CORES
Returns the number of cores available on the machine. If the function is unsupported a constant 1 is returned. See THREAD-CORE-MASK
-
EXTERNAL FUNCTION MACHINE-ROOM
Returns the machine's primary memory usage statistics. Returns two values: The number of physical bytes occupied The total number of physical bytes available If the function is unsupported a constant 0 is returned for all values. See PROCESS-ROOM See GC-ROOM See GPU-ROOM See STATIC-ROOM See STACK-ROOM See STORAGE-ROOM
-
EXTERNAL FUNCTION MACHINE-TIME
- CORE
- &REST
Returns the amount of time spent processing. Core may be T for an aggregate of all cores, or an integer of the core number. Returns two values: The time spent idle in seconds The total time spent in seconds If the function is unsupported a constant 0.0d0 is returned. See MACHINE-CORES
-
EXTERNAL FUNCTION MACHINE-UPTIME
Returns the number of seconds since the machine was started up. If the function is unsupported a constant 0 is returned.
-
EXTERNAL FUNCTION NETWORK-DEVICES
Returns a list of network device names. If the function is unsupported an empty list is returned. See NETWORK-IO-BYTES
-
EXTERNAL FUNCTION NETWORK-IO-BYTES
- DEVICE
- &REST
Returns the number of bytes of IO performed on the network device. The argument may either be the system name of the device as a string or T to get an aggregate of all attached devices. Returns three values: The total number of IO bytes performed. The bytes read. The bytes written. If the function is unsupported a constant 0 is returned. See NETWORK-DEVICES See PROCESS-IO-BYTES See STORAGE-IO-BYTES
-
EXTERNAL FUNCTION PROCESS-IO-BYTES
Returns the number of bytes of IO performed by the process. Returns three values: The total number of IO bytes performed. The bytes read. The bytes written. IO in this context refers to any activity to external devices such as drives, networking, etc. If the function is unsupported a constant 0 is returned for all values. See STORAGE-IO-BYTES See NETWORK-IO-BYTES
-
EXTERNAL FUNCTION PROCESS-PRIORITY
Accessor to the scheduler priority of the process. The priority can be one of the following values, in ascending order of importance: :IDLE :LOW :NORMAL :HIGH :REALTIME If the function is unsupported :NORMAL is returned in all cases. When setting this place, the *actual* priority of the process is returned, which may differ from the one you tried to set. See THREAD-PRIORITY
-
EXTERNAL FUNCTION (SETF PROCESS-PRIORITY)
- PRIORITY
- &REST
No documentation provided. -
EXTERNAL FUNCTION PROCESS-ROOM
Returns the process' memory usage statistics. This includes foreign memory usage. Returns the number of bytes occupied. If the function is unsupported a constant 0 is returned. See MACHINE-ROOM See GC-ROOM See GPU-ROOM See STATIC-ROOM See STACK-ROOM See STORAGE-ROOM
-
EXTERNAL FUNCTION PROCESS-TIME
Returns the amount of processing time spent by this process in seconds. This does not include time spent in the kernel. If the function is unsupported a constant 0.0d0 is returned. See MACHINE-TIME See THREAD-TIME See GC-TIME See GPU-TIME
-
EXTERNAL FUNCTION STACK-ROOM
Return the stack usage statistics. Returns two values: The number of free stack bytes The total stack space available See MACHINE-ROOM See PROCESS-ROOM See GC-ROOM See GPU-ROOM See STATIC-ROOM See STORAGE-ROOM
-
EXTERNAL FUNCTION STATIC-ROOM
Returns the static space size as an integer. If the function is unsupported zero is returned. See MACHINE-ROOM See PROCESS-ROOM See GC-ROOM See GPU-ROOM See STACK-ROOM See STORAGE-ROOM
-
EXTERNAL FUNCTION STORAGE-DEVICE
- PATH
- &REST
Return the system device name of the device backing the path. Returns the device name as a string if it can be found and signals a QUERY-FAILED error otherwise. See STORAGE-DEVICE-PATH See STORAGE-ROOM See STORAGE-IO-BYTES
-
EXTERNAL FUNCTION STORAGE-DEVICE-PATH
- DEVICE
- &REST
Return a path which the storage device is backing if any. Returns the path as a directory pathname if it can be found and signals a QUERY-FAILED error otherwise. See STORAGE-DEVICE See STORAGE-ROOM See STORAGE-IO-BYTES
-
EXTERNAL FUNCTION STORAGE-IO-BYTES
- DEVICE
- &REST
Returns the number of bytes of IO performed on the storage device. The argument may either be a pathname to a file on the device to query, the system provided name for the device, or T to get an aggregate of all attached devices. Returns three values: The total number of IO bytes performed. The bytes read. The bytes written. If the function is unsupported a constant 0 is returned. See STORAGE-DEVICE See STORAGE-DEVICE-PATH See NETWORK-IO-BYTES See PROCESS-IO-BYTES
-
EXTERNAL FUNCTION STORAGE-ROOM
- PATH
- &REST
Return file system storage usage statistics. The argument may either be a pathname to a file on the device to query, or the system provided name for the device. Returns two values: The number of free bytes The total number of bytes available See STORAGE-DEVICE See STORAGE-DEVICE-PATH See MACHINE-ROOM See PROCESS-ROOM See GC-ROOM See GPU-ROOM See STATIC-ROOM See STACK-ROOM
-
EXTERNAL FUNCTION THREAD-CORE-MASK
- THREAD
- &REST
Accessor to the CPU core affinity mask of the thread. The mask is a bitfield where each set bit in the integer designates a core that the thread may be executed on. For compatibility reasons only integers up to 64 bits are supported. Thread may be T for the current thread, or a BT:THREAD. If the function is unsupported a constant of all 1s is returned. When setting this place, the *actual* affinity mask of the thread is returned, which may differ from the one you tried to set. See MACHINE-CORES
-
EXTERNAL FUNCTION (SETF THREAD-CORE-MASK)
- MASK
- THREAD
- &REST
No documentation provided. -
EXTERNAL FUNCTION THREAD-PRIORITY
- THREAD
- &REST
Accessor to the scheduler priority of the thread. The priority can be one of the following values, in ascending order of importance: :IDLE :LOW :NORMAL :HIGH :REALTIME Thread may be T for the current thread, or a BT:THREAD. If the function is unsupported :NORMAL is returned in all cases. When setting this place, the *actual* priority of the thread is returned, which may differ from the one you tried to set. See PROCESS-PRIORITY
-
EXTERNAL FUNCTION (SETF THREAD-PRIORITY)
- THREAD
- PRIORITY
- &REST
No documentation provided. -
EXTERNAL FUNCTION THREAD-TIME
- THREAD
- &REST
Returns the amount of processing time spent by this thread in seconds. This does not include time spent in the kernel. Thread may be T for the current thread, or a BT:THREAD. If the function is unsupported a constant 0.0d0 is returned. See MACHINE-TIME See PROCESS-TIME See GC-TIME See GPU-TIME
-