allow EventLog tag numbers to be auto-assigned
With this change, you can specify "?" in place of a tag number in a
.logtags file and the build system will assign numbers to these tags.
(The numbers used shouldn't matter since we translate them back to tag
names whenever the logs are read back.)
This is pretty straightforward to do:
- make merge-event-log-tags.py assign numbers to any tags that specify
"?"
- make the generated java files depend on the merged output
- make java-event-log-tags.py read both the original .logtags and the
merged output, and fill in tag numbers for any "?" using the merged
version.
Change-Id: Icc6ccd705db461d570fc929922a830aa6deaca48
diff --git a/tools/event_log_tags.py b/tools/event_log_tags.py
index 4e6d960..81e8b39 100644
--- a/tools/event_log_tags.py
+++ b/tools/event_log_tags.py
@@ -75,11 +75,14 @@
self.options[parts[1]] = parts[2:]
continue
- try:
- tag = int(parts[0])
- except ValueError:
- self.AddError("\"%s\" isn't an integer tag" % (parts[0],))
- continue
+ if parts[0] == "?":
+ tag = None
+ else:
+ try:
+ tag = int(parts[0])
+ except ValueError:
+ self.AddError("\"%s\" isn't an integer tag or '?'" % (parts[0],))
+ continue
tagname = parts[1]
if len(parts) == 3: