summaryrefslogtreecommitdiffstats
path: root/libmeminfo
Commit message (Collapse)AuthorAgeFilesLines
* procrank: do not keep process maps aroundSandeep Patil2019-04-261-11/+11
| | | | | | | | | | | | | | | | | procrank's usage in its output shows 20x increase from last year. This is because it is keeping the process maps around until termination. Fix that by getting rid of ProcMemInfo objects when done parsing /proc/<pid>/maps,pagemap. Note that the total allocations do not change and have not necessarily regressed from Pie. Bug: 130672819 Test: adb shell procrank | grep 'procrank\|cmdline' Change-Id: Ib7bf960ed1d053347fcfc0c8aee9019607a1eb01 Merged-In: Ib7bf960ed1d053347fcfc0c8aee9019607a1eb01 Signed-off-by: Sandeep Patil <sspatil@google.com>
* libmeminfo/procrank: Ignore failures when process disappears.Sandeep Patil2019-04-101-13/+19
| | | | | | | | | | | | | | | | | | | procrank currently fails if a process gets killed while it is reading the stats. This behavior is a regression from the previous version of procrank and is often undesired. Change procrank to silently ignore the process if it detects that it had been killed while reading the stats. If the process is still around, then print a warning about it and continue to read stats for other processes in the system. Fixes: 130177765 Test: Tested by deliberately killing specific process in ProcessRecord() constructor Change-Id: I701808c3226bb9b3a350ccf8e67fb29b59b0d4e0 Merged-In: I701808c3226bb9b3a350ccf8e67fb29b59b0d4e0 Signed-off-by: Sandeep Patil <sspatil@google.com>
* libmeminfo: librank optimization using maps instead of vectorsErick Reyes2019-03-011-23/+24
| | | | | | | | | | | | | | | | | | librank was calling std::vector::find_if in nested loops when iterating through processes and maps. Changed the implementation to use std::map::insert, this resulted in a significant improvement to execution speed. Test: time librank on crosshatch Before: 1m22.57s real 1m15.87s user 0m05.79s system After: 0m03.85s real 0m00.88s user 0m02.92s system Bug: 124523194 Change-Id: I2b519d0bfd7f7929c6c4c6c2374794cb1a744585 Signed-off-by: Erick Reyes <erickreyes@google.com>
* Merge "procinfo: Read inode number from /proc/<pid>/maps"Treehugger Robot2019-02-152-28/+7
|\
| * procinfo: Read inode number from /proc/<pid>/mapsSandeep Patil2019-02-112-28/+7
| | | | | | | | | | | | | | | | | | | | | | | | Adjust all callbacks to include the inode number as well. Fixes: 123532375 Test: libprocinfo_test Test: libdmabufinfo_test Test: libmeminfo_test Change-Id: I71fd75d90d5ee44585011c5ae654a1dd7e185458 Signed-off-by: Sandeep Patil <sspatil@google.com>
* | libmeminfo: change dmabuf_dump from soc_specific to product_specificErick Reyes2019-02-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | The vendor partition does not give dmabuf_dump enough permissions to retrieve shared buffer information for all processes. Move it to product partition where it can be invoked from platform's dumpstate. Bug: 63860998 Change-Id: I73957f59943d1e49fcb59abb723aad4eeeaa4172 Signed-off-by: Erick Reyes <erickreyes@google.com>
* | Merge "meminfo: make dmabuf_dump dependency on debugfs optional"Treehugger Robot2019-02-101-2/+2
|\ \
| * | meminfo: make dmabuf_dump dependency on debugfs optionalErick Reyes2019-02-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | dmabuf_dump had a hard dependency on debugfs to gather the initial list of buffers for all proceses, make it optional. Change-Id: I1d271297c0ad6124b321a1ee8aa01d3e88ca9fed Signed-off-by: Erick Reyes <erickreyes@google.com>
* | | Merge "libmeminfo: make libdmabufinfo and dmabuf_dump vendor available"Treehugger Robot2019-02-103-16/+43
|\| |
| * | libmeminfo: make libdmabufinfo and dmabuf_dump vendor availableErick Reyes2019-02-063-16/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removed dependency on libc++fs and changed liblog to shared linkage to cope with build errors derived from the change. Removed dmabuf_dump unnecessary dependencies and made it soc_specific. Removed reference to std::filesystem::is_symlink to workaround the following error when linking with the library: ld.lld: error: undefined symbol: std::__1::__fs::filesystem::__symlink_status(std::__1::__fs::filesystem::path const&, std::__1::error_code*) >>> referenced by filesystem:1743 (external/libcxx/include/filesystem:1743) >>> dmabufinfo.o:(android::dmabufinfo::AppendDmaBufInfo(int, std::__1::vector<android::dmabufinfo::DmaBuffer, std::__1::allocator<android::dmabufinfo::DmaBuffer> >*)) in archive Bug: 63860998 Change-Id: Ieafdc87c64f153625df9e21fc8299292b2447aef Signed-off-by: Erick Reyes <erickreyes@google.com>
* | | Merge "Fix 32-bit dmabuf_dump build"Treehugger Robot2019-02-081-1/+1
|\ \ \
| * | | Fix 32-bit dmabuf_dump buildColin Cross2019-02-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: system/core/libmeminfo/libdmabufinfo/tools/dmabuf_dump.cpp:109:39: error: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat] Test: lunch aosp_arm-eng && m dmabuf_dump Change-Id: Ie605d9b94f5eff888f6a64801512216253a6babb
* | | | Don't abort the build if a repo doesn't have the test/vts/tools/build/.Nicolas Geoffray2019-02-081-1/+1
|/ / / | | | | | | | | | | | | | | | Test: build with master-art manifest Exempt-From-Owner-Approval: Required for unbreaking ART development. Change-Id: I6afc0e5444dfa21532a4c802f8c463091cab2b11
* | | Merge "meminfo: add tools/dmabufinfo_dump to dmabufinfo"Treehugger Robot2019-02-082-0/+216
|\| |
| * | meminfo: add tools/dmabufinfo_dump to dmabufinfoErick Reyes2019-02-062-0/+216
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding tool to dump the dmabuf information using the dmabufinfo library. Test: run "dmabuf_dump" and "dmabuf_dump <pid>" on crosshatch Bug: 63860998 Change-Id: I16fe0a701deb5086ca0e1a8ceecb70dbc17934e6 Signed-off-by: Erick Reyes <erickreyes@google.com>
* | | Merge "vts test for /proc/<pid>/smaps_rollup"Treehugger Robot2019-02-084-0/+102
|\ \ \ | |/ / |/| |
| * | vts test for /proc/<pid>/smaps_rollupTri Vo2019-02-034-0/+102
| |/ | | | | | | | | | | | | | | Bug: 122148371 Test: vts-tradefed run commandAndExit vts-kernel --skip-all-system-status-check --primary-abi-only --skip-preconditions --skip-device-info --module VtsKernelMemInfoTest Change-Id: I855984a35a06c21e6e90ef3f8c33c3c0643090f1
* / meminfo: Fix dmabufinfo total ref accountingErick Reyes2019-02-062-8/+12
|/ | | | | | | | | | The number of references to a buffer total_refs was not accounting for a process holding multiple references to the same buffer. Also, clarify AppendDmaBufInfo functionality in comments Change-Id: I044a18acad1570492a925d51b9464d5b0e60ca35 Signed-off-by: Erick Reyes <erickreyes@google.com>
* Add more tests to libdmabufinfoChenbo Feng2019-02-012-7/+245
| | | | | | | | | | Add some test to verify the refcount and fd reference is correct when the dma_buf is shared between processes. Bug; 63860998 Test: libdmabufinfo_test Change-Id: Id22e68e7a65820f19847b2faab11c78e6d942d92
* Merge "meminfo: handle multiple buffer references in dmabufinfo"Treehugger Robot2019-01-303-16/+58
|\
| * meminfo: handle multiple buffer references in dmabufinfoErick Reyes2019-01-293-16/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change the dmabufinfo library to handle multiple references to the same buffer across PIDs by doing these changes: - Add function AppendDmaBufInfo: appends the information for a specific PID to an existing DmaBuffer vector - Change the way fd/map references to a buffer belonging to a PID are stored in DmaBuffer from vector<pid_t> to unorderedmap<pid_t, int> - When parsing proc/%pid/{maps|fds}, look up the buffer by inode and update the data if found Test: builds Bug: 63860998 Change-Id: If22feea772f182086ae3446b46d626a750674b1f Signed-off-by: Erick Reyes <erickreyes@google.com>
* | meminfo: Remove libpagemap dependencySandeep Patil2019-01-282-305/+38
|/ | | | | | | | | | | Remove all tests that validated libmeminfo against the libpagemap implementation and make libmeminfo_test self sufficient. Bug: 111694435 Bug: 113035067 Test: libmeminfo_test Change-Id: I21b9a0e2c71ef3f1f672a3b1de8080c0c36b4bfe Signed-off-by: Sandeep Patil <sspatil@google.com>
* meminfo: Add memtrack dmabufinfo libraryErick Reyes2019-01-284-0/+621
| | | | | | | | | | | | | | | | | | This is the userspace component for the improved shared memory buffer tracking. A new static library called libdmabufinfo will provide APIs to parse dmabuf debugfs entries. The library can also map and read the file descriptors per process to cross-reference the global data per process. This change only adds a global API to read dmabuf stats from debugfs. Bug: 63860998 Test: dmabufinfo_test Change-Id: Ib0deedc73337a70875e03e07d3e9a692c4c33e63 Signed-off-by: Greg Hackmann <ghackmann@google.com> Signed-off-by: Erick Reyes <erickreyes@google.com> Signed-off-by: Sandeep Patil <sspatil@google.com>
* meminfo: Add support to track working set with idle page tracking.Sandeep Patil2019-01-234-6/+260
| | | | | | | | | | Also adds a tool to make use of this if it exists call 'wsstop' Bug: 111694435 Test: wsstop -d 3 -n 100 1 Change-Id: I50415f0bdc09c09b5b414cf0e4fff8f2907c5823 Signed-off-by: Sandeep Patil <sspatil@google.com>
* Merge "meminfo: Pull ReadVmallocInfo() out of the SysMemInfo class."Sandeep Patil2019-01-234-41/+49
|\
| * meminfo: Pull ReadVmallocInfo() out of the SysMemInfo class.Sandeep Patil2019-01-224-41/+49
| | | | | | | | | | | | | | | | | | | | | | There is no need for the vmalloc reader to be in the sysmeminfo object. The caller has to create the SysMemInfo object for no reason right now. Bug: 111694435 Test: libmeminfo_test 1 Change-Id: I263c08c169ea6caf2221bfb915b26ef3c0b1c20c Signed-off-by: Sandeep Patil <sspatil@google.com>
* | Merge "meminfo: Add API to read pagemap for a vma within a process."Sandeep Patil2019-01-225-0/+76
|\ \ | |/ |/|
| * meminfo: Add API to read pagemap for a vma within a process.Sandeep Patil2019-01-215-0/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | .. and make sure we have some helper methods exposed to the clients to do some basic checks for the pagemap values. For example, to check if the page is present or swapped. Bug: 111694435 Test: libmeminfo_test 1 --gtest_filter=ValidateProcMemInfo.TestPageMap Test: libmeminfo_test 1 Change-Id: Ic6ae91f4214b42346f3d0b54164a43ac79d5ade1 Signed-off-by: Sandeep Patil <sspatil@google.com>
* | meminfo/tools: Enable all libmeminfo based toolsSandeep Patil2019-01-191-4/+4
|/ | | | | | | | | | | | Enables procrank, procmem, librank and showmap. Only showmap gets built into the default builds. Bug: 111694435 Test: builds Test: showmap exists in final builds Change-Id: Ib5901aa2bd4ccc6aa3d02915fda92f8320651315 Signed-off-by: Sandeep Patil <sspatil@google.com>
* procmeminfo: use getline() instead of fgets() everywhereSandeep Patil2019-01-141-4/+10
| | | | | | | | Bug: 111694435 Test: libmeminfo_test 1 --gtest_filter=TestProcMemInfo.* Change-Id: Idfc797aa65f45e0152765605c14622e2110dfdc1 Signed-off-by: Sandeep Patil <sspatil@google.com>
* meminfo: test: delete SmapsOrRollupReturn testSandeep Patil2019-01-141-9/+0
| | | | | | | | | | | | | | The test has become invalid due to addition of IsSmapsRollupSupported() and its internal usage by SmapsOrRollup() method. The method now returns success and returns statistics even if 'smaps_rollup' doesn't exist. It does that by internally checking for it's existence and falls back to using /proc/<pid>/smaps Bug: 111694435 Test: mma -j Change-Id: I1983a23f1f617aee126bc66a4c1fbd4abb50f565 Signed-off-by: Sandeep Patil <sspatil@google.com>
* meminfo: Add IsSmapsRollupSupported ApiSandeep Patil2019-01-143-11/+52
| | | | | | | | | | | | | | | | Consolidate the checking of /proc/<pid>/smaps_rollup support in libmeminfo and do it in a thread safe way. Use the API in ProcMemInfo as well to eliminate the extra parameters passed to SmapsOrRollup* methods. Bug: 111694435 Test: libmeminfo_test 1 --gtest_filter=TestProcMemInfo.IsSmapsSupportedTest Test: Tested with and without the smaps_rollup support in kernel. Change-Id: I992057f06b54569025fa0cdade9618da2675d1de Merged-In: I992057f06b54569025fa0cdade9618da2675d1de Signed-off-by: Sandeep Patil <sspatil@google.com>
* meminfo: Add SmapsOrRollupPssSandeep Patil2019-01-143-0/+77
| | | | | | | | | | | | Adds SmapsOrRollup parsing methods to only read Pss of the process fomr /proc/<pid>/{smaps, smaps_rollup}. Bug: 111694435 Test: libmeminfo_test 1 --gtest_filter=TestProcMemInfo.* Change-Id: I31b982ae5ff2bb5b165ea33f6c57755ee34cbbc7 Merged-In: I31b982ae5ff2bb5b165ea33f6c57755ee34cbbc7 Signed-off-by: Sandeep Patil <sspatil@google.com>
* meminfo: Remove unnecessary working set statsSandeep Patil2019-01-145-43/+22
| | | | | | | | | | | | | The Vma and ProcMemInfo objects do not need separate stats objects for storing working set. The Vma either has working set or memory usage information and never both. Bug: 111694435 Test: libmeminfo_test 1 Change-Id: I2df05f7e750bbba4325474633e705d6d68dd2ccb Merged-In: I2df05f7e750bbba4325474633e705d6d68dd2ccb Signed-off-by: Sandeep Patil <sspatil@google.com>
* meminfo: Fix ProcMemInfo ForEachVmaFromFileSandeep Patil2019-01-142-1/+7
| | | | | | | | | | | Caused by passing invalid parameters to getline(3) and the test failure went unnoticed. Bug: 111694435 Test: libmeminfo_test 1 --gtest_filter=TestProcMemInfo.ForEachVmaFromFileTest Change-Id: Ideb39604c58f89237b05d2f7c8edb67c5ae65768 Merged-In: Ideb39604c58f89237b05d2f7c8edb67c5ae65768 Signed-off-by: Sandeep Patil <sspatil@google.com>
* meminfo: Add Smaps(), showmap and friends.Sandeep Patil2019-01-088-1/+819
| | | | | | | | | | | | | | | | | | | | | | | Needed by showmap and also android_s_Debug to classify each allocation into multiple heaps. The APIs added are: ForEachVmaFromFile - Global API to parse a file expected to be in the same format as /proc/<pid>/smaps and make a callback for each VMA found. ProcMemInfo::ForEachVma - Same as 'ForEachVmaFromFile' but for a ProcMemInfo object corresponding to a process(pid). ProcMemInfo::Smaps - Wrapper to ProcMemInfo::ForEachVma, except the function collects 'struct Vma' in a member vector and returns the reference for the same. Added showmap2 using the APIs and the corresponding tests the same time. Bug: 111694435 Test: showmap_test.sh Test: libmeminfo_test 1 Change-Id: I3065809cf94ecf3da88529809701035c47a8ce34 Signed-off-by: Sandeep Patil <sspatil@google.com>
* libmeminfo: Add SmapsRollupSandeep Patil2019-01-076-5/+56543
| | | | | | | | | | | | | | | | | | | | This adds the tests and SmapsRollup() parsing function in ProcMemInfo. Adds tests to check the return value as well as the correctness. Bug: 111694435 Test: libmeminfo_test 1 --gtest_filter=TestProcMemInfo.* Test: libmeminfo_benchmark --benchmark_filter=BM_SmapsRollup_ Result: ---------------------------------------------------------- Benchmark Time CPU Iterations ---------------------------------------------------------- BM_SmapsRollup_old 4751 ns 4730 ns 149458 BM_SmapsRollup_new 4858 ns 4837 ns 144636 ---------------------------------------------------------- Change-Id: Ia051fe53a7622e3091502ff7166efafae35e7935 Signed-off-by: Sandeep Patil <sspatil@google.com>
* meminfo: Add ReadVmallocInfo()Sandeep Patil2019-01-075-2/+1935
| | | | | | | | | | | | | | | | | | | | | | | | | | This is to replace occurrences of get_allocated_vmalloc_memory(). Splitting into libmeminfo already found a bug with current code which failed to account for memory allocated by modules due to addition of the extra [%module_name%] in __builtin_return_address(). See: https://elixir.bootlin.com/linux/latest/source/kernel/kallsyms.c#L373 Also improves the performance a bit in the process. Bug: 119639955 Bug: 111694435 Test: libmeminfo_test 1 --gtest_filter=SysMemInfoParser.TestVmallocInfo Test: libmeminfo_benchmark --benchmark_filter=BM_VmallocInfo_* Result: ---------------------------------------------------------------- Benchmark Time CPU Iterations ---------------------------------------------------------------- BM_VmallocInfo_old_fixed 459239 ns 457268 ns 1532 BM_VmallocInfo_new 386032 ns 384353 ns 1821 ---------------------------------------------------------------- Change-Id: I1b6606ac73b5cc2dac31d24487b462ec9abfb2ef Signed-off-by: Sandeep Patil <sspatil@google.com>
* meminfo: Use getprogname(3) in all tools.Sandeep Patil2018-12-303-17/+17
| | | | | | | | Test: procrank2 -h;librank2 -h;procmem2 -h Bug: none Change-Id: Ieccd943b7140a7866694eea047969500bb3bb972 Signed-off-by: Sandeep Patil <sspatil@google.com>
* Add librank2Sandeep Patil2018-12-202-2/+364
| | | | | | | | | | | | | | | Identical with librank, but written using libmeminfo. Bug: 114325007 Bug: 111694435 Test: librank2 Test: librank2 -m rx Test: librank2 -m rx -P /system/lib64 Test: librank2 -u -P /system/lib Test: librank2 -R -m rx Change-Id: Ib6ecb601a0b6ecb5b4b75285f772586e05ae388a Signed-off-by: Sandeep Patil <sspatil@google.com>
* libmeminfo: Add ReadSysMemInfo variantsSandeep Patil2018-12-115-37/+314
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new variant is primarily used in framework. See: go/ag/5780400 for usage. Also add tests, benchmarks and fix several issues found in SysMemInfo class. New benchmark results are: -------------------------------------------------------------- Benchmark Time CPU Iterations -------------------------------------------------------------- BM_ReadMemInfo_old 7726 ns 7696 ns 90201 BM_ReadMemInfo_new 7554 ns 7525 ns 90358 BM_ZramTotal_old 6446 ns 6406 ns 108361 BM_ZramTotal_new 6529 ns 6488 ns 106545 BM_MemInfoWithZram_old 14485 ns 14412 ns 48492 BM_MemInfoWithZram_new 20572 ns 20459 ns 33438 -------------------------------------------------------------- The reason for BM_MemInfoWithZram_new shows worse numbers is because the new API also tries to find more than 1 zram device (if it exists). The old implementation hard coded everything to "/sys/block/zram0/" Test: libmeminfo_test 1 Bug: 114325007 Bug: 111694435 Change-Id: I246d9e9a54986ee9b2542d1eaac79ecf7310b23a Signed-off-by: Sandeep Patil <sspatil@google.com>
* Add OWNERS fileSandeep Patil2018-12-071-0/+1
| | | | | Change-Id: Id8421b9d7fb391615232a8a8e75ad8a68e20dfbc Signed-off-by: Sandeep Patil <sspatil@google.com>
* procmem2: Finish implementing all optionsSandeep Patil2018-12-072-55/+79
| | | | | | | | | | | | | | | | | | | In the same time replace iomanipulators with ::android::base::StringPrintf which makes the output much more readable and the overall program simpler. Bug: 114325007 Bug: 111694435 Test: procmem 1 Test: procmem -W 1 Test: procmem -u 1 Test: procmem -p 1 Test: procmem -w 1 Test: procmem -w -u 1 Test: procmem -w -p 1 Change-Id: Ibf7ef59b24dfcb851c78a3b2fad672d96a708b98 Signed-off-by: Sandeep Patil <sspatil@google.com>
* Add procrank2Sandeep Patil2018-12-072-0/+545
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement procrank using new libmeminfo APIs. procrank2 is functionally equivalent to procrank except for the part where the old procrank would print processes under each oomadj level if called with 'procrank -c -o'. The output format of 'procrank2' is identical to that of 'procrank'. 'procrank2' also gives significant performance boost over 'procrank' but does cost a more memory as the library is written to 99% use case where callers almost always want to read the memory usage of hte process. Bug: 114325007 Bug: 111694435 Test: # adb push /google/data/ro/users/ss/sspatil/test-memutils.sh /data/local/tmp/ # adb push procmem2 /data/local/tmp && adb push procrank2 /data/local/tmp # adb root && adb shell $ cd /data/local/tmp/ $ chmod +x test-memutils.sh $ ./test-memutils.sh 2>&1 | tee test.log Test: procrank: 0m00.43s real 0m00.11s user 0m00.32s system procrank2: 0m00.42s real 0m00.05s user 0m00.36s system Change-Id: I37b71a4625248e333ba01801c0d8d7ef348e4cfa Signed-off-by: Sandeep Patil <sspatil@google.com>
* libmeminfo: defer maps reading only when required for procmeminfoSandeep Patil2018-12-053-6/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | This restores the original behavior. The main reason it should be this way is to make the class generic for all things memory under /proc/<pid>/. For example, with the current behavior, a program that only needs to read /proc/<pid>/smaps_rollup will end up wasting time and memory by parsing /proc/<pid>/maps when the object is being constructed. Same goes for a program that only wants to reset the working set. The 'ProcMemInfo' object still retains the property that it can only be used once to read maps and the object must be destroyed + recreated to update the stats. Bug: 114325007 Bug: 111694435 Test: libmeminfo_test 1 Test: # adb push /google/data/ro/users/ss/sspatil/test-memutils.sh /data/local/tmp/ # adb push procmem2 /data/local/tmp && adb push procrank2 /data/local/tmp # adb root && adb shell $ cd /data/local/tmp/ $ chmod +x test-memutils.sh $ ./test-memutils.sh 2>&1 | tee test.log Change-Id: I856d3b78a0088cff02cbd010b29ffbe0e35f5ee2 Signed-off-by: Sandeep Patil <sspatil@google.com>
* libmeminfo: Add support to reset workingset without procmeminfo objectsSandeep Patil2018-12-054-30/+26
| | | | | | | | | Bug: 114325007 Bug: 111694435 Test: libmeminfo_test 1 Change-Id: I816809cda13983e47294a956347a27085397cbcf Signed-off-by: Sandeep Patil <sspatil@google.com>
* libmeminfo: Add support to fiter accounting based on page flagsSandeep Patil2018-12-043-2/+57
| | | | | | | | | Bug: 114325007 Bug: 111694435 Test: libmeminfo_test 1 --gtest_filter=ValidateProcMemInfoFlags.* Change-Id: Ifa7006de78dd909b5b4db282a8c9931ebf97a68a Signed-off-by: Sandeep Patil <sspatil@google.com>
* libmeminfo: Add support to read zram memory consumptionSandeep Patil2018-12-047-12/+152
| | | | | | | | | | | | | | | | Bug: 114325007 Bug: 111694435 Test: libmeminfo_test 1 --gtest_filter=SysMemInfoParse.TestZramTotal Benchmark: libmeminfo_benchmark --benchmark_filter=BM_.*ZramTotal Benchmark Result on Blueline: ----------------------------------------------------------- Benchmark Time CPU Iterations ----------------------------------------------------------- BM_OldReadZramTotal 3857 ns 3839 ns 134096 BM_NewReadZramTotal 4461 ns 4440 ns 157341 Change-Id: I5220fa17b101981ef859179960fe78fe68e84852 Signed-off-by: Sandeep Patil <sspatil@google.com>
* libmeminfo: Add support for counting swap pagesSandeep Patil2018-12-046-24/+80
| | | | | | | | | | | Adds procmeminfo API to get the vector of swap_offsets if SWAP is enabled on the device. Bug: 114325007 Bug: 111694435 Test: libmeminfo_test 1 Change-Id: If0b52d042749a5bcb2c87aa2cb1595190d4769b1 Signed-off-by: Sandeep Patil <sspatil@google.com>
* switch to using android-base/file.h instead of android-base/test_utils.hMark Salyzyn2018-11-142-2/+0
| | | | | | Test: compile Bug: 119313545 Change-Id: I4f7ad84743e974b4b4d1d7256088f6c8b749a237