Android Log

This data source is supported only on Android userdebug builds.

The “android.log” data source records log events from the Android log daemon (logd). These are the same log messages that are available via adb logcat.

Both textual events and binary-formatted events from the EventLog are supported.

This allows you to see log events time-synced with the rest of the trace. When recording long traces, it allows you to record event logs indefinitely, regardless of the Android log daemon buffer size (i.e. log events are periodically fetched and copied into the trace buffer).

The data source can be configured to filter event from specific log buffers and keep only the events matching specific tags or priority.

UI

At the UI level, log events are showed in two widgets:

  1. A summary track that allows to quickly glance at the distribution of events and their severity on the timeline.

  2. A table, time-synced with the viewport, that allows to see events within the selected time range.

SQL

select l.ts, t.tid, p.pid, p.name as process, l.prio, l.tag, l.msg
from android_logs as l left join thread as t using(utid) left join process as p using(upid)
tstidpidprocesspriotagmsg
2914747372982642912829128traced_probes4perfettoprobes_producer.cc:231 Ftrace setup (target_buf=1)
291474852699265625625surfaceflinger3SurfaceFlingerFinished setting power mode 1 on display 0
29147485327410918181228system_server3SurfaceControlExcessive delay in setPowerMode()
29147488247484112921228system_server4DisplayPowerControllerUnblocked screen on after 242 ms
29147491824661512791228system_server4am_pssPid=28568 UID=10194 Process Name=“com.google.android.apps.fitness” Pss=12077056 Uss=10723328 SwapPss=183296 Rss=55021568 StatType=0 ProcState=18 TimeToCollect=51

TraceConfig

Trace proto: AndroidLogPacket

Config proto: AndroidLogConfig

Sample config:

data_sources: {
    config {
        name: "android.log"
        android_log_config {
            min_prio: PRIO_VERBOSE
            filter_tags: "perfetto"
            filter_tags: "my_tag_2"
            log_ids: LID_DEFAULT
            log_ids: LID_RADIO
            log_ids: LID_EVENTS
            log_ids: LID_SYSTEM
            log_ids: LID_CRASH
            log_ids: LID_KERNEL
        }
    }
}