Subject: perfmon2: Temporary fix due to the change from ptrace to utrace. From: Kevin Corry When one process (the 'monitoring' process) attempts to load a Perfmon2 context on another process (the 'monitored' process), it need to use ptrace to stop the monitored process and keep it from being scheduled on any CPUs until certain Perfmon2 system-calls have been completed. The Perfmon2 code uses the ptrace_check_attach() call to ensure that user-space has made the appropriate ptrace calls. However, ptrace_check_attach() is no longer available with the switch to utrace. But, as long as user-space behaves correctly, this call is not strictly needed. And if user-space happens to behave incorrectly, the worst that will happen is that the counter values may be invalid. So for the time being, simply comment-out the call to ptrace_check_attach() until a proper solution can be found using the utrace routines. Signed-off-by: Kevin Corry Signed-off-by: Carl Love 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,9 @@ int pfm_get_task(struct pfm_context *ctx * returns 0 if cannot attach */ ret1 = ptrace_may_attach(p); -// if (ret1) + if (ret1) // ret = ptrace_check_attach(p, 0); + ret = 0; PFM_DBG("may_attach=%d check_attach=%d", ret1, ret); @@ -276,7 +277,8 @@ recheck: /* * check that the thread is ptraced AND STOPPED */ - ret = -ESRCH; // ptrace_check_attach(task, 0); +// ret = ptrace_check_attach(task, 0); + ret = 0; spin_lock_irqsave(&ctx->lock, new_flags);