1 /* 2 * Copyright (C) 2020 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef SRC_ANDROID_STATS_PERFETTO_ATOMS_H_ 18 #define SRC_ANDROID_STATS_PERFETTO_ATOMS_H_ 19 20 namespace perfetto { 21 22 // This must match the values of the PerfettoUploadEvent enum in: 23 // frameworks/proto_logging/stats/atoms.proto 24 enum class PerfettoStatsdAtom { 25 kUndefined = 0, 26 27 // Checkpoints inside perfetto_cmd before tracing is finished. 28 kTraceBegin = 1, 29 kBackgroundTraceBegin = 2, 30 kCmdCloneTraceBegin = 55, 31 kCmdCloneTriggerTraceBegin = 56, 32 kOnConnect = 3, 33 kCmdOnSessionClone = 58, 34 kCmdOnTriggerSessionClone = 59, 35 36 // Guardrails inside perfetto_cmd before tracing is finished. 37 kOnTimeout = 16, 38 39 // Checkpoints inside traced. 40 kTracedEnableTracing = 37, 41 kTracedStartTracing = 38, 42 kTracedDisableTracing = 39, 43 kTracedNotifyTracingDisabled = 40, 44 45 // Trigger checkpoints inside traced. 46 // These atoms are special because, along with the UUID, 47 // they log the trigger name. 48 kTracedTriggerStartTracing = 41, 49 kTracedTriggerStopTracing = 42, 50 kTracedTriggerCloneSnapshot = 53, 51 52 // Guardrails inside traced. 53 kTracedEnableTracingExistingTraceSession = 18, 54 kTracedEnableTracingTooLongTrace = 19, 55 kTracedEnableTracingInvalidTriggerTimeout = 20, 56 kTracedEnableTracingDurationWithTrigger = 21, 57 kTracedEnableTracingStopTracingWriteIntoFile = 22, 58 kTracedEnableTracingDuplicateTriggerName = 23, 59 kTracedEnableTracingInvalidDeferredStart = 24, 60 kTracedEnableTracingInvalidBufferSize = 25, 61 kTracedEnableTracingBufferSizeTooLarge = 26, 62 kTracedEnableTracingTooManyBuffers = 27, 63 kTracedEnableTracingDuplicateSessionName = 28, 64 kTracedEnableTracingSessionNameTooRecent = 29, 65 kTracedEnableTracingTooManySessionsForUid = 30, 66 kTracedEnableTracingTooManyConcurrentSessions = 31, 67 kTracedEnableTracingInvalidFdOutputFile = 32, 68 kTracedEnableTracingFailedToCreateFile = 33, 69 kTracedEnableTracingOom = 34, 70 kTracedEnableTracingUnknown = 35, 71 kTracedStartTracingInvalidSessionState = 36, 72 kTracedEnableTracingInvalidFilter = 47, 73 kTracedEnableTracingOobTargetBuffer = 48, 74 kTracedEnableTracingInvalidTriggerMode = 52, 75 kTracedEnableTracingInvalidBrFilename = 54, 76 kTracedEnableTracingFailedSessionSemaphoreCheck = 57, 77 78 // Checkpoints inside perfetto_cmd after tracing has finished. 79 kOnTracingDisabled = 4, 80 kFinalizeTraceAndExit = 11, 81 kCmdFwReportBegin = 49, 82 // Will be removed once incidentd is no longer used. 83 kUploadIncidentBegin = 8, 84 kNotUploadingEmptyTrace = 17, 85 86 // Guardrails inside perfetto_cmd after tracing has finished. 87 kCmdFwReportEmptyTrace = 50, 88 // Will be removed once incidentd is no longer used. 89 kUploadIncidentFailure = 10, 90 91 // "Successful" terminal states inside perfetto_cmd. 92 kCmdFwReportHandoff = 51, 93 94 // Deprecated as "success" is misleading; it simply means we were 95 // able to communicate with incidentd. Will be removed once 96 // incidentd is no longer used. 97 kUploadIncidentSuccess = 9, 98 99 // Contained trigger begin/success/failure. Replaced by 100 // |PerfettoTriggerAtom| to allow aggregation using a count metric 101 // and reduce spam. 102 // reserved 12, 13, 14; 103 104 // Contained that a guardrail in perfetto_cmd was hit. Replaced with 105 // kCmd* guardrails. 106 // reserved 15; 107 108 // Contained status of Dropbox uploads. Removed as Perfetto no 109 // longer supports uploading traces using Dropbox. 110 // reserved 5, 6, 7; 111 112 // Contained status of guardrail state initialization and upload limit in 113 // perfetto_cmd. Removed as perfetto no longer manages stateful guardrails 114 // reserved 44, 45, 46; 115 116 // Contained the guardrail for user build tracing. Removed as this guardrail 117 // causes more problem than it solves these days. 118 // reserved 43; 119 }; 120 121 // This must match the values of the PerfettoTrigger::TriggerType enum in: 122 // frameworks/proto_logging/stats/atoms.proto 123 enum PerfettoTriggerAtom { 124 kUndefined = 0, 125 126 kTracedLimitProbability = 5, 127 kTracedLimitMaxPer24h = 6, 128 129 kTracedTrigger = 9, 130 131 // Contained events of logging triggers through perfetto_cmd, probes and 132 // trigger_perfetto. 133 // Removed in W (Oct 2024) and replaced by |kTracedTrigger|. 134 // reserved 1, 2, 3, 4, 7, 8 135 }; 136 137 } // namespace perfetto 138 139 #endif // SRC_ANDROID_STATS_PERFETTO_ATOMS_H_ 140