aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitrii Ishcheikin <ishcheikin@google.com>2024-05-13 22:32:01 +0000
committerDmitrii Ishcheikin <ishcheikin@google.com>2024-05-13 22:34:45 +0000
commite5569f9265188cfe7a1bbbd606d328e60dc341cf (patch)
tree8c07311547512f751b54a298816aecf3750e3d5b
parentfc0618d34e9fedce3bbccc81dc2bf69d95e4ea85 (diff)
downloadcsuite-main.tar.gz
Use pgrep to get single zygote64 pidHEADmastermain
This fixes the failures when `pidof zygote64` returned multiple pids because a new process was just forked from the zygote. Test: abtd Change-Id: I7ef21ccfc2549d14ec7f750b28dafd2056b75f4e
-rw-r--r--test_scripts/src/main/java/com/android/art/tests/AppLaunchImgdiagTest.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/test_scripts/src/main/java/com/android/art/tests/AppLaunchImgdiagTest.java b/test_scripts/src/main/java/com/android/art/tests/AppLaunchImgdiagTest.java
index 8db2094..f739f1b 100644
--- a/test_scripts/src/main/java/com/android/art/tests/AppLaunchImgdiagTest.java
+++ b/test_scripts/src/main/java/com/android/art/tests/AppLaunchImgdiagTest.java
@@ -76,8 +76,10 @@ public class AppLaunchImgdiagTest extends AppLaunchTest {
* @return The complete `imgdiag` command that can be run with `adb shell`.
*/
public static String getImgdiagRunCmd(String targetPid, String outFilePath) {
+ // There may be more than one process with "zygote64" name when a new app
+ // is forked. Use `pgrep -f zygote64 -o` to get the oldest process.
return String.format(
- "imgdiag --zygote-diff-pid=`pidof zygote64` --image-diff-pid=%s"
+ "imgdiag --zygote-diff-pid=`pgrep -f zygote64 -o` --image-diff-pid=%s"
+ " --output=%s"
+ " --dump-dirty-objects --boot-image="
+ "/data/misc/apexdata/com.android.art/dalvik-cache/boot.art",