diff mbox

[V3,2/2] powerpc, perf: BHRB filter configuration should follow the task

Message ID 1370843609-32618-3-git-send-email-khandual@linux.vnet.ibm.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Anshuman Khandual June 10, 2013, 5:53 a.m. UTC
When the task moves around the system, the corresponding cpuhw
per cpu strcuture should be popullated with the BHRB filter
request value so that PMU could be configured appropriately with
that during the next call into power_pmu_enable().

Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
---
 arch/powerpc/perf/core-book3s.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Michael Neuling June 24, 2013, 7:20 a.m. UTC | #1
Anshuman Khandual <khandual@linux.vnet.ibm.com> wrote:

> When the task moves around the system, the corresponding cpuhw
> per cpu strcuture should be popullated with the BHRB filter
> request value so that PMU could be configured appropriately with
> that during the next call into power_pmu_enable().
> 
> Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>

benh you might want to fix the spelling mistakes above 

  strcuture -> structure
  popullated -> populated

Otherwise:

Acked-by: Michael Neuling <mikey@neuling.org>


> ---
>  arch/powerpc/perf/core-book3s.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c
> index 426180b..48c68a8 100644
> --- a/arch/powerpc/perf/core-book3s.c
> +++ b/arch/powerpc/perf/core-book3s.c
> @@ -1122,8 +1122,11 @@ nocheck:
>  
>  	ret = 0;
>   out:
> -	if (has_branch_stack(event))
> +	if (has_branch_stack(event)) {
>  		power_pmu_bhrb_enable(event);
> +		cpuhw->bhrb_filter = ppmu->bhrb_filter_map(
> +					event->attr.branch_sample_type);
> +	}
>  
>  	perf_pmu_enable(event->pmu);
>  	local_irq_restore(flags);
> -- 
> 1.7.11.7
>
Anshuman Khandual July 22, 2013, 6:39 a.m. UTC | #2
On 06/24/2013 12:50 PM, Michael Neuling wrote:
> Anshuman Khandual <khandual@linux.vnet.ibm.com> wrote:
> 
>> When the task moves around the system, the corresponding cpuhw
>> per cpu strcuture should be popullated with the BHRB filter
>> request value so that PMU could be configured appropriately with
>> that during the next call into power_pmu_enable().
>>
>> Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
> 
> benh you might want to fix the spelling mistakes above 
> 
>   strcuture -> structure
>   popullated -> populated
> 
> Otherwise:
> 
> Acked-by: Michael Neuling <mikey@neuling.org>

Hey Ben,

These patches have not been applied yet. Would like me to correct
these spellings myself and send out again. Please do let me know. Thanks !

Regards
Anshuman
Benjamin Herrenschmidt July 22, 2013, 6:48 a.m. UTC | #3
On Mon, 2013-07-22 at 12:09 +0530, Anshuman Khandual wrote:
> These patches have not been applied yet. Would like me to correct
> these spellings myself and send out again. Please do let me know.
> Thanks !

No, it's ok, I'll add them to my batch.

Usually I assume that perf related stuff goes through acme's perf tree
so I might have overlooked them because of that.

Michael, you're ok with these ?

Cheers,
Ben
Michael Ellerman July 23, 2013, 1:20 p.m. UTC | #4
On Mon, Jul 22, 2013 at 04:48:16PM +1000, Benjamin Herrenschmidt wrote:
> On Mon, 2013-07-22 at 12:09 +0530, Anshuman Khandual wrote:
> > These patches have not been applied yet. Would like me to correct
> > these spellings myself and send out again. Please do let me know.
> > Thanks !
> 
> No, it's ok, I'll add them to my batch.
> 
> Usually I assume that perf related stuff goes through acme's perf tree
> so I might have overlooked them because of that.
> 
> Michael, you're ok with these ?

Which Michael? :)

I haven't had time to really get my head around the BHRB code, so I
can't really say.

cheers
diff mbox

Patch

diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c
index 426180b..48c68a8 100644
--- a/arch/powerpc/perf/core-book3s.c
+++ b/arch/powerpc/perf/core-book3s.c
@@ -1122,8 +1122,11 @@  nocheck:
 
 	ret = 0;
  out:
-	if (has_branch_stack(event))
+	if (has_branch_stack(event)) {
 		power_pmu_bhrb_enable(event);
+		cpuhw->bhrb_filter = ppmu->bhrb_filter_map(
+					event->attr.branch_sample_type);
+	}
 
 	perf_pmu_enable(event->pmu);
 	local_irq_restore(flags);