From 823d4651620f07a73376c2ca72f82009d44adbd7 Mon Sep 17 00:00:00 2001 From: Kalesh Singh Date: Mon, 12 Jul 2021 13:32:27 +0000 Subject: [PATCH] getGpuDmaBufUsageKb: Report usage in Kilobytes getGpuDmabufUsageKb currently reports the total size of dma-bufs attached by the GPU device from /sys/kernel/dmabuf/buffer//size nodes. However these sysfs nodes report the buffer size in bytes. Convert the value returned by getGpuDmaBufUsageKb to KB. Bug: 193403146 Test: Manual Change-Id: Ie17382794f7e4db34ddadf75488d8f82de435ae0 Merged-In: Ie17382794f7e4db34ddadf75488d8f82de435ae0 --- core/jni/android_os_Debug.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/jni/android_os_Debug.cpp b/core/jni/android_os_Debug.cpp index de65b894e6777..41804480122c3 100644 --- a/core/jni/android_os_Debug.cpp +++ b/core/jni/android_os_Debug.cpp @@ -880,7 +880,7 @@ static jlong android_os_Debug_getGpuDmaBufUsageKb(JNIEnv* env, jobject clazz) { continue; } - sizeKb += importer_info->second.size; + sizeKb += importer_info->second.size / 1024; } return sizeKb;