summaryrefslogtreecommitdiff
path: root/src/com/android/loganalysis/parser/DmesgParser.java
diff options
context:
space:
mode:
authorKimberly Kreider <kkreider@google.com>2019-12-20 15:34:01 +0000
committerKimberly Kreider <kkreider@google.com>2019-12-20 15:53:44 +0000
commit3169a3ad3876d42119764a1bf21e482c11dd4228 (patch)
tree2eaec95c1eeacb580684b882ed0a3dff03949b4c /src/com/android/loganalysis/parser/DmesgParser.java
parentdcca8cd8c51030c41f2a3aa8ccc1c0210f329cdf (diff)
downloadloganalysis-3169a3ad3876d42119764a1bf21e482c11dd4228.tar.gz
Revert submission 9940985-qpr1-dev merge
Reason for revert: broke tests b/146476630 Bug: 146476630 Reverted Changes: Ib3436a42b2ca8c9614939a30fb548ab39bc23e57 Change-Id: Ic936e0f03b001fff37308bb576376299c5ebef20 Exclude merging into branches that contain last aosp change included in merge. Merged-In: 483ea33b74d7008d909e817c754ba9165ae704b1
Diffstat (limited to 'src/com/android/loganalysis/parser/DmesgParser.java')
-rw-r--r--src/com/android/loganalysis/parser/DmesgParser.java21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/com/android/loganalysis/parser/DmesgParser.java b/src/com/android/loganalysis/parser/DmesgParser.java
index 9fce9b8..be292ff 100644
--- a/src/com/android/loganalysis/parser/DmesgParser.java
+++ b/src/com/android/loganalysis/parser/DmesgParser.java
@@ -40,7 +40,6 @@ public class DmesgParser implements IParser {
private static final String TIMESTAMP = "TIMESTAMP";
private static final String STAGE = "STAGE";
private static final String ACTION = "ACTION";
- private static final String SOURCE = "SOURCE";
private static final String DURATION = "DURATION";
private static final String UEVENTD = "ueventd";
private static final String INIT = "init";
@@ -75,13 +74,21 @@ public class DmesgParser implements IParser {
// Matches: init: processing action (early-init) from (/init.rc:14)
private static final String START_PROCESSING_ACTION_PREFIX =
- String.format("processing action \\((?<%s>[^)]*)\\)( from \\((?<%s>.*)\\)|.*)$",
- ACTION, SOURCE);
+ String.format("processing action \\((?<%s>.*)\\) from.*$", ACTION);
+
+ // Matches: init: processing action (early-init)
+ 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: 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(
"(?<%s>.*)\\s+took\\s+(?<%s>.*)\\s+seconds$", STAGE, DURATION);
@@ -235,11 +242,9 @@ 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();
- if (match.group(SOURCE) != null) {
- actionInfoItem.setSourceName(match.group(SOURCE));
- }
actionInfoItem.setActionName(match.group(ACTION));
actionInfoItem.setStartTime((long) (Double.parseDouble(
match.group(TIMESTAMP)) * 1000));
@@ -278,4 +283,4 @@ public class DmesgParser implements IParser {
return mDmesgItem.getActionInfoItems();
}
-} \ No newline at end of file
+}