* [PATCH] powerpc/perf: use MSR to report privilege level on P9 DD1
@ 2017-01-03 9:13 Madhavan Srinivasan
2017-01-17 5:46 ` Michael Ellerman
0 siblings, 1 reply; 3+ messages in thread
From: Madhavan Srinivasan @ 2017-01-03 9:13 UTC (permalink / raw)
To: mpe; +Cc: linuxppc-dev, Madhavan Srinivasan
"use_siar" variable is primarily used for deciding the sampled address
and the privilege level to be reported for a sample. perf_read_regs()
function updates the "use_siar" and "regs->result" based on the pmu
flags along with other checks. To force the use of MSR to report the
privilege level and to use "regs->nip" to report the instruction pointer,
set "PPMU_NO_CONT_SAMPLING" flag and remove "PPMU_HAS_SIER" from the
ppmu->flags.
Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
---
arch/powerpc/perf/power9-pmu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/perf/power9-pmu.c b/arch/powerpc/perf/power9-pmu.c
index a46ef29e50e7..06b7e8ebd29a 100644
--- a/arch/powerpc/perf/power9-pmu.c
+++ b/arch/powerpc/perf/power9-pmu.c
@@ -403,7 +403,7 @@ static struct power_pmu power9_isa207_pmu = {
.bhrb_filter_map = power9_bhrb_filter_map,
.get_constraint = isa207_get_constraint,
.disable_pmc = isa207_disable_pmc,
- .flags = PPMU_HAS_SIER | PPMU_ARCH_207S,
+ .flags = PPMU_NO_CONT_SAMPLING | PPMU_ARCH_207S,
.n_generic = ARRAY_SIZE(power9_generic_events),
.generic_events = power9_generic_events,
.cache_events = &power9_cache_events,
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] powerpc/perf: use MSR to report privilege level on P9 DD1
2017-01-03 9:13 [PATCH] powerpc/perf: use MSR to report privilege level on P9 DD1 Madhavan Srinivasan
@ 2017-01-17 5:46 ` Michael Ellerman
2017-01-17 6:18 ` Madhavan Srinivasan
0 siblings, 1 reply; 3+ messages in thread
From: Michael Ellerman @ 2017-01-17 5:46 UTC (permalink / raw)
To: Madhavan Srinivasan; +Cc: linuxppc-dev, Madhavan Srinivasan
Madhavan Srinivasan <maddy@linux.vnet.ibm.com> writes:
> "use_siar" variable is primarily used for deciding the sampled address
> and the privilege level to be reported for a sample. perf_read_regs()
> function updates the "use_siar" and "regs->result" based on the pmu
> flags along with other checks. To force the use of MSR to report the
> privilege level and to use "regs->nip" to report the instruction pointer,
> set "PPMU_NO_CONT_SAMPLING" flag and remove "PPMU_HAS_SIER" from the
> ppmu->flags.
This still won't work for marked events AFAICS:
if (TRAP(regs) != 0xf00)
use_siar = 0;
else if (marked)
use_siar = 1;
else if ((ppmu->flags & PPMU_NO_CONT_SAMPLING))
use_siar = 0;
else if (!(ppmu->flags & PPMU_NO_SIPR) && regs_sipr(regs))
use_siar = 0;
else
use_siar = 1;
So perhaps we just want a USE_SIAR flag?
And I don't see how HAS_SIER is related? Or is SIER broken too?
cheers
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] powerpc/perf: use MSR to report privilege level on P9 DD1
2017-01-17 5:46 ` Michael Ellerman
@ 2017-01-17 6:18 ` Madhavan Srinivasan
0 siblings, 0 replies; 3+ messages in thread
From: Madhavan Srinivasan @ 2017-01-17 6:18 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev
On Tuesday 17 January 2017 11:16 AM, Michael Ellerman wrote:
> Madhavan Srinivasan <maddy@linux.vnet.ibm.com> writes:
>
>> "use_siar" variable is primarily used for deciding the sampled address
>> and the privilege level to be reported for a sample. perf_read_regs()
>> function updates the "use_siar" and "regs->result" based on the pmu
>> flags along with other checks. To force the use of MSR to report the
>> privilege level and to use "regs->nip" to report the instruction pointer,
>> set "PPMU_NO_CONT_SAMPLING" flag and remove "PPMU_HAS_SIER" from the
>> ppmu->flags.
> This still won't work for marked events AFAICS:
nice catch. My bad. Did not try with the marked events when testing this
patch.
>
> if (TRAP(regs) != 0xf00)
> use_siar = 0;
> else if (marked)
> use_siar = 1;
> else if ((ppmu->flags & PPMU_NO_CONT_SAMPLING))
> use_siar = 0;
> else if (!(ppmu->flags & PPMU_NO_SIPR) && regs_sipr(regs))
> use_siar = 0;
> else
> use_siar = 1;
>
> So perhaps we just want a USE_SIAR flag?
OK, Will add a new flag. How about "PPMU_DISBALE_USE_SIAR"?
> And I don't see how HAS_SIER is related? Or is SIER broken too?
We dont see proper values in SIER for some samples and we use
SIER (regs_sipr) to update the misc_flag.
Will fix the commit message.
Maddy
> cheers
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-01-17 6:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-03 9:13 [PATCH] powerpc/perf: use MSR to report privilege level on P9 DD1 Madhavan Srinivasan
2017-01-17 5:46 ` Michael Ellerman
2017-01-17 6:18 ` Madhavan Srinivasan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).