blob: fd4fa9e5e91462e30120e54f4dc578d2b53457c7 [file] [log] [blame]
Yi Jin3c034c92017-12-22 17:36:47 -08001/*
2 * Copyright (C) 2017 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";
18package android.util;
19
20option java_multiple_files = true;
21
22// Represents a Text Log in logd
23// Next Tag: 9
24message TextLogEntry {
25 optional uint64 sec = 1;
26 optional uint64 nanosec = 2;
27
28 enum LogPriority {
29 LOG_UNKNOWN = 0;
30 LOG_DEFAULT = 1;
31 LOG_VERBOSE = 2;
32 LOG_DEBUG = 3;
33 LOG_INFO = 4;
34 LOG_WARN = 5;
35 LOG_ERROR = 6;
36 LOG_FATAL = 7;
37 LOG_SILENT = 8;
38 }
39 optional LogPriority priority = 3;
40 optional int32 uid = 4;
41 optional int32 pid = 5;
42 optional int32 tid = 6;
43 optional string tag = 7;
44 optional string log = 8;
45}
46
47// Represents a Binary Log in logd, need to look event-log-tags for more info.
48// Next Tag: 8
49message BinaryLogEntry {
50 optional uint64 sec = 1;
51 optional uint64 nanosec = 2;
52 optional int32 uid = 3;
53 optional int32 pid = 4;
54 optional int32 tid = 5;
55
56 // Index of the event tag, can look up in event-log-tags file
57 optional uint32 tag_index = 6;
58
59 message Elem {
Yi Jin30789db2018-01-09 11:29:38 -080060 // must be sync with AOSP liblog's log.h
Yi Jin3c034c92017-12-22 17:36:47 -080061 enum Type {
Yi Jin30789db2018-01-09 11:29:38 -080062 EVENT_TYPE_LIST_STOP = 10; // ascii decimal value of char '\n'
63 EVENT_TYPE_UNKNOWN = 63; // ascii decimal value of char '?'
Yi Jin3c034c92017-12-22 17:36:47 -080064
65 EVENT_TYPE_INT = 0;
66 EVENT_TYPE_LONG = 1;
67 EVENT_TYPE_STRING = 2;
68 EVENT_TYPE_LIST = 3;
69 EVENT_TYPE_FLOAT = 4;
70 }
71 optional Type type = 1 [default=EVENT_TYPE_UNKNOWN];
72
73 oneof value {
74 int32 val_int32 = 2;
75 int64 val_int64 = 3;
76 string val_string = 4;
77 float val_float = 5;
78 }
79 }
80 repeated Elem elems = 7;
81}
82
83message LogProto {
84 repeated TextLogEntry text_logs = 1;
85
86 repeated BinaryLogEntry binary_logs = 2;
87}
88