Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 370814
b: refs/heads/master
c: 5682c46
h: refs/heads/master
v: v3
  • Loading branch information
Michael Ellerman authored and Benjamin Herrenschmidt committed Apr 26, 2013
1 parent 2ddbf3a commit 279d103
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 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: 7a7868326d77416018e8f3b4c4697a3c57444549
refs/heads/master: 5682c460264149b258b82105f0eefcb9878aa1e7
20 changes: 11 additions & 9 deletions trunk/arch/powerpc/perf/core-book3s.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,24 +131,24 @@ static inline void perf_get_data_addr(struct pt_regs *regs, u64 *addrp)
*addrp = mfspr(SPRN_SDAR);
}

static bool mmcra_sihv(unsigned long mmcra)
static bool regs_sihv(struct pt_regs *regs)
{
unsigned long sihv = MMCRA_SIHV;

if (ppmu->flags & PPMU_ALT_SIPR)
sihv = POWER6_MMCRA_SIHV;

return !!(mmcra & sihv);
return !!(regs->dsisr & sihv);
}

static bool mmcra_sipr(unsigned long mmcra)
static bool regs_sipr(struct pt_regs *regs)
{
unsigned long sipr = MMCRA_SIPR;

if (ppmu->flags & PPMU_ALT_SIPR)
sipr = POWER6_MMCRA_SIPR;

return !!(mmcra & sipr);
return !!(regs->dsisr & sipr);
}

static inline u32 perf_flags_from_msr(struct pt_regs *regs)
Expand All @@ -162,7 +162,6 @@ static inline u32 perf_flags_from_msr(struct pt_regs *regs)

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

if (!use_siar)
Expand All @@ -182,10 +181,12 @@ static inline u32 perf_get_misc_flags(struct pt_regs *regs)
}

/* PR has priority over HV, so order below is important */
if (mmcra_sipr(mmcra))
if (regs_sipr(regs))
return PERF_RECORD_MISC_USER;
if (mmcra_sihv(mmcra) && (freeze_events_kernel != MMCR0_FCHV))

if (regs_sihv(regs) && (freeze_events_kernel != MMCR0_FCHV))
return PERF_RECORD_MISC_HYPERVISOR;

return PERF_RECORD_MISC_KERNEL;
}

Expand All @@ -201,6 +202,8 @@ static inline void perf_read_regs(struct pt_regs *regs)
int marked = mmcra & MMCRA_SAMPLE_ENABLE;
int use_siar;

regs->dsisr = mmcra;

/*
* If this isn't a PMU exception (eg a software event) the SIAR is
* not valid. Use pt_regs.
Expand All @@ -224,12 +227,11 @@ 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) && mmcra_sipr(mmcra))
else if (!(ppmu->flags & PPMU_NO_SIPR) && regs_sipr(regs))
use_siar = 0;
else
use_siar = 1;

regs->dsisr = mmcra;
regs->result = use_siar;
}

Expand Down

0 comments on commit 279d103

Please sign in to comment.