summaryrefslogtreecommitdiff
path: root/core/java/android/os/Debug.java
Commit message (Collapse)AuthorAgeFilesLines
* Add API to get GPU private memoryKalesh Singh2021-07-141-2/+2
| | | | | | | | | | | | | | Remove getGpuDmabufUsageKb since the kernel no longer supports the sysfs nodes that this depends on. Add getGpuPrivateMemoryKb which uses the memtrack hal to report the system-wide GPU private memory. Bug: 193226716 Bug: 193465681 Bug: 192621117 Test: dumpsys meminfo Change-Id: Ib90505ec184339d5acbcd42c67dad3ad65dbd933
* Merge "Inline two constants from CorePlatform" am: dbf1544b68 am: e3eefd6d2e ↵Anton Hansson2021-05-111-1/+2
|\ | | | | | | | | | | | | | | am: 833e374197 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1699727 Change-Id: Ibac0caf69f17c8f003a4a197654c176448a9b7b9
| * Inline two constants from CorePlatformAnton Hansson2021-05-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Inlining these constants allow the public api metalava run to depend on ART's public API rather than the "internal" CorePlatform API, which prevents picking up unintentional classes (such as annotations) from the CorePlatform API in the public stubs. Because these constants get inlined in the API/stubs, and the constants have been finalized for many years, they can never change. Because they cannot change, reusing the constant is of limited value. I've added some comments to point readers to other places the constant is used. Bug: 154796679 Test: m checkapi Change-Id: I0b347a2964cfe5a1206145fdc56934727b890469
* | Merge "Update Kotlin sample code for CountDownTimer and Parcelable" am: ↵Jing Ji2021-04-201-1/+1
|\| | | | | | | | | | | | | | | 598675abef am: a61b23b89e am: 3d7210ee88 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1673235 Change-Id: I33967535b9da48028d895d51078c545329eda681
| * Update Kotlin sample code for CountDownTimer and ParcelableJing Ji2021-04-141-1/+1
| | | | | | | | | | | | | | | | | | | | Also fixed a typo in the javadoc of android.os.Debug Bug: 155869891 Bug: 152033307 Bug: 177360175 Test: m -j ds-docs Change-Id: I52da37d24ab224344f931fed558df86f250bf86f
| * dumpsys: Print total DMA-BUFs exported from the DMA-BUF heaps frameworkHridya Valsaraju2021-02-121-0/+8
| | | | | | | | | | | | | | | | | | | | This patch adds the total size of DMA-BUFs exported from the DMA-BUF heaps framework to dumpsys meminfo. Bug: 167709539 Test: adb shell dumpsys meminfo Change-Id: I153721a0dc91ee5084a446ba1ce4f8ec9c51c4f0 Merged-In: I153721a0dc91ee5084a446ba1ce4f8ec9c51c4f0
| * Provide an interface to query dmabuf GPU allocationsKalesh Singh2021-02-121-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | The DMA buffers mapped by GPU device(s) are already accounted for in the total exported dmabuf size (ionHeap) size. To remove GPU memory from lost RAM, provide an API to get only the DMA buf memory mapped by the GPU device(s). Bug: 176477627 Test: adb shell dumpsys meminfo Change-Id: Ie72f46c8de026b143629406714f413677ce6693b Merged-In: Ie72f46c8de026b143629406714f413677ce6693b
* | dumpsys: Print total DMA-BUFs exported from the DMA-BUF heaps frameworkHridya Valsaraju2021-02-121-0/+8
| | | | | | | | | | | | | | | | | | | | This patch adds the total size of DMA-BUFs exported from the DMA-BUF heaps framework to dumpsys meminfo. Bug: 167709539 Test: adb shell dumpsys meminfo Change-Id: I153721a0dc91ee5084a446ba1ce4f8ec9c51c4f0 Merged-In: I153721a0dc91ee5084a446ba1ce4f8ec9c51c4f0
* | Merge changes I631488d9,Ie72f46c8 into sc-devKalesh Singh2021-02-121-0/+7
|\ \ | | | | | | | | | | | | | | | * changes: Eliminate memtrack variability from the lost RAM calculation Provide an interface to query dmabuf GPU allocations
| * | Provide an interface to query dmabuf GPU allocationsKalesh Singh2021-02-121-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The DMA buffers mapped by GPU device(s) are already accounted for in the total exported dmabuf size (ionHeap) size. To remove GPU memory from lost RAM, provide an API to get only the DMA buf memory mapped by the GPU device(s). Bug: 176477627 Test: adb shell dumpsys meminfo Change-Id: Ie72f46c8de026b143629406714f413677ce6693b
* | | Merge "Extend getPssPid to report itemized memtrack values" am: ca115f206a ↵Suren Baghdasaryan2021-02-121-1/+2
|\ \ \ | |/ / |/| / | |/ | | | | | | | | | | | | am: b641d098da am: 9530beb872 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1583743 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I77ed3093ecad45dc2e4c68a72bdfa23eafc53553
| * Extend getPssPid to report itemized memtrack valuesSuren Baghdasaryan2021-02-121-1/+2
| | | | | | | | | | | | | | | | | | | | | | Currently getPssPid includes memtrack HAL reported values in the pss calculation. This makes it impossible to get these values separately. Extend this interface to include itemized memtrack values. Bug: 165832481 Test: dumpsys meminfo Signed-off-by: Suren Baghdasaryan <surenb@google.com> Change-Id: Ieb7e1b79ad8ecae6023338d9992467952558e2bd
| * Add total DMA-BUF heap pool size information to dumpsys meminfoHridya Valsaraju2021-02-101-0/+8
| | | | | | | | | | | | | | | | | | | | | | Some DMA-BUF heaps maintain pools of pre-zeroed memory for faster allocations. Print the total size of all DMA-BUF heap pools as part of dumpsys meminfo and use the same in LostRam calculation. Test: dumpsys meminfo Bug: 167709539 Change-Id: Ifb61fe596c1a8fab1bd536ec904285e532629b71 Merged-In: Ifb61fe596c1a8fab1bd536ec904285e532629b71
| * Add total size of DMA-BUFs exported to 'dumpsys meminfo'Hridya Valsaraju2021-02-101-0/+8
| | | | | | | | | | | | | | | | | | | | When ION support is not detected, print the total size of DMA-BUFs exported as part of dumpsys meminfo. Bug: 167709539 Test: dumpsys meminfo Change-Id: I3439a8f00cf1aef37e5043b505ed53d47a8a4756 Merged-In: I3439a8f00cf1aef37e5043b505ed53d47a8a4756
| * Rename getIonMappedSizeKb to getDmabufMappedSizeKbHridya Valsaraju2021-02-101-2/+2
| | | | | | | | | | | | | | | | | | The function is actually calculating the total mapped DMA-BUF memory. Test: dumpsys meminfo Bug: 167709539 Change-Id: I5c19dc604cf48c3d7ccbfd2d9a83ddd7b35f20d5 Merged-In: I5c19dc604cf48c3d7ccbfd2d9a83ddd7b35f20d5
| * Add total GPU usage report into dumpsys meminfo outputSuren Baghdasaryan2020-12-301-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | With latest kernel changes, total GPU memory usage is reported and can be obtained via a BPF program. Create JNI interface to query it and report inside dumpsys meminfo output. Bug: 171261987 Test: dumpsys meminfo Signed-off-by: Suren Baghdasaryan <surenb@google.com> Merged-In: I949a13836d5b5bc87fc43f60871b4fbf2add6480 Change-Id: I949a13836d5b5bc87fc43f60871b4fbf2add6480
| * Add maxTargetSdk restriction to unused APIs.Mathew Inwood2020-11-041-9/+9
| | | | | | | | | | | | | | | | | | | | | | These are APIs that have @UnsupportedAppUsage but for which we don't have any evidence of them currently being used, so should be safe to remove from the unsupported list. Bug: 170729553 Test: Treehugger Merged-In: I626caf7c1fe46c5ab1f39c2895b42a34319f771a Change-Id: I54e5ecd11e76ca1de3c5893e3a98b0108e735413
* | Add total DMA-BUF heap pool size information to dumpsys meminfoHridya Valsaraju2021-02-091-0/+8
| | | | | | | | | | | | | | | | | | | | | | Some DMA-BUF heaps maintain pools of pre-zeroed memory for faster allocations. Print the total size of all DMA-BUF heap pools as part of dumpsys meminfo and use the same in LostRam calculation. Test: dumpsys meminfo Bug: 167709539 Change-Id: Ifb61fe596c1a8fab1bd536ec904285e532629b71 Merged-In: Ifb61fe596c1a8fab1bd536ec904285e532629b71
* | Add total size of DMA-BUFs exported to 'dumpsys meminfo'Hridya Valsaraju2021-02-091-0/+8
| | | | | | | | | | | | | | | | | | | | When ION support is not detected, print the total size of DMA-BUFs exported as part of dumpsys meminfo. Bug: 167709539 Test: dumpsys meminfo Change-Id: I3439a8f00cf1aef37e5043b505ed53d47a8a4756 Merged-In: I3439a8f00cf1aef37e5043b505ed53d47a8a4756
* | Rename getIonMappedSizeKb to getDmabufMappedSizeKbHridya Valsaraju2021-02-091-2/+2
| | | | | | | | | | | | | | | | | | The function is actually calculating the total mapped DMA-BUF memory. Test: dumpsys meminfo Bug: 167709539 Change-Id: I5c19dc604cf48c3d7ccbfd2d9a83ddd7b35f20d5 Merged-In: I5c19dc604cf48c3d7ccbfd2d9a83ddd7b35f20d5
* | Add total GPU usage report into dumpsys meminfo outputSuren Baghdasaryan2020-12-181-0/+7
| | | | | | | | | | | | | | | | | | | | | | With latest kernel changes, total GPU memory usage is reported and can be obtained via a BPF program. Create JNI interface to query it and report inside dumpsys meminfo output. Bug: 171261987 Test: dumpsys meminfo Signed-off-by: Suren Baghdasaryan <surenb@google.com> Change-Id: I949a13836d5b5bc87fc43f60871b4fbf2add6480
* | Add SystemMemory pulled atom in statsdIoannis Ilkos2020-12-031-1/+7
| | | | | | | | | | | | | | | | | | Initial implementation of kernel-level memory metrics Bug: 149462065 Bug: 172201884 Test: statsd_testdrive Change-Id: I9c0e24f2771ce398942845af6934f0cbc64044c0
* | Add maxTargetSdk restriction to unused APIs.Mathew Inwood2020-10-291-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are APIs that have @UnsupportedAppUsage but for which we don't have any evidence of them currently being used, so should be safe to remove from the unsupported list. This is a resubmit of ag/12929664 with some APIs excluded that caused test failures; see bugs 171886397, 171888296, 171864568. APIs excluded: Landroid/bluetooth/le/ScanRecord;->parseFromBytes([B)Landroid/bluetooth/le/ScanRecord; Landroid/os/Process;->myPpid()I Landroid/os/SharedMemory;->getFd()I Landroid/hardware/input/InputManager;->INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH:I Bug: 170729553 Test: Treehugger Change-Id: I8285daa8530260251ecad6f3f38f98e263629ca7
* | Revert "Add maxTargetSdk restriction to unused APIs."Hongwei Wang2020-10-281-9/+9
| | | | | | | | | | | | | | | | | | This reverts commit 72f07d6a8a32db4a0dedd7682a0b3385be2b9cd6. Reason for revert: Droidcop-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?testMethod=testAppZygotePreload&testClass=android.app.cts.ServiceTest&atpConfigName=suite%2Ftest-mapping-presubmit-retry_cloud-tf&testModule=CtsAppTestCases&fkbb=6936597&lkbb=6936969&lkgb=6936551&testResults=true&branch=git_master&target=cf_x86_phone-userdebug>, bug b/171886397 Bug: 171886397 Change-Id: Ibe0f0430a3451477c1ee8ef56a596e91ea1e7672
* | Add maxTargetSdk restriction to unused APIs.Mathew Inwood2020-10-271-9/+9
| | | | | | | | | | | | | | | | | | | | These are APIs that have @UnsupportedAppUsage but for which we don't have any evidence of them currently being used, so should be safe to remove from the unsupported list. Bug: 170729553 Test: Treehugger Change-Id: I4c8fd0006f950de9955242e93968fb0996ceb372
* | Apply fixes for EfficientStrings.Jeff Sharkey2020-10-201-3/+3
|/ | | | | | | | | Refactoring to avoid StringBuffer synchronization overhead. Bug: 170978902 Test: none Exempt-From-Owner-Approval: trivial refactoring Change-Id: Ibf843ed780c1202d5d96a11eaca889e592f19263
* Report ION usage event when ION heap size is 0Suren Baghdasaryan2020-09-231-2/+4
| | | | | | | | | | | In a situation when ION heap size is 0 dumpsys meminfo will not report ION memory usage. Fix this by differentiating 0-size ION heap or pool from the cases when /sys/kernel/ion/* do not exist or not readable. Bug: 168942451 Test: emulate 0-size ION heap and run dumpsys meminfo Signed-off-by: Suren Baghdasaryan <surenb@google.com> Change-Id: I66624c9e3c73a59462cce8830a36323677db0029
* Merge "Remove unused / unimplemented CorePlatformAPI methods." am: ↵Nicolas Geoffray2020-07-021-24/+1
|\ | | | | | | | | | | | | | | ebe415b310 am: 4d150059e3 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1352354 Change-Id: Ife8fad22006a2817d04e9f7238dcd84b198c8869
| * Remove unused / unimplemented CorePlatformAPI methods.Nicolas Geoffray2020-06-301-24/+1
| | | | | | | | | | | | Test: m Bug: 154796679 Change-Id: I7dc1ad23894c8067c3d7bfb7dab526e7f2596918
| * Use new UnsupportedAppUsage annotation.Artur Satayev2020-01-131-1/+1
| | | | | | | | | | | | | | | | | | Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library. Bug: 145132366 Test: m && diff unsupportedappusage_index.csv Change-Id: I534e3fd1305e2f4af076986770033478448a665c Merged-In: I534e3fd1305e2f4af076986770033478448a665c
* | Merge "Skip meminfo item for the gone processes"Jing Ji2020-01-061-1/+6
|\ \
| * | Skip meminfo item for the gone processesJing Ji2019-12-231-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix race conditions that processes could get killed during meminfo dump. Also fixed various other issues with meminfo dump Bug: 144503238 Test: Insert the below code before retrieving process meminfo, and then set a pid, run dumpsys meminfo, check the output. if (SystemProperties.getBoolean("sys.fake-kill." + pid, false)) { Process.killProcess(pid); Thread.sleep(1000); } Change-Id: I96436800ce218309cc5fd8a21c35ad29584faf6f
* | | Merge "Prevent double-counting of kernel stack size in dumpsys reports" am: ↵Automerger Merge Worker2020-01-031-0/+8
|\ \ \ | |/ / |/| / | |/ | | | | 9493f0ed0b am: a457a78ab7 am: 6dfd9358a3 Change-Id: Ic4ed5159c6e823167bc867e29d15dc526a3c33ea
| * Prevent double-counting of kernel stack size in dumpsys reportsSuren Baghdasaryan2020-01-021-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When kernel is configured with CONFIG_VMAP_STACK=y kernel stacks are mapped into process space and therefore already accounted as part of the value returned by ReadVmallocInfo and reported under MEMINFO_VM_ALLOC_USED category. Introduce isVmapStack function to check if kernel is configured with that option and if so do not exclude kernel stack size in the calculation of memory used by kernel. Bug: 146088882 Test: dumpsys meminfo with CONFIG_VMAP_STACK enabled and disabled Change-Id: I9230bbf0ab05524cf52ded35171fd9ec3da16fa0 Signed-off-by: Suren Baghdasaryan <surenb@google.com>
| * Add JNI API to query sizes of ION heaps, pools and mapped part of the heapsSuren Baghdasaryan2019-12-191-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | Provide means for system_server to query ION memory usage. The new API allows to get total size of ION heaps, pools and part of ION heaps that is mapped into user space. Bug: 138148041 Test: dumpsys meminfo Change-Id: I6d76d534bbab5ee1646e8e3e3fe5210dcf76bc23 Merged-In: I6d76d534bbab5ee1646e8e3e3fe5210dcf76bc23 Signed-off-by: Suren Baghdasaryan <surenb@google.com>
* | Merge "Add JNI API to query sizes of ION heaps, pools and mapped part of the ↵Suren Baghdasaryan2019-12-191-0/+23
|\ \ | | | | | | | | | heaps"
| * | Add JNI API to query sizes of ION heaps, pools and mapped part of the heapsSuren Baghdasaryan2019-12-191-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Provide means for system_server to query ION memory usage. The new API allows to get total size of ION heaps, pools and part of ION heaps that is mapped into user space. Bug: 138148041 Test: dumpsys meminfo Change-Id: I6d76d534bbab5ee1646e8e3e3fe5210dcf76bc23 Signed-off-by: Suren Baghdasaryan <surenb@google.com>
* | | Merge "Use new UnsupportedAppUsage annotation."Artur Satayev2019-12-191-1/+1
|\ \ \ | |/ / |/| |
| * | Use new UnsupportedAppUsage annotation.Artur Satayev2019-12-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library. Bug: 145132366 Test: m && diff unsupportedappusage_index.csv Change-Id: I534e3fd1305e2f4af076986770033478448a665c
* | | Merge "Include KReclaimable meminfo field into getMemInfo results" am: ↵Automerger Merge Worker2019-12-191-1/+7
|\ \ \ | |/ / |/| / | |/ | | | | f61d2347c0 am: 215e1d5e27 am: d23e6f7b09 Change-Id: I3d0f27c2ca0471af8058b86a7d1510cd246fda87
| * Include KReclaimable meminfo field into getMemInfo resultsSuren Baghdasaryan2019-12-181-1/+7
| | | | | | | | | | | | | | | | | | | | With new KReclaimable stat available in /proc/meminfo include it in getMemInfo results so that it can be accounted in dumpsys meminfo reports. Bug: 138148041 Test: dumpsys meminfo Change-Id: Id475fcc0a63c6fc12ea64e08cec5cd24c83848a5 Signed-off-by: Suren Baghdasaryan <surenb@google.com>
* | Merge "Add disclaimer to Debug.getRuntimeStat()" am: 52218ffa3b am: c83c344516Hans Boehm2019-11-061-0/+2
|\| | | | | | | | | | | am: c02f9c70b3 Change-Id: I8745414c51cdf25c967452cafb4e4c74377710f9
| * Add disclaimer to Debug.getRuntimeStat()Hans Boehm2019-10-081-0/+2
| | | | | | | | | | | | | | | | | | It is too expensive to compute bytes-allocated exactly, and we haven't done so in a while. Admit that. Bug: 142328050 Test: Treehugger Change-Id: I6f64e9532879d8164beabb8f886164f0d338b842
| * Adjust and update dumpsys meminfo output.Nicolas Geoffray2019-10-031-11/+16
| | | | | | | | | | | | | | | | | | | | | | | | Adjust for JIT zygote. Test: dumpsys meminfo Bug: 119800099 (cherry picked from commit 08fcd7588c972c57169a7b1d5dc291ca993f8cf8) Change-Id: I84e0d41619558ff3528d7ac8670b1fac04afd34e Merged-In: Ie0e7d6b938b6ee81c01191d6830f1196fa2121c1
* | Adjust and update dumpsys meminfo output.Nicolas Geoffray2019-10-031-12/+19
| | | | | | | | | | | | | | | | Adjust for JIT zygote. Test: dumpsys meminfo Bug: 119800099 Change-Id: Ie0e7d6b938b6ee81c01191d6830f1196fa2121c1
* | Add RSS to dumpsys meminfoJing Ji2019-08-091-0/+62
|/ | | | | | | | | | | | Include the RSS info into the meminfo output of dumpsys and incident_report. Bug: 117880513 Test: adb shell dumpsys meminfo Test: cts-tradefed run cts-dev --module \ CtsIncidentHostTestCases --test \ com.android.server.cts.MemInfoIncidentTest Change-Id: Id1058e279b7ca6925b59a6a523e0f0d14d830761
* Add @UnsupportedAppUsage annotationsAndrei Onea2019-03-151-0/+44
| | | | | | | | | | | | | | | | For packages: android.os This is an automatically generated CL. See go/UnsupportedAppUsage for more details. Exempted-From-Owner-Approval: Mechanical changes to the codebase which have been approved by Android API council and announced on android-eng@ Bug: 110868826 Test: m Change-Id: I4ece0a3f37f88fc2508cb965092aed7cabc61819
* All Parcelable CREATOR fields are @NonNull.Jeff Sharkey2019-02-281-1/+1
| | | | | | | | | If they were null, then the Parcelable would fail to work. Bug: 126726802 Test: manual Change-Id: I7929ffa2f20e5de1c8e68e8263cca99496e9d014 Exempt-From-Owner-Approval: Trivial API annotations
* Update AppCompacted WW atom to include device ZRAM usage.Ben Murdoch2019-02-111-0/+7
| | | | | | | | | We log free ZRAM in kilobytes before and after the compaction event. Test: manually verified am_compact and statsd logging looks correct. Bug: 123623746 Change-Id: I20d5991fb1d060584d415b76c30769fe9f049ffd
* Throttle requests to ActivityManager.getProcessMemoryInfo().Dianne Hackborn2018-08-261-0/+39
| | | | | | | | | | | | This is very expensive and needs to run in the system process, we don't want apps abusing it. Also don't allow apps to get information about anything but their own process, unless they have the appropriate privileged permissions. Bug: 112537519 Test: manual Change-Id: I01997d6f888341e8eb2afe6a69545dd5be013744