summaryrefslogtreecommitdiff
path: root/libs/binder/Debug.cpp
diff options
context:
space:
mode:
author Colin Cross <ccross@android.com> 2017-06-20 17:48:33 -0700
committer Colin Cross <ccross@android.com> 2017-07-13 15:35:42 +0000
commit0fb888d052ae9d889ecc03a6ea5a62576131c9f0 (patch)
tree2311035d81d06f8bc5dbe38ae57d2ec23d3e86f4 /libs/binder/Debug.cpp
parent2bb661ca09d87de9a47bd06145c42dfe99d51ca7 (diff)
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)
Diffstat (limited to 'libs/binder/Debug.cpp')
-rw-r--r--libs/binder/Debug.cpp10
1 files changed, 10 insertions, 0 deletions
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 <binder/Debug.h>
+#include <binder/ProcessState.h>
#include <utils/misc.h>
@@ -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<ProcessState> proc = ProcessState::selfOrNull();
+ if (proc.get() == NULL) {
+ return 0;
+ }
+
+ return proc->getKernelReferences(count, buf);
+}
+
}; // namespace android