diff options
author | gopinath <gelanchezhian@google.com> | 2017-06-15 18:37:48 -0700 |
---|---|---|
committer | gopinath <gelanchezhian@google.com> | 2017-06-15 18:50:27 -0700 |
commit | c72e8e31c48c06c9775365f8fe5837965cfe5e69 (patch) | |
tree | d32e9704f3e6802a89bbd513b7a8947f6f17c191 /src | |
parent | 4f2c82cabd90f0a565edbba23c78991507d41dd4 (diff) | |
download | loganalysis-c72e8e31c48c06c9775365f8fe5837965cfe5e69.tar.gz |
Support parsing the boottime legacy log format (i.e processing actions)
b/62394657
Test: OK (257 tests).
Change-Id: Ib5f5f9db27426b1a334e3c05faa6eb183a2e2975
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/loganalysis/parser/DmesgParser.java | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/com/android/loganalysis/parser/DmesgParser.java b/src/com/android/loganalysis/parser/DmesgParser.java index ce3d389..63026d4 100644 --- a/src/com/android/loganalysis/parser/DmesgParser.java +++ b/src/com/android/loganalysis/parser/DmesgParser.java @@ -71,13 +71,22 @@ public class DmesgParser implements IParser { private static final Pattern START_STAGE = Pattern.compile( String.format("%s%s", SERVICE_PREFIX, START_STAGE_PREFIX)); + // Matches: init: processing action (early-init) from (/init.rc:14) + private static final String START_PROCESSING_ACTION_PREFIX = + String.format("processing action \\((?<%s>.*)\\) from.*$", ACTION); + // Matches: init: processing action (early-init) - private static final String START_PROCESSING_ACTION_PREFIX = String.format( - "processing action \\((?<%s>.*)\\) from.*$", ACTION); + private static final String START_PROCESSING_ACTION_PREFIX_LEGACY = + String.format("processing action \\((?<%s>.*)\\).*$", ACTION); + + // Matches: init: processing action (early-init) from (/init.rc:14) + private static final Pattern START_PROCESSING_ACTION = + Pattern.compile(String.format("%s%s", SERVICE_PREFIX, START_PROCESSING_ACTION_PREFIX)); - // Matches: [ 14.942872] init: processing action (early-init) - private static final Pattern START_PROCESSING_ACTION = Pattern.compile( - String.format("%s%s", SERVICE_PREFIX, START_PROCESSING_ACTION_PREFIX)); + // Matches: init: processing action (early-init) + private static final Pattern START_PROCESSING_ACTION_LEGACY = + Pattern.compile( + String.format("%s%s", SERVICE_PREFIX, START_PROCESSING_ACTION_PREFIX_LEGACY)); // Matches: [ 3.791635] ueventd: Coldboot took 0.695055 seconds private static final String STAGE_SUFFIX= String.format( @@ -216,7 +225,8 @@ public class DmesgParser implements IParser { @VisibleForTesting boolean parseActionInfo(String line) { Matcher match = null; - if ((match = matches(START_PROCESSING_ACTION, line)) != null) { + if ((match = matches(START_PROCESSING_ACTION, line)) != null + || (match = matches(START_PROCESSING_ACTION_LEGACY, line)) != null) { DmesgActionInfoItem actionInfoItem = new DmesgActionInfoItem(); actionInfoItem.setActionName(match.group(ACTION)); actionInfoItem.setStartTime((long) (Double.parseDouble( |