• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (C) 2018 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";
18option optimize_for = LITE_RUNTIME;
19package perfetto.protos;
20
21import "perfetto/common/android_log_constants.proto";
22
23message AndroidLogPacket {
24  message LogEvent {
25    // The log buffer (e.g. MAIN, SYSTEM, RADIO) the event comes from.
26    optional AndroidLogId log_id = 1;
27
28    // PID (TGID), TID and UID of the task that emitted the event.
29    optional int32 pid = 2;
30    optional int32 tid = 3;
31    optional int32 uid = 4;
32
33    // Timestamp [ns]. The clock source is CLOCK_REALTIME, unlike many other
34    // Perfetto trace events that instead use CLOCK_BOOTTIME. The trace
35    // processor will take care of realigning clocks using the ClockSnapshot(s).
36    optional uint64 timestamp = 5;
37
38    // When log_id == LID_EVENTS, |tag| corresponds to the event name defined in
39    // the second column of /system/etc/event-log-tags. For all other events,
40    // |tag| is the app-specified argument passed to __android_log_write().
41    optional string tag = 6;
42
43    // Empty when log_id == LID_EVENTS.
44    optional AndroidLogPriority prio = 7;
45
46    // Empty when log_id == LID_EVENTS.
47    optional string message = 8;
48
49    message Arg {
50      optional string name = 1;
51      oneof value {
52        int64 int_value = 2;
53        float float_value = 3;
54        string string_value = 4;
55      }
56    }
57    // Only populated when log_id == LID_EVENTS.
58    repeated Arg args = 9;
59  }
60
61  repeated LogEvent events = 1;
62
63  // Stats are emitted only upon Flush() and are monotonic (i.e. they are
64  // absolute counters since the beginning of the lifetime of the tracing
65  // session and NOT relative to the previous Stats snapshot).
66  message Stats {
67    // Total number of log events seen, including errors and skipped entries
68    // (num of events stored in the trace = total - failed - skipped).
69    optional uint64 num_total = 1;
70
71    // Parser failures.
72    optional uint64 num_failed = 2;
73
74    // Messages skipped due to filters.
75    optional uint64 num_skipped = 3;
76  }
77  optional Stats stats = 2;
78}
79