linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] powerpc/perf: use MSR to report privilege level on P9 DD1
Date: Tue, 17 Jan 2017 11:48:26 +0530	[thread overview]
Message-ID: <556f4715-254c-7e3d-333c-518b1f7e96de@linux.vnet.ibm.com> (raw)
In-Reply-To: <87fukib5mg.fsf@concordia.ellerman.id.au>



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
>

      reply	other threads:[~2017-01-17  6:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=556f4715-254c-7e3d-333c-518b1f7e96de@linux.vnet.ibm.com \
    --to=maddy@linux.vnet.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).