perfmon broken
Looks like this changeset back between 2.6.9-rc1-bk15 & bk16 broke
perfmon:
http://linux.bkbits.net:8080/linux-2.5/cset@413f1bdabfaQNzIZpU6bPxNlSxdriQ
[PATCH] cleanup ptrace stops and remove notify_parent
This adds a new state TASK_TRACED that is used in place of TASK_STOPPED when a thread stops because it is ptraced. Now ptrace operations are only permitted when the target is in TASK_TRACED state, not in TASK_STOPPED.
...
Here's the simple fix, perhaps Stephane has a better approach. Thanks,
Alex
Signature · 24 lines
Signed-off-by: Alex Williamson <[email protected]> === arch/ia64/kernel/perfmon.c 1.90 vs edited ==--- 1.90/arch/ia64/kernel/perfmon.c 2004-09-03 08:54:08 -06:00 +++ edited/arch/ia64/kernel/perfmon.c 2004-09-28 16:42:05 -06:00 @@ -2601,7 +2601,7 @@ */ if (task = current) return 0; - if (task->state != TASK_STOPPED) { + if ((task->state != TASK_STOPPED) && (task->state != TASK_TRACED)){ DPRINT(("cannot attach to non-stopped task [%d] state=%ld\n", task->pid, task->state)); return -EBUSY; } @@ -4755,7 +4755,8 @@ * the task must be stopped. */ if (PFM_CMD_STOPPED(cmd)) { - if (task->state != TASK_STOPPED) { + if ((task->state != TASK_STOPPED) && + (task->state != TASK_TRACED)) { DPRINT(("[%d] task not in stopped state\n", task->pid)); return -EBUSY; }
Alex,
Yes, your patch will likely fix the problem. I need to check to see if we need to keep TASK_STOPPED.
Thanks.
Quoted 44 lines · Alex Williamson
Looks like this changeset back between 2.6.9-rc1-bk15 & bk16 broke
perfmon:http://linux.bkbits.net:8080/linux-2.5/cset@413f1bdabfaQNzIZpU6bPxNlSxdriQ
[PATCH] cleanup ptrace stops and remove
notify_parentThis adds a new state
TASK_TRACEDthat is used in place ofTASK_STOPPEDwhen a thread stops because it is ptraced. Now ptrace operations are only permitted when the target is inTASK_TRACEDstate, not inTASK_STOPPED.
...Here's the simple fix, perhaps Stephane has a better approach. Thanks,
Alex
Signature · 5 lines
Signed-off-by: Alex Williamson <[email protected]> === arch/ia64/kernel/perfmon.c 1.90 vs edited ==> --- 1.90/arch/ia64/kernel/perfmon.c 2004-09-03 08:54:08 -06:00 +++ edited/arch/ia64/kernel/perfmon.c 2004-09-28 16:42:05 -06:00(quoted diff) +3
-2@@ -2601,7 +2601,7 @@ */ if (task = current) return 0; - if (task->state != TASK_STOPPED) { + if ((task->state != TASK_STOPPED) && (task->state != TASK_TRACED)){ DPRINT(("cannot attach to non-stopped task [%d] state=%ld\n", task->pid, task->state)); return -EBUSY; }@@ -4755,7 +4755,8 @@ * the task must be stopped. */ if (PFM_CMD_STOPPED(cmd)) { - if (task->state != TASK_STOPPED) { + if ((task->state != TASK_STOPPED) && + (task->state != TASK_TRACED)) { DPRINT(("[%d] task not in stopped state\n", task->pid)); return -EBUSY; }
Signature · 1 line
-Stephane