Concepts
Subprocesses and child processes
One recording holds every Python process that the command started, each linked to the process that started it, and says which Python processes it missed.
ormaos run records every Python process the command creates, not only the first one: Python subprocesses and multiprocessing children are in the same recording, each linked to the process that started it.
How a child is recorded#
The recorder starts in a child process through the ormaos.pth file that the package installs, driven by environment variables (ORMAOS_DIR, ORMAOS_PATH, ORMAOS_IO). A child is recorded when:
- it runs a Python in which
ormaosis installed, - with its site packages (not
-S), - and with
ORMAOS_DIRin its environment.
ormaos status says whether the recorder starts by itself here (starts by itself under run: yes).
What the recording says about them#
ormaos show --fulllists every process: its pid, its parent, the Python and its path, what it recorded, its counts and how it ended.- A process that a signal ended is named with the signal and who sent it: its pool, the program (
terminate(),kill(),os.kill), or a signal the program was not seen sending. - When the program started a Python with
subprocessand that Python was not recorded, the recording says how many are missing. That count comes from the I/O events, so with--no-ioit is not made, andnot_collectedsays so. When no Python at all was recorded, it says that.
Which process an event is in#
Every call, exception, I/O event and logging record says which process it ran in, as a small number of the recording (process 1, process 2). ormaos run waits up to one second at the end for Python processes of the recording that are still alive, so that the summary does not call the recording incomplete because of them.
Subprocesses as I/O#
A program started with subprocess or os.exec*/os.posix_spawn is also an I/O event of kind subprocess: its name and how many arguments, never the arguments, environment or output. os.system is recorded as system shell and os.fork as fork.