Inside the machine
| Command | Does |
|---|---|
machine tasks |
List the tasks the machine runs |
machine meminfo |
Show the machine’s memory |
machine diskinfo |
Show the machine’s root filesystem |
machine syscalls |
List the system calls, by number |
machine ints |
List the interrupt vectors |
machine focus |
Show and change which tasks a machine steers |
machine send |
Send input to a device of a run |
machine exec |
Execute a command in the machine |
machine put |
Put a file into the machine or a container |
machine get |
Get a file from the machine or a container |
machine containers |
List the containers, or stop, kill, crash, pause or limit one |
machine net |
Show the faults of each container’s link, or put faults on one |
machine core |
Get a core dump of a process |
machine profile |
Profile what the machine runs |
machine irq |
Inject an interrupt into the vCPUs |
machine irqs |
List the interrupts of a machine |
machine inject |
Inject faults into the machine’s system calls and kernel |
machine axis |
Set the defaults of the draw axes a run uses |
machine vtime |
Show and change machine time |
machine clock |
Show and change the machine’s date and each container’s |
machine rng |
Show and seed the RNG device of a machine |
machine decisions |
Show and change how a program’s decisions are answered |
machine coverage |
List the coverage modules of a run and the edges hit |
machine tasks
List the tasks the guest runs. See Looking at tasks.
A task is what the guest kernel schedules: a thread of a program, or the kernel’s own. Each task has a tid. Its tgid names its thread group, the process it belongs to.
Each row is one task, by its tid, the thread id ps -L shows. Its tgid is the pid
of its process. Use --vcpu to list the tasks of one vCPU. Use --focused to
list the tasks that focus steers.
The subcommands steer the scheduler, so an order of tasks can be tried. The hold, yield and release subcommands control whether a task runs.
The slice subcommand sets how long a task runs. The pin subcommand places it on a vCPU. The cgroups subcommand groups the list. The exits subcommand lists the tasks that left.
1 | machine tasks [-h] [--vcpu n] [--focused] run command ... |
| Argument | Does |
|---|---|
run |
Run name |
| Option | Does |
|---|---|
--vcpu n |
Only tasks on this vCPU |
--focused |
Only the tasks focus is steering |
Examples:
1 | machine tasks run1 the tasks in run1's machine |
Prints:
1 | TGID TID the tgid, and the task of it |
Refuses, and the way past:
1 | a machine not yet up machine run run1 --until tasks |
See also:
machine tasks list
List the tasks.
The listing is the one the command prints with no verb. Use --vcpu to list the
tasks of one vCPU.
1 | machine tasks run list [-h] [--vcpu n] [--focused] |
| Option | Does |
|---|---|
--vcpu n |
Only tasks on this vCPU |
--focused |
Only the tasks focus is steering |
Examples:
1 | machine tasks run1 list every task |
See also:
machine tasks cgroups
List the tasks grouped by cgroup. See Holding threads.
Use --vcpu to list the tasks of one vCPU.
1 | machine tasks run cgroups [-h] [--vcpu n] |
| Option | Does |
|---|---|
--vcpu n |
Only tasks on this vCPU |
Examples:
1 | machine tasks run1 cgroups tasks grouped by cgroup |
See also:
machine tasks exits
List the tasks that exited and how each one ended. See Holding threads.
The list is kept across checkpoints and replays. It is bounded and says how many it dropped.
1 | machine tasks run exits [-h] |
Examples:
1 | machine tasks run1 exits tasks that left, newest last |
Prints:
1 | text TGID TID COMM OUTCOME |
See also:
machine tasks exist
Assert that the machine runs a program, a comm, a tid or a tgid.
The command lists the tasks that match and is refused when none does. It takes
the words inject add takes for --in, except all.
A program is the absolute path of the file it runs, the EXE that tasks shows. A symlink’s path matches no task.
The command reads the task table. It changes nothing in the machine and the run records nothing.
1 | machine tasks run exist [-h] path|comm=name|tid=n|tgid=n |
| Argument | Does |
|---|---|
path|comm=name|tid=n|tgid=n |
Program by absolute path, comm, tid or tgid |
Examples:
1 | machine tasks run1 exist /usr/bin/app is /usr/bin/app running |
See also:
machine tasks hold
Take a task off the runqueue. See Holding threads.
The scheduler cannot pick a held task. Every vCPU makes a scheduling decision before the run goes on. Holding the last runnable task leaves nothing to run. Release it to go on.
1 | machine tasks run hold [-h] tid |
| Argument | Does |
|---|---|
tid |
Task, by its tid |
Examples:
1 | machine tasks run1 hold 56 hold tid 56 |
See also:
machine tasks yield
Put a task behind its peers. See Holding threads.
The task stays runnable. It does nothing when no peer is runnable. A yield takes effect at once, as a hold does.
1 | machine tasks run yield [-h] tid |
| Argument | Does |
|---|---|
tid |
Task, by its tid |
Examples:
1 | machine tasks run1 yield 56 put tid 56 behind its peers |
See also:
machine tasks release
Undo a hold or a yield. See Holding threads.
A release takes effect at once, as a hold does.
1 | machine tasks run release [-h] tid |
| Argument | Does |
|---|---|
tid |
Task, by its tid |
Examples:
1 | machine tasks run1 release 56 undo hold and yield |
See also:
machine tasks slice
Set how long a task runs between decisions. See Holding threads.
A decision is a scheduling decision of the vCPU. Give a duration with a unit, such as 10us, 0.6ms or 750000ns. Use default for the kernel’s own. A slice survives release.
1 | machine tasks run slice [-h] tid duration|default |
| Argument | Does |
|---|---|
tid |
Task, by its tid |
duration|default |
Duration with a unit, or default |
Examples:
1 | machine tasks run1 slice 56 600us run tid 56 for 600 us |
See also:
machine tasks pin
Place a task on one or more vCPUs when it next wakes. See Holding threads.
A set of vCPUs is one number, 1, or a range, 1-3, both ends included.
Free means any vCPU. None means no vCPU, which stops the task running.
Pin is a placement policy, not confinement. A task already queued elsewhere keeps that vCPU until it wakes.
1 | machine tasks run pin [-h] tid set|free|none |
| Argument | Does |
|---|---|
tid |
Task, by its tid |
set|free|none |
Set of vCPUs to place the task on, such as 1 or 0-2; free for any, none for no vCPU |
Examples:
1 | machine tasks run1 pin 56 2 place tid 56 on vCPU 2 |
See also:
machine tasks signal
Send a task a signal.
The guest sends the signal at its next entry from user mode, as GDB’s signal command delivers one. The task acts on it when it next runs. The run log keeps the request, so a replay sends it at the same instruction.
1 | machine tasks run signal [-h] tid signal |
| Argument | Does |
|---|---|
tid |
Task, by its tid |
signal |
Signal by name, such as SIGTERM or TERM, or by number |
Examples:
1 | machine tasks run1 signal 56 SIGTERM send tid 56 SIGTERM |
See also:
machine meminfo
Show the guest’s memory.
The command shows the guest’s memory as free -h shows it. Then it shows the dirty pages and the memory events since boot.
The machine reads the guest kernel’s own counters from guest memory with the guest stopped. Nothing runs in the guest, and the run records nothing. The answer agrees with /proc/meminfo in the guest.
1 | machine meminfo [-h] run |
| Argument | Does |
|---|---|
run |
Run name |
Examples:
1 | machine meminfo run1 the guest's memory, as free -h shows it |
Refuses, and the way past:
1 | a run on an older guest kernel machine create run2 --disk hello |
See also:
machine diskinfo
Show the guest’s root filesystem.
The command shows the root filesystem’s size, use and inodes as df shows them. Then it shows its device’s reads and writes since boot.
The machine reads the guest kernel’s own counters from guest memory with the guest stopped. Nothing runs in the guest, and the run records nothing. The space agrees with df in the guest before a sync.
The root is the filesystem the kernel mounted at boot. Its space is read on ext2, ext3 and ext4.
1 | machine diskinfo [-h] run |
| Argument | Does |
|---|---|
run |
Run name |
Examples:
1 | machine diskinfo run1 the root filesystem, as df shows it |
Refuses, and the way past:
1 | a run on an older guest kernel machine create run2 --disk hello |
See also:
machine syscalls
List the system calls, by number. See Looking at tasks.
A name filters the list to calls whose name contains that text.
A task shows its syscall histogram instead. Name a task by tid, tgid, absolute
path, cgroup=path or comm=name. The histogram counts calls made while the focus
entry of the task was armed with focus add <path> +syscalls.
1 | machine syscalls [-h] run [name|tid|tgid|path] |
| Argument | Does |
|---|---|
run |
Run name |
[name|tid|tgid|path] |
Filter the list, or a task to show its histogram |
Examples:
1 | machine syscalls run1 the system calls of the machine |
See also:
machine ints
List the interrupt vectors. See Looking at tasks.
One row per IDT vector that the machine has a handler for. The vector is in hex, as the table is indexed. A name filters to handlers whose name contains that text.
A task shows its interrupt histogram instead. Name a task by tid, tgid, absolute
path, cgroup=path or comm=name. The histogram counts interrupts taken while the
focus entry of the task was armed with focus add <path> +ints.
1 | machine ints [-h] run [name|tid|tgid|path] |
| Argument | Does |
|---|---|
run |
Run name |
[name|tid|tgid|path] |
Filter the list, or a task to show its histogram |
Examples:
1 | machine ints run1 the interrupt vectors of the machine |
See also:
machine focus
Show and change which tasks a machine steers. See Focus.
The focus list names the programs the machine steers. A run stops at each
context switch of a focused program, and where the program reaches its own code.
A run with --iters 0 and neither --until nor --within goes on through
switches until it stops. The tasks subcommands then decide which task runs next.
A program is named by its absolute path, matched exactly. Write cgroup=<path>
to match the cgroup of a task. Write tgid=<n> to name a tgid. The tgid of a
task is shown by tasks.
Write comm=<name> to focus each process with a task of that comm, as inject
add and tasks exist read it. A comm names a busybox applet or a script, which a
path cannot. A task renamed after exec is seen at the next fork, exec or exit.
Use add and remove to change the list. Use clear to empty it.
1 | machine focus [-h] run command ... |
| Argument | Does |
|---|---|
run |
Run name |
Examples:
1 | machine focus run1 what is focused |
Prints:
1 | Focus each program or cgroup named, and what is counted for it |
See also:
machine focus add
Steer another program. See Focus.
The entry is a program path, cgroup=<path>, comm=<name> or tgid=<n>. Add
+syscalls or +ints to count its system calls or interrupts.
1 | machine focus run add [-h] path|cgroup=path|comm=name|tgid=n [+syscalls|+ints ...] |
| Argument | Does |
|---|---|
path|cgroup=path|comm=name|tgid=n |
Program path, cgroup, comm, or tgid to match |
[+syscalls|+ints ...] |
Count this program’s syscalls or interrupts |
Examples:
1 | machine focus run1 add /test focus the program /test |
See also:
machine focus remove
Stop steering a program. See Focus.
Name the entry as it was added, by program path, cgroup=<path>, comm=<name>
or tgid=<n>.
1 | machine focus run remove [-h] path|cgroup=path|comm=name|tgid=n |
| Argument | Does |
|---|---|
path|cgroup=path|comm=name|tgid=n |
Program path, cgroup, comm, or tgid to match |
Examples:
1 | machine focus run1 remove /test stop focusing /test |
See also:
machine focus clear
Empty the list of steered programs. See Focus.
1 | machine focus run clear [-h] |
Examples:
1 | machine focus run1 clear focus nothing |
See also:
machine send
Send input to a device of a run.
The command writes bytes to a serial port, the virtio console or the keyboard of a run. A program in the guest reads them from the device, as it reads what a person types.
The text is sent as written, and a newline follows it, which is Enter. Use -n to send no newline. Use -e to read escapes in the text, so that Ctrl-C is \x03.
The text - sends standard input as it is. The command adds no newline to it and reads no escape in it.
At the control prompt the command is /send. The text is the rest of the line after the options, with its quotes. A semicolon inside quotes does not end the command. A pair of quotes around the whole text keeps the spaces at its ends.
The keyboard takes text and types it on a US keyboard. The machine presses and releases a key for each character. It holds Shift or Ctrl where the character needs one.
A device that begins with a slash is the path of a file in the machine. The bytes go at the end of the file. A pipe is such a file. A program that reads its input from a pipe is sent input this way.
A process of the machine writes the file, and the command prints its id. The exec proc subcommand says whether the bytes were written.
The command does not run the machine. It queues the bytes and returns. The device takes them the next time the run executes, and the run records them there. A replay reproduces them.
Use fork to send other input than a run recorded. The branch takes its own.
1 | machine send [-h] [-n] [-e] [--device name] run text |
| Argument | Does |
|---|---|
run |
Run name |
text |
Text to send, or - to send standard input as it is |
| Option | Does |
|---|---|
-n |
Send no newline after the text |
-e |
Read the escapes \n, \r, \t, \b, \e, \0, \ and \xNN in the text |
--device name |
Device to send to: console, ttyS0 to ttyS3, hvc0 or keyboard, or the path of a file in the machine (default: console) |
Examples:
1 | machine send run1 ls type ls and Enter on the console |
Prints:
1 | text Queued <n> bytes for <device> of <run> (<id>) |
Refuses, and the way past:
1 | a machine that is replaying machine fork run1 --name try2 |
See also:
machine exec
Execute a command in the guest.
A command is a program of the machine’s disk and its arguments, written after two dashes. No shell reads it. Use -c to give a line to the shell of the disk, with its pipes and redirections.
The run subcommand executes it and runs the machine until it exits. The start subcommand sends it and returns.
Each command is a process with an id. The run records what the process prints and how it ends, each line at its entry. A replay reproduces them, and a branch has the processes of its parent.
Without a subcommand the command lists the processes of the run. The proc subcommand shows one.
The id is the entry the command was sent at and the process number, 23090p1. In
the machine, its output is in /.machine/output/exec/ID/stdout and stderr. Its
events are in /.machine/output/exec/ID/status. The output source
/output/exec/ID/stdout names the first in output and run --until.
The machine’s disk runs the agent that executes the commands, /sbin/machine-exec. A disk without it executes none.
1 | machine exec [-h] run command ... |
| Argument | Does |
|---|---|
run |
Run name |
Examples:
1 | machine exec run1 the processes of run1 |
Prints:
1 | text ID PID STATE ENTRIES COMMAND |
See also:
machine exec run
Execute a command and run the machine until it exits.
The command prints what the command printed, its standard output and its standard error each on its own. The exit status is that of the command.
Use --container to execute it in a container. The command then has the
environment of the container. Use --user to choose the user it runs as there.
Use --net to run a program of the machine on a container’s network, such as
tcpdump on its eth0. The program has the machine’s files and the container’s
interfaces.
The machine runs until the command ends. Other programs of the machine run with it.
A command gets 30 minutes of machine time to end. Use --within to give it
another. A command that has not ended by then stays, and the refusal names its
id.
1 | machine exec run run [-h] [-c line] [--container name] [--user user] [--net name] |
| Argument | Does |
|---|---|
[command ...] |
The command and its arguments, after -- |
| Option | Does |
|---|---|
-c line |
A line for the shell of the machine’s disk, in place of a command |
--container name |
Container to execute it in, by its id, its name or its Compose service (default: the machine itself) |
--user user |
User the command runs as in the container, such as root or 1000:1000 |
--net name |
Container whose network a program of the machine runs on, by its id, its name or its Compose service |
--within duration |
Machine time the command gets to end in, such as 10s (default: 30m) |
Examples:
1 | machine exec run1 run -- ls -la / execute ls and print its output |
Prints:
1 | text what the command printed, and its exit status |
Refuses, and the way past:
1 | a machine that is replaying machine fork run1 --name try2 |
See also:
machine exec start
Send a command to execute and return.
The command prints the id of the process. The machine does not run. The process starts the next time the run executes.
Use the proc subcommand with the id to read the process.
Use --container to execute it in a container. Use --net to run a program of
the machine on a container’s network.
1 | machine exec run start [-h] [-c line] [--container name] [--user user] [--net name] |
| Argument | Does |
|---|---|
[command ...] |
The command and its arguments, after -- |
| Option | Does |
|---|---|
-c line |
A line for the shell of the machine’s disk, in place of a command |
--container name |
Container to execute it in, by its id, its name or its Compose service (default: the machine itself) |
--user user |
User the command runs as in the container, such as root or 1000:1000 |
--net name |
Container whose network a program of the machine runs on, by its id, its name or its Compose service |
Examples:
1 | machine exec run1 start -- sleep 5 send it and return its id |
Prints:
1 | text Sent <id> to <run> (<id>) |
Refuses, and the way past:
1 | a machine that is replaying machine fork run1 --name try2 |
See also:
machine exec proc
Show a process: its state, its output and its events.
The summary has the command, the pid, the state and how the process ended. A process is pending until the machine runs and the guest takes the request.
The events view lists every line the process printed and every change of its state, each with its entry. The stdout and stderr views print one stream. The exits view prints how the process ended.
In the machine, the streams are /.machine/output/exec/ID/stdout and /.machine/output/exec/ID/stderr.
1 | machine exec run proc [-h] id [{summary,events,stdout,stderr,exits}] |
| Argument | Does |
|---|---|
id |
Process id |
[{summary,events,stdout,stderr,exits}] |
What to show: summary, events, stdout, stderr or exits (default: summary) |
Examples:
1 | machine exec run1 proc 40787p1 its state and how it ended |
Prints:
1 | summary Process Run Command Pid State Entries Stdout Stderr |
Refuses, and the way past:
1 | a process the guest has not taken machine run run1 |
See also:
machine put
Put a file into the guest or a container.
The command copies a file on this computer to a path in the running machine. Use
--container to put it in a container instead. A file of any size is put. The
directories on the way to the path are made.
The file has its name only once all of it is written, so a program never reads part of it. A file already at the path is replaced.
The machine runs while the file goes in. Other programs of the machine run with it. The bytes are a recorded input, so a replay puts the same file.
The file is written to the disk before the command returns. A checkpoint taken after it has the file, and fs reads it there.
1 | machine put [-h] [--container name] [--mode mode] [--owner uid:gid] [--no-pipe] |
| Argument | Does |
|---|---|
run |
Run name |
file |
File on this computer to put, or - for standard input |
path |
Path the file gets in the machine or in the container |
| Option | Does |
|---|---|
--container name |
Container to put the file in, by its id, its name or its Compose service (default: the machine itself) |
--mode mode |
Mode of the file, as octal digits (default: 644) |
--owner uid:gid |
Owner of the file, as numbers (default: root) |
--no-pipe |
Send the file over the serial port instead of the faster data channel |
--within duration |
Machine time allowed each time the command runs the machine, such as 10s (default: 30m) |
Examples:
1 | machine put run1 ./a.conf /etc/a.conf into the machine |
Prints:
1 | text Put <n> bytes at <path> of <run> (<id>) |
Refuses, and the way past:
1 | a machine that is replaying machine fork run1 --name try2 |
See also:
machine get
Get a file from the guest or a container.
The command copies a file of the running machine to a file on this computer. Use
--container to get it from a container instead. A file of any size is copied.
The file is read as it is now, with what programs wrote and the disk does not have yet. The fs command reads the disk at a checkpoint instead.
The machine runs while the file comes out. Other programs of the machine run with it, so a file a program is writing can change on the way.
1 | machine get [-h] [--container name] [--within duration] run path file |
| Argument | Does |
|---|---|
run |
Run name |
path |
Path of the file in the machine or in the container |
file |
File on this computer to write, or - for standard output |
| Option | Does |
|---|---|
--container name |
Container to get the file from, by its id, its name or its Compose service (default: the machine itself) |
--within duration |
Machine time allowed each time the command runs the machine, such as 10s (default: 30m) |
Examples:
1 | machine get run1 /etc/a.conf ./a.conf from the machine |
Prints:
1 | text Got <n> bytes from <path> of <run> (<id>) |
Refuses, and the way past:
1 | a machine that is replaying machine fork run1 --name try2 |
See also:
machine containers
List the containers, or stop, kill, crash, pause or limit one.
The command prints each container with its Compose service, its state and its image. Stopped containers are listed too. A container that no service started has no service.
A verb puts a fault on one container while the others run: a node of a cluster that stops, dies, loses power, freezes or starves. Throttle limits its CPU, and memory its memory. Pids, files and ports run it out of processes, open files and local ports.
A limit holds when the container starts again, until it is lifted. A container
that Compose recreates starts without it. A limit set with --for is set back
after the duration, whichever start of the container runs then.
Every command that takes a container takes its id, its name or its Compose service. An id is the surer way to name one. The machine knows an id as soon as Docker creates the container. It knows a name shortly after the container starts.
A running container is found with the machine stopped. A name not known yet is refused, and its id works. A service stands for its one running container. The start verb asks Docker for a stopped container.
A name is matched first, then a service, then an id. An id takes 12 hex digits or more, as docker ps prints it.
The machine runs until Docker has answered. The list is of the machine as it is then. The command runs processes in the machine, and the run records them, so a replay acts at the same point.
1 | machine containers [-h] [--within duration] run command ... |
| Argument | Does |
|---|---|
run |
Run name |
| Option | Does |
|---|---|
--within duration |
Machine time the command gets to end in, such as 10s (default: 30m) |
Examples:
1 | machine containers run1 the containers of run1 |
Prints:
1 | text SERVICE CONTAINER ID STATE IMAGE ADDRESS LINK LIMITS |
Refuses, and the way past:
1 | a machine that is replaying machine fork run1 --name try2 |
See also:
machine containers stop
Stop a container.
The container’s processes get SIGTERM, and SIGKILL after the grace period. A program that handles SIGTERM exits on its own first.
The container stays down. Use --restart 5s to start it again after 5 seconds
of machine time. Use --restart 0 to start it at once. Other containers keep
running while it is down.
A container started again keeps its writable layer and its volumes. Use
--fresh to start it from its image instead, as Compose recreates a service.
Its volumes are kept.
1 | machine containers run stop [-h] [--grace duration] [--restart duration|never] [--fresh] |
| Argument | Does |
|---|---|
container |
Container, by its id, its name or its service’s |
| Option | Does |
|---|---|
--grace duration |
Machine time between SIGTERM and SIGKILL, such as 5s (default: 10s) |
--restart duration|never |
Start it again after this machine time, 0 at once (default: never) |
--fresh |
Start it from its image, its writable layer discarded |
Examples:
1 | machine containers run1 stop db db stops |
Refuses, and the way past:
1 | a container that is not running or paused machine containers run1 start db |
See also:
machine containers kill
Kill a container.
Every process of the container gets SIGKILL and no cleanup runs. What the programs wrote stays, since the guest’s kernel writes it out.
The container stays down. Use --restart 5s to start it again after 5 seconds
of machine time. Use --restart 0 to start it at once. Other containers keep
running while it is down.
A container started again keeps its writable layer and its volumes. Use
--fresh to start it from its image instead, as Compose recreates a service.
Its volumes are kept.
1 | machine containers run kill [-h] [--restart duration|never] [--fresh] container |
| Argument | Does |
|---|---|
container |
Container, by its id, its name or its service’s |
| Option | Does |
|---|---|
--restart duration|never |
Start it again after this machine time, 0 at once (default: never) |
--fresh |
Start it from its image, its writable layer discarded |
Examples:
1 | machine containers run1 kill db db dies |
Refuses, and the way past:
1 | a container that is not running or paused machine containers run1 start db |
See also:
machine containers crash
Cut a container as a power cut cuts a node.
The container’s volumes lose the writes they had not synced, and it dies. The others run on. A volume keeps what was synced, and loses the writes still in memory.
A crash cuts the volumes the project’s x-machine names, each a filesystem of its own. Name one by its path in the container to cut it alone. A volume replays its journal when the container starts again.
The container is frozen first, and the cut is when its volumes stop writing to the disk. A write the kernel finishes between the two is kept. A volume that another running container mounts is refused, since the cut would fail its writes too.
The container stays down. Use --restart 5s to start it again after 5 seconds
of machine time. Use --restart 0 to start it at once. Other containers keep
running while it is down.
A container started again keeps its writable layer and its volumes. Use
--fresh to start it from its image instead, as Compose recreates a service.
Its volumes are kept.
1 | machine containers run crash [-h] [--restart duration|never] [--fresh] container [path] |
| Argument | Does |
|---|---|
container |
Container, by its id, its name or its service’s |
[path] |
A volume’s path in the container, to cut it alone (default: every volume) |
| Option | Does |
|---|---|
--restart duration|never |
Start it again after this machine time, 0 at once (default: never) |
--fresh |
Start it from its image, its writable layer discarded |
Examples:
1 | machine containers run1 crash db a power cut of db |
Refuses, and the way past:
1 | a container with no volume of its own machine containers run1 |
See also:
machine containers start
Start a container that is down.
Use --fresh to start it from its image, as Compose recreates a service. Its
writable layer is discarded and its volumes are kept.
1 | machine containers run start [-h] [--fresh] container |
| Argument | Does |
|---|---|
container |
Container, by its id, its name or its service’s |
| Option | Does |
|---|---|
--fresh |
Start it from its image, its writable layer discarded |
Examples:
1 | machine containers run1 start db db runs again |
Refuses, and the way past:
1 | a container that is running machine containers run1 |
See also:
machine containers pause
Freeze a container.
The container’s processes are frozen using the cgroup freezer. Other containers
see it as unresponsive. Use --for 5s to thaw it after 5 seconds of machine
time. Use resume to thaw it now.
1 | machine containers run pause [-h] [--for duration] container |
| Argument | Does |
|---|---|
container |
Container, by its id, its name or its service’s |
| Option | Does |
|---|---|
--for duration |
Thaw it after this machine time, such as 5s |
Examples:
1 | machine containers run1 pause db db freezes |
Refuses, and the way past:
1 | a container that is not running machine containers run1 |
See also:
machine containers resume
Thaw a frozen container.
1 | machine containers run resume [-h] container |
| Argument | Does |
|---|---|
container |
Container, by its id, its name or its service’s |
Examples:
1 | machine containers run1 resume db db thaws |
Refuses, and the way past:
1 | a container that is not paused machine containers run1 |
See also:
machine containers list
List the containers.
The command prints each container with its Compose service, its state and its image. Each running one has its addresses, its links and the limits of its cgroup. The listing is the one the command prints with no verb.
1 | machine containers run list [-h] |
Examples:
1 | machine containers run1 list each container and its limits |
See also:
machine containers throttle
Limit the CPU of a container.
The container’s cgroup gets a CPU quota of the number of CPUs given. A number of 0 sets back the container’s own limit, its Compose file’s or none. The limit holds when the container starts again.
Use --for 30s to restore the previous limit after 30 seconds of machine time.
1 | machine containers run throttle [-h] --cpus n [--for duration] container |
| Argument | Does |
|---|---|
container |
Container, by its id, its name or its service’s |
| Option | Does |
|---|---|
--cpus n |
CPUs it may use, such as 0.1; 0 for the container’s own limit |
--for duration |
Restore the previous limit after this machine time, such as 30s |
Examples:
1 | machine containers run1 throttle db --cpus 0.1 a tenth of a CPU |
Refuses, and the way past:
1 | a container that is not running machine containers run1 |
See also:
machine containers memory
Limit the memory of a container.
The container’s processes may use the memory given and no more. A size of 0 sets back the container’s own limit, its Compose file’s or none. The limit holds when the container starts again.
A limit below what they use makes the guest kernel reclaim memory. What it cannot reclaim, its out-of-memory killer takes: a process of the container is killed.
A soft limit, with --soft, is the memory past which the kernel reclaims and
slows the processes. It kills none of them, and the hard limit stays as it was.
Use --for 30s to restore the previous limit after 30 seconds of machine time.
1 | machine containers run memory [-h] [--soft] [--for duration] container size |
| Argument | Does |
|---|---|
container |
Container, by its id, its name or its service’s |
size |
Memory it may use, such as 256m or 1g; 0 for the container’s own limit |
| Option | Does |
|---|---|
--soft |
Reclaim and slow its processes past the size, and kill none |
--for duration |
Restore the previous limit after this machine time, such as 30s |
Examples:
1 | machine containers run1 memory db 256m db may use 256MB |
See also:
machine containers pids
Limit the processes of a container.
The container’s processes and threads may number the count given and no more. A count of 0 sets back the container’s own limit, its Compose file’s or none. The limit holds when the container starts again.
Past the limit, a fork or a new thread in the container fails with EAGAIN. The processes already running go on.
Use --for 30s to restore the previous limit after 30 seconds of machine time.
1 | machine containers run pids [-h] [--for duration] container count |
| Argument | Does |
|---|---|
container |
Container, by its id, its name or its service’s |
count |
Processes and threads it may have; 0 for the container’s own limit |
| Option | Does |
|---|---|
--for duration |
Restore the previous limit after this machine time, such as 30s |
Examples:
1 | machine containers run1 pids db 50 50 processes and threads |
See also:
machine containers ports
Narrow the ephemeral ports of a container.
A connection the container opens takes its local port from the range given. A range of 0 sets back the container’s own range, its Compose file’s or the kernel’s 32768-60999. The range holds when the container starts again.
Once every port of the range is taken for one destination, a connect to it fails with EADDRNOTAVAIL. Two connections to different destinations can share a port. A program that binds port 0 before it connects gets EADDRINUSE. A port stays taken after its connection closes, in TIME_WAIT for 60 seconds.
The range applies to every process on the container’s network. The command refuses a container on the machine’s network. It also refuses a container that uses another container’s network.
Use --for 30s to restore the previous range after 30 seconds of machine time.
1 | machine containers run ports [-h] [--for duration] container range |
| Argument | Does |
|---|---|
container |
Container, by its id, its name or its service’s |
range |
Ports it may connect from, such as 32768-32770; 0 for the container’s own |
| Option | Does |
|---|---|
--for duration |
Restore the previous limit after this machine time, such as 30s |
Examples:
1 | machine containers run1 ports api 40000-40009 10 ports |
Refuses, and the way past:
1 | a container on the machine's network machine containers run1 |
See also:
machine containers files
Limit the open files of a container.
Each process of the container may hold open the count of files given and no more. A socket or a pipe counts as a file. A count of 0 sets back the container’s own limit.
Past the limit, an open, a socket or an accept fails with EMFILE. A file already open stays open.
The limit is set on the processes that run now, and what they start takes it. A process docker exec starts takes the container’s own limit. The limit holds when the container starts again.
Use --for 30s to restore the previous limit after 30 seconds of machine time.
1 | machine containers run files [-h] [--for duration] container count |
| Argument | Does |
|---|---|
container |
Container, by its id, its name or its service’s |
count |
Files each process may hold open; 0 for the container’s own limit |
| Option | Does |
|---|---|
--for duration |
Restore the previous limit after this machine time, such as 30s |
Examples:
1 | machine containers run1 files api 64 64 open files |
See also:
machine net
Show the faults of each container’s link, or put faults on one.
A link connects a container to a peer. A fault acts on the packets the container sends. The command delays them, loses some, sends some twice, changes them, sends them out of order or limits their rate. It holds them and releases them together.
The command cuts two containers apart, one way or both. It resets their TCP connections. It shows and changes a container’s neighbour table.
A fault is on every packet the container sends, or on the packets a match takes. A match names a peer, a protocol, a port or TCP SYNs. ARP is a protocol a match names. A fault on one match leaves the container’s other links as they are.
The faults are part of the machine. The run records each change, and a replay makes it at the same point. A checkpoint keeps a link’s faults.
Every command that takes a container takes its id, its name or its Compose service, as containers does. The machine runs until the link is set.
1 | machine net [-h] [--within duration] run command ... |
| Argument | Does |
|---|---|
run |
Run name |
| Option | Does |
|---|---|
--within duration |
Machine time the command gets to end in, such as 10s (default: 30m) |
Examples:
1 | machine net run1 each link and its faults |
See also:
machine net delay
Delay the packets a container sends.
Each packet waits the delay before it leaves, give or take the jitter. A delay of 0 takes the delay away. The link keeps its other faults.
Use --to db to put the fault on what the container sends to db alone. Use
--proto, --port and --syn to take some packets alone, such as port 5432. A
packet a match takes gets only the match’s faults, not the whole link’s.
The link draws from a seed, so a replay acts on the same packets. Use --seed
to give one. A link keeps its seed, and a link without one draws a new seed.
Use --for 30s to set back what the command set after 30 seconds of machine
time. The link keeps a change made in between.
Use --log to write each decision of the fault to /output/drop/.machine/net, a
file for each container. The run drops that output unless it keeps it.
1 | machine net run delay [-h] [--jitter duration] [--to container] |
| Argument | Does |
|---|---|
container |
Container, by its id, its name or its service’s |
delay |
Delay of each packet, such as 100ms |
| Option | Does |
|---|---|
--jitter duration |
Each packet’s delay differs by up to this, such as 20ms |
--to container |
The packets to this container alone (default: to every peer) |
--proto {tcp,udp,icmp,arp} |
The packets of this protocol alone |
--port n |
The packets with this source or destination port alone |
--syn |
The TCP SYNs that open a connection alone |
--seed n |
Seed of the draws (default: the link’s seed, or one drawn) |
--for duration |
Set the link back after this machine time, such as 30s |
--log, --no-log |
Write each decision of the fault to the container’s log (default: as the link has it) |
Examples:
1 | machine net run1 delay db 100ms db's packets wait 100ms |
See also:
machine net loss
Lose some of the packets a container sends.
Each packet is lost by chance, the share given. A share of 0% takes the fault away. The link keeps its other faults.
Use --to db to put the fault on what the container sends to db alone. Use
--proto, --port and --syn to take some packets alone, such as port 5432. A
packet a match takes gets only the match’s faults, not the whole link’s.
The link draws from a seed, so a replay acts on the same packets. Use --seed
to give one. A link keeps its seed, and a link without one draws a new seed.
Use --for 30s to set back what the command set after 30 seconds of machine
time. The link keeps a change made in between.
Use --log to write each decision of the fault to /output/drop/.machine/net, a
file for each container. The run drops that output unless it keeps it.
1 | machine net run loss [-h] [--to container] [--proto {tcp,udp,icmp,arp}] [--port n] [--syn] |
| Argument | Does |
|---|---|
container |
Container, by its id, its name or its service’s |
share |
Share of the packets, such as 10% |
| Option | Does |
|---|---|
--to container |
The packets to this container alone (default: to every peer) |
--proto {tcp,udp,icmp,arp} |
The packets of this protocol alone |
--port n |
The packets with this source or destination port alone |
--syn |
The TCP SYNs that open a connection alone |
--seed n |
Seed of the draws (default: the link’s seed, or one drawn) |
--for duration |
Set the link back after this machine time, such as 30s |
--log, --no-log |
Write each decision of the fault to the container’s log (default: as the link has it) |
Examples:
1 | machine net run1 loss db 10% a tenth of db's packets lost |
See also:
machine net duplicate
Send some of a container’s packets twice.
Each packet is sent twice by chance, the share given. A share of 0% takes the fault away. The link keeps its other faults.
Use --to db to put the fault on what the container sends to db alone. Use
--proto, --port and --syn to take some packets alone, such as port 5432. A
packet a match takes gets only the match’s faults, not the whole link’s.
The link draws from a seed, so a replay acts on the same packets. Use --seed
to give one. A link keeps its seed, and a link without one draws a new seed.
Use --for 30s to set back what the command set after 30 seconds of machine
time. The link keeps a change made in between.
Use --log to write each decision of the fault to /output/drop/.machine/net, a
file for each container. The run drops that output unless it keeps it.
1 | machine net run duplicate [-h] [--to container] [--proto {tcp,udp,icmp,arp}] [--port n] |
| Argument | Does |
|---|---|
container |
Container, by its id, its name or its service’s |
share |
Share of the packets, such as 10% |
| Option | Does |
|---|---|
--to container |
The packets to this container alone (default: to every peer) |
--proto {tcp,udp,icmp,arp} |
The packets of this protocol alone |
--port n |
The packets with this source or destination port alone |
--syn |
The TCP SYNs that open a connection alone |
--seed n |
Seed of the draws (default: the link’s seed, or one drawn) |
--for duration |
Set the link back after this machine time, such as 30s |
--log, --no-log |
Write each decision of the fault to the container’s log (default: as the link has it) |
Examples:
1 | machine net run1 duplicate db 5% one packet in 20 sent twice |
See also:
machine net corrupt
Change a bit of some of the packets a container sends.
Each packet has one bit flipped by chance, the share given. A checksum finds most of them. A share of 0% takes the fault away. The link keeps its other faults.
Use --to db to put the fault on what the container sends to db alone. Use
--proto, --port and --syn to take some packets alone, such as port 5432. A
packet a match takes gets only the match’s faults, not the whole link’s.
The link draws from a seed, so a replay acts on the same packets. Use --seed
to give one. A link keeps its seed, and a link without one draws a new seed.
Use --for 30s to set back what the command set after 30 seconds of machine
time. The link keeps a change made in between.
Use --log to write each decision of the fault to /output/drop/.machine/net, a
file for each container. The run drops that output unless it keeps it.
1 | machine net run corrupt [-h] [--to container] [--proto {tcp,udp,icmp,arp}] [--port n] |
| Argument | Does |
|---|---|
container |
Container, by its id, its name or its service’s |
share |
Share of the packets, such as 10% |
| Option | Does |
|---|---|
--to container |
The packets to this container alone (default: to every peer) |
--proto {tcp,udp,icmp,arp} |
The packets of this protocol alone |
--port n |
The packets with this source or destination port alone |
--syn |
The TCP SYNs that open a connection alone |
--seed n |
Seed of the draws (default: the link’s seed, or one drawn) |
--for duration |
Set the link back after this machine time, such as 30s |
--log, --no-log |
Write each decision of the fault to the container’s log (default: as the link has it) |
Examples:
1 | machine net run1 corrupt db 1% one packet in 100 changed |
See also:
machine net reorder
Send some of a container’s packets ahead of the others.
Each packet is sent at once by chance, the share given, while the rest wait the link’s delay. A link to reorder needs a delay. A share of 0% takes the fault away.
Use --to db to put the fault on what the container sends to db alone. Use
--proto, --port and --syn to take some packets alone, such as port 5432. A
packet a match takes gets only the match’s faults, not the whole link’s.
The link draws from a seed, so a replay acts on the same packets. Use --seed
to give one. A link keeps its seed, and a link without one draws a new seed.
Use --for 30s to set back what the command set after 30 seconds of machine
time. The link keeps a change made in between.
Use --log to write each decision of the fault to /output/drop/.machine/net, a
file for each container. The run drops that output unless it keeps it.
1 | machine net run reorder [-h] [--to container] [--proto {tcp,udp,icmp,arp}] [--port n] |
| Argument | Does |
|---|---|
container |
Container, by its id, its name or its service’s |
share |
Share of the packets sent ahead, such as 25% |
| Option | Does |
|---|---|
--to container |
The packets to this container alone (default: to every peer) |
--proto {tcp,udp,icmp,arp} |
The packets of this protocol alone |
--port n |
The packets with this source or destination port alone |
--syn |
The TCP SYNs that open a connection alone |
--seed n |
Seed of the draws (default: the link’s seed, or one drawn) |
--for duration |
Set the link back after this machine time, such as 30s |
--log, --no-log |
Write each decision of the fault to the container’s log (default: as the link has it) |
Examples:
1 | machine net run1 reorder db 25% a quarter ahead of the delay |
See also:
machine net rate
Limit how fast a container sends.
The link sends at most the rate given, and the packets past it wait. A rate of 0 takes the limit away. The link keeps its other faults.
Use --to db to put the fault on what the container sends to db alone. Use
--proto, --port and --syn to take some packets alone, such as port 5432. A
packet a match takes gets only the match’s faults, not the whole link’s.
Use --for 30s to set back what the command set after 30 seconds of machine
time. The link keeps a change made in between.
Use --log to write each decision of the fault to /output/drop/.machine/net, a
file for each container. The run drops that output unless it keeps it.
1 | machine net run rate [-h] [--to container] [--proto {tcp,udp,icmp,arp}] [--port n] [--syn] |
| Argument | Does |
|---|---|
container |
Container, by its id, its name or its service’s |
rate |
Bits a second, such as 1mbit or 500kbit; 0 for no limit |
| Option | Does |
|---|---|
--to container |
The packets to this container alone (default: to every peer) |
--proto {tcp,udp,icmp,arp} |
The packets of this protocol alone |
--port n |
The packets with this source or destination port alone |
--syn |
The TCP SYNs that open a connection alone |
--for duration |
Set the link back after this machine time, such as 30s |
--log, --no-log |
Write each decision of the fault to the container’s log (default: as the link has it) |
Examples:
1 | machine net run1 rate db 1mbit db sends 1 megabit a second |
See also:
machine net partition
Cut the link between two containers.
Everything each container sends the other is lost, and their other links stay as
they are. Use --one-way to cut what the first sends the second alone. Use
--port 5432 to cut the packets of port 5432 alone.
Use --for 30s to set both directions back together after 30 seconds of machine
time.
1 | machine net run partition [-h] [--one-way] [--proto {tcp,udp,icmp,arp}] [--port n] [--syn] |
| Argument | Does |
|---|---|
container |
One container of the two |
other |
The other container |
| Option | Does |
|---|---|
--one-way |
Cut what the first sends the second, not the reverse |
--proto {tcp,udp,icmp,arp} |
The packets of this protocol alone |
--port n |
The packets with this source or destination port alone |
--syn |
The TCP SYNs that open a connection alone |
--for duration |
Set the link back after this machine time, such as 30s |
Examples:
1 | machine net run1 partition db api nothing between db and api |
See also:
machine net list
List each container’s links and their faults.
The listing is the one the command prints with no verb.
1 | machine net run list [-h] |
Examples:
1 | machine net run1 list each link and its faults |
See also:
machine net hold
Hold the packets a container sends.
Every packet waits in the link until a release, and then they all leave together. The link holds 1000 full-size packets and drops the ones past them.
Without a container the command holds every link at the instruction the machine is stopped at. All networking between the containers stops there, and a replay holds at the same point. A release without a container lets every packet go.
Use --to db to put the fault on what the container sends to db alone. Use
--proto, --port and --syn to take some packets alone, such as port 5432. A
packet a match takes gets only the match’s faults, not the whole link’s.
Use --for 5s with a container to release its packets after 5 seconds of
machine time. The hold of every link ends with a release.
1 | machine net run hold [-h] [--to container] [--proto {tcp,udp,icmp,arp}] [--port n] [--syn] |
| Argument | Does |
|---|---|
[container] |
Container, by its id, its name or its service’s (default: every one) |
| Option | Does |
|---|---|
--to container |
The packets to this container alone (default: to every peer) |
--proto {tcp,udp,icmp,arp} |
The packets of this protocol alone |
--port n |
The packets with this source or destination port alone |
--syn |
The TCP SYNs that open a connection alone |
--for duration |
Release the packets after this machine time, such as 5s |
Examples:
1 | machine net run1 hold db until a release |
See also:
machine net release
Release the packets a container’s links hold.
The held packets leave together, in the order they were sent. The link keeps its other faults. Without a container the command releases every link.
1 | machine net run release [-h] [--to container] [--proto {tcp,udp,icmp,arp}] [--port n] |
| Argument | Does |
|---|---|
[container] |
Container, by its id, its name or its service’s (default: every one) |
| Option | Does |
|---|---|
--to container |
The packets to this container alone (default: to every peer) |
--proto {tcp,udp,icmp,arp} |
The packets of this protocol alone |
--port n |
The packets with this source or destination port alone |
--syn |
The TCP SYNs that open a connection alone |
Examples:
1 | machine net run1 release db db's held packets leave |
See also:
machine net apply
Apply a container’s faults to its link again.
A program in a container can take the faults off its link. The command applies them again. It applies the machine’s hold to the link too. The command leaves the faults that still act as they are.
Without a container the command applies the faults of every container. The command runs the machine until the faults are applied.
1 | machine net run apply [-h] [container] |
| Argument | Does |
|---|---|
[container] |
Container, by its id, its name or its service’s (default: every one) |
Examples:
1 | machine net run1 apply db db's faults act again |
See also:
machine net reset
Reset the TCP connections of a container.
The program on the container’s side sees its socket fail with ECONNABORTED, and
the peer receives a TCP reset. A listening socket stays open. Use --to db and
--port 5432 to reset some connections alone.
1 | machine net run reset [-h] [--to container] [--port n] container |
| Argument | Does |
|---|---|
container |
Container, by its id, its name or its service’s |
| Option | Does |
|---|---|
--to container |
The connections to this container alone (default: every one) |
--port n |
The connections with this local or remote port alone |
Examples:
1 | machine net run1 reset api every connection of api |
See also:
machine net arp
Show or change a container’s neighbour table.
The table maps each peer’s address to the MAC that ARP resolved. The show verb lists it, with the peer each address belongs to and the state of each entry.
The other verbs change the table. They set a wrong MAC, mark an entry stale or delete entries. The reachable verb sets how long an entry stays reachable. A container that starts again begins with an empty table.
1 | machine net run arp [-h] command ... |
Examples:
1 | machine net run1 arp show api api's neighbour table |
See also:
machine net arp show
List a container’s neighbour table.
Each entry shows its interface, the address, the peer it belongs to, the MAC and its state.
1 | machine net run arp show [-h] container |
| Argument | Does |
|---|---|
container |
Container, by its id, its name or its service’s |
Examples:
1 | machine net run1 arp show api api's neighbour table |
See also:
machine net arp set
Map a peer’s address to a MAC.
The entry is permanent, so ARP never corrects it. The container sends the peer’s frames to that MAC until the entry is deleted.
1 | machine net run arp set [-h] container peer mac |
| Argument | Does |
|---|---|
container |
Container, by its id, its name or its service’s |
peer |
The peer, by its id, its name or its service’s |
mac |
The MAC, such as 02:42:ac:12:00:99 |
Examples:
1 | machine net run1 arp set api db 02:42:ac:12:00:99 a wrong MAC |
See also:
machine net arp stale
Mark a peer’s entry stale.
The kernel uses the entry, then confirms it by ARP at the next packet.
1 | machine net run arp stale [-h] container peer |
| Argument | Does |
|---|---|
container |
Container, by its id, its name or its service’s |
peer |
The peer, by its id, its name or its service’s |
Examples:
1 | machine net run1 arp stale api db confirmed by ARP next |
See also:
machine net arp delete
Delete a peer’s entry.
The next packet to the peer resolves its address by ARP again.
1 | machine net run arp delete [-h] container peer |
| Argument | Does |
|---|---|
container |
Container, by its id, its name or its service’s |
peer |
The peer, by its id, its name or its service’s |
Examples:
1 | machine net run1 arp delete api db db resolved again |
See also:
machine net arp flush
Delete every entry of the table.
Every peer is resolved by ARP again at its next packet.
1 | machine net run arp flush [-h] container |
| Argument | Does |
|---|---|
container |
Container, by its id, its name or its service’s |
Examples:
1 | machine net run1 arp flush api every entry deleted |
See also:
machine net arp reachable
Set how long an entry stays reachable.
After ARP confirms an entry, the kernel keeps it reachable for a random time around this one. The entry is then stale.
1 | machine net run arp reachable [-h] container duration |
| Argument | Does |
|---|---|
container |
Container, by its id, its name or its service’s |
duration |
The base reachable time, such as 1s |
Examples:
1 | machine net run1 arp reachable api 1s stale after about 1s |
See also:
machine net heal
Take the faults off a container’s links.
Without a container the command heals every link. Use --to db to heal the
faults on packets to db alone. The command releases the packets a hold keeps. A
packet the link delays already still leaves at its time.
1 | machine net run heal [-h] [--to container] [--proto {tcp,udp,icmp,arp}] [--port n] [--syn] |
| Argument | Does |
|---|---|
[container] |
Container, by its id, its name or its service’s (default: every one) |
| Option | Does |
|---|---|
--to container |
The packets to this container alone (default: to every peer) |
--proto {tcp,udp,icmp,arp} |
The packets of this protocol alone |
--port n |
The packets with this source or destination port alone |
--syn |
The TCP SYNs that open a connection alone |
Examples:
1 | machine net run1 heal db db's links healed |
See also:
machine core
Get a core dump of a process.
The command tells a process to generate a core dump and copies it to your
computer. A debugger reads the core with the program of the process. Use
--container for a process of a container, by the pid it has there.
Taking a core ends the process. The process dies of the signal. Use fork first to keep the run as it is, and take the core on the branch.
A process that handles the signal dumps no core. Use --signal to name another.
The first process of a container dumps none.
The machine runs until the core is written and copied. Other programs of the machine run with it.
1 | machine core [-h] [--container name] [--signal signal] [--within duration] run pid file |
| Argument | Does |
|---|---|
run |
Run name |
pid |
Pid of the process in the machine or in the container |
file |
File on this computer to write the core to |
| Option | Does |
|---|---|
--container name |
Container the process is in, by its id, its name or its Compose service (default: the machine itself) |
--signal signal |
Signal the process dies of, by name or number (default: ABRT) |
--within duration |
Machine time allowed each time the command runs the machine, such as 10s (default: 30m) |
Examples:
1 | machine core run1 412 ./app.core a core of pid 412 |
Prints:
1 | text Core of <pid> of <run> (<id>): <n> bytes in <file> |
Refuses, and the way past:
1 | a machine that is replaying machine fork run1 --name try2 |
See also:
machine profile
Profile what the guest runs.
The machine samples each CPU at every timer interrupt, 250 times a second. Nothing runs in the guest for it. The command prints the functions that ran. Each has the share of samples it ran in and the share it was on the stack of.
Use --from to profile a stretch the run already recorded. The stretch is
replayed on a branch, which is deleted after. The run is not changed and need
not be running. A stretch profiled twice gives the same samples.
Use --pid or --container to show one process or one container. Use
--folded to print every stack with its count, one a line. That text is what
flame graph tools read. Use --flame to draw a flame graph in the terminal.
The names come from the program files on the machine’s disk when the stretch ends. No checkpoint is taken. A function in a file that is not on the disk is shown by the file’s name.
Time in the kernel is one frame for each system call, named like sys_read_[k].
Without --from the machine runs for the time sampled. A machine that is idle
has no samples.
Use --in-guest to sample with a program in the guest, which the exec agent of
the disk runs. It names the functions of the kernel, and programs not yet
written to the disk. The run records that program like any other.
1 | machine profile [-h] [--for duration | --from point [point ...]] [--to point [point ...]] |
| Argument | Does |
|---|---|
run |
Run name |
| Option | Does |
|---|---|
--for duration |
Machine time to run and sample for, such as 500ms (default: 1s) |
--from point [point ...] |
Point a recorded stretch begins at: ^checkpoint, #entry, -N for N entries back, a time such as 10ms or -10ms, console~regex, console:N where line N was printed, parent [n], root, or %mark. The stretch is replayed on a branch |
--to point [point ...] |
Point the recorded stretch ends at, as --from takes one (default: the run’s last entry) |
--pid pid |
Process to show, by its pid in the machine or in the container (default: every process) |
--container name |
Container to show, by its id, its name or its Compose service (default: the machine itself) |
--in-guest |
Sample with the profiler of the exec agent, a process of the guest: kernel functions by name, at the cost of changing the run |
--folded |
Print the stacks, one a line with its count, for another tool to draw |
--flame |
Draw a flame graph in the terminal |
--top n |
Functions the table shows (default: 20) |
--within duration |
Machine time allowed to find the container, such as 10s (default: 30m) |
Examples:
1 | machine profile run1 where a second of run1 went |
Prints:
1 | text SELF TOTAL FUNCTION |
Refuses, and the way past:
1 | a container the run does not have machine containers run1 |
See also:
machine irq
Inject an interrupt into the vCPUs. See Interrupts.
The command takes a vector, or --nmi alone for an NMI. Use irqs to list the
vector names.
The vector is a number, or a name from irq_vectors.h of the guest kernel. The name preempt is 0xf5, the vector Machine preempts a task with. The name reschedule is 0xfd, the reschedule vector of the guest kernel.
The vector is delivered as given. It reaches the handler that the kernel of the machine installed for it. A vector with no handler is a spurious interrupt. Vectors below 32 are CPU exceptions and are refused.
The interrupt is queued when the command returns. It is delivered and recorded when the machine next runs. A replay delivers it at the same instruction. Step first to choose that instruction.
1 | machine irq [-h] [--vcpu n] [--nmi] run [vector] |
| Argument | Does |
|---|---|
run |
Run name |
[vector] |
Vector: a name such as preempt, or a number 32-255 |
| Option | Does |
|---|---|
--vcpu n |
Which vCPU takes it, or all (default: the last entry’s) |
--nmi |
Deliver as an NMI rather than a fixed interrupt |
Examples:
1 | machine irq run1 0xec inject vector 0xec |
See also:
machine irqs
List the interrupts of a machine. See Holding interrupts.
The command lists every interrupt the machine owes or holds now, then the vectors irq injects.
An owed interrupt was raised by a device or a timer and is injected at the next
dispatch. A held interrupt waits for its due, which run --irq-delay drew. The
state hash irq_pending is of the held ones, and dump --show irq keeps the
first 32 of them.
The command changes nothing. Use ints for the interrupts the guest took, by vector.
1 | machine irqs [-h] run |
| Argument | Does |
|---|---|
run |
Run name |
Examples:
1 | machine irqs run1 the pending interrupts and the vectors |
See also:
machine inject
Inject faults into the guest’s system calls and kernel.
A fault makes a system call fail with an error, or wait. A fault at a kernel site fails a disk request or drops its completion. It also fails an allocation of the kernel, or a copy to or from a program’s memory. The guest kernel decides at each call, without stopping the machine.
A replay acts on the same calls the same way. The faults are part of the machine. A checkpoint keeps them, and a fork has its parent’s. The run records each change, and a replay makes it at the same point.
Use --in to say whose calls a fault acts on. It is required. A program is the
absolute path of the file it runs, the EXE that tasks shows. It takes the tasks
running that file, and the processes they fork without exec.
A comm is the name the kernel gives a task at exec, and comm=name takes the tasks of that comm. A script runs as its interpreter, so its comm names it. tid=n takes one task, tgid=n the tasks of one tgid, and all every task in the machine.
A fault lets a number of matching calls through first. It then fires on each call by a chance, up to a number of calls or without end. Each fault counts the calls it matches on its own. The first fault that fires on a call acts on it.
A program’s fault can be added before the program starts. Its calls match from
its exec on, and the commands that start it match none. A fault on a tgid
applies to whatever that tgid runs, exec’s setup of it first. Use tasks exist to
check that what --in names is running.
Without a verb the command lists the faults.
1 | machine inject [-h] run command ... |
| Argument | Does |
|---|---|
run |
Run name |
Examples:
1 | machine inject run1 the faults |
See also:
machine inject add
Inject a fault into a subsystem of the guest.
The subsystem is syscall, or one of the kernel’s own fault sites: disk, disk-timeout, slab, pages, usercopy and futex-access. The subsystems disk-corrupt, disk-torn and disk-lost are faults of the disk itself. The function subsystem makes a function of a program return a value.
Every subsystem takes the same options, with the same meaning. The disk
subsystems also take --file, --op and --sectors.
A fault fires on every matching call by default. Use --prob to fire on a call
by chance. A --prob of 0 fires on none and counts the matches.
The fault draws from its seed which calls it fires on. A replay draws the same.
Use --seed to draw as another run did.
Use --on and --off to make a fault cycle on the machine’s clock. With --on 2s --off 5s, the fault is active for 2 seconds from when it is added. It then
rests for 5 seconds, and the cycle repeats. A resting fault matches no call and
counts none.
1 | machine inject run add [-h] subsystem ... |
Examples:
1 | machine inject run1 add syscall openat ENOENT --in /app fail |
See also:
machine inject add syscall
Fail calls of system calls with errors, or hold them.
A failed call returns an error without running. Each system call gets its own fault. A failing call returns one error of the set, drawn at random.
The set holds names or numbers. Use valid for the errors the system call’s man page documents, and all for every error Linux names. A -ERRNO in the set takes that error out.
Use --delay to hold each call the fault fires on for a time, drawn from a
span. A fault with a delay and no errors runs the call after the hold. A fault
with both holds the call, then fails it. The hold is on the guest’s own clock,
so a replay holds the same calls for the same time.
Use --pick to take a number of the set at random when the fault is added. Each
system call picks its own. A run then fails with its own few errors, as swarm
testing does.
A dynamic program’s loader opens and reads its libraries after the exec. A fault on openat or read added before the program starts fails the loader. Add such a fault once the program is up.
1 | machine inject run add syscall [-h] [--delay span] [--pick n] --in who [--prob p] |
| Argument | Does |
|---|---|
syscall[,syscall...] |
System calls, by name or number |
[errors] |
Errors: ENOENT, a number, valid or all, comma-separated; -ERRNO takes one out. Without them, --delay is required and the call runs |
| Option | Does |
|---|---|
--delay span |
Hold each call the fault fires on for a time drawn from a span such as 0:20ms, at most 1s |
--pick n |
Pick n of the errors at random when the fault is added (default: all of them) |
--in who |
Whose calls the fault acts on: a program by the absolute path of its file, comm=name, tid=n, tgid=n, container=name for its tasks, or all for every task |
--prob p |
Chance a matching call fires the fault, 0 to 1, such as 0.1 (default: 1) |
--after n |
Let n matching calls through first (default: 0) |
--times n |
Fire on at most n calls, then let the rest through (default: no end) |
--seed n |
Seed the draws of the fault (default: a random seed) |
--on duration |
Machine time the fault is active in each cycle, such as 2s; needs --off (default: always active) |
--off duration |
Machine time the fault rests in each cycle, such as 5s; needs --on |
Examples:
1 | machine inject run1 add syscall connect EIO --in /a every connect |
See also:
machine inject add function
Make a function of a program return a value without running.
A call the fault fires on returns the value of --return to its caller, and the
function does not run. A malloc that returns 0 is an allocation that failed. The
C library does not set errno, so a caller that reads errno reads what was there.
The function is found by its name in the files a running task maps, a library or
the program itself. The task is one --in names, or the task of --at when
what --in names does not run yet. The fault acts on every task that maps the
same file and that --in names.
The guest kernel puts a breakpoint at the function in the tasks --in names.
Each call there traps into the kernel, which decides as for every fault.
1 | machine inject run add function [-h] [--return value] [--at tid] --in who [--prob p] |
| Argument | Does |
|---|---|
function |
Function, by its name |
| Option | Does |
|---|---|
--return value |
Value it returns, such as 0 or -1; 0 by default |
--at tid |
Task whose files the function is found in, when --in names none running |
--in who |
Whose calls the fault acts on: a program by the absolute path of its file, comm=name, tid=n, tgid=n, container=name for its tasks, or all for every task |
--prob p |
Chance a matching call fires the fault, 0 to 1, such as 0.1 (default: 1) |
--after n |
Let n matching calls through first (default: 0) |
--times n |
Fire on at most n calls, then let the rest through (default: no end) |
--seed n |
Seed the draws of the fault (default: a random seed) |
--on duration |
Machine time the fault is active in each cycle, such as 2s; needs --off (default: always active) |
--off duration |
Machine time the fault rests in each cycle, such as 5s; needs --on |
Examples:
1 | machine inject run1 add function malloc --in /app malloc fails |
See also:
machine inject add disk
Fail block requests of the guest’s disks with EIO.
A read or write request fails with EIO in the task that submits it. A program
submits its reads, its O_DIRECT writes and the writes its fsync forces. The
kernel’s flusher threads submit buffered writes later, so --in all or a
kworker comm matches those. A request the kernel splits counts once for each
part.
A buffered read is a readahead request, then more reads of the pages when the
readahead fails. A --times below the number of those reads lets the program
read the file. Leave out --times to return EIO to the program. An O_DIRECT
read fails on its first request.
A disk fault matches a request by its operation, its sectors and its file. Use
--file to name the file whose data the request carries. Buffered writes reach
the disk from the kernel’s flusher, so use --in all with --file.
A file matches whether it is opened or mapped before or after the fault is added.
The guest kernel decides at the kernel’s own fault site. It decides after the checks that keep a promised operation from failing. A site takes no errors and no delay, because it fails its own way.
1 | machine inject run add disk [-h] --in who [--prob p] [--after n] [--times n] [--seed n] |
| Option | Does |
|---|---|
--in who |
Whose calls the fault acts on: a program by the absolute path of its file, comm=name, tid=n, tgid=n, container=name for its tasks, or all for every task |
--prob p |
Chance a matching call fires the fault, 0 to 1, such as 0.1 (default: 1) |
--after n |
Let n matching calls through first (default: 0) |
--times n |
Fire on at most n calls, then let the rest through (default: no end) |
--seed n |
Seed the draws of the fault (default: a random seed) |
--on duration |
Machine time the fault is active in each cycle, such as 2s; needs --off (default: always active) |
--off duration |
Machine time the fault rests in each cycle, such as 5s; needs --on |
--file pattern |
Requests of a file’s data: an absolute path, where * matches within a directory and ** across them (default: any file) |
--op {read,write} |
Requests of one operation (default: both) |
--sectors lo:hi |
Requests that touch 512-byte sectors lo to hi of the disk (default: the whole disk) |
Examples:
1 | machine inject run1 add disk --in all every block request |
See also:
machine inject add disk-timeout
Drop the completions of block requests.
The request is decided in the task that submits it, and its completion is dropped when the disk answers. The guest’s disk driver has no timeout handler, so the request never completes and the task waiting on it hangs. The tasks that submit a request are as for disk.
A disk fault matches a request by its operation, its sectors and its file. Use
--file to name the file whose data the request carries. Buffered writes reach
the disk from the kernel’s flusher, so use --in all with --file.
A file matches whether it is opened or mapped before or after the fault is added.
The guest kernel decides at the kernel’s own fault site. It decides after the checks that keep a promised operation from failing. A site takes no errors and no delay, because it fails its own way.
1 | machine inject run add disk-timeout [-h] --in who [--prob p] [--after n] [--times n] |
| Option | Does |
|---|---|
--in who |
Whose calls the fault acts on: a program by the absolute path of its file, comm=name, tid=n, tgid=n, container=name for its tasks, or all for every task |
--prob p |
Chance a matching call fires the fault, 0 to 1, such as 0.1 (default: 1) |
--after n |
Let n matching calls through first (default: 0) |
--times n |
Fire on at most n calls, then let the rest through (default: no end) |
--seed n |
Seed the draws of the fault (default: a random seed) |
--on duration |
Machine time the fault is active in each cycle, such as 2s; needs --off (default: always active) |
--off duration |
Machine time the fault rests in each cycle, such as 5s; needs --on |
--file pattern |
Requests of a file’s data: an absolute path, where * matches within a directory and ** across them (default: any file) |
--op {read,write} |
Requests of one operation (default: both) |
--sectors lo:hi |
Requests that touch 512-byte sectors lo to hi of the disk (default: the whole disk) |
Examples:
1 | machine inject run1 add disk-timeout --times 1 --in comm=dd dd hangs |
See also:
machine inject add slab
Fail slab allocations of the guest kernel.
The allocation returns NULL, and the call that made it fails with ENOMEM or as the kernel handles it. An allocation the kernel promised, with __GFP_NOFAIL, never fails.
The guest kernel decides at the kernel’s own fault site. It decides after the checks that keep a promised operation from failing. A site takes no errors and no delay, because it fails its own way.
1 | machine inject run add slab [-h] --in who [--prob p] [--after n] [--times n] [--seed n] |
| Option | Does |
|---|---|
--in who |
Whose calls the fault acts on: a program by the absolute path of its file, comm=name, tid=n, tgid=n, container=name for its tasks, or all for every task |
--prob p |
Chance a matching call fires the fault, 0 to 1, such as 0.1 (default: 1) |
--after n |
Let n matching calls through first (default: 0) |
--times n |
Fire on at most n calls, then let the rest through (default: no end) |
--seed n |
Seed the draws of the fault (default: a random seed) |
--on duration |
Machine time the fault is active in each cycle, such as 2s; needs --off (default: always active) |
--off duration |
Machine time the fault rests in each cycle, such as 5s; needs --on |
Examples:
1 | machine inject run1 add slab --prob 0.001 --in comm=cat rarely |
See also:
machine inject add pages
Fail page allocations of the guest kernel.
The allocation returns no pages, and the call that made it fails with ENOMEM or as the kernel handles it. An allocation the kernel promised, with __GFP_NOFAIL, never fails.
The guest kernel decides at the kernel’s own fault site. It decides after the checks that keep a promised operation from failing. A site takes no errors and no delay, because it fails its own way.
1 | machine inject run add pages [-h] --in who [--prob p] [--after n] [--times n] [--seed n] |
| Option | Does |
|---|---|
--in who |
Whose calls the fault acts on: a program by the absolute path of its file, comm=name, tid=n, tgid=n, container=name for its tasks, or all for every task |
--prob p |
Chance a matching call fires the fault, 0 to 1, such as 0.1 (default: 1) |
--after n |
Let n matching calls through first (default: 0) |
--times n |
Fire on at most n calls, then let the rest through (default: no end) |
--seed n |
Seed the draws of the fault (default: a random seed) |
--on duration |
Machine time the fault is active in each cycle, such as 2s; needs --off (default: always active) |
--off duration |
Machine time the fault rests in each cycle, such as 5s; needs --on |
Examples:
1 | machine inject run1 add pages --after 99 --times 1 --in all the 100th |
See also:
machine inject add usercopy
Fail copies between the kernel and a program’s memory.
The copy fails, and the system call that made it returns EFAULT or a short count. A system call that copies a buffer to or from the program copies through it. A call that reads or writes one value with get_user or put_user does not.
The guest kernel decides at the kernel’s own fault site. It decides after the checks that keep a promised operation from failing. A site takes no errors and no delay, because it fails its own way.
1 | machine inject run add usercopy [-h] --in who [--prob p] [--after n] [--times n] [--seed n] |
| Option | Does |
|---|---|
--in who |
Whose calls the fault acts on: a program by the absolute path of its file, comm=name, tid=n, tgid=n, container=name for its tasks, or all for every task |
--prob p |
Chance a matching call fires the fault, 0 to 1, such as 0.1 (default: 1) |
--after n |
Let n matching calls through first (default: 0) |
--times n |
Fire on at most n calls, then let the rest through (default: no end) |
--seed n |
Seed the draws of the fault (default: a random seed) |
--on duration |
Machine time the fault is active in each cycle, such as 2s; needs --off (default: always active) |
--off duration |
Machine time the fault rests in each cycle, such as 5s; needs --on |
Examples:
1 | machine inject run1 add usercopy --times 1 --in tid=41 one copy |
See also:
machine inject add futex-access
Fail a futex’s access to a program’s memory.
A futex operation’s access to the program’s memory fails. The futex call returns EFAULT, or EDEADLK where a priority-inheritance futex checks its owner.
The guest kernel decides at the kernel’s own fault site. It decides after the checks that keep a promised operation from failing. A site takes no errors and no delay, because it fails its own way.
1 | machine inject run add futex-access [-h] --in who [--prob p] [--after n] [--times n] |
| Option | Does |
|---|---|
--in who |
Whose calls the fault acts on: a program by the absolute path of its file, comm=name, tid=n, tgid=n, container=name for its tasks, or all for every task |
--prob p |
Chance a matching call fires the fault, 0 to 1, such as 0.1 (default: 1) |
--after n |
Let n matching calls through first (default: 0) |
--times n |
Fire on at most n calls, then let the rest through (default: no end) |
--seed n |
Seed the draws of the fault (default: a random seed) |
--on duration |
Machine time the fault is active in each cycle, such as 2s; needs --off (default: always active) |
--off duration |
Machine time the fault rests in each cycle, such as 5s; needs --on |
Examples:
1 | machine inject run1 add futex-access --in tgid=412 every futex call |
See also:
machine inject add disk-corrupt
Change bytes of reads and writes of the guest’s disks.
The disk stores a write with bytes changed, or returns a read with bytes changed. The request succeeds. The changed bytes are drawn from the fault’s seed. A program’s own reads of a written file come from the page cache until the guest drops it.
A disk fault matches a request by its operation, its sectors and its file. Use
--file to name the file whose data the request carries. Buffered writes reach
the disk from the kernel’s flusher, so use --in all with --file.
A file matches whether it is opened or mapped before or after the fault is added.
The guest kernel decides on each request in the task that submits it. The virtual disk then changes what it stores or returns. A replay makes the same decisions and changes the same bytes.
1 | machine inject run add disk-corrupt [-h] --in who [--prob p] [--after n] [--times n] |
| Option | Does |
|---|---|
--in who |
Whose calls the fault acts on: a program by the absolute path of its file, comm=name, tid=n, tgid=n, container=name for its tasks, or all for every task |
--prob p |
Chance a matching call fires the fault, 0 to 1, such as 0.1 (default: 1) |
--after n |
Let n matching calls through first (default: 0) |
--times n |
Fire on at most n calls, then let the rest through (default: no end) |
--seed n |
Seed the draws of the fault (default: a random seed) |
--on duration |
Machine time the fault is active in each cycle, such as 2s; needs --off (default: always active) |
--off duration |
Machine time the fault rests in each cycle, such as 5s; needs --on |
--file pattern |
Requests of a file’s data: an absolute path, where * matches within a directory and ** across them (default: any file) |
--op {read,write} |
Requests of one operation (default: both) |
--sectors lo:hi |
Requests that touch 512-byte sectors lo to hi of the disk (default: the whole disk) |
--bytes n |
Bytes of the request to change, 1 to 4096 (default: 1) |
Examples:
1 | machine inject run1 add disk-corrupt --file '/db/*/c.bin' --in all parts |
See also:
machine inject add disk-torn
Store part of a write of the guest’s disks.
The disk stores the first sectors of a write and reports success. It stores one sector at least, and fewer than all. The rest keeps what the disk held. A sector is written whole, so a write of one sector does not tear.
A disk fault matches a request by its operation, its sectors and its file. Use
--file to name the file whose data the request carries. Buffered writes reach
the disk from the kernel’s flusher, so use --in all with --file.
A file matches whether it is opened or mapped before or after the fault is added.
The guest kernel decides on each request in the task that submits it. The virtual disk then changes what it stores or returns. A replay makes the same decisions and changes the same bytes.
1 | machine inject run add disk-torn [-h] --in who [--prob p] [--after n] [--times n] |
| Option | Does |
|---|---|
--in who |
Whose calls the fault acts on: a program by the absolute path of its file, comm=name, tid=n, tgid=n, container=name for its tasks, or all for every task |
--prob p |
Chance a matching call fires the fault, 0 to 1, such as 0.1 (default: 1) |
--after n |
Let n matching calls through first (default: 0) |
--times n |
Fire on at most n calls, then let the rest through (default: no end) |
--seed n |
Seed the draws of the fault (default: a random seed) |
--on duration |
Machine time the fault is active in each cycle, such as 2s; needs --off (default: always active) |
--off duration |
Machine time the fault rests in each cycle, such as 5s; needs --on |
--file pattern |
Requests of a file’s data: an absolute path, where * matches within a directory and ** across them (default: any file) |
--sectors lo:hi |
Requests that touch 512-byte sectors lo to hi of the disk (default: the whole disk) |
Examples:
1 | machine inject run1 add disk-torn --file /db/wal --in all torn writes |
See also:
machine inject add disk-lost
Lose writes of the guest’s disks.
The disk reports a write done and stores none of it. The disk keeps what it held, as a disk that lost its cache does.
A disk fault matches a request by its operation, its sectors and its file. Use
--file to name the file whose data the request carries. Buffered writes reach
the disk from the kernel’s flusher, so use --in all with --file.
A file matches whether it is opened or mapped before or after the fault is added.
The guest kernel decides on each request in the task that submits it. The virtual disk then changes what it stores or returns. A replay makes the same decisions and changes the same bytes.
1 | machine inject run add disk-lost [-h] --in who [--prob p] [--after n] [--times n] |
| Option | Does |
|---|---|
--in who |
Whose calls the fault acts on: a program by the absolute path of its file, comm=name, tid=n, tgid=n, container=name for its tasks, or all for every task |
--prob p |
Chance a matching call fires the fault, 0 to 1, such as 0.1 (default: 1) |
--after n |
Let n matching calls through first (default: 0) |
--times n |
Fire on at most n calls, then let the rest through (default: no end) |
--seed n |
Seed the draws of the fault (default: a random seed) |
--on duration |
Machine time the fault is active in each cycle, such as 2s; needs --off (default: always active) |
--off duration |
Machine time the fault rests in each cycle, such as 5s; needs --on |
--file pattern |
Requests of a file’s data: an absolute path, where * matches within a directory and ** across them (default: any file) |
--sectors lo:hi |
Requests that touch 512-byte sectors lo to hi of the disk (default: the whole disk) |
Examples:
1 | machine inject run1 add disk-lost --file /db/wal --in all lost writes |
See also:
machine inject delete
Delete a fault.
The fault’s calls run again from here.
1 | machine inject run delete [-h] n |
| Argument | Does |
|---|---|
n |
Fault number, as the listing shows it |
Examples:
1 | machine inject run1 delete 2 the second fault |
See also:
machine inject list
List the faults.
The listing is the one the command prints with no verb.
1 | machine inject run list [-h] |
Examples:
1 | machine inject run1 list the faults, by number |
See also:
machine inject clear
Delete every fault.
1 | machine inject run clear [-h] |
Examples:
1 | machine inject run1 clear every fault |
See also:
machine axis
Set the defaults of the draw axes a run uses.
A default is a plan clause the run keeps. Every run, exec and plan draws from the defaults until they are removed. The axes are the ones a plan clause takes, such as mode, vtime-rate, task-sched and irq-delay.
A run option or a plan clause replaces a default for the axes it names. A default with a when condition replaces one with no condition where the condition holds. Of two conditions that hold, the default set last wins.
The defaults are part of the machine. A checkpoint keeps them, and a fork has its parent’s. The run records each change, and a replay makes it at the same point.
Without a verb the command lists the defaults.
1 | machine axis [-h] run command ... |
| Argument | Does |
|---|---|
run |
Run name |
Examples:
1 | machine axis run1 the defaults |
See also:
machine axis set
Set a default of the draw axes.
The default is a clause of a plan, written as a plan file writes it. It names one or more axes and their values. A clause that starts with when applies where its predicate holds.
The default replaces the values its axes had under the same condition. A clause that names several axes draws them together.
1 | machine axis run set [-h] ... |
| Argument | Does |
|---|---|
... |
A plan clause, such as when /app:on task-sched hold |
Examples:
1 | machine axis run1 set vtime-rate 10:40 a drawn rate |
See also:
machine axis unset
Remove defaults of the draw axes.
The axes are named as a clause names them, without values. A clause that starts with when removes the defaults under that predicate. Without when, the command removes the defaults that have no condition.
Use --all to remove the axes’ defaults under every condition.
1 | machine axis run unset [-h] [--all] ... |
| Argument | Does |
|---|---|
... |
Axis names after an optional when predicate, such as when /app:on mode |
| Option | Does |
|---|---|
--all |
Remove the axes’ defaults under every condition |
Examples:
1 | machine axis run1 unset mode no condition |
See also:
machine axis clear
Remove every default.
1 | machine axis run clear [-h] |
Examples:
1 | machine axis run1 clear every default |
See also:
machine vtime
Show and change machine time. See Machine time.
Machine time is the guest’s clock. It is derived from what the machine executes, not from the host clock.
Use rate to change how fast machine time passes. Use cost to change what each exit costs on it. Use add to push the clock forward without running the machine. The clock only goes forward.
Use rewind to put the run back at an earlier point.
1 | machine vtime [-h] run command ... |
| Argument | Does |
|---|---|
run |
Run name |
Examples:
1 | machine vtime run1 machine time and its rate |
See also:
machine vtime rate
Set how fast machine time passes. See Machine time.
The rate is the nanoseconds of machine time for each conditional branch the
guest retires. A run starts at 10 unless create was given --vtime-rate.
Give the rate as a number or as num/den. Add N=rate to give vCPU N its own rate, so its work costs more or less time than the others’. A rate for every vCPU clears each vCPU’s own.
The run records each change, and a replay makes it at the same point. A run’s
--vtime-rate draws one rate for every vCPU for that run alone.
1 | machine vtime run rate [-h] rate |
| Argument | Does |
|---|---|
rate |
Rate, num/den, and N=rate for vCPU N’s own, such as 10,1=40 |
Examples:
1 | machine vtime run1 rate 20 20 ns for each conditional branch |
See also:
machine vtime add
Push the clock forward without running the machine. See Machine time.
Give a time such as 1s or 250ms. A bare number is nanoseconds.
1 | machine vtime run add [-h] time |
| Argument | Does |
|---|---|
time |
Time to add, such as 1s or 250ms; a bare number is nanoseconds |
Examples:
1 | machine vtime run1 add 10us advance the clock 10 us |
See also:
machine vtime cost
Set what each exit costs on the machine’s clock.
Each exit of the guest advances machine time by a cost. The exits priced are an I/O, MMIO or hypercall exit, an RDTSC and each PAUSE of a spin loop. The rate prices the guest’s computing, and the costs price its waiting. Their ratio decides whether a spin or an I/O completion wins a race.
Give io=, rdtsc= or pause= with a time from 1ns to 1s. A bare number is nanoseconds. A cost not given stays as it is. The RDTSC cost follows the I/O cost until it is given, and rdtsc=io makes it follow again.
The run records the change, and a replay makes it at the same point. A run’s
--vtime-io-cost, --vtime-rdtsc-cost or --vtime-pause-cost draws its own
costs for that run alone.
1 | machine vtime run cost [-h] exit=time [exit=time ...] |
| Argument | Does |
|---|---|
exit=time [exit=time ...] |
An exit and its cost, such as io=2us, rdtsc=1us or pause=50; rdtsc=io follows the I/O cost |
Examples:
1 | machine vtime run1 cost io=20us each I/O exit costs 20 us |
See also:
machine clock
Show and change the guest’s date and each container’s.
The command steps the date and sets it. It makes a container’s date drift, or slews it to a new value. It steps the date to a drawn offset each period, as NTP does. It inserts or deletes a leap second.
The date is what date, time and gettimeofday return. A change moves it for every process in the guest. Elapsed time, the TSC and timers measured in elapsed time do not move. Use vtime to change how fast time runs.
The guest kernel applies a change when the run next executes. The command answers with the date as it stands and the change waiting. The reading after that run names a change the guest kernel refused.
A change is part of the machine. The run records it, and a replay makes it at the same point. A checkpoint keeps the date and a pending undo.
A container’s date is an offset from the guest’s date. Every process of the container reads it, those docker exec starts included. A timer armed after a change agrees with it. A timer armed before keeps its deadline.
Without a verb the command shows the date and each container’s. The command finds a container with the machine stopped and never runs it. It tries a name first, then a service, then an id. An id works from the container’s start, while a name is known shortly after.
A jump or a set takes a running container. A show or a reset also takes a stopped one with an offset. A service stands for its one container of those.
1 | machine clock [-h] [--container name] run command ... |
| Argument | Does |
|---|---|
run |
Run name |
| Option | Does |
|---|---|
--container name |
A container by its id, its name or its Compose service |
Examples:
1 | machine clock run1 the guest's date |
See also:
machine clock jumpmachine clock setmachine clock driftmachine clock jittermachine clock leapmachine containersmachine vtime
machine clock jump
Step the guest’s date forward or back.
The step is the one an NTP step or date -s makes. A timer armed for an absolute date sees the step. A timerfd with TFD_TIMER_CANCEL_ON_SET is woken. Each step adds to the ones before it.
Use --for 30s to undo the change after 30 seconds of machine time. The undo
takes back the command’s own change, and what a drift gave meanwhile stays. A
later change cancels an undo still pending.
Use --slew 30s with --container to move a container’s date over 30 seconds
of machine time. No read in it sees a jump. With --for, the date slews back
over the same time.
Use --container db to change one container’s date alone. The container keeps
its offset from the guest’s date across a restart.
1 | machine clock run jump [-h] [--for duration] [--slew duration] [--container name] offset |
| Argument | Does |
|---|---|
offset |
The step, such as +5s, -2h or 59m50s; no sign is forward |
| Option | Does |
|---|---|
--for duration |
Undo the change after this much machine time, such as 30s |
--slew duration |
Move a container’s date over this machine time, such as 30s |
--container name |
A container by its id, its name or its Compose service |
Examples:
1 | machine clock run1 jump +5s forward |
See also:
machine clock set
Set the guest’s date.
The date is written with its zone, such as 2027-03-28T00:59:50Z. The change is a step, as date -s makes one.
Use --for 30s to undo the change after 30 seconds of machine time. The undo
takes back the command’s own change, and what a drift gave meanwhile stays. A
later change cancels an undo still pending.
Use --slew 30s with --container to move a container’s date over 30 seconds
of machine time. No read in it sees a jump. With --for, the date slews back
over the same time.
Use --container db to change one container’s date alone. The container keeps
its offset from the guest’s date across a restart.
1 | machine clock run set [-h] [--for duration] [--slew duration] [--container name] date |
| Argument | Does |
|---|---|
date |
The date with its zone, such as 2027-03-28T00:59:50Z |
| Option | Does |
|---|---|
--for duration |
Undo the change after this much machine time, such as 30s |
--slew duration |
Move a container’s date over this machine time, such as 30s |
--container name |
A container by its id, its name or its Compose service |
Examples:
1 | machine clock run1 set 2026-12-31T23:59:50Z the year's end |
See also:
machine clock drift
Make a container’s date gain or lose time.
The container’s date gains the rate of each second of machine time, such as +200ppm, 0.72 seconds an hour. No read sees a jump. Its processes read it in the vDSO and in system calls. A timer armed after agrees with it.
Use drift 0 to stop it and keep the offset it reached. A jump, a set or a jitter moves the date under the drift.
The guest’s date has no drift. Use vtime rate to make the whole machine’s time run fast or slow.
Use --for 30s to undo the change after 30 seconds of machine time. The undo
takes back the command’s own change, and what a drift gave meanwhile stays. A
later change cancels an undo still pending.
1 | machine clock run drift [-h] [--for duration] [--container name] rate |
| Argument | Does |
|---|---|
rate |
The rate, such as +200ppm, -1.5ppm or 300ppb; 0 stops it |
| Option | Does |
|---|---|
--for duration |
Undo the change after this much machine time, such as 30s |
--container name |
A container by its id, its name or its Compose service |
Examples:
1 | machine clock run1 drift +200ppm --container db 0.72s an hour |
See also:
machine clock jitter
Step the guest’s date to a drawn offset each period.
Each period of machine time the date is set to a value drawn from the choices. The value is around the date the jitter leaves alone. A choice is a span such as -200ms:200ms or one value such as 1s. A weight in brackets draws a choice more often, as -1s[1],0[8],1s[1] does.
The first step is taken when the guest takes the command, and the next a period later. Each step is a step of the date, as NTP makes one. A jump or a set moves the date under the jitter, which goes on around it. Use jitter off to stop it and return to the date without it.
The draws come from --seed, or from a seed drawn at random and shown. A replay
steps by the same amounts at the same points. A fork has its parent’s jitter and
draws on from where it was.
Use --for 30s to undo the change after 30 seconds of machine time. The undo
takes back the command’s own change, and what a drift gave meanwhile stays. A
later change cancels an undo still pending.
Use --container db to change one container’s date alone. The container keeps
its offset from the guest’s date across a restart.
1 | machine clock run jitter [-h] [--every duration] [--seed n] [--for duration] |
| Argument | Does |
|---|---|
choices |
The choices, such as -200ms:200ms or -1s[1],0[8],1s[1]; off stops it |
| Option | Does |
|---|---|
--every duration |
Machine time between two steps, such as 10m |
--seed n |
The seed the steps are drawn from (default: one drawn at random) |
--for duration |
Undo the change after this much machine time, such as 30s |
--container name |
A container by its id, its name or its Compose service |
Examples:
1 | machine clock run1 jitter -200ms:200ms --every 10m NTP's steps |
See also:
machine clock leap
Insert or delete a second at the next UTC midnight.
The guest kernel inserts 23:59:60 or skips 23:59:59 at the next midnight of the guest’s date. It does so as an NTP daemon’s leap flag asks it to. Then it clears the flag. Use leap off to cancel a leap still pending.
A leap second is the guest kernel’s timekeeping, so it moves every container with the guest’s date. A reset cancels it too.
1 | machine clock run leap [-h] [--container name] {insert,delete,off} |
| Argument | Does |
|---|---|
{insert,delete,off} |
Insert, delete, or off to cancel a leap pending |
| Option | Does |
|---|---|
--container name |
A container by its id, its name or its Compose service |
Examples:
1 | machine clock run1 leap insert 23:59:60 at midnight |
See also:
machine clock reset
Step the guest’s date and every container’s back to machine time.
Machine time is the date the guest kernel had at boot, moved by elapsed time. The reset undoes every step, those of clock and those a process made, and cancels every pending undo.
Use --container db to return one container to the guest’s date. The guest’s
date and the other containers stay as they are.
1 | machine clock run reset [-h] [--container name] |
| Option | Does |
|---|---|
--container name |
A container by its id, its name or its Compose service |
Examples:
1 | machine clock run1 reset the guest and every container |
See also:
machine rng
Show and seed the RNG device of a machine. See Random numbers.
The RNG device gives the guest its random bytes from a seed. A run takes the
seed from create --rng-seed.
Use seed to seed it again here. The run records the seed, and a replay seeds the device at the same point. A guest kernel that reads the seed reseeds its own generator at once. A kernel that does not read the seed picks it up the next time that kernel reseeds.
A run created with --no-rng has no RNG device, and the command refuses it.
1 | machine rng [-h] run command ... |
| Argument | Does |
|---|---|
run |
Run name |
Examples:
1 | machine rng run1 the seed and whether the guest reseeds at once |
See also:
machine rng seed
Seed the RNG device again.
The device gives its bytes from the new seed, as from create --rng-seed. The
run records the seed, so a replay seeds the device at the same point.
1 | machine rng run seed [-h] n |
| Argument | Does |
|---|---|
n |
Seed, 0 to 2^64-1 |
Examples:
1 | machine rng run1 seed 7 seed the RNG device from 7 |
See also:
machine decisions
Show and change how a program’s decisions are answered.
A program built with an Antithesis SDK draws its random values through the
library the machine serves. Each draw is a decision. The guest kernel answers it
from a seeded default stream. A run takes the stream’s seed from create
--rng-seed.
Use add to answer decisions from a list of values, and delete to remove the rule. Use seed to seed the stream again here. A branch starts with its parent’s seed, settings and rules, and changes its own.
The command also turns parts of the guest API off and on. Use --no-decisions
to stop recording decisions, and --decisions to record them again. Use
--no-events to write no events, and --events to write them again.
Use --intercept to make the random draws of programs started after it
decisions, though the programs never call the library. The draws taken are rand
of libc, random of Python, rand of Perl, Math.random of Node, java.util.Random
and std::random_device. Each is a decision at its stack site, such as
random/randbelow/main.py:42. With no rule a draw keeps its own value, so the
numbers change only where a rule says.
The run records every change, and a replay makes it at the same point.
A run created before decisions were recorded draws from seed 0, and a change to it is refused. A guest kernel without the API is refused.
1 | machine decisions [-h] [--decisions | --no-decisions] [--events | --no-events] |
| Argument | Does |
|---|---|
run |
Run name |
| Option | Does |
|---|---|
--decisions, --no-decisions |
Record the program’s decisions; --no-decisions answers them by the default stream and records none |
--events, --no-events |
Write the program’s events; --no-events writes none, and the call returns inside the guest |
--intercept, --no-intercept |
Intercept the random draws of programs started after, each a decision at its stack site |
Examples:
1 | machine decisions run1 the seed, decisions, rules |
See also:
machine decisions addmachine decisions deletemachine decisions sitesmachine decisions seedmachine decisions functionsmachine eventsmachine forkmachine rng
machine decisions seed
Seed the default stream again.
The default stream draws from the new seed. The run records the seed, so a replay seeds the stream at the same point.
1 | machine decisions run seed [-h] n |
| Argument | Does |
|---|---|
n |
Seed, 0 to 2^64-1 |
Examples:
1 | machine decisions run1 seed 7 seed the default stream from 7 |
See also:
machine decisions add
Add a rule that answers decisions from a list.
The rules answer in order, the new rule after every rule before it. The first rule that matches a decision answers with the next value of its list. A rule whose list is used up stops matching. A decision no rule answers takes the default stream.
Use --site to answer the decisions of one site and the sites under it. Use
--in to answer the decisions of one program or task.
A choice rule answers with the index of an option. The rule is pinned to the
options of its site’s last choice, as decisions sites lists them. A choice that
offers other options stops the run before its answer. Use --options any to
answer any options.
A bytes rule answers a byte decision with an input, one --values-file each,
such as a corpus file. A call takes the next input, its first bytes up to the
length the call asks for.
The run records the rule and its list, so a replay answers the same decisions the same way. A run holds 16 rules.
1 | machine decisions run add [-h] [--options hash] [--in who] [--site path] [--after n] |
| Argument | Does |
|---|---|
kind |
The decisions the rule answers: random, choice or bytes |
| Option | Does |
|---|---|
--options hash |
A choice rule’s options: any, or a hash as decisions sites shows it in JSON (default: the site’s) |
--in who |
Whose decisions: a program by the absolute path of its file, comm=name, tid=n, tgid=n, container=name, or all (default: all) |
--site path |
Site path such as level1/enemy, matching the sites under it too (default: any) |
--after n |
Matching decisions let through first (default: 0) |
--values list |
Values, comma-separated, each 0 to 2^64-1 |
--values-file file |
File of values, each 8 bytes little-endian; for bytes, one input a file (repeatable) |
Examples:
1 | machine decisions run1 add random --values 1,2,3 3 draws |
See also:
machine decisions sites
List the sites where programs made decisions.
A site is a path of names that a program gives a decision, such as level1/enemy. A program names it with fuzz_get_random_id from the library the machine serves. A decision of an Antithesis SDK is at the site antithesis.
Each program counts the decisions of each site apart. One site drawing more moves no other site’s defaults. A program is its file: its copies in every container share each site’s count, and the table names the first container.
The command reads the sites from the machine’s memory. Nothing runs and nothing is recorded. The machine lists 512 sites. The lines after the table say how many it holds and count the sites it could not list.
1 | machine decisions run sites [-h] |
Examples:
1 | machine decisions run1 sites every site and its decisions |
See also:
machine decisions delete
Delete a rule.
The rule’s decisions go to the rules after it, or to the default stream. The run records the delete, so a replay makes it at the same point.
1 | machine decisions run delete [-h] n |
| Argument | Does |
|---|---|
n |
Rule number, as listed |
Examples:
1 | machine decisions run1 delete 1 rule 1 gone |
See also:
machine decisions refill
Give a rule a new list of values.
The rule keeps what it matches and answers from the first new value. A decision an exhausted catchpoint stopped at takes it.
The run records the refill, so a replay makes it at the same point.
1 | machine decisions run refill [-h] (--values list | --values-file file) n |
| Argument | Does |
|---|---|
n |
Rule number, as listed |
| Option | Does |
|---|---|
--values list |
Values, comma-separated, each 0 to 2^64-1 |
--values-file file |
File of values, each 8 bytes little-endian; for bytes, one input a file (repeatable) |
Examples:
1 | machine decisions run1 refill 1 --values 8,7 8, then 7 |
See also:
machine decisions functions
List the functions whose return values are decisions.
An intercepted function returns a decision at random/<function>/<caller>.
With no rule the decision is the function’s own value. This reaches what
--intercept does not: a static binary, a Go program, a program’s own
generator.
The machine reads the caller by the frame pointers. A program built without frame pointers has the first frame of its caller alone.
1 | machine decisions run functions [-h] command ... |
Examples:
1 | machine decisions run1 functions every one intercepted |
See also:
machine decisions functions add
Intercept functions of a running program.
The command finds each function by its name in the files of the task. The machine takes the function’s value where each of its return instructions returns. Every process of the file is intercepted, those started after included.
Use --go to intercept the generators of Go’s math/rand and math/rand/v2. Use
--range for the values a function returns, such as 2147483648 for rand of
libc.
The run records each function, so a replay intercepts it at the same point. A run intercepts 32 return instructions, and a function takes one for each of its own.
1 | machine decisions run functions add [-h] [--go] [--range n] tid [function ...] |
| Argument | Does |
|---|---|
tid |
A task that runs the program |
[function ...] |
Function name, as machine symbols lists it |
| Option | Does |
|---|---|
--go |
Intercept the generators of Go’s math/rand and math/rand/v2 |
--range n |
Values the functions return, 0 to n-1 (default: all of 64 bits) |
Examples:
1 | machine decisions run1 functions add 412 --go Go's math/rand |
See also:
machine decisions functions delete
Stop intercepting a function.
The function’s calls return their own values again. The run records the delete, so a replay makes it at the same point.
1 | machine decisions run functions delete [-h] n |
| Argument | Does |
|---|---|
n |
Function number, as listed |
Examples:
1 | machine decisions run1 functions delete 1 function 1 gone |
See also:
machine coverage
List the coverage modules of a run and the edges hit.
A program built with coverage instrumentation registers its modules through the library the machine serves. The machine keeps a bit for each edge of each module. It records an edge the first time any process of the program hits it. A branch has its parent’s edges, so an edge is new once along a lineage.
Name a module, by its number or its name, to list its edges hit. The output source coverage has a line for each new edge, in order.
The command reads the machine’s memory. Nothing runs and nothing is recorded.
1 | machine coverage [-h] run [module] |
| Argument | Does |
|---|---|
run |
Run name |
[module] |
Module number or name, as listed: its edges hit |
Examples:
1 | machine coverage run1 the modules and their edges hit |
See also: