processTree

fnProcessTree processTree(int rootPid) @safe

Builds a process tree starting from a specific PID.

Constructs a hierarchical tree of processes with the specified process as the root and all its descendants as children.

Parameters

rootPidThe PID of the root process.

Returns

A ProcessTree with the specified process as root.

Example:

auto tree = processTree(1);  // init process tree
writeln("Total memory: ", tree.totalMemory());