thank you very much!
it works well now

2008-08-06 



xudi 



发件人: stephane eranian 
发送时间: 2008-08-06  11:21:51 
收件人: xudi 
抄送: 
主题: Re: Re: [perfmon2] (no subject) 
 
On Tue, Aug 5, 2008 at 7:16 PM, xudi  <[EMAIL PROTECTED] > wrote:
> hi,
>     Is that mean when using PFM_FL_NOTIFY_BLOCK, the kernel won't schedule
> and run my process after the process's buffer is overflow if I don't issue
> pfm_restart()?
>
That is correct.
pfm_restart() will reset the buffer, resume monitoring, and unblock your thread.

>
> 2008-08-06
> ________________________________
> xudi
> ________________________________
> 发件人: stephane eranian
> 发送时间: 2008-08-06  07:28:25
> 收件人: xudi
> 抄送: perfmon2-devel
> 主题: Re: [perfmon2] (no subject)
> 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

Reply via email to