From c680bfeaf29e414383764aa2b309fe7b4169c7bc Mon Sep 17 00:00:00 2001 From: Tom Cherry Date: Wed, 5 Jul 2017 13:57:42 -0700 Subject: [PATCH] init: add info logs in first stage mount if we have to poll It's not a error case if we do not find a device that we're attempting to regenerate uevents for during first stage mount, but it is likely to increase boot time, so we log a message to attribute this delay. Bug: 63327193 Test: Boot bullhead, sailfish Merged-In: I97c2e5aefd218bbdd87717ff3c375381f725de08 Change-Id: I97c2e5aefd218bbdd87717ff3c375381f725de08 (cherry picked from commit 322e176f6a03414d659e82eb9f4b943c78d3322b) --- init/init_first_stage.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/init/init_first_stage.cpp b/init/init_first_stage.cpp index 3781a22c9..d72c3ac4e 100644 --- a/init/init_first_stage.cpp +++ b/init/init_first_stage.cpp @@ -168,10 +168,13 @@ bool FirstStageMount::InitRequiredDevices() { }; uevent_listener_.RegenerateUeventsForPath("/sys" + dm_path, dm_callback); if (!found) { + LOG(INFO) << "device-mapper device not found in /sys, waiting for its uevent"; + Timer t; uevent_listener_.Poll(dm_callback, 10s); + LOG(INFO) << "Wait for device-mapper returned after " << t; } if (!found) { - LOG(ERROR) << "device-mapper device not found"; + LOG(ERROR) << "device-mapper device not found after polling timeout"; return false; } } @@ -182,11 +185,16 @@ bool FirstStageMount::InitRequiredDevices() { // UeventCallback() will remove found partitions from required_devices_partition_names_. // So if it isn't empty here, it means some partitions are not found. if (!required_devices_partition_names_.empty()) { + LOG(INFO) << __PRETTY_FUNCTION__ + << ": partition(s) not found in /sys, waiting for their uevent(s): " + << android::base::Join(required_devices_partition_names_, ", "); + Timer t; uevent_listener_.Poll(uevent_callback, 10s); + LOG(INFO) << "Wait for partitions returned after " << t; } if (!required_devices_partition_names_.empty()) { - LOG(ERROR) << __PRETTY_FUNCTION__ << ": partition(s) not found: " + LOG(ERROR) << __PRETTY_FUNCTION__ << ": partition(s) not found after polling timeout: " << android::base::Join(required_devices_partition_names_, ", "); return false; } @@ -238,10 +246,13 @@ bool FirstStageMount::InitVerityDevice(const std::string& verity_device) { uevent_listener_.RegenerateUeventsForPath(syspath, verity_callback); if (!found) { + LOG(INFO) << "dm-verity device not found in /sys, waiting for its uevent"; + Timer t; uevent_listener_.Poll(verity_callback, 10s); + LOG(INFO) << "wait for dm-verity device returned after " << t; } if (!found) { - LOG(ERROR) << "dm-verity device not found"; + LOG(ERROR) << "dm-verity device not found after polling timeout"; return false; }