| // Copyright 2021 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| @available(added=7) |
| library fuchsia.diagnostics.types; |
| |
| using zx; |
| |
| // Task associated with a running component. |
| type Task = flexible resource union { |
| 1: job zx.handle:JOB; |
| 2: process zx.handle:PROCESS; |
| 3: thread zx.handle:THREAD; |
| }; |
| |
| // Contains handles for tasks of the running component. This is emitted by |
| // runners and handled by component manager to obtain information about the |
| // process and record diagnostics. |
| type ComponentTasks = resource table { |
| // The Zircon task for the running component. |
| // Resource usage for the component is attributed to this task. |
| 1: component_task Task; |
| |
| // The container task running the component. |
| // This field is set to the task that runs `component_task`. For |
| // example, if `component_task` is run a part of a Virtual Machine, |
| // this task is set so that resources attributed to the parent can be |
| // subdivided between their children. |
| // |
| // This field is used only when a portion of the `component_task`'s resource |
| // usage is shared with another component. If `component_task` owns exactly |
| // only those resources used by the component, `parent_task` must be left |
| // unset. |
| 2: parent_task Task; |
| }; |
| |
| // Diagnostics information about a component provided by the runner. |
| type ComponentDiagnostics = resource table { |
| // Tasks associated with the running component. |
| 1: tasks ComponentTasks; |
| }; |