Hello, On Mon, Aug 4, 2008 at 7:48 PM, xudi <[EMAIL PROTECTED]> wrote: > hello, > I want to monitor multiple processes simultaneously(5 or more), and I > set every context flag to PFM_FL_NOTIFY_BLOCK, > after I get the message PFM_MSG_OVFL, first I stop the process by > PTRACE_ATTACH, then process the buffer, then restart > perfmon by perfmonctl(PFM_RESTART), at last let the process run by > PTRACE_DETACH.
You don't need to stop the process, the kernel does it for you if you use PFM_FL_NOTIFY_BLOCK. You can use attach/detach if you don't use PFM_FL_NOTIFY_BLOCK. > The problem is I can only got the overflow message once, after DETACH > the process, the process itself seemed > continued, but perfmon is still stop, I remove the context flag > "PFM_FL_NOTIFY_BLOCK", all seemed works well. > What's the problem? Thank You Yes, it is because when you attach and you used PFM_FL_NOTIFY_BLOCK, you actually wake up the thread and it goes to sleep on something else. But when you issue pfm_restart(), the thread is not where it was supposed to do and consequently nothing happens, monitoring is not resume thus you don't get any further samples. ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ perfmon2-devel mailing list perfmon2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/perfmon2-devel