Merge "Report ION usage event when ION heap size is 0" am: 7687adc00d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1431373 Change-Id: I63145aea8d511ad773fb4ea186b09f278559bd8a
This commit is contained in:
committed by
Automerger Merge Worker
commit
d493ed705b
@@ -2551,14 +2551,16 @@ public final class Debug
|
||||
public static native long getZramFreeKb();
|
||||
|
||||
/**
|
||||
* Return memory size in kilobytes allocated for ION heaps.
|
||||
* Return memory size in kilobytes allocated for ION heaps or -1 if
|
||||
* /sys/kernel/ion/total_heaps_kb could not be read.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public static native long getIonHeapsSizeKb();
|
||||
|
||||
/**
|
||||
* Return memory size in kilobytes allocated for ION pools.
|
||||
* Return memory size in kilobytes allocated for ION pools or -1 if
|
||||
* /sys/kernel/ion/total_pools_kb could not be read.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
|
||||
@@ -792,7 +792,7 @@ static jlong android_os_Debug_getFreeZramKb(JNIEnv* env, jobject clazz) {
|
||||
}
|
||||
|
||||
static jlong android_os_Debug_getIonHeapsSizeKb(JNIEnv* env, jobject clazz) {
|
||||
jlong heapsSizeKb = 0;
|
||||
jlong heapsSizeKb = -1;
|
||||
uint64_t size;
|
||||
|
||||
if (meminfo::ReadIonHeapsSizeKb(&size)) {
|
||||
@@ -803,7 +803,7 @@ static jlong android_os_Debug_getIonHeapsSizeKb(JNIEnv* env, jobject clazz) {
|
||||
}
|
||||
|
||||
static jlong android_os_Debug_getIonPoolsSizeKb(JNIEnv* env, jobject clazz) {
|
||||
jlong poolsSizeKb = 0;
|
||||
jlong poolsSizeKb = -1;
|
||||
uint64_t size;
|
||||
|
||||
if (meminfo::ReadIonPoolsSizeKb(&size)) {
|
||||
|
||||
@@ -13738,10 +13738,10 @@ public class ActivityManagerService extends IActivityManager.Stub
|
||||
}
|
||||
long kernelUsed = memInfo.getKernelUsedSizeKb();
|
||||
final long ionHeap = Debug.getIonHeapsSizeKb();
|
||||
if (ionHeap > 0) {
|
||||
final long ionPool = Debug.getIonPoolsSizeKb();
|
||||
if (ionHeap >= 0 && ionPool >= 0) {
|
||||
final long ionMapped = Debug.getIonMappedSizeKb();
|
||||
final long ionUnmapped = ionHeap - ionMapped;
|
||||
final long ionPool = Debug.getIonPoolsSizeKb();
|
||||
pw.print(" ION: ");
|
||||
pw.print(stringifyKBSize(ionHeap + ionPool));
|
||||
pw.print(" (");
|
||||
@@ -14552,10 +14552,10 @@ public class ActivityManagerService extends IActivityManager.Stub
|
||||
memInfoBuilder.append("\n");
|
||||
long kernelUsed = memInfo.getKernelUsedSizeKb();
|
||||
final long ionHeap = Debug.getIonHeapsSizeKb();
|
||||
if (ionHeap > 0) {
|
||||
final long ionPool = Debug.getIonPoolsSizeKb();
|
||||
if (ionHeap >= 0 && ionPool >= 0) {
|
||||
final long ionMapped = Debug.getIonMappedSizeKb();
|
||||
final long ionUnmapped = ionHeap - ionMapped;
|
||||
final long ionPool = Debug.getIonPoolsSizeKb();
|
||||
memInfoBuilder.append(" ION: ");
|
||||
memInfoBuilder.append(stringifyKBSize(ionHeap + ionPool));
|
||||
memInfoBuilder.append("\n");
|
||||
|
||||
Reference in New Issue
Block a user