Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 922
b: refs/heads/master
c: a5a70b7
h: refs/heads/master
v: v3
  • Loading branch information
stephane eranian authored and Tony Luck committed May 3, 2005
1 parent 3f56d40 commit d611008
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8df5a500a3e97f7811cdce0f553ca1917ccd4220
refs/heads/master: a5a70b75d93b26e14c0c5e759099d602a480b9e2
30 changes: 20 additions & 10 deletions trunk/arch/ia64/kernel/perfmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -4215,7 +4215,7 @@ pfm_context_load(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs)
DPRINT(("cannot load to [%d], invalid ctx_state=%d\n",
req->load_pid,
ctx->ctx_state));
return -EINVAL;
return -EBUSY;
}

DPRINT(("load_pid [%d] using_dbreg=%d\n", req->load_pid, ctx->ctx_fl_using_dbreg));
Expand Down Expand Up @@ -4717,16 +4717,26 @@ pfm_check_task_state(pfm_context_t *ctx, int cmd, unsigned long flags)
if (task == current || ctx->ctx_fl_system) return 0;

/*
* if context is UNLOADED we are safe to go
*/
if (state == PFM_CTX_UNLOADED) return 0;

/*
* no command can operate on a zombie context
* we are monitoring another thread
*/
if (state == PFM_CTX_ZOMBIE) {
DPRINT(("cmd %d state zombie cannot operate on context\n", cmd));
return -EINVAL;
switch(state) {
case PFM_CTX_UNLOADED:
/*
* if context is UNLOADED we are safe to go
*/
return 0;
case PFM_CTX_ZOMBIE:
/*
* no command can operate on a zombie context
*/
DPRINT(("cmd %d state zombie cannot operate on context\n", cmd));
return -EINVAL;
case PFM_CTX_MASKED:
/*
* PMU state has been saved to software even though
* the thread may still be running.
*/
if (cmd != PFM_UNLOAD_CONTEXT) return 0;
}

/*
Expand Down

0 comments on commit d611008

Please sign in to comment.