summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Salyzyn2017-02-21 18:19:08 -0600
committerMark Salyzyn2017-02-22 16:16:31 -0600
commit407537f798c443a2252fd3bbbd1535f7d6fabc53 (patch)
treec1b031477a9f5ea6907d920c3d9d1241a5a8df6a /logd/LogTags.cpp
parent8dcd94b2cd01fed5fa0c1e6d56af1bba5389a866 (diff)
downloadplatform-system-core-407537f798c443a2252fd3bbbd1535f7d6fabc53.tar.gz
platform-system-core-407537f798c443a2252fd3bbbd1535f7d6fabc53.tar.xz
platform-system-core-407537f798c443a2252fd3bbbd1535f7d6fabc53.zip
logd: add getEventTag id= command
This is the precursor for "Plan B" recovery when access to /dev/event-log-tags is blocked to untrusted zones. Also deals with mitigating issues with long-lived mappings that do not update /dev/event-log-tags when dynamically changed. Test: gTest logd-unit-test --gtest_filter=logd.getEventTag_42 Bug: 31456426 Bug: 35326290 Change-Id: I3db2e73763603727a369da3952c5ab4cf709f901
Diffstat (limited to 'logd/LogTags.cpp')
-rw-r--r--logd/LogTags.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/logd/LogTags.cpp b/logd/LogTags.cpp
index a109592ba..64aa219e9 100644
--- a/logd/LogTags.cpp
+++ b/logd/LogTags.cpp
@@ -836,6 +836,11 @@ std::string LogTags::formatEntry_locked(uint32_t tag, uid_t uid,
836 return ret; 836 return ret;
837} 837}
838 838
839std::string LogTags::formatEntry(uint32_t tag, uid_t uid) {
840 android::RWLock::AutoRLock readLock(rwlock);
841 return formatEntry_locked(tag, uid);
842}
843
839std::string LogTags::formatGetEventTag(uid_t uid, 844std::string LogTags::formatGetEventTag(uid_t uid,
840 const char* name, const char* format) { 845 const char* name, const char* format) {
841 bool all = name && (name[0] == '*') && !name[1]; 846 bool all = name && (name[0] == '*') && !name[1];