diff options
author | 2023-10-10 13:39:42 +0100 | |
---|---|---|
committer | 2023-11-23 13:37:12 +0000 | |
commit | 338b3e46ffdeab9f02d72950a9c3b99351217a47 (patch) | |
tree | 7a6c84b770d3adebf623583eeccc2896968f9d17 | |
parent | 47a90616494e74bcf9e4d2af0b140124cedfd55d (diff) |
Mount /sys/kernel/tracing inside the chroot.
It allows atrace to work from inside the chroot.
Test: art/test/testrunner/testrunner.py --target --64
Test: art/tools/run-gtests.sh -j4
Test: Manually running buildbot-{setup,cleanup,teardown}-device.sh on
Pixel6.
Test: Testing with perfetto with dalvik atrace category enabled, on
Pixel6 with 4k (aosp_oriole_64) and 16k (aosp_oriole_16k_64)
images.
Change-Id: Ib032f631a794a7709963c96149d305368a9f70c8
-rwxr-xr-x | tools/buildbot-setup-device.sh | 5 | ||||
-rwxr-xr-x | tools/buildbot-teardown-device.sh | 7 |
2 files changed, 9 insertions, 3 deletions
diff --git a/tools/buildbot-setup-device.sh b/tools/buildbot-setup-device.sh index 43bb95d7d6..1df5d4f85b 100755 --- a/tools/buildbot-setup-device.sh +++ b/tools/buildbot-setup-device.sh @@ -204,6 +204,11 @@ if [[ -n "$ART_TEST_CHROOT" ]]; then # Provide /sys/kernel/debug in chroot. adb shell mount | grep -q "^debugfs on $ART_TEST_CHROOT/sys/kernel/debug type debugfs " \ || adb shell mount -t debugfs debugfs "$ART_TEST_CHROOT/sys/kernel/debug" + # Provide /sys/kernel/tracing in chroot. Using a bind mount is important, + # otherwise mounting tracefs multiple times confuses the + # android.hardware.atrace service. + adb shell mount | grep -q "^tracefs on $ART_TEST_CHROOT/sys/kernel/tracing type tracefs " \ + || adb shell mount -o bind /sys/kernel/tracing "$ART_TEST_CHROOT/sys/kernel/tracing" # Provide /dev in chroot. adb shell mkdir -p "$ART_TEST_CHROOT/dev" diff --git a/tools/buildbot-teardown-device.sh b/tools/buildbot-teardown-device.sh index e71dcbef0b..e276cf8243 100755 --- a/tools/buildbot-teardown-device.sh +++ b/tools/buildbot-teardown-device.sh @@ -101,10 +101,11 @@ if [[ -n "$ART_TEST_CHROOT" ]]; then remove_filesystem_from_chroot dev/pts devpts false remove_filesystem_from_chroot dev tmpfs true - # Remove /sys/kernel/debug from chroot. - # The /sys/kernel/debug directory under the chroot dir cannot be - # deleted, as it is part of the host device's /sys filesystem. + # Remove /sys/kernel/{debug,tracing} from chroot. + # The /sys/kernel/{debug,tracing} directories under the chroot dir cannot be + # deleted, as they are part of the host device's /sys filesystem. remove_filesystem_from_chroot sys/kernel/debug debugfs false + remove_filesystem_from_chroot sys/kernel/tracing tracefs false # Remove /sys from chroot. remove_filesystem_from_chroot sys sysfs true |