Skip to content

Commit

Permalink
powerpc/perf: Add an accessor for regs->result
Browse files Browse the repository at this point in the history
Add an accessor for regs->result so we can use it to store more flags in
future.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
  • Loading branch information
Michael Ellerman authored and Benjamin Herrenschmidt committed Apr 26, 2013
1 parent 5682c46 commit 3390405
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions arch/powerpc/perf/core-book3s.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ static inline int siar_valid(struct pt_regs *regs)

#endif /* CONFIG_PPC32 */

static bool regs_use_siar(struct pt_regs *regs)
{
return !!(regs->result & 1);
}

/*
* Things that are specific to 64-bit implementations.
*/
Expand Down Expand Up @@ -162,7 +167,7 @@ static inline u32 perf_flags_from_msr(struct pt_regs *regs)

static inline u32 perf_get_misc_flags(struct pt_regs *regs)
{
unsigned long use_siar = regs->result;
bool use_siar = regs_use_siar(regs);

if (!use_siar)
return perf_flags_from_msr(regs);
Expand Down Expand Up @@ -1425,7 +1430,7 @@ unsigned long perf_misc_flags(struct pt_regs *regs)
*/
unsigned long perf_instruction_pointer(struct pt_regs *regs)
{
unsigned long use_siar = regs->result;
bool use_siar = regs_use_siar(regs);

if (use_siar && siar_valid(regs))
return mfspr(SPRN_SIAR) + perf_ip_adjust(regs);
Expand Down

0 comments on commit 3390405

Please sign in to comment.