linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] pebs, x86: Make sure to really disable PEBS
@ 2012-08-18 16:15 Andi Kleen
  2012-08-18 16:15 ` [PATCH 2/2] perf: Enable function tracing for perf core Andi Kleen
  2012-08-20 10:10 ` [PATCH 1/2] pebs, x86: Make sure to really disable PEBS Peter Zijlstra
  0 siblings, 2 replies; 4+ messages in thread
From: Andi Kleen @ 2012-08-18 16:15 UTC (permalink / raw)
  To: mingo; +Cc: a.p.zijlstra, linux-kernel, Andi Kleen

From: Andi Kleen <ak@linux.intel.com>

When disabling a PEBS event we need to check the old value
to determine if PEBS was running. Otherwise the last PEBS value
could be kept running.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 arch/x86/kernel/cpu/perf_event_intel_ds.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/cpu/perf_event_intel_ds.c b/arch/x86/kernel/cpu/perf_event_intel_ds.c
index e38d97b..db49ab3 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_ds.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_ds.c
@@ -438,9 +438,10 @@ void intel_pmu_pebs_disable(struct perf_event *event)
 {
 	struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
 	struct hw_perf_event *hwc = &event->hw;
+	u64 old = cpuc->pebs_enabled;
 
 	cpuc->pebs_enabled &= ~(1ULL << hwc->idx);
-	if (cpuc->enabled)
+	if (old)
 		wrmsrl(MSR_IA32_PEBS_ENABLE, cpuc->pebs_enabled);
 
 	hwc->config |= ARCH_PERFMON_EVENTSEL_INT;
-- 
1.7.7.6


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] perf: Enable function tracing for perf core
  2012-08-18 16:15 [PATCH 1/2] pebs, x86: Make sure to really disable PEBS Andi Kleen
@ 2012-08-18 16:15 ` Andi Kleen
  2012-08-21 15:13   ` Steven Rostedt
  2012-08-20 10:10 ` [PATCH 1/2] pebs, x86: Make sure to really disable PEBS Peter Zijlstra
  1 sibling, 1 reply; 4+ messages in thread
From: Andi Kleen @ 2012-08-18 16:15 UTC (permalink / raw)
  To: mingo; +Cc: a.p.zijlstra, linux-kernel, Andi Kleen, rostedt

From: Andi Kleen <ak@linux.intel.com>

According to Steven R. there is no reason left to not support
function tracing for the perf core. This makes it easier to debug
perf.

Don't remove -pg for the x86 and generic perf core.

Cc: rostedt@goodmis.org
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 arch/x86/kernel/cpu/Makefile |    1 -
 kernel/events/Makefile       |    4 ----
 2 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/arch/x86/kernel/cpu/Makefile b/arch/x86/kernel/cpu/Makefile
index d30a6a9..6a16725 100644
--- a/arch/x86/kernel/cpu/Makefile
+++ b/arch/x86/kernel/cpu/Makefile
@@ -5,7 +5,6 @@
 # Don't trace early stages of a secondary CPU boot
 ifdef CONFIG_FUNCTION_TRACER
 CFLAGS_REMOVE_common.o = -pg
-CFLAGS_REMOVE_perf_event.o = -pg
 endif
 
 # Make sure load_percpu_segment has no stackprotector
diff --git a/kernel/events/Makefile b/kernel/events/Makefile
index 103f5d1..a630994 100644
--- a/kernel/events/Makefile
+++ b/kernel/events/Makefile
@@ -1,7 +1,3 @@
-ifdef CONFIG_FUNCTION_TRACER
-CFLAGS_REMOVE_core.o = -pg
-endif
-
 obj-y := core.o ring_buffer.o callchain.o
 
 obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o
-- 
1.7.7.6


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] pebs, x86: Make sure to really disable PEBS
  2012-08-18 16:15 [PATCH 1/2] pebs, x86: Make sure to really disable PEBS Andi Kleen
  2012-08-18 16:15 ` [PATCH 2/2] perf: Enable function tracing for perf core Andi Kleen
@ 2012-08-20 10:10 ` Peter Zijlstra
  1 sibling, 0 replies; 4+ messages in thread
From: Peter Zijlstra @ 2012-08-20 10:10 UTC (permalink / raw)
  To: Andi Kleen; +Cc: mingo, linux-kernel, Andi Kleen

On Sat, 2012-08-18 at 09:15 -0700, Andi Kleen wrote:
> From: Andi Kleen <ak@linux.intel.com>
> 
> When disabling a PEBS event we need to check the old value
> to determine if PEBS was running. Otherwise the last PEBS value
> could be kept running.
> 
> Signed-off-by: Andi Kleen <ak@linux.intel.com>
> ---
>  arch/x86/kernel/cpu/perf_event_intel_ds.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/x86/kernel/cpu/perf_event_intel_ds.c b/arch/x86/kernel/cpu/perf_event_intel_ds.c
> index e38d97b..db49ab3 100644
> --- a/arch/x86/kernel/cpu/perf_event_intel_ds.c
> +++ b/arch/x86/kernel/cpu/perf_event_intel_ds.c
> @@ -438,9 +438,10 @@ void intel_pmu_pebs_disable(struct perf_event *event)
>  {
>  	struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
>  	struct hw_perf_event *hwc = &event->hw;
> +	u64 old = cpuc->pebs_enabled;
>  
>  	cpuc->pebs_enabled &= ~(1ULL << hwc->idx);
> -	if (cpuc->enabled)
> +	if (old)

cpuc->enabled != cpuc->pebs_enabled

>  		wrmsrl(MSR_IA32_PEBS_ENABLE, cpuc->pebs_enabled);
>  
>  	hwc->config |= ARCH_PERFMON_EVENTSEL_INT;


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] perf: Enable function tracing for perf core
  2012-08-18 16:15 ` [PATCH 2/2] perf: Enable function tracing for perf core Andi Kleen
@ 2012-08-21 15:13   ` Steven Rostedt
  0 siblings, 0 replies; 4+ messages in thread
From: Steven Rostedt @ 2012-08-21 15:13 UTC (permalink / raw)
  To: Andi Kleen; +Cc: mingo, a.p.zijlstra, linux-kernel, Andi Kleen

On Sat, 2012-08-18 at 09:15 -0700, Andi Kleen wrote:
> From: Andi Kleen <ak@linux.intel.com>
> 
> According to Steven R. there is no reason left to not support
> function tracing for the perf core. This makes it easier to debug
> perf.
> 
> Don't remove -pg for the x86 and generic perf core.

There's some new patches queued for 3.7 that has better function tracing
recursion protection. This should go after those.

Thanks,

-- Steve



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-08-21 15:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-18 16:15 [PATCH 1/2] pebs, x86: Make sure to really disable PEBS Andi Kleen
2012-08-18 16:15 ` [PATCH 2/2] perf: Enable function tracing for perf core Andi Kleen
2012-08-21 15:13   ` Steven Rostedt
2012-08-20 10:10 ` [PATCH 1/2] pebs, x86: Make sure to really disable PEBS Peter Zijlstra

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).