History

ANDROID: binder: Add BINDER_GET_NODE_DEBUG_INFO ioctl

The BINDER_GET_NODE_DEBUG_INFO ioctl will return debug info on a node. Each successive call reusing the previous return value will return the next node. The data will be used by libmemunreachable to mark the pointers with kernel references as reachable.

Colin Cross committed 9 years ago

Commit abcc6151 parent 408c68b2 files · +57 −0Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/android/binder.h+14−0
@@ -186,6 +186,19 @@ struct binder_version { · 185 unmodified lines
186186 #define BINDER_CURRENT_PROTOCOL_VERSION 8
187187 #endif
188188
189+/*
190+ * Use with BINDER_GET_NODE_DEBUG_INFO, driver reads ptr, writes to all fields.
191+ * Set ptr to NULL for the first call to get the info for the first node, and
192+ * then repeat the call passing the previously returned value to get the next
193+ * nodes. ptr will be 0 when there are no more nodes.
194+ */
195+struct binder_node_debug_info {
196+ binder_uintptr_t ptr;
197+ binder_uintptr_t cookie;
198+ __u32 has_strong_ref;
199+ __u32 has_weak_ref;
200+};
201+
189202 #define BINDER_WRITE_READ _IOWR('b', 1, struct binder_write_read)
190203 #define BINDER_SET_IDLE_TIMEOUT _IOW('b', 3, __s64)
191204 #define BINDER_SET_MAX_THREADS _IOW('b', 5, __u32)
@@ -193,6 +206,7 @@ struct binder_version { · 1 unmodified line
193206 #define BINDER_SET_CONTEXT_MGR _IOW('b', 7, __s32)
194207 #define BINDER_THREAD_EXIT _IOW('b', 8, __s32)
195208 #define BINDER_VERSION _IOWR('b', 9, struct binder_version)
209+#define BINDER_GET_NODE_DEBUG_INFO _IOWR('b', 11, struct binder_node_debug_info)
196210
197211 /*
198212 * NOTE: Two special error codes you should check for when calling