x86, perf_counter, bts: optimize BTS overflow handling
PATCH RESEND 1/1 x86, perf_counter, bts: optimize BTS overflow handling
Draining the BTS buffer on a buffer overflow interrupt takes too long resulting in a kernel lockup when tracing the kernel.
Restructure perf_counter sampling into sample creation and sample output.
Prepare a single reference sample for BTS sampling and update the from and to address fields when draining the BTS buffer.
Drain the entire BTS buffer between a single perf_output_begin() / perf_output_end() pair.
---
arch/x86/kernel/cpu/perf_counter.c | 60 37 + 23 - 0 ! include/linux/perf_counter.h | 68 64 + 4 - 0 ! kernel/perf_counter.c | 306 161 + 145 - 0 ! 3 files changed, 262 insertions(+), 172 deletions(-)
arch/x86/kernel/cpu/perf_counter.c +37 -23
@@ -36,10 +36,10 @@ static u64 perf_counter_mask __read_most#define BTS_RECORD_SIZE 24/* The size of a per-cpu BTS buffer in bytes: */ -#define BTS_BUFFER_SIZE (BTS_RECORD_SIZE * 1024) +#define BTS_BUFFER_SIZE (BTS_RECORD_SIZE * 2048)/* The BTS overflow threshold in bytes from the end of the buffer: */ -#define BTS_OVFL_TH (BTS_RECORD_SIZE * 64) +#define BTS_OVFL_TH (BTS_RECORD_SIZE * 128)/*
@@ -1488,8 +1488,7 @@ void perf_counter_print_debug(void)local_irq_restore (flags); } -static void intel_pmu_drain_bts_buffer (struct cpu_hw_counters *cpuc, -struct perf_sample_data *data) +static void intel_pmu_drain_bts_buffer (struct cpu_hw_counters *cpuc) {struct debug_store *ds = cpuc->ds; struct bts_record {
@@ -1498,8 +1497,11 @@ static void intel_pmu_drain_bts_buffer(su64 flags; };struct perf_counter *counter = cpuc->counters[X86_PMC_IDX_FIXED_BTS ]; -unsigned long orig_ip = data->regs->ip;struct bts_record *at, *top; +struct perf_output_handle handle; +struct perf_event_header header; +struct perf_sample_data data; +struct pt_regs regs;if (!counter)return ;
@@ -1510,19 +1512,38 @@ static void intel_pmu_drain_bts_buffer(s at = (struct bts_record *)(unsigned long )ds->bts_buffer_base; top = (struct bts_record *)(unsigned long )ds->bts_index; +if (top <= at) +return ; + ds->bts_index = ds->bts_buffer_base; + + data.period = counter->hw.last_period; + data.addr =0 ; + regs.ip =0 ; + +/* +* Prepare a generic sample, i.e. fill in the invariant fields. +* We will overwrite the from and to address before we output +* the sample. +*/ +perf_prepare_sample (&header, &data, counter, ®s); + +if (perf_output_begin (&handle, counter, + header.size * (top - at),1 ,1 )) +return ; +for (; at < top; at++) { - data->regs->ip = at->from; - data->addr = at->to; + data.ip = at->from; + data.addr = at->to; -perf_counter_output (counter,1 , data); +perf_output_sample (&handle, &header, &data, counter); } - data->regs->ip = orig_ip; - data->addr =0 ; +perf_output_end (&handle);/* There's new data available. */ + counter->hw.interrupts++; counter->pending_kill =POLL_IN ; }
@@ -1552,13 +1573,9 @@ static void x86_pmu_disable(struct perf_x86_perf_counter_update (counter, hwc, idx);/* Drain the remaining BTS records. */ -if (unlikely (idx ==X86_PMC_IDX_FIXED_BTS )) { -struct perf_sample_data data; -struct pt_regs regs; +if (unlikely (idx ==X86_PMC_IDX_FIXED_BTS )) +intel_pmu_drain_bts_buffer (cpuc); - data.regs = ®s; -intel_pmu_drain_bts_buffer (cpuc, &data); - } cpuc->counters[idx] =NULL ;clear_bit (idx, cpuc->used_mask);
@@ -1619,7 +1636,6 @@ static int p6_pmu_handle_irq(struct pt_rint idx, handled =0 ;u64 val; - data.regs = regs; data.addr =0 ; cpuc = &__get_cpu_var (cpu_hw_counters);
@@ -1644,7 +1660,7 @@ static int p6_pmu_handle_irq(struct pt_rif (!x86_perf_counter_set_period (counter, hwc, idx))continue ; -if (perf_counter_overflow (counter,1 , &data)) +if (perf_counter_overflow (counter,1 , &data, regs))p6_pmu_disable_counter (hwc, idx); }
@@ -1665,13 +1681,12 @@ static int intel_pmu_handle_irq(struct pint bit, loops;u64 ack, status; - data.regs = regs; data.addr =0 ; cpuc = &__get_cpu_var (cpu_hw_counters);perf_disable (); -intel_pmu_drain_bts_buffer (cpuc, &data); +intel_pmu_drain_bts_buffer (cpuc); status =intel_pmu_get_status ();if (!status) {perf_enable ();
@@ -1702,7 +1717,7 @@ again: data.period = counter->hw.last_period; -if (perf_counter_overflow (counter,1 , &data)) +if (perf_counter_overflow (counter,1 , &data, regs))intel_pmu_disable_counter (&counter->hw, bit); }
@@ -1729,7 +1744,6 @@ static int amd_pmu_handle_irq(struct pt_int idx, handled =0 ;u64 val; - data.regs = regs; data.addr =0 ; cpuc = &__get_cpu_var (cpu_hw_counters);
@@ -1754,7 +1768,7 @@ static int amd_pmu_handle_irq(struct pt_if (!x86_perf_counter_set_period (counter, hwc, idx))continue ; -if (perf_counter_overflow (counter,1 , &data)) +if (perf_counter_overflow (counter,1 , &data, regs))amd_pmu_disable_counter (hwc, idx); }
include/linux/perf_counter.h +64 -4
99 lines not on this page · raw message
kernel/perf_counter.c +161 -145
488 lines not on this page · raw message
---------------------------------------------------------------------
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen Germany
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Douglas Lusk, Peter Gleissner, Hannes Schwaderer
Registergericht: Muenchen HRB 47456 Ust.-IdNr.
VAT Registration No.: DE129385895
Citibank Frankfurt (BLZ 502 109 00) 600119052
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
Totally missed the first one, sorry for that :/
Quoted 9 lines · Markus Metzger
Draining the BTS buffer on a buffer overflow interrupt takes too long resulting in a kernel lockup when tracing the kernel.
Restructure
perf_countersampling into sample creation and sample output.
Prepare a single reference sample for BTS sampling and update the from and to address fields when draining the BTS buffer.
Drain the entire BTS buffer between a singleperf_output_begin()/perf_output_end()pair.
Generally looks very nice, one thing though, why did you take regs out of perf_sample_data, now you get to pass around one extra param..
Quoted 7 lines
CC Peter Zijlstra <[email protected]>Signed-off-by Markus Metzger <[email protected]>---
arch/x86/kernel/cpu/perf_counter.c | 60 37 + 23 - 0 ! include/linux/perf_counter.h | 68 64 + 4 - 0 ! kernel/perf_counter.c | 306 161 + 145 - 0 ! 3 files changed, 262 insertions(+), 172 deletions(-)
What is that diffstat thing? I always get things like:
kernel/sched.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
Quoted 12 lines
-----Original Message-----
From: Peter Zijlstra [mailto:[email protected]]
Sent: Tuesday, September 15, 2009 1:12 PMQuoted 6 lines
Restructure
perf_countersampling into sample creation and sample output.
Prepare a single reference sample for BTS sampling and update the from and to address fields when draining the BTS buffer.
Drain the entire BTS buffer between a singleperf_output_begin()/perf_output_end()pair.
Quoted 2 lines
Generally looks very nice, one thing though, why did you take regs out of
perf_sample_data, now you get to pass around one extra param..
That is to make perf_sample_data describe the sample directly.
The regs are used to create the sample; they're not needed once the sample has been created.
Quoted 8 lines
Quoted 7 lines
CC Peter Zijlstra <[email protected]>Signed-off-by Markus Metzger <[email protected]>---
arch/x86/kernel/cpu/perf_counter.c | 60 37 + 23 - 0 ! include/linux/perf_counter.h | 68 64 + 4 - 0 ! kernel/perf_counter.c | 306 161 + 145 - 0 ! 3 files changed, 262 insertions(+), 172 deletions(-)
Quoted 5 lines
What is that diffstat thing? I always get things like:
kernel/sched.c| 4 ++--1 files changed, 2 insertions(+), 2 deletions(-)
I'm using QUILT_DIFFSTAT_OPTS="-f0".
regards,
markus.
---------------------------------------------------------------------
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen Germany
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Douglas Lusk, Peter Gleissner, Hannes Schwaderer
Registergericht: Muenchen HRB 47456 Ust.-IdNr.
VAT Registration No.: DE129385895
Citibank Frankfurt (BLZ 502 109 00) 600119052
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
Quoted 7 lines · Markus T
Quoted 7 lines
Quoted 6 lines
Restructure
perf_countersampling into sample creation and sample output.
Prepare a single reference sample for BTS sampling and update the from and to address fields when draining the BTS buffer.
Drain the entire BTS buffer between a singleperf_output_begin()/perf_output_end()pair.
Quoted 8 lines
Quoted 2 lines
Generally looks very nice, one thing though, why did you take regs out of
perf_sample_data, now you get to pass around one extra param..That is to make
perf_sample_datadescribe the sample directly.The regs are used to create the sample; they're not needed once the sample has been created.
True, but I'd have been lazy and not added that extra parameter all over the place, but sure ;-)
This is now fast enough to BTS trace the kernel too?
Quoted 23 lines
-----Original Message-----
From: Peter Zijlstra [mailto:[email protected]]
Sent: Tuesday, September 15, 2009 1:25 PM
To: Metzger, Markus T
Cc: [email protected]; [email protected]; [email protected]; [email protected]; linux- [email protected]
Subject: RE: [patch, resend] x86,perf_counter, bts: optimize BTS overflow handlingQuoted 13 lines · Markus T
Quoted 9 lines
Quoted 6 lines
Restructure
perf_countersampling into sample creation and sample output.
Prepare a single reference sample for BTS sampling and update the from and to address fields when draining the BTS buffer.
Drain the entire BTS buffer between a singleperf_output_begin()/perf_output_end()pair.Generally looks very nice, one thing though, why did you take regs out of
perf_sample_data, now you get to pass around one extra param..That is to make
perf_sample_datadescribe the sample directly.
Quoted 7 lines
Quoted 2 lines
The regs are used to create the sample; they're not needed once the sample has been created.
True, but I'd have been lazy and not added that extra parameter all over the place, but sure ;-)
This is now fast enough to BTS trace the kernel too?
It is. At least on my box.
Once that patch has been accepted, I will ask Ingo to drop 1653192f510bd8114b7b133d7289e6e5c3e95046.
regards,
markus.
---------------------------------------------------------------------
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen Germany
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Douglas Lusk, Peter Gleissner, Hannes Schwaderer
Registergericht: Muenchen HRB 47456 Ust.-IdNr.
VAT Registration No.: DE129385895
Citibank Frankfurt (BLZ 502 109 00) 600119052
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
Peter Zijlstra
Acked-byQuoted 29 lines · Markus T
Quoted 29 lines
-----Original Message-----
From: Peter Zijlstra [mailto:[email protected]]
Sent: Tuesday, September 15, 2009 1:25 PM
To: Metzger, Markus T
Cc: [email protected]; [email protected]; [email protected]; [email protected]; linux- [email protected]
Subject: RE: [patch, resend] x86,perf_counter, bts: optimize BTS overflow handlingQuoted 7 lines · Markus T
Quoted 7 lines
Quoted 6 lines
Restructure
perf_countersampling into sample creation and sample output.
Prepare a single reference sample for BTS sampling and update the from and to address fields when draining the BTS buffer.
Drain the entire BTS buffer between a singleperf_output_begin()/perf_output_end()pair.Quoted 8 lines
Quoted 2 lines
Generally looks very nice, one thing though, why did you take regs out of
perf_sample_data, now you get to pass around one extra param..That is to make
perf_sample_datadescribe the sample directly.The regs are used to create the sample; they're not needed once the sample has been created.
True, but I'd have been lazy and not added that extra parameter all over the place, but sure ;-)
Quoted 6 lines
Quoted 1 line
This is now fast enough to BTS trace the kernel too?
It is. At least on my box.
Once that patch has been accepted, I will ask Ingo to drop
1653192f510bd8114b7b133d7289e6e5c3e95046.
Patch looks good,
You could also look at throttling the BTS interrupt when you notice you're doing them back-to-back..
Quoted 7 lines
-----Original Message-----
From: Peter Zijlstra [mailto:[email protected]]
Sent: Tuesday, September 15, 2009 1:40 PMYou could also look at throttling the BTS interrupt when you notice you're doing them back-to-back..
There are always ~2k kernel branches between two interrupts.
I would need to detect whether the rest of the kernel has enough time left. Any idea how I could do this?
thanks and regards,
markus.
---------------------------------------------------------------------
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen Germany
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Douglas Lusk, Peter Gleissner, Hannes Schwaderer
Registergericht: Muenchen HRB 47456 Ust.-IdNr.
VAT Registration No.: DE129385895
Citibank Frankfurt (BLZ 502 109 00) 600119052
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
[tip:perfcounters/core] x86, perf_counter, bts: Optimize BTS overflow handling
In reply to Markus MetzgerCommit-ID: 5622f295b53fb60dbf9bed3e2c89d182490a8b7f Gitweb: http://git.kernel.org/tip/5622f295b53fb60dbf9bed3e2c89d182490a8b7f Author: Markus Metzger <[email protected]> AuthorDate: Tue, 15 Sep 2009 13:00:23 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Fri, 18 Sep 2009 20:43:20 +0200
x86, perf_counter, bts: Optimize BTS overflow handling
Draining the BTS buffer on a buffer overflow interrupt takes too long resulting in a kernel lockup when tracing the kernel.
Restructure perf_counter sampling into sample creation and sample output.
Prepare a single reference sample for BTS sampling and update the from and to address fields when draining the BTS buffer. Drain the entire BTS buffer between a single perf_output_begin() / perf_output_end() pair.
LKML-Reference: <[email protected]>
--- arch/x86/kernel/cpu/perf_counter.c | 60 +++++--- include/linux/perf_counter.h | 68 ++++++++- kernel/perf_counter.c | 312 +++++++++++++++++++----------------- 3 files changed, 266 insertions(+), 174 deletions(-)
arch/x86/kernel/cpu/perf_counter.c +37 -23
@@ -36,10 +36,10 @@ static u64 perf_counter_mask __read_mostly;#define BTS_RECORD_SIZE 24/* The size of a per-cpu BTS buffer in bytes: */ -#define BTS_BUFFER_SIZE (BTS_RECORD_SIZE * 1024) +#define BTS_BUFFER_SIZE (BTS_RECORD_SIZE * 2048)/* The BTS overflow threshold in bytes from the end of the buffer: */ -#define BTS_OVFL_TH (BTS_RECORD_SIZE * 64) +#define BTS_OVFL_TH (BTS_RECORD_SIZE * 128)/*
@@ -1488,8 +1488,7 @@ void perf_counter_print_debug(void)local_irq_restore (flags); } -static void intel_pmu_drain_bts_buffer (struct cpu_hw_counters *cpuc, -struct perf_sample_data *data) +static void intel_pmu_drain_bts_buffer (struct cpu_hw_counters *cpuc) {struct debug_store *ds = cpuc->ds; struct bts_record {
@@ -1498,8 +1497,11 @@ static void intel_pmu_drain_bts_buffer(struct cpu_hw_counters *cpuc,u64 flags; };struct perf_counter *counter = cpuc->counters[X86_PMC_IDX_FIXED_BTS ]; -unsigned long orig_ip = data->regs->ip;struct bts_record *at, *top; +struct perf_output_handle handle; +struct perf_event_header header; +struct perf_sample_data data; +struct pt_regs regs;if (!counter)return ;
@@ -1510,19 +1512,38 @@ static void intel_pmu_drain_bts_buffer(struct cpu_hw_counters *cpuc, at = (struct bts_record *)(unsigned long )ds->bts_buffer_base; top = (struct bts_record *)(unsigned long )ds->bts_index; +if (top <= at) +return ; + ds->bts_index = ds->bts_buffer_base; + + data.period = counter->hw.last_period; + data.addr =0 ; + regs.ip =0 ; + +/* +* Prepare a generic sample, i.e. fill in the invariant fields. +* We will overwrite the from and to address before we output +* the sample. +*/ +perf_prepare_sample (&header, &data, counter, ®s); + +if (perf_output_begin (&handle, counter, + header.size * (top - at),1 ,1 )) +return ; +for (; at < top; at++) { - data->regs->ip = at->from; - data->addr = at->to; + data.ip = at->from; + data.addr = at->to; -perf_counter_output (counter,1 , data); +perf_output_sample (&handle, &header, &data, counter); } - data->regs->ip = orig_ip; - data->addr =0 ; +perf_output_end (&handle);/* There's new data available. */ + counter->hw.interrupts++; counter->pending_kill =POLL_IN ; }
@@ -1552,13 +1573,9 @@ static void x86_pmu_disable(struct perf_counter *counter)x86_perf_counter_update (counter, hwc, idx);/* Drain the remaining BTS records. */ -if (unlikely (idx ==X86_PMC_IDX_FIXED_BTS )) { -struct perf_sample_data data; -struct pt_regs regs; +if (unlikely (idx ==X86_PMC_IDX_FIXED_BTS )) +intel_pmu_drain_bts_buffer (cpuc); - data.regs = ®s; -intel_pmu_drain_bts_buffer (cpuc, &data); - } cpuc->counters[idx] =NULL ;clear_bit (idx, cpuc->used_mask);
@@ -1619,7 +1636,6 @@ static int p6_pmu_handle_irq(struct pt_regs *regs)int idx, handled =0 ;u64 val; - data.regs = regs; data.addr =0 ; cpuc = &__get_cpu_var (cpu_hw_counters);
@@ -1644,7 +1660,7 @@ static int p6_pmu_handle_irq(struct pt_regs *regs)if (!x86_perf_counter_set_period (counter, hwc, idx))continue ; -if (perf_counter_overflow (counter,1 , &data)) +if (perf_counter_overflow (counter,1 , &data, regs))p6_pmu_disable_counter (hwc, idx); }
@@ -1665,13 +1681,12 @@ static int intel_pmu_handle_irq(struct pt_regs *regs)int bit, loops;u64 ack, status; - data.regs = regs; data.addr =0 ; cpuc = &__get_cpu_var (cpu_hw_counters);perf_disable (); -intel_pmu_drain_bts_buffer (cpuc, &data); +intel_pmu_drain_bts_buffer (cpuc); status =intel_pmu_get_status ();if (!status) {perf_enable ();
@@ -1702,7 +1717,7 @@ again: data.period = counter->hw.last_period; -if (perf_counter_overflow (counter,1 , &data)) +if (perf_counter_overflow (counter,1 , &data, regs))intel_pmu_disable_counter (&counter->hw, bit); }
@@ -1729,7 +1744,6 @@ static int amd_pmu_handle_irq(struct pt_regs *regs)int idx, handled =0 ;u64 val; - data.regs = regs; data.addr =0 ; cpuc = &__get_cpu_var (cpu_hw_counters);
@@ -1754,7 +1768,7 @@ static int amd_pmu_handle_irq(struct pt_regs *regs)if (!x86_perf_counter_set_period (counter, hwc, idx))continue ; -if (perf_counter_overflow (counter,1 , &data)) +if (perf_counter_overflow (counter,1 , &data, regs))amd_pmu_disable_counter (hwc, idx); }
include/linux/perf_counter.h +64 -4
99 lines not on this page · raw message
kernel/perf_counter.c +165 -147
499 lines not on this page · raw message
RE: [tip:perfcounters/core] x86, perf_counter, bts: Optimize BTS overflow handling
Quoted 28 lines
-----Original Message-----
From: tip tree robot [mailto:[email protected]] On Behalf Of tip-bot for Markus Metzger
Sent: Friday, September 18, 2009 9:19 PM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Metzger, Markus T; [email protected]; [email protected]
Subject: [tip:perfcounters/core] x86,perf_counter, bts: Optimize BTS overflow handlingCommit-ID: 5622f295b53fb60dbf9bed3e2c89d182490a8b7f Gitweb: http://git.kernel.org/tip/5622f295b53fb60dbf9bed3e2c89d182490a8b7f Author: Markus Metzger <[email protected]> AuthorDate: Tue, 15 Sep 2009 13:00:23 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Fri, 18 Sep 2009 20:43:20 +0200x86,
perf_counter, bts: Optimize BTS overflow handlingDraining the BTS buffer on a buffer overflow interrupt takes too long resulting in a kernel lockup when tracing the kernel.
Restructure
perf_countersampling into sample creation and sample output.Prepare a single reference sample for BTS sampling and update the from and to address fields when draining the BTS buffer. Drain the entire BTS buffer between a single
perf_output_begin()/perf_output_end()pair.
Quoted 4 lines
Signed-off-by Markus Metzger <[email protected]>Signed-off-by Peter Zijlstra <[email protected]>LKML-Reference: <[email protected]>
Signed-off-by Ingo Molnar <[email protected]>
Ingo,
This change should speed up BTS overflow handling enough to support branch tracing the kernel.
Would you please drop 1653192f510bd8114b7b133d7289e6e5c3e95046 that disabled kernel tracing to work around the issue.
thanks and regards,
markus.
---------------------------------------------------------------------Intel GmbHDornacher Strasse 185622 Feldkirchen/Muenchen GermanySitz der Gesellschaft: Feldkirchen bei MuenchenGeschaeftsfuehrer: Douglas Lusk, Peter Gleissner, Hannes SchwadererRegistergericht: Muenchen HRB 47456 Ust.-IdNr.VAT Registration No.: DE129385895Citibank Frankfurt (BLZ 502 109 00) 600119052 This e-mail and any attachments may contain confidential material forthe sole use of the intended recipient(s). Any review or distributionby others is strictly prohibited. If you are not the intendedrecipient, please contact the sender and delete all copies.���{.n�+�������+%�����ݶ��w��{.n�+����{��G�����{ay�ʇڙ�,j��f���h��������z_�(�階�ݢj"���m������G������?����&���~��iO��z��v�^�m����������?�I�
Re: [tip:perfcounters/core] x86, perf_counter, bts: Optimize BTS overflow handling
Quoted 34 lines · Metzger, Markus T
Quoted 28 lines
-----Original Message-----
From: tip tree robot [mailto:[email protected]] On Behalf Of tip-bot for Markus Metzger
Sent: Friday, September 18, 2009 9:19 PM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Metzger, Markus T; [email protected]; [email protected]
Subject: [tip:perfcounters/core] x86,perf_counter, bts: Optimize BTS overflow handlingCommit-ID: 5622f295b53fb60dbf9bed3e2c89d182490a8b7f Gitweb: http://git.kernel.org/tip/5622f295b53fb60dbf9bed3e2c89d182490a8b7f Author: Markus Metzger <[email protected]> AuthorDate: Tue, 15 Sep 2009 13:00:23 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Fri, 18 Sep 2009 20:43:20 +0200x86,
perf_counter, bts: Optimize BTS overflow handlingDraining the BTS buffer on a buffer overflow interrupt takes too long resulting in a kernel lockup when tracing the kernel.
Restructure
perf_countersampling into sample creation and sample output.Prepare a single reference sample for BTS sampling and update the from and to address fields when draining the BTS buffer. Drain the entire BTS buffer between a single
perf_output_begin()/perf_output_end()pair.Quoted 4 lines
Signed-off-by Markus Metzger <[email protected]>Signed-off-by Peter Zijlstra <[email protected]>LKML-Reference: <[email protected]>
Signed-off-by Ingo Molnar <[email protected]>
Quoted 6 lines
Ingo,
This change should speed up BTS overflow handling enough to support branch tracing the kernel.
Would you please drop1653192f510bd8114b7b133d7289e6e5c3e95046that disabled kernel tracing to work around the issue.
Please send a proper patch that re-enables the (previously unreliable) aspect of BTS tracing, with a changelog that explains that the feature now works and with an indication that you've tested it.
Ingo