From 97deb299df063362d4150a0a6130d5b047ac014b Mon Sep 17 00:00:00 2001 From: Tom Cherry Date: Fri, 3 Apr 2020 14:22:12 -0700 Subject: [PATCH] liblog: include all structures in README.protocol.md We are stating that these structures will be stable, so include them in the documentation directly. Bug: 152466437 Test: n/a Change-Id: I52a05f61163aa35b99869d722284ff3f98d7f010 --- liblog/README.protocol.md | 43 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/liblog/README.protocol.md b/liblog/README.protocol.md index fef29c921..f247b2817 100644 --- a/liblog/README.protocol.md +++ b/liblog/README.protocol.md @@ -17,6 +17,49 @@ The data that liblog sends to logd is represented below. }; }; +where the embedded structs are defined as: + + struct android_log_header_t { + uint8_t id; + uint16_t tid; + log_time realtime; + }; + + struct log_time { + uint32_t tv_sec = 0; + uint32_t tv_nsec = 0; + } + + struct android_event_header_t { + int32_t tag; + }; + + struct android_event_list_t { + int8_t type; // EVENT_TYPE_LIST + int8_t element_count; + }; + + struct android_event_float_t { + int8_t type; // EVENT_TYPE_FLOAT + float data; + }; + + struct android_event_int_t { + int8_t type; // EVENT_TYPE_INT + int32_t data; + } android_event_int_t; + + struct android_event_long_t { + int8_t type; // EVENT_TYPE_LONG + int64_t data; + }; + + struct android_event_string_t { + int8_t type; // EVENT_TYPE_STRING; + int32_t length; + char data[]; + }; + The payload, excluding the header, has a max size of LOGGER_ENTRY_MAX_PAYLOAD. ## header