Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 29711d8c authored by Suren Baghdasaryan's avatar Suren Baghdasaryan Committed by Automerger Merge Worker
Browse files

Merge "Report ION usage event when ION heap size is 0" am: 7687adc0 am: d493ed70 am: da855f33

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1431373

Change-Id: I0abb5aebd750732e01a101cce8b9a7f80ebd9d51
parents 2dc78038 da855f33
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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
     */
+2 −2
Original line number Diff line number Diff line
@@ -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)) {
+4 −4
Original line number Diff line number Diff line
@@ -13742,10 +13742,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(" (");
@@ -14556,10 +14556,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");