aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuanlang Song <yuanlang@google.com>2017-09-08 18:37:06 -0700
committerYuchao Zhou <superzhou@google.com>2017-09-15 23:09:56 +0000
commitd71b225027b0800cd78598ce78a2486c87991b46 (patch)
tree25d4a6bca699380c0f7787408633d7a57979d1b3
parentb257c203edc889f7f1821deee1713a1420ba394d (diff)
downloadtradefederation-d71b225027b0800cd78598ce78a2486c87991b46.tar.gz
Fix emmc benchmark auto discover cache info
To split by multiple spaces, we need to use " +" as regex. Bug: 64729547 Change-Id: Icb391db75ad4284a284c1b1a87f130afdf5b5d2c
-rw-r--r--prod-tests/src/com/android/performance/tests/EmmcPerformanceTest.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/prod-tests/src/com/android/performance/tests/EmmcPerformanceTest.java b/prod-tests/src/com/android/performance/tests/EmmcPerformanceTest.java
index 91473ac3b..81eebc267 100644
--- a/prod-tests/src/com/android/performance/tests/EmmcPerformanceTest.java
+++ b/prod-tests/src/com/android/performance/tests/EmmcPerformanceTest.java
@@ -376,7 +376,7 @@ public class EmmcPerformanceTest implements IDeviceTest, IRemoteTest {
if (mTestDevice.enableAdbRoot()) {
String output = mTestDevice.executeShellCommand("vdc dump | grep cache");
CLog.d("Output from shell command 'vdc dump | grep cache': %s", output);
- String[] segments = output.split(" ");
+ String[] segments = output.split("\\s+");
if (segments.length >= 3) {
mCache = segments[2];
} else {
@@ -394,10 +394,10 @@ public class EmmcPerformanceTest implements IDeviceTest, IRemoteTest {
// Filesystem 1K-blocks Used Available Use% Mounted on
// /dev/block/mmcblk0p34 60400 56 60344 1% /cache
String output = mTestDevice.executeShellCommand("df cache");
- CLog.d(String.format("Output from shell command 'df cache': %s", output));
+ CLog.d(String.format("Output from shell command 'df cache':\n%s", output));
String[] lines = output.split("\r?\n");
if (lines.length >= 2) {
- String[] segments = lines[1].split(" ");
+ String[] segments = lines[1].split("\\s+");
if (segments.length >= 2) {
if (lines[0].toLowerCase().contains("1k-blocks")) {
mCachePartitionSize = Integer.parseInt(segments[1]) / 1024;