summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Salyzyn2016-09-12 16:51:54 -0500
committerMark Salyzyn2017-02-02 16:24:18 -0600
commit61e9ce6709a12cf39a9471476da3d50339efe466 (patch)
treec461a90ad53a38bf2baab5a3d9ec922aded478ea /logd/LogUtils.h
parent3dfe40129657165f4cfe6c6cf0a5b6c8e8e6d4da (diff)
downloadplatform-system-core-61e9ce6709a12cf39a9471476da3d50339efe466.tar.gz
platform-system-core-61e9ce6709a12cf39a9471476da3d50339efe466.tar.xz
platform-system-core-61e9ce6709a12cf39a9471476da3d50339efe466.zip
logd: add getEventTag command and service
Will register a new event tag by name and format, and return an event-log-tags format response with the newly allocated tag. If format is not specified, then nothing will be recorded, but a pre-existing named entry will be listed. If name and format are not specified, list all dynamic entries. If name=* list all event log tag entries. Stickiness through logd crash will be managed with the tmpfs file /dev/event-log-tags and through a reboot with add_tag entries in the pmsg last logcat event log. On debug builds we retain a /data/misc/logd/event-log-tags file that aids stickiness and that can be picked up by the bugreport. If we detect truncation damage to /dev/event-log-tags, or to /data/misc/logd/event-log-tags, rebuild file with a new first line signature incorporating the time so mmap'd readers of the file can detect the possible change in shape and order. Manual testing: Make sure nc (netcat) is built for the target platform on the host: $ m nc Then the following can be used to issue a request on the platform: $ echo -n 'getEventTag name=<name> format="<format>"\0EXIT\0' | > nc -U /dev/socket/logd Test: gTest logd-unit-test --gtest_filter=getEventTag* Bug: 31456426 Change-Id: I5dacc5f84a24d52dae09cca5ee1a3a9f9207f06d
Diffstat (limited to 'logd/LogUtils.h')
-rw-r--r--logd/LogUtils.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/logd/LogUtils.h b/logd/LogUtils.h
index 70f24e4d9..f044b2744 100644
--- a/logd/LogUtils.h
+++ b/logd/LogUtils.h
@@ -39,8 +39,9 @@ size_t sizesTotal();
39char *pidToName(pid_t pid); 39char *pidToName(pid_t pid);
40char *tidToName(pid_t tid); 40char *tidToName(pid_t tid);
41 41
42// Furnished in main.cpp. Thread safe. 42// Furnished in LogTags.cpp. Thread safe.
43const char *tagToName(size_t *len, uint32_t tag); 43const char *tagToName(uint32_t tag);
44void ReReadEventLogTags();
44 45
45// Furnished by LogKlog.cpp. 46// Furnished by LogKlog.cpp.
46const char* strnstr(const char* s, size_t len, const char* needle); 47const char* strnstr(const char* s, size_t len, const char* needle);