diff options
| -rw-r--r-- | arch/ia64/kernel/perfmon.c | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c index fd4f3be6e856..71c101601e3e 100644 --- a/arch/ia64/kernel/perfmon.c +++ b/arch/ia64/kernel/perfmon.c | |||
| @@ -4215,7 +4215,7 @@ pfm_context_load(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs) | |||
| 4215 | DPRINT(("cannot load to [%d], invalid ctx_state=%d\n", | 4215 | DPRINT(("cannot load to [%d], invalid ctx_state=%d\n", |
| 4216 | req->load_pid, | 4216 | req->load_pid, |
| 4217 | ctx->ctx_state)); | 4217 | ctx->ctx_state)); |
| 4218 | return -EINVAL; | 4218 | return -EBUSY; |
| 4219 | } | 4219 | } |
| 4220 | 4220 | ||
| 4221 | DPRINT(("load_pid [%d] using_dbreg=%d\n", req->load_pid, ctx->ctx_fl_using_dbreg)); | 4221 | DPRINT(("load_pid [%d] using_dbreg=%d\n", req->load_pid, ctx->ctx_fl_using_dbreg)); |
| @@ -4717,16 +4717,26 @@ recheck: | |||
| 4717 | if (task == current || ctx->ctx_fl_system) return 0; | 4717 | if (task == current || ctx->ctx_fl_system) return 0; |
| 4718 | 4718 | ||
| 4719 | /* | 4719 | /* |
| 4720 | * if context is UNLOADED we are safe to go | 4720 | * we are monitoring another thread |
| 4721 | */ | ||
| 4722 | if (state == PFM_CTX_UNLOADED) return 0; | ||
| 4723 | |||
| 4724 | /* | ||
| 4725 | * no command can operate on a zombie context | ||
| 4726 | */ | 4721 | */ |
| 4727 | if (state == PFM_CTX_ZOMBIE) { | 4722 | switch(state) { |
| 4728 | DPRINT(("cmd %d state zombie cannot operate on context\n", cmd)); | 4723 | case PFM_CTX_UNLOADED: |
| 4729 | return -EINVAL; | 4724 | /* |
| 4725 | * if context is UNLOADED we are safe to go | ||
| 4726 | */ | ||
| 4727 | return 0; | ||
| 4728 | case PFM_CTX_ZOMBIE: | ||
| 4729 | /* | ||
| 4730 | * no command can operate on a zombie context | ||
| 4731 | */ | ||
| 4732 | DPRINT(("cmd %d state zombie cannot operate on context\n", cmd)); | ||
| 4733 | return -EINVAL; | ||
| 4734 | case PFM_CTX_MASKED: | ||
| 4735 | /* | ||
| 4736 | * PMU state has been saved to software even though | ||
| 4737 | * the thread may still be running. | ||
| 4738 | */ | ||
| 4739 | if (cmd != PFM_UNLOAD_CONTEXT) return 0; | ||
| 4730 | } | 4740 | } |
| 4731 | 4741 | ||
| 4732 | /* | 4742 | /* |
