diff options
author | Amit Pundir <amit.pundir@linaro.org> | 2013-08-01 18:15:27 +0530 |
---|---|---|
committer | Amit Pundir <amit.pundir@linaro.org> | 2013-08-07 16:41:40 +0530 |
commit | 169a0d9570d07d4b404c9b3018b7c43456f0feff (patch) | |
tree | 5b6fa97113952130e30c0c85571f0c4e5b98cdbd | |
parent | 91c9642bfe1342aa90a3826222eba48952acb214 (diff) | |
download | native-linaro_android_4.3_juice.tar.gz |
servicemanager: enable bctest with debug logslinaro_android_4.3_juice
Enable bctest binder test and put ioctl pass/failure logs for lava.
Change-Id: I33eb6b87d3f9efcef7334dbb0a649ce23b8b0a21
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
-rw-r--r-- | cmds/servicemanager/Android.mk | 10 | ||||
-rw-r--r-- | cmds/servicemanager/binder.c | 30 |
2 files changed, 33 insertions, 7 deletions
diff --git a/cmds/servicemanager/Android.mk b/cmds/servicemanager/Android.mk index 8840867a9d..46a053d3ba 100644 --- a/cmds/servicemanager/Android.mk +++ b/cmds/servicemanager/Android.mk @@ -1,9 +1,11 @@ LOCAL_PATH:= $(call my-dir) -#include $(CLEAR_VARS) -#LOCAL_SRC_FILES := bctest.c binder.c -#LOCAL_MODULE := bctest -#include $(BUILD_EXECUTABLE) +include $(CLEAR_VARS) +LOCAL_SHARED_LIBRARIES := liblog +LOCAL_CFLAGS := -DBCTEST_DEBUG=1 +LOCAL_SRC_FILES := bctest.c binder.c +LOCAL_MODULE := bctest +include $(BUILD_EXECUTABLE) include $(CLEAR_VARS) LOCAL_SHARED_LIBRARIES := liblog diff --git a/cmds/servicemanager/binder.c b/cmds/servicemanager/binder.c index 1985756a66..c45ef6d2eb 100644 --- a/cmds/servicemanager/binder.c +++ b/cmds/servicemanager/binder.c @@ -136,7 +136,16 @@ void binder_close(struct binder_state *bs) int binder_become_context_manager(struct binder_state *bs) { - return ioctl(bs->fd, BINDER_SET_CONTEXT_MGR, 0); + int ret; + ret = ioctl(bs->fd, BINDER_SET_CONTEXT_MGR, 0); + if (ret < 0) { + fprintf(stderr,"binder_set_context_manager: ioctl FAIL (%s)\n", strerror(errno)); +#if BCTEST_DEBUG + } else { + fprintf(stderr,"binder_set_context_manager: ioctl PASS\n"); +#endif + } + return ret; } int binder_write(struct binder_state *bs, void *data, unsigned len) @@ -151,8 +160,12 @@ int binder_write(struct binder_state *bs, void *data, unsigned len) bwr.read_buffer = 0; res = ioctl(bs->fd, BINDER_WRITE_READ, &bwr); if (res < 0) { - fprintf(stderr,"binder_write: ioctl failed (%s)\n", + fprintf(stderr,"binder_write: ioctl FAIL (%s)\n", strerror(errno)); +#if BCTEST_DEBUG + } else { + fprintf(stderr,"binder_write: ioctl PASS\n"); +#endif } return res; } @@ -339,8 +352,12 @@ int binder_call(struct binder_state *bs, res = ioctl(bs->fd, BINDER_WRITE_READ, &bwr); if (res < 0) { - fprintf(stderr,"binder: ioctl failed (%s)\n", strerror(errno)); + fprintf(stderr,"binder: ioctl FAIL (%s)\n", strerror(errno)); goto fail; +#if BCTEST_DEBUG + } else { + fprintf(stderr,"binder: ioctl PASS\n"); +#endif } res = binder_parse(bs, reply, readbuf, bwr.read_consumed, 0); @@ -376,7 +393,14 @@ void binder_loop(struct binder_state *bs, binder_handler func) if (res < 0) { ALOGE("binder_loop: ioctl failed (%s)\n", strerror(errno)); +#if BCTEST_DEBUG + fprintf(stderr,"binder_loop: ioctl FAIL (%s)\n", strerror(errno)); +#endif break; +#if BCTEST_DEBUG + } else { + fprintf(stderr,"binder_loop: ioctl PASS\n"); +#endif } res = binder_parse(bs, 0, readbuf, bwr.read_consumed, func); |