Message ID | 20210818171556.36912-1-kjain@linux.ibm.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Series | [v4,1/3] powerpc/perf: Use stack siar instead of mfspr | expand |
Related | show |
On 18/08/21 10:45 pm, Kajol Jain wrote: > Minor optimization in the 'perf_instruction_pointer' function code by > making use of stack siar instead of mfspr. > > Fixes: 75382aa72f06 ("powerpc/perf: Move code to select SIAR or pt_regs > into perf_read_regs") > Signed-off-by: Kajol Jain <kjain@linux.ibm.com> Tested this patch series, not seeing any '0' values. Tested-by: Nageswara R Sastry <rnsastry@linux.ibm.com> example output: # perf report -D | grep addr 0 26236879714 0x3dcc8 [0x38]: PERF_RECORD_SAMPLE(IP, 0x1): 1446/1446: 0xc000000000113584 period: 1 addr: 0 0 26236882500 0x3dd00 [0x38]: PERF_RECORD_SAMPLE(IP, 0x1): 1446/1446: 0xc000000000113584 period: 1 addr: 0 0 26236883436 0x3dd38 [0x38]: PERF_RECORD_SAMPLE(IP, 0x1): 1446/1446: 0xc000000000113584 period: 10 addr: 0 ... > --- > arch/powerpc/perf/core-book3s.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c > index bb0ee716de91..1b464aad29c4 100644 > --- a/arch/powerpc/perf/core-book3s.c > +++ b/arch/powerpc/perf/core-book3s.c > @@ -2260,7 +2260,7 @@ unsigned long perf_instruction_pointer(struct pt_regs *regs) > else > return regs->nip; > } else if (use_siar && siar_valid(regs)) > - return mfspr(SPRN_SIAR) + perf_ip_adjust(regs); > + return siar + perf_ip_adjust(regs); > else if (use_siar) > return 0; // no valid instruction pointer > else >
On Wed, 18 Aug 2021 22:45:54 +0530, Kajol Jain wrote: > Minor optimization in the 'perf_instruction_pointer' function code by > making use of stack siar instead of mfspr. > > > > Applied to powerpc/next. [1/3] powerpc/perf: Use stack siar instead of mfspr https://git.kernel.org/powerpc/c/b1643084d164cea0c107a39bcdf0119fc52619af [2/3] powerpc/perf: Drop the case of returning 0 as instruction pointer https://git.kernel.org/powerpc/c/cc90c6742ef5b438f4cb86029d7a794bd0a44a06 [3/3] powerpc/perf: Fix the check for SIAR value https://git.kernel.org/powerpc/c/3c69a5f22223fa3e312689ec218b5059784d49d7 cheers
diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c index bb0ee716de91..1b464aad29c4 100644 --- a/arch/powerpc/perf/core-book3s.c +++ b/arch/powerpc/perf/core-book3s.c @@ -2260,7 +2260,7 @@ unsigned long perf_instruction_pointer(struct pt_regs *regs) else return regs->nip; } else if (use_siar && siar_valid(regs)) - return mfspr(SPRN_SIAR) + perf_ip_adjust(regs); + return siar + perf_ip_adjust(regs); else if (use_siar) return 0; // no valid instruction pointer else
Minor optimization in the 'perf_instruction_pointer' function code by making use of stack siar instead of mfspr. Fixes: 75382aa72f06 ("powerpc/perf: Move code to select SIAR or pt_regs into perf_read_regs") Signed-off-by: Kajol Jain <kjain@linux.ibm.com> --- arch/powerpc/perf/core-book3s.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)