summaryrefslogtreecommitdiff
path: root/libpagemap
AgeCommit message (Collapse)Author
2019-01-29libpagemap: Remove it.Sandeep Patil
Bug: 113035067 Test: lunch aosp_blueline-userdebug; m -j Change-Id: Id3b99876fea86d9fb74877d7d238241b718fc4dc Signed-off-by: Sandeep Patil <sspatil@google.com>
2019-01-19pagemap/tools: remove all pagemap based toolsSandeep Patil
Bug: 111694435 Test: builds Test: showmap and procrank exist on userdebug builds. Change-Id: I3fb63d3adeedd7dece843cbc38e1667f4309bfd3 Signed-off-by: Sandeep Patil <sspatil@google.com>
2018-10-23libpagemap: pm_map: skip pages that are neither present nor swapped.Sandeep Patil
The pm_map_workingset() code needlessly iterates through all the pages in the map regardless of whether they are actually present or not. Fix that by skipping the page if its not swapped AND not present. Bug: 111694435 Test: procmem -h -w 1 Change-Id: I8f16e8c516a5272ebeaa537c07b08ae9f41b73ca Signed-off-by: Sandeep Patil <sspatil@google.com>
2018-08-27Clean up the global -Wno- in system/extras.Elliott Hughes
Bug: N/A Test: builds Change-Id: Idde3d0dafba08ffcd12cc9aa3540550e2601a227
2018-08-22libpagemap: procmem: Add option to sort by USS.Sandeep Patil
In same case, especially working set, USS may be much more actionable for a process than PSS. Add option to sort by USS in all cases for the same. Bug: 111694435 Test: procmem -h -u 1 Test: procmem -h -i -u -w 1 Change-Id: Ifb9c4bd2ff18bb73d82c492cb1862a065ed630b4 Signed-off-by: Sandeep Patil <sspatil@google.com>
2018-08-22libpagemap: procmem: Reset working set everytime if page_idle is used.Sandeep Patil
Idle page tracking works a bit differently than that of clear_refs. A write of 1 to page_idle/bitmap tell the kernel to determine if the page is "idle" and is not accessed *anytime* in the past. This way, we end up catching any new allocations that may have been done since the last time working set was reset too. Bug: 111694435 Test: procmem -h -W 1 && procmem -h -w 1 Test: procmem -h -i -W 1 Test: procmem -h -i -w 1 Test: procmem -h -i -w <pid>; alloc memory in <pid>; procmem -h -i -w <pid> Observe that newly allocated and set memory is no accounted in the working set. Change-Id: Icfabd4e27c006b84e01502fff666d76ebb74c409 Signed-off-by: Sandeep Patil <sspatil@google.com>
2018-08-22libpagemap: Add APIs to mark and read idle pages of a process.Sandeep Patil
pm_kernel_init_page_idle() - Initialize idle page tracking. pm_kernel_has_page_idle() - Returns 1 if idle page tracking has been successfully initialized. pm_kernel_get_page_idle() - Gets the idle status of the page frame. pm_kernel_mark_page_idle() - Marks one or many page frames idle. pm_kernel_page_is_accessed() - Returns 1 if page is accessed. pm_map_mark_idle() - Marks mapped pages from a pagemap idle. Added '-i' usage flag to procmem that tells procmem to use idle page tracking. The flag is ignored in the absense of '-w' or '-W' options. Bug: 111694435 Test: procmem -i -h 1 Test: procmem -h -W 1 && procmem -h -w 1 Test: procmem -h -i -W 1 && procmem -h -i -w 1 Change-Id: Ib9cb679427798426c9477500552e9aa83a40fd48 Signed-off-by: Sandeep Patil <sspatil@google.com>
2018-08-22libpagemap: add .clang-format-4Sandeep Patil
Bug: None Test: None Change-Id: I7413d0dcdefddec66439f5ade29aeb898f82e0f4 Signed-off-by: Sandeep Patil <sspatil@google.com>
2018-08-22Merge "Remove Wno-unused-variable from defaults and fix resulting warnings."Treehugger Robot
2018-08-22Remove Wno-unused-variable from defaults and fix resulting warnings.Sandeep Patil
Bug: 113035007 Test: mmm -j system/extras Change-Id: Id3fa08008b643002baa5f0be0961b36db35e25a9 Signed-off-by: Sandeep Patil <sspatil@google.com>
2018-08-16libpagemap: make pm_kernel_* APIs consistently return negative errors.Sandeep Patil
pm_kernel_* APIs return errnos as error values, which works because almost all callers check if the return value is 'true' or 'false'. Most other APIs in libpagemap return negative errors however. Fix pm_kernel_* APIs to be consistent with other library functions. Bug: 111694435 Test: procrank; procmem 1; librank Change-Id: Ia5cbf6a5676bc797f7cf0843f8b90228bfc3eaec Signed-off-by: Sandeep Patil <sspatil@google.com>
2018-06-07pagemap: admit to the test's requirement for libpagemap.Elliott Hughes
Bug: N/A Test: N/A Change-Id: If1f30148856abe3a2e881d03d7b297cfde41d004
2018-04-12Switch procmem to C++.Elliott Hughes
Bug: N/A Test: builds Change-Id: If6db9e8958cd231ea6a2518c57ea0d667e2ba72c
2018-04-12KPF_ constants are bit numbers, not masks.Elliott Hughes
Adam Romanek mailed me to point out that this has been broken since 9eed624c760b9c70de9a8f75ff84c5f085d62fdc in 2016. Bug: N/A Test: `procrank -C` on hikey Change-Id: Icd4929396dc106175b847e876f02b449085b4846
2018-04-12procmem is another libpagemap tool.Elliott Hughes
Bug: N/A Test: builds Change-Id: Ib4c4079eb69ddda3fae04df955a41567833f6031
2018-04-12Minimal switch to C++ to make future cleanup easier.Elliott Hughes
Bug: N/A Test: builds Change-Id: Ia23db5a5e75749d11fa9797ee4469dd100a1ccaa
2018-04-12Move librank/procrank to Android.bp.Elliott Hughes
I have an actual bug to fix, and I'm distressed to see the amount of copy & paste means I have to fix it twice, so let's at least move these together. Bug: N/A Test: builds Change-Id: If4e8e1873a0a798b52c2a6149136c6552fe0fd72
2017-10-02Use -Werror in system/extrasChih-Hung Hsieh
* Use system-extras-cflags-defaults * Move -Wall -Werror from cppflags to cflags * fix warning on redefinition of MAX_PATH Bug: 66996870 Test: build with WITH_TIDY=1 Change-Id: Ib14b4d8eece767225a6fef639ed190b343678c00
2017-09-07Mark the module as VNDK or VNDK-SP in Android.bpJustin Yun
As a VNDK/VNDK-SP module, Android.bp must have 'vndk' tag as well as 'vendor_available: true'. For a VNDK module, the 'vndk' tag has 'enabled: true'. It will be installed system/lib(64)/vndk as a vendor variant. For a VNDK-SP module, the 'vndk' tag has 'support_system_process: true' as well as 'enabled: true'. It will be installed system/lib(64)/vndk-sp as a vendor variant. Bug: 63866913 Test: build and boot with BOARD_VNDK_VERSION=current Merged-In: I7a2eaf4894188d4d300fcc78380a2b05517c54f4 Change-Id: I7a2eaf4894188d4d300fcc78380a2b05517c54f4 (cherry picked from commit 953341705abd2a840b464928d9ce56e0c1f37b25)
2017-05-24Mark libpagemap vendor_available.Jayant Chowdhary
libpagemap is a library which belongs to vndk-cap. Mark it vendor_available to enable vndk abi stability checks on it. Details: https://android-review.googlesource.com/368372 Test: mm -j64 Bug: 38244611 Change-Id: I310d0a4d8dd9e87615c276bd66639170b2a70648
2016-09-15libpagemap: add static library for pagemapDimitry Ivanov
Bionic unit/cts tests need use static version of libpagemap to avoid depending on internal android library. Test: mm && run pagemap_static_test Bug: http://b/22182538 Change-Id: Ic8b4e74565f77a71540e8cb2c7f9dc67f8d5e10c
2016-08-23Don't invent our own pagemap constants.Elliott Hughes
Use the uapi ones instead, so I don't have to think about whether ours are correct. Bug: http://b/31044648 Change-Id: Ibe4a078ad3223419301a5f585e8ed24dd7366ce2
2016-08-11procrank: fix bounds check to prevent heap overflowNick Desaulniers
Bug: 30774296 Change-Id: I44005caaa3cc17fe829f375a4cfeb5a464c97fbe (cherry picked from commit 98a20cd1283b6ee029e871c0876815300475c40a)
2016-07-12Convert libpagemap Android.mk to Android.bpColin Cross
Change-Id: I551a7f7ce46267bb609e5ed8bd8dafc00b9fbab7
2016-05-18Fix misc-macro-parentheses warnings in libpagemap.Chih-Hung Hsieh
Bug: 28705665 Change-Id: I3a40229aeba12b3fb643770c92039a2af1e4a441
2016-03-01Merge "Fix pagemap_test#maps."Elliott Hughes
am: 5dc5241d77 * commit '5dc5241d7785569a6a4b65df475ac9451cdfe531': Fix pagemap_test#maps.
2016-03-01Fix pagemap_test#maps.Elliott Hughes
We don't necessarily have a brk-based heap. Bug: http://b/27425642 Change-Id: Iac30904ba35c645afe9b056de8df975ebce92a37
2016-02-17Merge commit '4258431621ef3cd32d3cec9604fa17324299cc42' into HEADBill Yi
2016-02-02Fix warnings in system/extras.Dan Albert
Bug: http://b/26936282 Change-Id: I1b9c6c9bb06944c32abcb871279d056eea0fb11a
2015-12-02procrank: add proportional swap accounting am: 08ea6e722bThierry Strudel
am: 6ca5d69923 * commit '6ca5d6992307ac6d063e4a7a1f0457afb88e033c': procrank: add proportional swap accounting
2015-11-30procrank: add proportional swap accountingThierry Strudel
Shared pages are reported in each of the sharing process swapped pages. Compute a proportional swap usage to get a meaningful value of what each process has in swap. Report also process unique pages swapped out. In case ZRAM is used compute the compression ration and report the actual RAM use of the swapped pages. Bug: 25392275 Change-Id: I3a28c7812a09a02e1a604593615f5c6ad0340f9f
2015-11-20Swap column in procrank not reported with swap enabledYu Liu
Bug: 25392275 Change-Id: I6d2a0b03abba555b3667f6ccf12896caeecf27aa
2015-09-22Use %n to parse maps in libpagemap.Elliott Hughes
Bug: http://b/24212024 Change-Id: If00782c7af6fde30650045180512132ee5a8fd89
2015-06-18Swap column in procrank not reported with swap enabledYu Liu
2015-04-22Do free and fclose when error occur.daegeun.song
Do free and fclose when error occur. Change-Id: Ifc611579cf919eeb3fbbf1dff70e7f851a26e083 Signed-off-by: Daegeun Song <daegeun.song@lge.com>
2014-09-03Revert "libpagemap: Mask off page shift to get page frame number"Daniel Rosenberg
This reverts commit 4bf06a51869f49d7ee3fb0163a2517ec5e33ba1f. Bug: 17360804 Bug: 17332389 Change-Id: I7e4d55215f391f5b3f71388943e9d95e5eff6f81
2014-08-29libpagemap: Mask off page shift to get page frame numberDaniel Rosenberg
see comment above pagemap_read() from the kernel Bug: 17332389 Change-Id: Iaec9a2c8d2783f5c1e7ba06d9c7156305abe0453 Signed-off-by: Daniel Rosenberg <drosen@google.com>
2014-06-17libpagemap: support 64-bit kernel from 32-bit libpagemapColin Cross
Use uint64_t and lseek64 to handle 64-bit virtual addresses when libpagemap is compiled as a 32-bit library. Change-Id: Ie4b6c7ef05aac604011f3ee28b059d9dfcd63edb
2014-06-16fix libpagemap for x86_64Colin Cross
libpagemap was storing a virtual pfn in an int, which works on arm64 with 39 bits of virtual address space but fails on x86_64. Use an unsigned long instead. Fixes errors when running procrank on x86_64: warning: could not read usage for 1 Change-Id: I171c8ee49faa51accf3c1bb69059d549aee04979
2014-05-15Merge "libpagemap: handle zero length memory regions"Colin Cross
2014-05-14libpagemap: handle zero length memory regionsColin Cross
/proc/pid/maps may report a zero-length memory region for a 4kB PROT_GROWSDOWN region because it subtracts 4kB for the guard page. Return 0 instead of -1 when this occurs, and set range_out to NULL and len to 0. All existing callers of pm_process_pagemap_range will not dereference range_out if len is 0. Bug: 14683277 Change-Id: If405651ad034dda780b93fab2dc616e177a0b917
2014-05-06Add {BEGIN,END}_DECLS to header file.Torne (Richard Coles)
Enable this header to be cleanly included in C++ code. Change-Id: Ie4ae60629661237ce07b49b17802f01bf95552d8
2013-08-28libpagemap: fix memory leak in pm_process_destroy()Carton He
procrank/librank not impacted because they end quickly. But other programs that use libpagemap and last for long time can easily see this memory leak. Change-Id: I8c9e9444555bef9145c9d89850987a29f15a9b3b Signed-off-by: Carton He <carton.he@marvell.com>
2013-06-24libpagemap: add pm_process_usage_flagsColin Cross
Add pm_process_usage flags to get memory usage by a process, only counting pages with specified flags set. Change-Id: I900b673ddbb5ae92312773a8670dd59769617268
2013-06-24libpagemap: fix new kernel flag names to start with PM_PAGE_Colin Cross
Change-Id: I6b030d9d0356d63b3ddb853de304407bc70b38c4
2013-06-24libpagemap: count swapped pagesColin Cross
Add a new memusage field for swapped pages. Change-Id: I857143a5fdd294315dd89e834b1217a219f10479
2013-06-24libpagemap: add pm_map_usage_flagsColin Cross
Add pm_map_usage_flags, which is the same as pm_map_usage but only counts pages with the specified flags set. This can be used to only count "swapbacked" pages, which are pages that cannot be flushed back to disk without using swap. Change-Id: I6367555d9385502c797935849bb4221a8354e251
2013-06-24libpagemap: add page flags for new kernelsColin Cross
Change-Id: If4a4a2bbe9b1a68c5dce1151cf8b7c60cae1a3fa
2013-06-24libpagemap: add definition for mask of permission flagsColin Cross
Change-Id: Ibd0b26e4f5245592152d2c8ef00e7da1ad5f3fdf
2013-06-24libpagemap: fix vss calculationColin Cross
pm_map_usage was not incrementing vss for pages that were in the process's map but not occupying a physical page. Move the vss increment above the check for present mappings. Change-Id: I2706e6fbcbfe7d70f10950333a486d690bc84d6c