Messages in this thread | | | Date | Mon, 1 Dec 2008 11:49:51 +1100 | From | Paul Mackerras <> | Subject | Re: [patch 20/24] perfmon: system calls interface |
| |
stephane eranian writes:
> Perfmon requires ptrace ONLY to stop the thread you want to operate > on. For instance, to read the counters in a thread via pfm_read(), you > need to have that thread stopped, so perfmon can extract the machine > state safely.
What would happen if the thread wasn't stopped? Is it just that the numbers would be inaccurate, or is there some kind of security exposure?
If it's just that the numbers would be inaccurate, then I don't think the kernel needs to enforce it. The monitoring program *should* ensure that the thread is stopped or blocked, one way or another, but it could do that simply by sending a SIGSTOP to the thread. I don't see that it would necessarily have to use ptrace.
Paul.
| |