• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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   kOnConnect = 3,
31 
32   // Guardrails inside perfetto_cmd before tracing is finished.
33   kOnTimeout = 16,
34   kCmdUserBuildTracingNotAllowed = 43,
35   kCmdFailedToInitGuardrailState = 44,
36   kCmdInvalidGuardrailState = 45,
37   kCmdHitUploadLimit = 46,
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 
76   // Checkpoints inside perfetto_cmd after tracing has finished.
77   kOnTracingDisabled = 4,
78   kFinalizeTraceAndExit = 11,
79   kCmdFwReportBegin = 49,
80   // Will be removed once incidentd is no longer used.
81   kUploadIncidentBegin = 8,
82   kNotUploadingEmptyTrace = 17,
83 
84   // Guardrails inside perfetto_cmd after tracing has finished.
85   kCmdFwReportEmptyTrace = 50,
86   // Will be removed once incidentd is no longer used.
87   kUploadIncidentFailure = 10,
88 
89   // "Successful" terminal states inside perfetto_cmd.
90   kCmdFwReportHandoff = 51,
91 
92   // Deprecated as "success" is misleading; it simply means we were
93   // able to communicate with incidentd. Will be removed once
94   // incidentd is no longer used.
95   kUploadIncidentSuccess = 9,
96 
97   // Contained trigger begin/success/failure. Replaced by
98   // |PerfettoTriggerAtom| to allow aggregation using a count metric
99   // and reduce spam.
100   // reserved 12, 13, 14;
101 
102   // Contained that a guardrail in perfetto_cmd was hit. Replaced with
103   // kCmd* guardrails.
104   // reserved 15;
105 
106   // Contained status of Dropbox uploads. Removed as Perfetto no
107   // longer supports uploading traces using Dropbox.
108   // reserved 5, 6, 7;
109 };
110 
111 // This must match the values of the PerfettoTrigger::TriggerType enum in:
112 // frameworks/proto_logging/stats/atoms.proto
113 enum PerfettoTriggerAtom {
114   kUndefined = 0,
115 
116   kCmdTrigger = 1,
117   kCmdTriggerFail = 2,
118 
119   kTriggerPerfettoTrigger = 3,
120   kTriggerPerfettoTriggerFail = 4,
121 
122   kTracedLimitProbability = 5,
123   kTracedLimitMaxPer24h = 6,
124 
125   kProbesProducerTrigger = 7,
126   kProbesProducerTriggerFail = 8,
127 };
128 
129 }  // namespace perfetto
130 
131 #endif  // SRC_ANDROID_STATS_PERFETTO_ATOMS_H_
132