Hi,

I'm working on a program that dynamically inserts prefetches in program code.
Now I'm trying to measure the number of prefetches executed by the  
program, when I use:

pfmon -u -e PREFETCH_INSTRUCTIONS_DISPATCHED:ALL ./myprog

I get:

0 PREFETCH_INSTRUCTIONS_DISPATCHED:ALL

I'm sure the prefetches are inserted into the code, but for some  
reason they are not dispatched...


I've written some test programs in C:

#include <stdio.h>

int main() {

     int my_var = 3;

     asm(
       " prefetcht0 (%0) \n"
       : /* no output registers */
       :  "r" (my_var)
     );

     return 0;
}

If I compile and execute the code above, I get 1 prefetch instruction  
dispatched. However, If I compile and execute the code below, I get 0  
prefetch instruction dispatched.

#include <stdio.h>

int main() {

    int b = 3;
    int my_var = (int)(&b);

     asm(
       " prefetcht0 (%0) \n"
       : /* no output registers */
       :  "r" (my_var)
     );

     return 0;
}

Is there an explanation for this behaviour ? Are the counters missing  
the events or are the prefetches not executed ?

Thanks !
Frederick



------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
perfmon2-devel mailing list
perfmon2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel

Reply via email to