On 07/16/2009 04:33 PM, Tanima Dey wrote: > > Hi, > > Thanks for the reply. > > It is mentioned in the manual that the thread to which the context is > attached is the monitored thread, in my case then it is the application > thread to which the context should be loaded, right? If it is so, I am > initializing and loading the context in the appThread, and trying to > read the counters value in the monitor thread. So I have used ptrace() > to stop the appThread in the monitor thread and trying to read the > counters, but it is showing the error message: Cannot attach: Operation > not permitted. Also I tried to read by saving the file descriptor > variable, it is also not working. > > Must the per-thread monitoring always be self-monitoring? Otherwise, I > think it will always be the case that the monitoring thread wont have > any access to PMU state initialized by the appThread. > > What wrong I am doing here?Do you have any examples for perthread > monitoring using threads? >
You can monitor from the same thread or from another thread, or from another thread in a different process. Have you looked at libpfm/examples_v2.x/task_attach.c ? It is an example of monitoring events in another task (i.e. process or thread). - Corey ------------------------------------------------------------------------------ Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge _______________________________________________ perfmon2-devel mailing list perfmon2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/perfmon2-devel