From 175366df447efef0f326805d4c62f4f17072f366 Mon Sep 17 00:00:00 2001 From: Tom Cherry Date: Tue, 11 Aug 2020 09:20:18 -0700 Subject: [PATCH] liblog: remove android_lookupEventTag This function has been marked deprecated for quite some time, has no users, and isn't in liblog.map.txt. Test: build Change-Id: Ic3bf47c780b18a5d4f1e997b9265be76049fb824 --- liblog/event_tag_map.cpp | 15 --------------- liblog/include/log/event_tag_map.h | 8 -------- 2 files changed, 23 deletions(-) diff --git a/liblog/event_tag_map.cpp b/liblog/event_tag_map.cpp index 51c5e60a8..2c0156ea2 100644 --- a/liblog/event_tag_map.cpp +++ b/liblog/event_tag_map.cpp @@ -559,21 +559,6 @@ const char* android_lookupEventFormat_len(const EventTagMap* map, size_t* len, u return str->second.data(); } -// This function is deprecated and replaced with android_lookupEventTag_len -// since it will cause the map to change from Shared and backed by a file, -// to Private Dirty and backed up by swap, albeit highly compressible. By -// deprecating this function everywhere, we save 100s of MB of memory space. -const char* android_lookupEventTag(const EventTagMap* map, unsigned int tag) { - size_t len; - const char* tagStr = android_lookupEventTag_len(map, &len, tag); - - if (!tagStr) return tagStr; - char* cp = const_cast(tagStr); - cp += len; - if (*cp) *cp = '\0'; // Trigger copy on write :-( and why deprecated. - return tagStr; -} - // Look up tagname, generate one if necessary, and return a tag int android_lookupEventTagNum(EventTagMap* map, const char* tagname, const char* format, int prio) { const char* ep = endOfTag(tagname); diff --git a/liblog/include/log/event_tag_map.h b/liblog/include/log/event_tag_map.h index f7ec208b3..4d0ebf954 100644 --- a/liblog/include/log/event_tag_map.h +++ b/liblog/include/log/event_tag_map.h @@ -39,14 +39,6 @@ EventTagMap* android_openEventTagMap(const char* fileName); */ void android_closeEventTagMap(EventTagMap* map); -/* - * Look up a tag by index. Returns the tag string, or NULL if not found. - */ -const char* android_lookupEventTag(const EventTagMap* map, unsigned int tag) - __attribute__(( - deprecated("use android_lookupEventTag_len() instead to minimize " - "MAP_PRIVATE copy-on-write memory impact"))); - /* * Look up a tag by index. Returns the tag string & string length, or NULL if * not found. Returned string is not guaranteed to be nul terminated.