BZ: 36161
For debug usage,For debug ANR and UIWDT issues, we need get more details from the
/d/binder, /proc/xxx/stack, proc/xxx/comm, from it we can know which
process block the binder read, and we can also get more other useful
informations, but the current ptrace implement may block it. the patch
add a debugfs interface to enable read by default.
Signed-off-by: xiaobing tu <xiaobing.tu@intel.com>
Change-Id: Ied22eaa00316ff5e3602799af5825f2afb4fa21f
Reviewed-on: http://android.intel.com:8080/51907
Reviewed-by: Zhang, LongX <longx.zhang@intel.com>
Reviewed-by: Gross, Mark <mark.gross@intel.com>
Reviewed-by: Ren, Jack <jack.ren@intel.com>
Reviewed-by: Yang, Fei <fei.yang@intel.com>
Tested-by: Ng, Cheon-woei <cheon-woei.ng@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
#include <linux/uaccess.h>
#include <linux/regset.h>
#include <linux/hw_breakpoint.h>
+#include <linux/debugfs.h>
-
+static int ptrace_can_access;
+module_param_named(ptrace_can_access, ptrace_can_access, int, \
+ S_IRUGO | S_IWUSR | S_IWGRP);
/*
* ptrace a task: make the debugger its new parent and
* move it to the ptrace list.
bool ptrace_may_access(struct task_struct *task, unsigned int mode)
{
int err;
+
+ if (ptrace_can_access)
+ return true;
task_lock(task);
err = __ptrace_may_access(task, mode);
task_unlock(task);