Skip to main content

starnix_logging/
trace.rs

1// Copyright 2023 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// The trace category used for starnix-related traces.
6pub const CATEGORY_STARNIX: &'static str = "starnix";
7
8// The trace category used for memory manager related traces.
9pub const CATEGORY_STARNIX_MM: &'static str = "starnix:mm";
10
11// The trace category used for security related traces.
12pub const CATEGORY_STARNIX_SECURITY: &'static str = "starnix:security";
13
14// The name used to track the duration in Starnix while executing a task.
15pub const NAME_RUN_TASK: &'static str = "RunTask";
16
17// The trace category used for atrace events generated within starnix.
18pub const CATEGORY_ATRACE: &'static str = "starnix:atrace";
19
20// The trace category used for trace events about emitting trace events.
21pub const CATEGORY_TRACE_META: &'static str = "starnix:trace_meta";
22
23// The name used to identify blob records from the container's Perfetto daemon.
24pub const NAME_PERFETTO_BLOB: &'static str = "starnix_perfetto";
25
26// The name used to track the duration of creating a container.
27pub const NAME_CREATE_CONTAINER: &'static str = "CreateContainer";
28
29// The name used to track the start time of the starnix kernel.
30pub const NAME_START_KERNEL: &'static str = "StartKernel";
31
32// The name used to track when a thread was kicked.
33pub const NAME_RESTRICTED_KICK: &'static str = "RestrictedKick";
34
35// The name used to track the duration for inline exception handling.
36pub const NAME_HANDLE_EXCEPTION: &'static str = "HandleException";
37
38// The names used to track durations for restricted state I/O.
39pub const NAME_READ_RESTRICTED_STATE: &'static str = "ReadRestrictedState";
40pub const NAME_WRITE_RESTRICTED_STATE: &'static str = "WriteRestrictedState";
41pub const NAME_MAP_RESTRICTED_STATE: &'static str = "MapRestrictedState";
42
43// The name used to track the duration of checking whether the task loop should exit.
44pub const NAME_CHECK_TASK_EXIT: &'static str = "CheckTaskExit";
45
46pub const ARG_NAME: &'static str = "name";
47
48#[inline]
49pub fn regular_trace_category_enabled(category: &'static str) -> bool {
50    fuchsia_trace::category_enabled(category)
51}