Fixes an issue where the thread pool leaks when code generation
throws an exception (for example because of an invalid log string).
When the thread pool leaks, System.exit() no longer works, because
the JVM waits for all threads to exit - which never happens for the
leaked thread pool.
Test: `ProtoLog.w(LOG_GROUP, new String())` -> make droid should not hang
Change-Id: Ibdae0f1e68441c6fe004398d146f496503ccc4cd
Adds a test that verifies we compute the correct hash end-to-end, i.e. including
the actual path logic, which previously caused a divergence between the viewer config
and the generated code.
Test: atest protologtool-tests
Change-Id: Ia2a414322aa6ccdaedda7f9754d903ec984902d6
Fixes a bug caused by inconsistent paths - when transforming sources, we took the
path of the file, while when generating the viewer json, we used the path relative
to the root package.
Test: enable protolog, verify winscope can parse it.
Change-Id: Ib636515d70ca5b66da687542a84107465e51053d
We introduce a generated class ProtoLog$Cache, which contains a field
for each ProtoLogGroup to cache whether it is enabled or not.
This both makes lookup faster, and reduces code size.
Test: make droid
Change-Id: I581c87849c875918b182eff85996b6d19a6755ec
Improves build time by speeding up the protolog source transformation
tool:
- parallelize the transformation to use all available cores
- remove dependency on lexicographically preserving printer
- disable comment attribution and language level validation
Speeds up the build step from ~30s to ~4s.
Test: atest protologtool-tests
Test: make services.core.protologsrc && edit file in fw/base/services/core && time make services.core.protologsrc
Change-Id: I052e9eb3cc791edf60c555c6fcf59f2e59f0ba68
Improves behavior when parsing fails; now, ProtoLog skips the offending files, and
relies on the subsequent compilation step to catch the error.
Additionally, the build no longer fails when the canonical protolog.json file contains
obsolete entries.
Test: Introduce syntax error in services/core/ file, make and verify error messaging is sound
Change-Id: Ic23dec4a14489316ecb0e46bbabe246ddae29655
ProtoLogTool error messages are hard to read, this CL addresses this
issue adding more info (including file name and line number) and using
verbose exception messages where available.
Updated README with recent ProtoLog changes.
Bug: 141672033
Test: atest protologtool-tests
Change-Id: Ibfca908808526adb6c8c5f68893f093a8233728f
Having line numbers in log statement location info in protolog viewer
config makes the config file invalid after every code merge.
Bug:
Test: atest protologtool-tests
Change-Id: I7e9ae434517bc94ecfc7f421e71d21b07f3c233f
- Added log statement location info to viewer config
- Fixed a NPE in ProtoLogImpl
- Reworked early return for log calls
- Changed type of message hash field to signed (for Java compat)
- Fix flaky tests for ProtoLogImpl
Bug:
Test: atest protologtool-tests FrameworksServicesTests:com.android.server.protolog
Change-Id: I7874475083ab5d01fe46fd3013a058743acd3884
This CL implements the on-device part of ProtoLog
- the new logging system for WindowManager.
Design doc: go/windowmanager-log2proto
Change-Id: I2c88c97dabb3465ffc0615b8017b335a494bca59
Bug:
Test: atest FrameworksServicesTests:com.android.server.protolog protologtool-tests
A bug in the JavaParser LexicalPreservingPrinter prevents
the ProtoLogTool from correctly handling multiple subsequent
ProtoLog calls. This bug is a known issue, no fix is worked on
at this moment (https://github.com/javaparser/javaparser/issues/2290).
Bug:
Test: atest protologtool-tests
Change-Id: I919527a31c5ed21b17e5f3e271c2758d35896ea5