Question about oprofile

Andy Fleming afleming at freescale.com
Wed Mar 21 06:13:33 EST 2007


On Mar 20, 2007, at 13:47, Ilya Lipovsky wrote:

> Hi,
>
>
>
> I am trying to understand how oprofile works, and so far I have a  
> question:
>
> When rfi’ing back into user context the PMM is cleared. However, if  
> PMM is cleared and then a context switch happens (say, to another  
> CPU-local thread) the counters keep getting incremented. Is that  
> right?
>
>
>
> If this is the case, then the PMC statistics account not just for  
> the current user thread, but also for other ones as well and thus  
> are not “pure.”

oprofile does not support counting just on one thread.  The PMM bit  
is only used to make it so that the interrupt handler and setup code  
are not counted.  In order to count in one thread, you would need to  
modify the context switch code to allow the PMM bit to stay set on  
marked threads, and you would need to modify the oprofile code in  
arch/powerpc to only count when the mark bit is set (rather than when  
it is cleared).

Andy





More information about the Linuxppc-embedded mailing list