Subject: perfmon2: don't try ptrace_check_attach From: Arnd Bergmann ptrace_check_attach has been removed with the move to utrace, which breaks perfmon2. This tries to work around the problem with minimal breakage, but some functionality is missing for now. More info from Kevin Corry: There are three ways you can do hardware-counter monitoring with Perfmon2: 1) System-wide, where you monitor all processes on one or more CPUs. 2) Per-process self-monitored, where a process monitors only itself. 3) Per-process externally-monitored, where one process monitors another single process. Number 3 above breaks with the ptrace/utrace changes, since Perfmon2 currently enforces that the monitored process must be ptraced and stopped by the monitoring process in order to perform certain Perfmon2 system calls on the monitored process. Cc: Kevin Corry Signed-off-by: Arnd Bergmann Index: linux-2.6/perfmon/perfmon_syscalls.c =================================================================== --- linux-2.6.orig/perfmon/perfmon_syscalls.c +++ linux-2.6/perfmon/perfmon_syscalls.c @@ -155,8 +155,8 @@ int pfm_get_task(struct pfm_context *ctx * returns 0 if cannot attach */ ret1 = ptrace_may_attach(p); - if (ret1) - ret = ptrace_check_attach(p, 0); +// if (ret1) +// ret = ptrace_check_attach(p, 0); PFM_DBG("may_attach=%d check_attach=%d", ret1, ret); @@ -276,7 +276,7 @@ recheck: /* * check that the thread is ptraced AND STOPPED */ - ret = ptrace_check_attach(task, 0); + ret = -ESRCH; // ptrace_check_attach(task, 0); spin_lock_irqsave(&ctx->lock, new_flags);