Commit Graph

8 Commits

Author SHA1 Message Date
Christopher Ferris 3bae40b279 Add ReadMapFileAsyncSafe function.
This is a function designed so that it doesn't do any allocations.
It's purpose is for testing allocation related code where doing an
allocation can disturb the test.

Added unit tests for the new code that disable memory allocations
before running.

Also, made the tests run in isolation mode since I added a bunch of
tests and this will keep the total runtime about the same as
before.

Bug: 137795072

Test: All unit tests pass.
Change-Id: I7645f1e9f88cdfbc57c8eebce80199b9cfae64c1
2019-08-23 10:07:44 -07:00
Sandeep Patil f31c70989b procinfo: Read inode number from /proc/<pid>/maps
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>
2019-02-11 01:38:08 +00:00
Florian Mayer 3f1f2e07ab Add missing includes.
Test: Builds.
Change-Id: Ia8b79154902503cdd774dc3b4523466123b4324c
2018-12-06 10:09:20 -08:00
Yabin Cui 0fe48f943d libprocinfo: provide MapInfo structure for reading maps.
Bug: none
Test: run libprocinfo_test.
Change-Id: I4d3c0f3012e91571aef7ebf4b154df1c9c5addc2
2018-10-30 17:36:09 -07:00
Yabin Cui 5f036ab89b libprocinfo: return error msg instead of printing it.
So users can decide whether to print error msg or not.

Bug: none
Test: run libprocinfo_test.
Change-Id: Ie1afcb58cb97493c7ffade6841b6eb7a800a3981
2018-07-24 14:34:06 -07:00
Yabin Cui 3841accba8 libprocinfo: add functions reading process map file.
Add test and benchmark.
Also switch libbacktrace, libunwindstack, libmemunreachable
to use libprocinfo for map file reading.
The benchmark shows using libprocinfo speeds up map file reading
in libbacktrace and libunwindstack 18% - 36% on walleye.

Bug: http://b/79118393
Test: run procinfo_test.
Test: run libunwindstack_test.
Test: run libbacktrace_test.
Test: run memunreachable_test.

Change-Id: Icf281c352f4103fc8d4ba6732c5c07b943330ca1
2018-05-14 14:00:18 -07:00
Josh Gao 9cb2e2eb8c libprocinfo: add support for parsing process state.
Bug: http://b/63008395
Test: libprocinfo_test32
Change-Id: I20a337bb5075bcdb325d2b48e174b0b5ef896261
2017-06-27 15:06:27 -07:00
Josh Gao 911d729c8a libprocinfo: introduce.
Add a new library for parsing /proc files. Start with helpers for
parsing /proc/<pid>/status and /proc/<pid>/task.

Bug: http://b/30705528
Test: libprocinfo_test32/64 on host/bullhead
Change-Id: I5757514c0aede8a9d75834b55aae42a5cf762b95
2016-11-14 13:42:18 -08:00