Logging improvements

Suppress the authfs atime message even with --debug; it is very noisy.

Make sure we capture the VM logs from compilation when the
ComposTestCases succeed - sometimes they are useful.

Bug: 264496291
Test: atest ComposTestCase#testOdrefreshSpeed
Change-Id: Ib65c22b38910bde351858bcdae8506a74e91cd60
This commit is contained in:
Alan Stokes 2023-02-01 09:36:17 +00:00
parent 77b7dce790
commit bd6d08aaa4
2 changed files with 21 additions and 6 deletions

View File

@ -23,7 +23,7 @@ use fuse::filesystem::{
SetattrValid, ZeroCopyReader, ZeroCopyWriter,
};
use fuse::sys::OpenOptions as FuseOpenOptions;
use log::{debug, error, warn};
use log::{error, trace, warn};
use std::collections::{btree_map, BTreeMap};
use std::convert::{TryFrom, TryInto};
use std::ffi::{CStr, CString, OsStr};
@ -1062,7 +1062,7 @@ fn check_unsupported_setattr_request(valid: SetattrValid) -> io::Result<()> {
| SetattrValid::MTIME
| SetattrValid::MTIME_NOW,
) {
debug!("Ignoring ctime/atime/mtime change as authfs does not maintain timestamp currently");
trace!("Ignoring ctime/atime/mtime change as authfs does not maintain timestamp currently");
}
Ok(())
}

View File

@ -27,6 +27,7 @@ import android.platform.test.annotations.RootPermissionTest;
import com.android.microdroid.test.host.CommandRunner;
import com.android.microdroid.test.host.MicrodroidHostTestCaseBase;
import com.android.tradefed.device.DeviceNotAvailableException;
import com.android.tradefed.log.LogUtil.CLog;
import com.android.tradefed.result.FileInputStreamSource;
import com.android.tradefed.result.LogDataType;
@ -94,10 +95,7 @@ public final class ComposTestCase extends MicrodroidHostTestCaseBase {
public void tearDown() throws Exception {
killVmAndReconnectAdb();
archiveLogThenDelete(mTestLogs, getDevice(), COMPOS_APEXDATA_DIR + "/vm_console.log",
"vm_console.log-" + mTestName.getMethodName());
archiveLogThenDelete(mTestLogs, getDevice(), COMPOS_APEXDATA_DIR + "/vm.log",
"vm.log-" + mTestName.getMethodName());
archiveVmLogsThenDelete("teardown");
CommandRunner android = new CommandRunner(getDevice());
@ -115,6 +113,19 @@ public final class ComposTestCase extends MicrodroidHostTestCaseBase {
}
}
private void archiveVmLogsThenDelete(String suffix) throws DeviceNotAvailableException {
archiveLogThenDelete(
mTestLogs,
getDevice(),
COMPOS_APEXDATA_DIR + "/vm_console.log",
"vm_console.log-" + suffix + "-" + mTestName.getMethodName());
archiveLogThenDelete(
mTestLogs,
getDevice(),
COMPOS_APEXDATA_DIR + "/vm.log",
"vm.log-" + suffix + "-" + mTestName.getMethodName());
}
@Test
public void testOdrefreshSpeed() throws Exception {
getDevice().setProperty(SYSTEM_SERVER_COMPILER_FILTER_PROP_NAME, "speed");
@ -159,6 +170,10 @@ public final class ComposTestCase extends MicrodroidHostTestCaseBase {
}
killVmAndReconnectAdb();
// These logs are potentially useful, capture them before they are overwritten by
// compos_verify.
archiveVmLogsThenDelete("compile");
// Expect the BCC extracted from the BCC to be well-formed.
assertVmBccIsValid();