summaryrefslogtreecommitdiffstats
path: root/drivers/android/binder.c
diff options
context:
space:
mode:
authorSherry Yang <sherryy@android.com>2017-08-23 08:46:40 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-08-28 16:47:17 +0200
commit4175e2b46fd4b9021ef81f18f1be9474b2f45d4a (patch)
treef71d84f71001cecc96563950400c15f609375619 /drivers/android/binder.c
parente21762196118c272321532fe64c512efaa088b7e (diff)
downloadblackbird-obmc-linux-4175e2b46fd4b9021ef81f18f1be9474b2f45d4a.tar.gz
blackbird-obmc-linux-4175e2b46fd4b9021ef81f18f1be9474b2f45d4a.zip
android: binder: Add allocator selftest
binder_alloc_selftest tests that alloc_new_buf handles page allocation and deallocation properly when allocate and free buffers. The test allocates 5 buffers of various sizes to cover all possible page alignment cases, and frees the buffers using a list of exhaustive freeing order. Test: boot the device with ANDROID_BINDER_IPC_SELFTEST config option enabled. Allocator selftest passes. Signed-off-by: Sherry Yang <sherryy@android.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/android/binder.c')
-rw-r--r--drivers/android/binder.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/android/binder.c b/drivers/android/binder.c
index 947eb7056fa7..e4b6055aafc7 100644
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
@@ -4225,6 +4225,8 @@ static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
/*pr_info("binder_ioctl: %d:%d %x %lx\n",
proc->pid, current->pid, cmd, arg);*/
+ binder_selftest_alloc(&proc->alloc);
+
trace_binder_ioctl(cmd, arg);
ret = wait_event_interruptible(binder_user_error_wait, binder_stop_on_user_error < 2);
OpenPOWER on IntegriCloud