1-- 2-- Copyright 2023 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-- https://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-- Android network packet events (from android.network_packets data source). 17CREATE PERFETTO VIEW android_network_packets ( 18 -- Timestamp. 19 ts TIMESTAMP, 20 -- Duration (non-zero only in aggregate events) 21 dur DURATION, 22 -- The track name (interface and direction) 23 track_name STRING, 24 -- Traffic package source (or uid=$X if not found) 25 package_name STRING, 26 -- Traffic interface name (linux interface name) 27 iface STRING, 28 -- Traffic direction ('Transmitted' or 'Received') 29 direction STRING, 30 -- Number of packets in this event 31 packet_count LONG, 32 -- Number of bytes in this event (wire size) 33 packet_length LONG, 34 -- Transport used for traffic in this event 35 packet_transport STRING, 36 -- TCP flags used by tcp frames in this event 37 packet_tcp_flags LONG, 38 -- The Android traffic tag of the network socket 39 socket_tag STRING, 40 -- The Linux user id of the network socket 41 socket_uid LONG, 42 -- The local port number (for udp or tcp only) 43 local_port LONG, 44 -- The remote port number (for udp or tcp only) 45 remote_port LONG, 46 -- 1-byte ICMP type identifier. 47 packet_icmp_type LONG, 48 -- 1-byte ICMP code identifier. 49 packet_icmp_code LONG, 50 -- Packet's tcp flags bitmask (e.g. FIN=0x1, SYN=0x2). 51 packet_tcp_flags_int LONG, 52 -- Packet's socket tag as an integer. 53 socket_tag_int LONG 54) AS 55SELECT 56 ts, 57 dur, 58 category AS track_name, 59 name AS package_name, 60 iface, 61 direction, 62 packet_count, 63 packet_length, 64 packet_transport, 65 -- For backwards compatibility, the _str suffixed flags (which the ui shows) 66 -- are exposed without suffix, and the integer fields get suffix instead. 67 packet_tcp_flags_str AS packet_tcp_flags, 68 packet_tcp_flags AS packet_tcp_flags_int, 69 socket_tag_str AS socket_tag, 70 socket_tag AS socket_tag_int, 71 socket_uid, 72 local_port, 73 remote_port, 74 packet_icmp_type, 75 packet_icmp_code 76FROM __intrinsic_android_network_packets; 77