xref: /aosp_15_r20/prebuilts/tools/linux-x86_64/perfetto/configs/long_trace_config.textproto (revision 6774467a9462441f7cd7fbc651979727f762377a)
1# Copyright (C) 2019 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15# proto-message: TraceConfig
16
17# Enable periodic flushing of the trace buffer into the output file.
18write_into_file: true
19
20# Writes the userspace buffer into the file every 2.5 seconds.
21file_write_period_ms: 2500
22
23# See b/126487238 - we need to guarantee ordering of events.
24flush_period_ms: 30000
25
26# The trace buffers needs to be big enough to hold |file_write_period_ms| of
27# trace data. The trace buffer sizing depends on the number of trace categories
28# enabled and the device activity.
29
30# RSS events
31buffers {
32  size_kb: 16384
33  fill_policy: RING_BUFFER
34}
35
36# procfs polling and linux system info from sysfs
37buffers {
38  size_kb: 8192
39  fill_policy: RING_BUFFER
40}
41
42data_sources {
43  config {
44    name: "linux.ftrace"
45    target_buffer: 0
46    ftrace_config {
47      throttle_rss_stat: true
48      # These parameters affect only the kernel trace buffer size and how
49      # frequently it gets moved into the userspace buffer defined above.
50      buffer_size_kb: 16384
51      drain_period_ms: 250
52
53      # We need to do process tracking to ensure kernel ftrace events targeted at short-lived
54      # threads are associated correctly
55      ftrace_events: "task/task_newtask"
56      ftrace_events: "task/task_rename"
57      ftrace_events: "sched/sched_process_exit"
58      ftrace_events: "sched/sched_process_free"
59
60      # Memory events
61      ftrace_events: "rss_stat"
62      ftrace_events: "ion_heap_shrink"
63      ftrace_events: "ion_heap_grow"
64      ftrace_events: "ion/ion_stat"
65      ftrace_events: "dmabuf_heap/dma_heap_stat"
66      ftrace_events: "oom_score_adj_update"
67      ftrace_events: "gpu_mem/gpu_mem_total"
68      ftrace_events: "fastrpc/fastrpc_dma_stat"
69
70      # Old (kernel) LMK
71      ftrace_events: "lowmemorykiller/lowmemory_kill"
72
73      # New (userspace) LMK
74      atrace_apps: "lmkd"
75      # Added for userspace annotation in the platform scenario test app
76      atrace_apps: "android.platform.test.scenario"
77
78      atrace_categories: "am"
79    }
80  }
81}
82
83data_sources: {
84  config {
85    name: "android.gpu.memory"
86    target_buffer: 0
87  }
88}
89
90data_sources {
91  config {
92    name: "linux.process_stats"
93    target_buffer: 1
94    process_stats_config {
95      proc_stats_poll_ms: 10000
96      proc_stats_cache_ttl_ms: 60000
97    }
98  }
99}
100
101data_sources {
102  config {
103    name: "linux.system_info"
104    target_buffer: 1
105  }
106}
107
108data_sources {
109  config {
110    name: "linux.sys_stats"
111    target_buffer: 1
112    sys_stats_config {
113      meminfo_period_ms: 1000
114      meminfo_counters: MEMINFO_MEM_TOTAL
115      meminfo_counters: MEMINFO_MEM_FREE
116      meminfo_counters: MEMINFO_MEM_AVAILABLE
117      meminfo_counters: MEMINFO_BUFFERS
118      meminfo_counters: MEMINFO_CACHED
119      meminfo_counters: MEMINFO_SWAP_CACHED
120      meminfo_counters: MEMINFO_ACTIVE
121      meminfo_counters: MEMINFO_INACTIVE
122      meminfo_counters: MEMINFO_ACTIVE_ANON
123      meminfo_counters: MEMINFO_INACTIVE_ANON
124      meminfo_counters: MEMINFO_ACTIVE_FILE
125      meminfo_counters: MEMINFO_INACTIVE_FILE
126      meminfo_counters: MEMINFO_UNEVICTABLE
127      meminfo_counters: MEMINFO_SWAP_TOTAL
128      meminfo_counters: MEMINFO_SWAP_FREE
129      meminfo_counters: MEMINFO_DIRTY
130      meminfo_counters: MEMINFO_WRITEBACK
131      meminfo_counters: MEMINFO_ANON_PAGES
132      meminfo_counters: MEMINFO_MAPPED
133      meminfo_counters: MEMINFO_SHMEM
134    }
135  }
136}
137
138data_sources {
139  config {
140    name: "android.power"
141    target_buffer: 1
142    android_power_config {
143      battery_poll_ms: 5000
144      collect_power_rails: true
145      battery_counters: BATTERY_COUNTER_CAPACITY_PERCENT
146      battery_counters: BATTERY_COUNTER_CHARGE
147      battery_counters: BATTERY_COUNTER_CURRENT
148    }
149  }
150}
151