-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrace_config.proto
138 lines (115 loc) · 5.13 KB
/
trace_config.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
import "perfetto/config/data_source_config.proto";
package perfetto.protos;
// When editing this file run ./tools/gen_tracing_cpp_headers_from_protos.py
// to reflect changes in the corresponding C++ headers.
// The overall config that is used when starting a new tracing session through
// ProducerPort::StartTracing().
// It contains the general config for the logging buffer(s) and the configs for
// all the data source being enabled.
//
// Next id: 8.
message TraceConfig {
message BufferConfig {
optional uint32 size_kb = 1;
reserved 2; // |page_size|, now deprecated.
reserved 3; // |optimize_for|, now deprecated.
enum FillPolicy {
UNSPECIFIED = 0;
RING_BUFFER = 1;
// TODO: not implemented yet.
// STOP_WHEN_FULL = 2;
}
optional FillPolicy fill_policy = 4;
}
repeated BufferConfig buffers = 1;
message DataSource {
// Filters and data-source specific config. It contains also the unique name
// of the data source, the one passed in the DataSourceDescriptor when they
// register on the service.
optional protos.DataSourceConfig config = 1;
// Optional. If multiple producers (~processes) expose the same data source
// and |producer_name_filter| != "", the data source is enabled only for
// producers whose names match any of the producer_name_filter below.
// The |producer_name_filter| has to be an exact match. (TODO(primiano):
// support wildcards or regex).
// This allows to enable a data source only for specific processes.
// The "repeated" field has OR sematics: specifying a filter ["foo", "bar"]
// will enable data source on both "foo" and "bar" (if existent).
repeated string producer_name_filter = 2;
}
repeated DataSource data_sources = 2;
optional uint32 duration_ms = 3;
// This is set when --dropbox is passed to the Perfetto command line client
// and enables guardrails that limit resource usage for traces requested
// by statsd.
optional bool enable_extra_guardrails = 4;
enum LockdownModeOperation {
LOCKDOWN_UNCHANGED = 0;
LOCKDOWN_CLEAR = 1;
LOCKDOWN_SET = 2;
}
// Reject producers that are not running under the same UID as the tracing
// service.
optional LockdownModeOperation lockdown_mode = 5;
message ProducerConfig {
// Identifies the producer for which this config is for.
optional string producer_name = 1;
// Specifies the preferred size of the shared memory buffer. If the size is
// larger than the max size, the max will be used. If it is smaller than
// the page size or doesn't fit pages evenly into it, it will fall back to
// the size specified by the producer or finally the default shared memory
// size.
optional uint32 shm_size_kb = 2;
// Specifies the preferred size of each page in the shared memory buffer.
// Must be an integer mutiple of 4K.
optional uint32 page_size_kb = 3;
}
repeated ProducerConfig producers = 6;
// Contains statsd-specific metadata about an alert associated with the trace.
message StatsdMetadata {
// The identifier of the alert which triggered this trace.
optional int64 triggering_alert_id = 1;
// The uid which registered the triggering configuration with statsd.
optional int32 triggering_config_uid = 2;
// The identifier of the config which triggered the alert.
optional int64 triggering_config_id = 3;
}
// Statsd-specific metadata.
optional StatsdMetadata statsd_metadata = 7;
// When true, the EnableTracing() request must also provide a file descriptor.
// The service will then periodically read packets out of the trace buffer and
// store it into the passed file.
optional bool write_into_file = 8;
// Optional. If non-zero tunes the write period. A min value of 100ms is
// enforced (i.e. smaller values are ignored).
optional uint32 file_write_period_ms = 9;
// Optional. When non zero the periodic write stops once at most X bytes
// have been written into the file. Tracing is disabled when this limit is
// reached, even if |duration_ms| has not been reached yet.
optional uint64 max_file_size_bytes = 10;
// Contains flags which override the default values of the guardrails inside
// Perfetto. These values are only affect userdebug builds.
message GuardrailOverrides {
// Override the default limit (in bytes) for uploading data to server within
// a 24 hour period.
optional uint64 max_upload_per_day_bytes = 1;
}
optional GuardrailOverrides guardrail_overrides = 11;
}