From 9d45ccc0578570f90d5b2b73ada42c5bfd1c993a Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Tue, 20 Jun 2017 17:48:33 -0700 Subject: Add getBinderKernelReferences Add a wrapper for the new BINDER_GET_NODE_DEBUG_INFO ioctl for use by libmemunreachable. Test: memunreachable_binder_test Bug: 28275695 Change-Id: Ic112584fa05071bd336974b3a18869077a69389b Merged-In: Ic112584fa05071bd336974b3a18869077a69389b (cherry picked from commit b869cc94704d1a3d6226f471984eb33ff1bac7d5) --- libs/binder/Debug.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'libs/binder/Debug.cpp') diff --git a/libs/binder/Debug.cpp b/libs/binder/Debug.cpp index a8f2da5ba5..4ac61a3007 100644 --- a/libs/binder/Debug.cpp +++ b/libs/binder/Debug.cpp @@ -15,6 +15,7 @@ */ #include +#include #include @@ -294,5 +295,14 @@ void printHexData(int32_t indent, const void *buf, size_t length, } } +ssize_t getBinderKernelReferences(size_t count, uintptr_t* buf) { + sp proc = ProcessState::selfOrNull(); + if (proc.get() == NULL) { + return 0; + } + + return proc->getKernelReferences(count, buf); +} + }; // namespace android -- cgit v1.2.3-59-g8ed1b