Commit b2371fea authored by Xi Han's avatar Xi Han Committed by Commit Bot

Add more logs in ServicificationBackgroundService.

Adds more logs to investigate the failures on test-go-phone.

Bug: 1096833
Change-Id: Ic067a93ddb87c6afb314f415f69307fe31794394
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2300269Reviewed-by: default avatarYaron Friedman <yfriedman@chromium.org>
Commit-Queue: Xi Han <hanxi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#788760}
parent 4b7890cd
...@@ -25,25 +25,34 @@ JNI_ServicificationBackgroundService_TestPersistentHistogramsOnDiskSystemProfile ...@@ -25,25 +25,34 @@ JNI_ServicificationBackgroundService_TestPersistentHistogramsOnDiskSystemProfile
JNIEnv* env) { JNIEnv* env) {
base::GlobalHistogramAllocator* allocator = base::GlobalHistogramAllocator* allocator =
base::GlobalHistogramAllocator::Get(); base::GlobalHistogramAllocator::Get();
if (!allocator) if (!allocator) {
LOG(ERROR) << "The GlobalHistogramAllocator is null!";
return false; return false;
}
const base::FilePath& persistent_file_path = const base::FilePath& persistent_file_path =
allocator->GetPersistentLocation(); allocator->GetPersistentLocation();
if (persistent_file_path.empty()) if (persistent_file_path.empty()) {
LOG(ERROR) << "The path of the persistent file is empty!";
return false; return false;
}
base::File file(persistent_file_path, base::File file(persistent_file_path,
base::File::FLAG_OPEN | base::File::FLAG_READ); base::File::FLAG_OPEN | base::File::FLAG_READ);
if (!file.IsValid()) if (!file.IsValid()) {
LOG(ERROR) << "The persistent file isn't valid!";
return false; return false;
}
std::unique_ptr<base::MemoryMappedFile> mapped(new base::MemoryMappedFile()); std::unique_ptr<base::MemoryMappedFile> mapped(new base::MemoryMappedFile());
if (!mapped->Initialize(std::move(file), base::MemoryMappedFile::READ_ONLY)) if (!mapped->Initialize(std::move(file), base::MemoryMappedFile::READ_ONLY)) {
LOG(ERROR) << "Fails to Initialize the memory mapped file!";
return false; return false;
}
if (!base::FilePersistentMemoryAllocator::IsFileAcceptable( if (!base::FilePersistentMemoryAllocator::IsFileAcceptable(
*mapped, true /* read_only */)) { *mapped, true /* read_only */)) {
LOG(ERROR) << "The memory mapped file isn't acceptable!";
return false; return false;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment