1# Copyright (C) 2022 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# proto-message: TraceConfig 15 16# Trace config originally supplied in b/230177578. 17 18# Periodically writes the central tracing buffers (defined below) to disk. 19write_into_file: true 20file_write_period_ms: 1000 21 22# Ensure worst-case reordering of events in the central tracing buffers. 23flush_period_ms: 30000 24 25# The trace buffers need to be big enough to hold |file_write_period_ms| of 26# trace data. The trace buffer sizing depends on the number of trace categories 27# enabled and the device activity. 28buffers: { 29 size_kb: 20480 30 fill_policy: RING_BUFFER 31} 32 33data_sources: { 34 config: { 35 name: "linux.ftrace" 36 target_buffer: 0 37 ftrace_config: { 38 throttle_rss_stat: true 39 compact_sched: { 40 enabled: true 41 } 42 43 # core: scheduling 44 ftrace_events: "sched/sched_switch" 45 ftrace_events: "sched/sched_waking" 46 47 # core: process lifetime events 48 ftrace_events: "sched/sched_wakeup_new" 49 ftrace_events: "sched/sched_process_exit" 50 ftrace_events: "sched/sched_process_free" 51 ftrace_events: "task/task_newtask" 52 ftrace_events: "task/task_rename" 53 54 # scheduling: why any given thread is blocked 55 ftrace_events: "sched/sched_blocked_reason" 56 # device suspend/resume events 57 ftrace_events: "power/suspend_resume" 58 59 # RSS and ION buffer events 60 ftrace_events: "dmabuf_heap/dma_heap_stat" 61 ftrace_events: "fastrpc/fastrpc_dma_stat" 62 ftrace_events: "gpu_mem/gpu_mem_total" 63 ftrace_events: "ion/ion_stat" 64 ftrace_events: "kmem/ion_heap_grow" 65 ftrace_events: "kmem/ion_heap_shrink" 66 ftrace_events: "kmem/rss_stat" 67 68 # optional: LMK 69 atrace_apps: "lmkd" 70 ftrace_events: "lowmemorykiller/lowmemory_kill" 71 ftrace_events: "oom/oom_score_adj_update" 72 ftrace_events: "oom/mark_victim" 73 74 # userspace events from system_server 75 atrace_categories: "ss" 76 atrace_apps: "system_server" 77 # userspace events from activity and window managers 78 atrace_categories: "am" 79 atrace_categories: "wm" 80 # userspace events from java and c runtimes 81 atrace_categories: "dalvik" 82 atrace_categories: "bionic" 83 # userspace events from systemui 84 atrace_apps: "com.android.systemui" 85 86 # groups that expand into power events (mix of userspace and ftrace) 87 atrace_categories: "freq" 88 # "thermal" removed for APIs <= 30, temporarily. 89 atrace_categories: "power" 90 91 # binder & HALs 92 atrace_categories: "aidl" 93 atrace_categories: "hal" 94 atrace_categories: "binder_driver" 95 96 # Other userspace event groups, see 97 # frameworks/native/cmds/atrace/atrace.cpp in the Android tree for 98 # available categories. The encoding of userspace events is very verbose 99 # so keep the list focused or you will need to readjust the buffer sizes 100 # to avoid data loss. 101 atrace_categories: "disk" 102 atrace_categories: "gfx" 103 atrace_categories: "res" 104 atrace_categories: "view" 105 atrace_categories: "idle" 106 atrace_categories: "webview" 107 108 # Default to enabling userspace events from all apps. 109 atrace_apps: "*" 110 111 # Following line will be used to inject additional configs. Do not remove or modify. 112 # {injected_config} 113 } 114 } 115} 116 117data_sources { 118 config { 119 name: "linux.process_stats" 120 target_buffer: 0 121 # polled per-process memory counters and process/thread names. 122 # If you don't want the polled counters, remove the "process_stats_config" 123 # section, but keep the data source itself as it still provides on-demand 124 # thread/process naming for ftrace data below. 125 process_stats_config { 126 proc_stats_poll_ms: 500 127 scan_all_processes_on_start: true 128 } 129 } 130} 131 132data_sources: { 133 config { 134 # rendering: expected vs actual frame timeline tracks 135 name: "android.surfaceflinger.frametimeline" 136 target_buffer: 0 137 } 138} 139