summaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorYusuke Sato <yusukes@google.com>2015-08-04 00:28:56 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-08-04 00:28:56 +0000
commit9358ae91c9d260fa75244942b611e00d2fb02ddc (patch)
treede653f01303c7fd8a3fc572c6692649eaffe37b3 /init
parentfb1dbac1439eb0ed2a95fa64a74c5257b20992e3 (diff)
parent69386e33b67eaee721b4e8d7bddbd4263302ff77 (diff)
downloadcore-9358ae91c9d260fa75244942b611e00d2fb02ddc.tar.gz
core-9358ae91c9d260fa75244942b611e00d2fb02ddc.tar.bz2
core-9358ae91c9d260fa75244942b611e00d2fb02ddc.zip
am 69386e33: am 81fd50c3: Merge "perfboot.py: ignore tags not listed in /system/etc/event-log-tags"
* commit '69386e33b67eaee721b4e8d7bddbd4263302ff77': perfboot.py: ignore tags not listed in /system/etc/event-log-tags
Diffstat (limited to 'init')
-rwxr-xr-xinit/perfboot.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/init/perfboot.py b/init/perfboot.py
index 13da32879..82f7e673c 100755
--- a/init/perfboot.py
+++ b/init/perfboot.py
@@ -236,6 +236,23 @@ def make_event_tags_re(tags):
'|'.join(tags))
+def filter_event_tags(tags, device):
+ """Drop unknown tags not listed in device's event-log-tags file."""
+ device.wait()
+ supported_tags = set()
+ for l in device.shell(['cat', '/system/etc/event-log-tags']).splitlines():
+ tokens = l.split(' ')
+ if len(tokens) >= 2:
+ supported_tags.add(tokens[1])
+ filtered = []
+ for tag in tags:
+ if tag in supported_tags:
+ filtered.append(tag)
+ else:
+ logging.warning('Unknown tag \'%s\'. Ignoring...', tag)
+ return filtered
+
+
def get_values(record, tag):
"""Gets values that matches |tag| from |record|."""
keys = [key for key in record.keys() if key[0] == tag]
@@ -406,7 +423,7 @@ def main():
check_dm_verity_settings(device)
record_list = []
- event_tags = read_event_tags(args.tags)
+ event_tags = filter_event_tags(read_event_tags(args.tags), device)
init_perf(device, args.output, record_list, event_tags)
interval_adjuster = IntervalAdjuster(args.interval, device)
event_tags_re = make_event_tags_re(event_tags)