summaryrefslogtreecommitdiff
path: root/src/com/android/loganalysis/parser/DmesgParser.java
diff options
context:
space:
mode:
authorKimberly Kreider <kkreider@google.com>2019-11-14 15:11:53 -0800
committerKimberly Kreider <kkreider@google.com>2019-12-17 22:30:42 +0000
commitdcca8cd8c51030c41f2a3aa8ccc1c0210f329cdf (patch)
treec81949ebdccecb2f82c361b3f23d8f2249ba09eb /src/com/android/loganalysis/parser/DmesgParser.java
parent0fba460ec1ee01a0d3232fe65af921caaf5b79ac (diff)
downloadloganalysis-dcca8cd8c51030c41f2a3aa8ccc1c0210f329cdf.tar.gz
DO NOT MERGE: Adding required loganalysis changes for tradefed merge into qt-dev.
Bug: 143908003 Change-Id: Ib3436a42b2ca8c9614939a30fb548ab39bc23e57 Exclude merging into *-plus-aosp branches, since they already include the change. Merged-In: I2ae86ba9706747873268192988c32879005ed0f7 Merged-In: I38efc115f2c691754d481fdffb6630607ef970e8 (cherry picked from commit c7bcaba872c7d82286960c750edd67e56ee73712)
Diffstat (limited to 'src/com/android/loganalysis/parser/DmesgParser.java')
-rw-r--r--src/com/android/loganalysis/parser/DmesgParser.java21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/com/android/loganalysis/parser/DmesgParser.java b/src/com/android/loganalysis/parser/DmesgParser.java
index be292ff..9fce9b8 100644
--- a/src/com/android/loganalysis/parser/DmesgParser.java
+++ b/src/com/android/loganalysis/parser/DmesgParser.java
@@ -40,6 +40,7 @@ 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";
@@ -74,21 +75,13 @@ 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.*$", ACTION);
-
- // Matches: init: processing action (early-init)
- private static final String START_PROCESSING_ACTION_PREFIX_LEGACY =
- String.format("processing action \\((?<%s>.*)\\).*$", ACTION);
+ String.format("processing action \\((?<%s>[^)]*)\\)( from \\((?<%s>.*)\\)|.*)$",
+ ACTION, SOURCE);
// 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);
@@ -242,9 +235,11 @@ public class DmesgParser implements IParser {
@VisibleForTesting
boolean parseActionInfo(String line) {
Matcher match = null;
- if ((match = matches(START_PROCESSING_ACTION, line)) != null
- || (match = matches(START_PROCESSING_ACTION_LEGACY, line)) != null) {
+ if ((match = matches(START_PROCESSING_ACTION, 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));
@@ -283,4 +278,4 @@ public class DmesgParser implements IParser {
return mDmesgItem.getActionInfoItems();
}
-}
+} \ No newline at end of file