Messages in this thread | | | Date | Fri, 14 Nov 2008 22:10:35 +0100 | From | "stephane eranian" <> | Subject | Re: debugctl msr |
| |
Markus,
I am trying another approach for connecting perfmon to ds.c. I have added new callbacks to perfmon to allow me to invoke ds_request_pebs, once I know the target thread or CPU. That seems to work, however I ran into a spinlock problem is ds_request():
static int ds_request(struct task_struct *task, void *base, size_t size, ds_ovfl_callback_t ovfl, enum ds_qualifier qual) { struct ds_context *context; unsigned long buffer, adj; const unsigned long alignment = (1 << 3); int error = 0;
if (!ds_cfg.sizeof_ds) return -EOPNOTSUPP;
/* we require some space to do alignment adjustments below */ if (size < (alignment + ds_cfg.sizeof_rec[qual])) return -EINVAL;
/* buffer overflow notification is not yet implemented */ if (ovfl) return -EOPNOTSUPP;
spin_lock(&ds_lock);
>> if (!check_tracer(task)) >> return -EPERM;
You need to spin_unlock() before returning here!
| |