From 5d4e5478baa20fc70dba33053cf1928e6f4fdc5c Mon Sep 17 00:00:00 2001 From: Tom Cherry Date: Wed, 23 Oct 2019 16:25:55 +0000 Subject: [PATCH] Revert "liblog: remove mistakenly added symbols from vndk" This reverts commit 5f8162b0862cc04fc9d88305c44fde40ae3ea31c. Reason for revert: Turns out they're being used. Change-Id: Iad9010190c7a4140b69dc553df5debdd88dcf81a --- libcutils/trace-dev.inc | 1 + liblog/include_vndk/log/log.h | 18 +++--------- liblog/include_vndk/log/log_event_list.h | 15 +++++++++- liblog/include_vndk/log/log_id.h | 35 +----------------------- liblog/include_vndk/log/log_properties.h | 1 + liblog/include_vndk/log/log_read.h | 1 + liblog/include_vndk/log/log_time.h | 10 ++++++- liblog/liblog.map.txt | 30 +++++++++++++------- 8 files changed, 51 insertions(+), 60 deletions(-) mode change 100644 => 120000 liblog/include_vndk/log/log_id.h create mode 120000 liblog/include_vndk/log/log_properties.h create mode 120000 liblog/include_vndk/log/log_read.h diff --git a/libcutils/trace-dev.inc b/libcutils/trace-dev.inc index fc7a870f7..e3da77bec 100644 --- a/libcutils/trace-dev.inc +++ b/libcutils/trace-dev.inc @@ -32,6 +32,7 @@ #include #include #include +#include /** * Maximum size of a message that can be logged to the trace buffer. diff --git a/liblog/include_vndk/log/log.h b/liblog/include_vndk/log/log.h index 393b48060..a79beecd4 100644 --- a/liblog/include_vndk/log/log.h +++ b/liblog/include_vndk/log/log.h @@ -1,11 +1,13 @@ /*Special log.h file for VNDK linking modules*/ -#pragma once +#ifndef _LIBS_LOG_LOG_H +#define _LIBS_LOG_LOG_H #include #include #include #include +#include #include #include #include @@ -20,16 +22,4 @@ #define LOG_TAG NULL #endif -// Legacy dependencies... -/* deal with possible sys/cdefs.h conflict with fcntl.h */ -#ifdef __unused -#define __unused_defined __unused -#undef __unused -#endif - -#include /* Pick up O_* macros */ - -/* restore definitions from above */ -#ifdef __unused_defined -#define __unused __attribute__((__unused__)) -#endif +#endif /*_LIBS_LOG_LOG_H*/ diff --git a/liblog/include_vndk/log/log_event_list.h b/liblog/include_vndk/log/log_event_list.h index 81c879f54..1f3dd377b 100644 --- a/liblog/include_vndk/log/log_event_list.h +++ b/liblog/include_vndk/log/log_event_list.h @@ -16,7 +16,8 @@ /* Special log_event_list.h file for VNDK linking modules */ -#pragma once +#ifndef _LIBS_LOG_EVENT_LIST_H +#define _LIBS_LOG_EVENT_LIST_H #include @@ -29,7 +30,10 @@ extern "C" { /* * The opaque context used to manipulate lists of events. */ +#ifndef __android_log_context_defined +#define __android_log_context_defined typedef struct android_log_context_internal* android_log_context; +#endif /* * Creates a context associated with an event tag to write elements to @@ -57,9 +61,18 @@ int android_log_write_float32(android_log_context ctx, float value); /* NB: LOG_ID_EVENTS and LOG_ID_SECURITY only valid binary buffers */ int android_log_write_list(android_log_context ctx, log_id_t id); +/* Reset writer context */ +int android_log_reset(android_log_context ctx); + +/* Reset reader context */ +int android_log_parser_reset(android_log_context ctx, + const char* msg, size_t len); + /* Finished with reader or writer context */ int android_log_destroy(android_log_context* ctx); #ifdef __cplusplus } #endif + +#endif /* _LIBS_LOG_EVENT_LIST_H */ diff --git a/liblog/include_vndk/log/log_id.h b/liblog/include_vndk/log/log_id.h deleted file mode 100644 index 3c6df8b72..000000000 --- a/liblog/include_vndk/log/log_id.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2005-2017 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Send a simple string to the log. - */ -int __android_log_buf_write(int bufID, int prio, const char* tag, const char* text); -int __android_log_buf_print(int bufID, int prio, const char* tag, const char* fmt, ...) - __attribute__((__format__(printf, 4, 5))); - -#ifdef __cplusplus -} -#endif diff --git a/liblog/include_vndk/log/log_id.h b/liblog/include_vndk/log/log_id.h new file mode 120000 index 000000000..dce92b991 --- /dev/null +++ b/liblog/include_vndk/log/log_id.h @@ -0,0 +1 @@ +../../include/log/log_id.h \ No newline at end of file diff --git a/liblog/include_vndk/log/log_properties.h b/liblog/include_vndk/log/log_properties.h new file mode 120000 index 000000000..bbec42614 --- /dev/null +++ b/liblog/include_vndk/log/log_properties.h @@ -0,0 +1 @@ +../../include/log/log_properties.h \ No newline at end of file diff --git a/liblog/include_vndk/log/log_read.h b/liblog/include_vndk/log/log_read.h new file mode 120000 index 000000000..01de8b9ec --- /dev/null +++ b/liblog/include_vndk/log/log_read.h @@ -0,0 +1 @@ +../../include/log/log_read.h \ No newline at end of file diff --git a/liblog/include_vndk/log/log_time.h b/liblog/include_vndk/log/log_time.h index 014af0897..5a09959a7 100644 --- a/liblog/include_vndk/log/log_time.h +++ b/liblog/include_vndk/log/log_time.h @@ -14,7 +14,8 @@ * limitations under the License. */ -#pragma once +#ifndef _LIBS_LOG_LOG_TIME_H +#define _LIBS_LOG_LOG_TIME_H #include @@ -29,6 +30,9 @@ #define MS_PER_SEC 1000ULL #endif +#ifndef __struct_log_time_defined +#define __struct_log_time_defined + #define LOG_TIME_SEC(t) ((t)->tv_sec) /* next power of two after NS_PER_SEC */ #define LOG_TIME_NSEC(t) ((t)->tv_nsec & (UINT32_MAX >> 2)) @@ -37,3 +41,7 @@ typedef struct log_time { uint32_t tv_sec; uint32_t tv_nsec; } __attribute__((__packed__)) log_time; + +#endif + +#endif /* _LIBS_LOG_LOG_TIME_H */ diff --git a/liblog/liblog.map.txt b/liblog/liblog.map.txt index ece8b7563..ce4c53c82 100644 --- a/liblog/liblog.map.txt +++ b/liblog/liblog.map.txt @@ -1,5 +1,7 @@ LIBLOG { global: + android_name_to_log_id; # vndk + android_log_id_to_name; # vndk __android_log_assert; __android_log_buf_print; __android_log_buf_write; @@ -12,15 +14,25 @@ LIBLOG { LIBLOG_L { global: - android_logger_list_alloc; # apex - android_logger_list_alloc_time; # apex - android_logger_list_free; # apex - android_logger_list_read; # apex - android_logger_open; # apex + android_logger_clear; # vndk + android_logger_get_id; # vndk + android_logger_get_log_readable_size; # vndk + android_logger_get_log_version; # vndk + android_logger_get_log_size; # vndk + android_logger_list_alloc; # apex vndk + android_logger_list_alloc_time; # apex vndk + android_logger_list_free; # apex vndk + android_logger_list_open; # vndk + android_logger_list_read; # apex vndk + android_logger_open; # apex vndk + android_logger_set_log_size; # vndk }; LIBLOG_M { global: + android_logger_get_prune_list; # vndk + android_logger_set_prune_list; # vndk + android_logger_get_statistics; # vndk __android_log_error_write; # apex vndk __android_log_is_loggable; create_android_logger; # apex vndk @@ -39,6 +51,7 @@ LIBLOG_M { LIBLOG_O { global: __android_log_is_loggable_len; + __android_log_is_debuggable; # vndk }; LIBLOG_Q { @@ -48,24 +61,21 @@ LIBLOG_Q { __android_log_bwrite; # apex __android_log_close; # apex __android_log_security; # apex + android_log_reset; #vndk + android_log_parser_reset; #vndk }; LIBLOG_PRIVATE { global: - __android_log_is_debuggable; __android_log_pmsg_file_read; __android_log_pmsg_file_write; __android_log_security_bswrite; __android_logger_get_buffer_size; __android_logger_property_get_bool; - android_name_to_log_id; android_openEventTagMap; - android_logger_list_open; - android_log_id_to_name; android_log_processBinaryLogBuffer; android_log_processLogBuffer; android_log_read_next; - android_log_reset; android_log_write_list_buffer; android_lookupEventTagNum; create_android_log_parser;