struct JobTarget
Defined at line 75 of file ../../src/performance/experimental/profiler/targets.h
Public Members
job job
zx_koid_t job_id
unordered_map processes
unordered_map child_jobs
vector ancestry
Public Methods
zx::result<> ForEachProcess (const fit::function<zx::result<> (std::span<const zx_koid_t>, const ProcessTarget &)> & f)
Do a depth first search to call f on each process in the modeled job tree.
Defined at line 28 of file ../../src/performance/experimental/profiler/targets.cc
zx::result<> ForEachJob (const fit::function<zx::result<> (const JobTarget &)> & f)
Do a depth first search to call f on each child job in the modeled job tree.
Defined at line 49 of file ../../src/performance/experimental/profiler/targets.cc
zx::result<> AddJob (std::span<const zx_koid_t> ancestry, JobTarget && job)
Add `job` into the job tree as a child to the nested jobs specified by `ancestry`.
Returns zx::ok if the job was successfully added,
ZX_ERR_NOT_FOUND if there is no matching ancestry
ZX_ERR_ALREADY_EXISTS if there is already an existing job at the location with the same job_id
Note: `ancestry` is the jobs that `job` will be placed under and does not include the job_id of
`job` itself.
Defined at line 66 of file ../../src/performance/experimental/profiler/targets.cc
void JobTarget (zx::job job, zx_koid_t job_id, std::span<const zx_koid_t> ancestry)
Defined at line 76 of file ../../src/performance/experimental/profiler/targets.h
void JobTarget (zx::job job, zx_koid_t job_id, std::unordered_map<zx_koid_t, ProcessTarget> processes, std::unordered_map<zx_koid_t, JobTarget> child_jobs, std::span<const zx_koid_t> ancestry)
Defined at line 78 of file ../../src/performance/experimental/profiler/targets.h
zx::result<> AddProcess (std::span<const zx_koid_t> job_path, ProcessTarget && process)
Add `process` into the job tree as a child to the job specified by `job_path`
Returns zx::ok if the process was successfully added,
ZX_ERR_NOT_FOUND if there is no matching job_path
ZX_ERR_ALREADY_EXISTS if there is already an existing process at the location with the same pid
Defined at line 80 of file ../../src/performance/experimental/profiler/targets.cc
void JobTarget (const JobTarget & )
Defined at line 87 of file ../../src/performance/experimental/profiler/targets.h
void JobTarget (JobTarget && )
Defined at line 88 of file ../../src/performance/experimental/profiler/targets.h
zx::result<ProcessTarget *> GetProcess (std::span<const zx_koid_t> job_path, zx_koid_t pid)
Get `process` from the job tree as a child to the job specified by `job_path`
Returns zx::ok if the process was found,
ZX_ERR_NOT_FOUND if there is no matching job_path or pid
Defined at line 95 of file ../../src/performance/experimental/profiler/targets.cc
zx::result<> AddThread (std::span<const zx_koid_t> job_path, zx_koid_t pid, ThreadTarget && thread)
Add `thread` into the job tree as a child to process in job specified by `pid` and `job_path`.
Returns zx::ok if the thread was successfully added,
ZX_ERR_NOT_FOUND if there is no matching job_path
ZX_ERR_ALREADY_EXISTS if there is already an existing thread at the location with the same tid
Defined at line 112 of file ../../src/performance/experimental/profiler/targets.cc
zx::result<> RemoveThread (std::span<const zx_koid_t> job_path, zx_koid_t pid, zx_koid_t tid)
Defined at line 132 of file ../../src/performance/experimental/profiler/targets.cc