This contains thread state that tracers can inspect and modify. It is
captured when a thread stops, and optionally copied back (if dirty) when a
thread starts again. An alternative implementation would involve the
tracers acting on thread state directly; however, this would involve sharing
CurrentTask structures across multiple threads, which goes against the
intent of the design of CurrentTask.
CgroupPidTable contains the mapping of ThreadGroup (by pid) to non-root cgroup.
If pid is valid but does not exist in the mapping, then it is assumed to be in the root cgroup.
CgroupRoot is the root of the cgroup hierarchy. The root cgroup is different from the rest of
the cgroups in a cgroup hierarchy (sub-cgroups of the root) in a few ways:
This type is a convenience to use when the Timeline isn’t clear in Starnix. It allows storing a
generic nanosecond duration which can be used to operate on Instants or Durations from any
Timeline.
All cgroups of the kernel. There is a single cgroup v2 hierarchy, and one-or-more cgroup v1
hierarchies.
TODO(https://fxbug.dev/389748287): Add cgroup v1 hierarchies on the kernel.
The task normal priority, used for favoring or disfavoring a task running
with some non-real-time scheduling policies. Ranges from -20 to +19 in
“user-space” representation and +1 to +40 in “kernel-internal”
representation. See “The nice value” at sched(7) for full specification.
The underlying implementation of the file descriptor that connects a process that triggers a
SECCOMP_RET_USER_NOTIF with the monitoring process. This support seccomp’s ability to notify a
user-space process on specific syscall triggers. See seccomp_unotify(2) for the semantics.
A session is a collection of ProcessGroup objects that are related to each other. Each
session has a session ID (sid), which is a unique identifier for the session.
Container around a weak task and a strong TaskPersistentInfo. It is needed to keep the
information even when the task is not upgradable, because when the task is dropped, there is a
moment where the task is not yet released, yet the weak pointer is not upgradeable anymore.
During this time, it is still necessary to access the persistent info to compute the state of
the thread for the different wait syscalls.
The information of the task that needs to be available to the ThreadGroup while computing
which process a wait can target. It is necessary to shared this data with the ThreadGroup so
that it is available while the task is being dropped and so is not accessible from a weak
pointer.
A wrapper around a Weak<ThreadGroup> that expects the underlying Weak to always be
valid. The wrapper will check this at runtime during creation and upgrade.
A list of zombie processes that were traced by a given tracer, but which
have not yet notified that tracer of their exit. Once the tracer is
notified, the original parent will be notified.
For most of the time, for the purposes of ptrace, a tracee is either “going”
or “stopped”. However, after certain ptrace calls, there are special rules
to be followed.
Uses the given core ptrace state (including tracer, attach type, etc) to
attach to another task, given by tracee_task. Also sends a signal to stop
tracee_task. Typical for when inheriting ptrace state from another task.
Implementation of ptrace(PTRACE_PEEKUSER). The user struct holds the
registers and other information about the process. See ptrace(2) and
sys/user.h for full details.