On Sat, Dec 19, 2009 at 3:06 AM, Vlad Slavici <vs...@ccs.neu.edu> wrote:
> Hi again,
>
> Is it possible to start performance monitoring from within C code and then 
> turn it off from the code as well? I would like to be able to do something 
> like:
>
For that look at the self.c example, i.e, self monitoring for counting.

> int main(){
> ...
> code
> ...
>
> start performance monitoring on LOCKED_OPS:CYCLES_WAITING event
>
> ...
> code
> ...
>
> turn off performance monitoring on LOCKED_OPS:CYCLES_WAITING event
> display perf. monitoring results
>
> ...
> code
> ...
>
> }
>
> I would use this to get separate results for various parts of my code, 
> without having to separate my code into different files and run 'task' on 
> them independently. I assume I have to link the executable with -lpfm4, but 
> besides that what libpfm4 library functions or utilities could I use from 
> withing my C program's main() function to start monitoring on the current 
> multithreaded process at a certain location in the code, and then turn off 
> monitoring later, display the results and run the rest of the main function 
> without monitoring?
>
> Thank you,
>
> Vlad
>
> ------------------------------------------------------------------------------
> This SF.Net email is sponsored by the Verizon Developer Community
> Take advantage of Verizon's best-in-class app development support
> A streamlined, 14 day to market process makes app distribution fast and easy
> Join now and get one step closer to millions of Verizon customers
> http://p.sf.net/sfu/verizon-dev2dev
> _______________________________________________
> perfmon2-devel mailing list
> perfmon2-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/perfmon2-devel
>

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
perfmon2-devel mailing list
perfmon2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel

Reply via email to