summaryrefslogtreecommitdiff
path: root/libpagemap/pm_process.c
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>
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-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>
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-09-22Use %n to parse maps in libpagemap.Elliott Hughes
Bug: http://b/24212024 Change-Id: If00782c7af6fde30650045180512132ee5a8fd89
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-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
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 reusing previous name for mappings with no nameColin Cross
Mappings that are not from a file do not have a name. The sscanf will read all of the fields up to the name, and then leave name untouched. This causes the previous name to be reused. Reset name to an empty string before each call to sscanf. Change-Id: Ib146732983eb074d0d4773be094efa0b672f5ed2
2012-01-20Fix various issues in procrank.Selim Gurun
Fixed these problems: 1. Page swapped bit was not extracted correctly. 2. Pages were ignored when page present bit is not set. 3. Bit operations were not correct. 4. There was a compiler warning about unsigned/signed comparision. 5. Line limit was too short for the map file. This was causing procrank to generate a warning and remove the related process from results. Change-Id: Ifed3913a49b15f59010cfa842090a13228074df9
2011-07-13Handle EOF when reading /proc/<pid>/pagemapColin Cross
Instead of handling maps with the name "[vectors]" specially, silently ignore EOF when reading from /proc/<pid>/pagemap, which occurs any time a a mapping is outside of the userspace range. Change-Id: I674ade1eab6fd7732c6d9e120d0750cca5415b25
2011-07-12Ignore the vector page in /proc/<pid>/mapsColin Cross
In kernel 2.6.37, the vector page was added to /proc/<pid>/maps, but because it is located above TASK_SIZE (usually 0xbf000000), it is considered to be in the kernel's address space, not the process', so it doesn't show up in /proc/<pid>/pagemap. When the vector page is detected, using the name "[vectors]", remove it from the map. Change-Id: I5f0758bbe5d2b927056fa9fee684fea63dd0fa4b
2009-03-03auto import from //depot/cupcake/@135843The Android Open Source Project
2009-03-03auto import from //depot/cupcake/@135843The Android Open Source Project
2008-10-21Initial Contributionandroid-1.0release-1.0cdma-importThe Android Open Source Project