[PATCH] powerpc/perf: Add PROBENOP macro for debug

Balbir Singh bsingharora at gmail.com
Thu Mar 2 16:38:57 AEDT 2017


On Sun, Feb 19, 2017 at 01:28:34AM +0530, Madhavan Srinivasan wrote:
> From PowerISA v2.07, architecture provides a special NOP
> instruction called "Probe-Nop" defined as "and 0,0,0".
> This form of "and" is reserved for use exclusively by the
> Performance Monitor.
> 
> Usage example:
> 
> Add PROBENOP() macro to __tlbie() in hash_native_64.c to
> verify the number of TLBIE. Power8 provides "PM_TLBIE_FIN"
> PMU event (r30058) to count "tlbie finished".
> 
> Power8 PMU event "PM_PROBE_NOP_DISP" (r40014) counts the
> "ProbeNops dispatched".
> 
> With modified kernel booted, output from perf:
> 
> # ./perf stat -e r30058,r40014 ls
> ....
>  Performance counter stats for 'ls':
> 
>                  7      r30058
>                  7      r40014
> 
>        0.003296959 seconds time elapsed
> 
> Macro comes handy when want to count specific instructions
> which may or may not have a PMU event.
> 
> Signed-off-by: Madhavan Srinivasan <maddy at linux.vnet.ibm.com>
> ---

Acked-by: Balbir Singh <bsingharora at gmail.com>


More information about the Linuxppc-dev mailing list