class TargetTree
Defined at line 190 of file ../../src/performance/cpu_profiler/targets.h
Public Methods
void TargetTree ()
Defined at line 192 of file ../../src/performance/cpu_profiler/targets.h
void TargetTree (const TargetTree & )
Defined at line 193 of file ../../src/performance/cpu_profiler/targets.h
TargetTree & operator= (const TargetTree & )
Defined at line 194 of file ../../src/performance/cpu_profiler/targets.h
void TargetTree (TargetTree && )
Defined at line 196 of file ../../src/performance/cpu_profiler/targets.h
TargetTree & operator= (TargetTree && )
Defined at line 197 of file ../../src/performance/cpu_profiler/targets.h
zx::result<> AddJob (JobTarget && job)
Add `job` into top level set of jobs in the tree.
Returns zx::ok if the job was successfully added,
ZX_ERR_ALREADY_EXISTS if there is already an existing job with the same job_id
Defined at line 382 of file ../../src/performance/cpu_profiler/targets.cc
zx::result<> AddThread (zx_koid_t pid, ThreadTarget && thread)
Add `thread` into the tree as a child to the process specified by `pid` with no parent job
Returns zx::ok if the thread was successfully added,
ZX_ERR_NOT_FOUND if there is no process matching `pid`
ZX_ERR_ALREADY_EXISTS if there is already an existing thread at the location
Defined at line 435 of file ../../src/performance/cpu_profiler/targets.cc
zx::result<> RemoveThread (zx_koid_t pid, zx_koid_t tid)
Defined at line 439 of file ../../src/performance/cpu_profiler/targets.cc
zx::result<> AddProcess (ProcessTarget && process)
Add `process` into the job tree as a process with no parent job
Returns zx::ok if the process was successfully added,
ZX_ERR_ALREADY_EXISTS if there is already an existing process with the same pid
Defined at line 400 of file ../../src/performance/cpu_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 job 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 386 of file ../../src/performance/cpu_profiler/targets.cc
zx::result<> RemoveThread (std::span<const zx_koid_t>job_path,zx_koid_tpid,zx_koid_ttid)
Defined at line 462 of file ../../src/performance/cpu_profiler/targets.cc
zx::result<> AddThread (std::span<const zx_koid_t>job_path,zx_koid_tpid,ThreadTarget &&thread)
Add `thread` into the job tree as a child to the job specified by `job_path` in the process
`pid`
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 443 of file ../../src/performance/cpu_profiler/targets.cc
zx::result<> AddProcess (std::span<const zx_koid_t> job_path, ProcessTarget && process)
Add `process` into the job tree as a child in the job 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 thread at the location with the same tid
Defined at line 404 of file ../../src/performance/cpu_profiler/targets.cc
zx::result<ProcessTarget *> GetProcess (std::span<const zx_koid_t> job_path, zx_koid_t pid)
Search `pid` as a ProcessTarget from the job tree indexed by `job_path`.
ZX_ERR_NOT_FOUND if there is no matching job_path and pid
Defined at line 418 of file ../../src/performance/cpu_profiler/targets.cc
void Clear ()
Defined at line 480 of file ../../src/performance/cpu_profiler/targets.cc
zx::result<> ForEachJob (const fit::function<zx::result<> (const JobTarget &)> & f)
Call `f` on each Job in the TargetTree. The order each job is visited is unspecified. If `f`
returns an error, the function will short circuit and immediately return the error code without
visiting any remaining jobs.
Defined at line 486 of file ../../src/performance/cpu_profiler/targets.cc
zx::result<> ForEachProcess (const fit::function<zx::result<> (std::span<const zx_koid_t>, const ProcessTarget &)> & f)
Call `f` on each top level unparented process as well as every process in each added job. The
order each process is visited is unspecified. If `f` returns an error, the function will short
circuit and immediately return the error code without visiting any remaining processes.
Defined at line 498 of file ../../src/performance/cpu_profiler/targets.cc
std::optional<std::string_view> GetProcessName (zx_koid_t pid)
Search for the name of the process specified by `pid`.
Defined at line 517 of file ../../src/performance/cpu_profiler/targets.cc
std::optional<std::string_view> GetThreadName (zx_koid_t tid)
Search for the name of the thread specified by `tid`.
Defined at line 530 of file ../../src/performance/cpu_profiler/targets.cc