Add a helpful error message if GetUnreachableMemory fails
The primary reason for GetUnreachableMemory failing is selinux blocking system apps from ptracing themselves. Add a helpful error message suggesting setenforce 0. Bug: 27945735 Test: dumpsys meminfo --unreachable com.android.systemui Change-Id: Ibfa9507860be36dffd514f82027f7a2f8a72ac48
This commit is contained in:
parent
6cc5927e0d
commit
72d3881412
|
@ -502,7 +502,10 @@ std::string UnreachableMemoryInfo::ToString(bool log_contents) const {
|
|||
std::string GetUnreachableMemoryString(bool log_contents, size_t limit) {
|
||||
UnreachableMemoryInfo info;
|
||||
if (!GetUnreachableMemory(info, limit)) {
|
||||
return "Failed to get unreachable memory\n";
|
||||
return "Failed to get unreachable memory\n"
|
||||
"If you are trying to get unreachable memory from a system app\n"
|
||||
"(like com.android.systemui), disable selinux first using\n"
|
||||
"setenforce 0\n";
|
||||
}
|
||||
|
||||
return info.ToString(log_contents);
|
||||
|
|
Loading…
Reference in New Issue