Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 370816
b: refs/heads/master
c: 860aad7
h: refs/heads/master
v: v3
  • Loading branch information
Michael Ellerman authored and Benjamin Herrenschmidt committed Apr 26, 2013
1 parent c15b099 commit 8f4af98
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 33904054b40832908dfaeeece282f2f0ff636f14
refs/heads/master: 860aad71fc7022e5a3907afe50fd96a11e546802
15 changes: 12 additions & 3 deletions trunk/arch/powerpc/perf/core-book3s.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,11 @@ static bool regs_sipr(struct pt_regs *regs)
return !!(regs->dsisr & sipr);
}

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

static inline u32 perf_flags_from_msr(struct pt_regs *regs)
{
if (regs->msr & MSR_PR)
Expand All @@ -178,7 +183,7 @@ static inline u32 perf_get_misc_flags(struct pt_regs *regs)
* SIAR which should give slightly more reliable
* results
*/
if (ppmu->flags & PPMU_NO_SIPR) {
if (regs_no_sipr(regs)) {
unsigned long siar = mfspr(SPRN_SIAR);
if (siar >= PAGE_OFFSET)
return PERF_RECORD_MISC_KERNEL;
Expand Down Expand Up @@ -208,6 +213,10 @@ static inline void perf_read_regs(struct pt_regs *regs)
int use_siar;

regs->dsisr = mmcra;
regs->result = 0;

if (ppmu->flags & PPMU_NO_SIPR)
regs->result |= 2;

/*
* If this isn't a PMU exception (eg a software event) the SIAR is
Expand All @@ -232,12 +241,12 @@ static inline void perf_read_regs(struct pt_regs *regs)
use_siar = 1;
else if ((ppmu->flags & PPMU_NO_CONT_SAMPLING))
use_siar = 0;
else if (!(ppmu->flags & PPMU_NO_SIPR) && regs_sipr(regs))
else if (!regs_no_sipr(regs) && regs_sipr(regs))
use_siar = 0;
else
use_siar = 1;

regs->result = use_siar;
regs->result |= use_siar;
}

/*
Expand Down

0 comments on commit 8f4af98

Please sign in to comment.