Commit 1f876a54 authored by Stéphane Eranian's avatar Stéphane Eranian Committed by Tony Luck

[IA64] perfmon2 fix for TASK_TRACED

fix a problem in pfm_check_task_state() and pfm_task_incompatible()
which was caused by the introduction of the new TASK_TRACED state.
Tool would fail to attach to a process,i.e., PFM_LOAD_CONTEXT would
fail. With the fix perfmon now accepts to operate on tasks which are
in either TASK_STOPPED or TASK_TRACED state. The problem was tracked
down by Alex Williamson from HP who also submitted the patch.
signed-off-by: default avatarStephane Eranian <eranian@hpl.hp.com>
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
parent 76642c02
......@@ -2601,7 +2601,7 @@ pfm_task_incompatible(pfm_context_t *ctx, struct task_struct *task)
*/
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,7 @@ pfm_check_task_state(pfm_context_t *ctx, int cmd, unsigned long flags)
* 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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment