summaryrefslogtreecommitdiffstats
path: root/testdata1
Commit message (Collapse)AuthorAgeFilesLines
* Allow ForEachVma*() APIs to use /proc/<pid>/mapsKalesh Singh2021-02-251-0/+6
| | | | | | | | | Not all clients are interested in the mem usage stats parsed from smaps. Allow using ForEachVma*() methods with /proc/<pid>/maps. Bug: 181174877 Test: libmeminfo_test Change-Id: I032e0cbf5707a8c305e0d0a4e47013503465bad1
* Add libmeminfo_test into TEST_MAPPINGSuren Baghdasaryan2020-01-131-86/+0
| | | | | | | | | | Include libmeminfo_test into presubmit test list. Move showmap_test.sh out of directory used by the test so that TreeHugger does not run this script as part of libmeminfo_test. Bug: 144949774 Change-Id: I48090cd6f05f39467d50b7ddf403c9abcda037db Signed-off-by: Suren Baghdasaryan <surenb@google.com>
* meminfo: Add Smaps(), showmap and friends.Sandeep Patil2019-01-082-0/+208
| | | | | | | | | | | | | | | | | | | | | | | 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-071-0/+56297
| | | | | | | | | | | | | | | | | | | | 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-071-0/+1774
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* libmeminfo: Add ReadSysMemInfo variantsSandeep Patil2018-12-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* libmeminfo: Add support to read zram memory consumptionSandeep Patil2018-12-041-0/+1
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>