1/* 2 * Copyright (C) 2022 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 17syntax = "proto2"; 18 19package perfetto.protos; 20 21// Network tracing data source that records details on all packets sent or 22// received by the network. 23message NetworkPacketTraceConfig { 24 // Polling frequency in milliseconds. Network tracing writes to a fixed size 25 // ring buffer. The polling interval should be such that the ring buffer is 26 // unlikely to fill in that interval (or that filling is an acceptable risk). 27 // The minimum polling rate is 100ms (values below this are ignored). 28 // Introduced in Android 14 (U). 29 optional uint32 poll_ms = 1; 30 31 // The aggregation_threshold is the number of packets at which an event will 32 // switch from per-packet details to aggregate details. For example, a value 33 // of 50 means that if a particular event (grouped by the unique combinations 34 // of metadata fields: {interface, direction, uid, etc}) has fewer than 50 35 // packets, the exact timestamp and length are recorded for each packet. If 36 // there were 50 or more packets in an event, it would only record the total 37 // duration, packets, and length. A value of zero or unspecified will always 38 /// record per-packet details. A value of 1 always records aggregate details. 39 optional uint32 aggregation_threshold = 2; 40 41 // Specifies the maximum number of packet contexts to intern at a time. This 42 // prevents the interning table from growing too large and controls whether 43 // interning is enabled or disabled (a value of zero disables interning and 44 // is the default). When a data sources interning table reaches this amount, 45 // packet contexts will be inlined into NetworkPacketEvents. 46 optional uint32 intern_limit = 3; 47 48 // The following fields specify whether certain fields should be dropped from 49 // the output. Dropping fields improves normalization results, reduces the 50 // size of the interning table, and slightly reduces event size. 51 optional bool drop_local_port = 4; 52 optional bool drop_remote_port = 5; 53 optional bool drop_tcp_flags = 6; 54} 55