ftrace: updates for 2.6.29
Subsystems (4)
Steven Rostedt
maintainercover ftrace: updates for 2.6.29
Ingo,
The following patches are in:
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
branch: tip/devel
Pekka Paalanen (3):
doc: mmiotrace.txt, buffer size control change
trace: mmiotrace to the tracer menu in Kconfig
mmiotrace: count events lost due to not recording
----
Documentation/tracers/mmiotrace.txt | 6 ++---- arch/x86/Kconfig.debug | 24 ++---------------------- kernel/trace/Kconfig | 23 +++++++++++++++++++++++ kernel/trace/trace_mmiotrace.c | 14 ++++++++++---- 4 files changed, 37 insertions(+), 30 deletions(-)
Steven Rostedt
maintainerPATCH 1/3 doc: mmiotrace.txt, buffer size control change
From: Pekka Paalanen <[email protected]>
Impact: prevents confusing the user when buffer size is inadequate
The tracing framework offers a resizeable buffer, which mmiotrace uses to record events. If the buffer is full, the following events will be lost. Events should not be lost, so the documentation instructs the user to increase the buffer size. The buffer size is set via a debugfs file.
Mmiotrace documentation was not updated the same time the debugfs file was changed. The old file was tracing/trace_entries and first contained the number of entries the buffer had space for, per cpu. Nowadays this file is replaced with the file tracing/buffer_size_kb, which tells the amount of memory reserved for the buffer, per cpu, in kilobytes.
Previously, a flag had to be toggled via the debugfs file tracing/tracing_enabled when the buffer size was changed. This is no longer necessary.
The mmiotrace documentation is updated to reflect the current state of the tracing framework.
--- Documentation/tracers/mmiotrace.txt | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-)
Documentation/tracers/mmiotrace.txt +2 -4
@@ -78,12 +78,10 @@ to view your kernel log and look for "mmiotrace has lost events" warning. If events were lost, the trace is incomplete. You should enlarge the buffers and try again. Buffers are enlarged by first seeing how large the current buffers are: -$ cat /debug/tracing/trace_entries +$ cat /debug/tracing/buffer_size_kb gives you a number. Approximately double this number and write it back, for instance: -$ echo 0 > /debug/tracing/tracing_enabled -$ echo 128000 > /debug/tracing/trace_entries -$ echo 1 > /debug/tracing/tracing_enabled +$ echo 128000 > /debug/tracing/buffer_size_kb Then start again from the top. If you are doing a trace for a driver project, e.g. Nouveau, you should also
Signature · 3 lines
1.5.6.5 --
Steven Rostedt
maintainerPATCH 2/3 trace: mmiotrace to the tracer menu in Kconfig
In reply to Steven RostedtFrom: Pekka Paalanen <[email protected]>
Impact: cosmetic change in Kconfig menu layout
This patch was originally suggested by Peter Zijlstra, but seems it was forgotten.
CONFIG_MMIOTRACE and CONFIG_MMIOTRACE_TEST were selectable directly under the Kernel hacking / debugging menu in the kernel configuration system. They were present only for x86 and x86_64.
Other tracers that use the ftrace tracing framework are in their own sub-menu. This patch moves the mmiotrace configuration options there. Since the Kconfig file, where the tracer menu is, is not architecture specific, HAVE_MMIOTRACE_SUPPORT is introduced and provided only by x86/x86_64. CONFIG_MMIOTRACE now depends on it.
--- arch/x86/Kconfig.debug | 24 ++---------------------- kernel/trace/Kconfig | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 22 deletions(-)
arch/x86/Kconfig.debug +2 -22
@@ -175,28 +175,8 @@ config IOMMU_LEAK Add a simple leak tracer to the IOMMU code. This is useful when you are debugging a buggy device driver that leaks IOMMU mappings. -config MMIOTRACE - bool "Memory mapped IO tracing" - depends on DEBUG_KERNEL && PCI - select TRACING - help - Mmiotrace traces Memory Mapped I/O access and is meant for - debugging and reverse engineering. It is called from the ioremap - implementation and works via page faults. Tracing is disabled by - default and can be enabled at run-time. - - See Documentation/tracers/mmiotrace.txt. - If you are not helping to develop drivers, say N. - -config MMIOTRACE_TEST - tristate "Test module for mmiotrace" - depends on MMIOTRACE && m - help - This is a dumb module for testing mmiotrace. It is very dangerous - as it will write garbage to IO memory starting at a given address. - However, it should be safe to use on e.g. unused portion of VRAM. - - Say N, unless you absolutely know what you are doing. +config HAVE_MMIOTRACE_SUPPORT + def_bool y # # IO delay types:
kernel/trace/Kconfig +23 -0
@@ -323,4 +323,27 @@ config FTRACE_STARTUP_TEST functioning properly. It will do tests on all the configured tracers of ftrace. +config MMIOTRACE + bool "Memory mapped IO tracing" + depends on HAVE_MMIOTRACE_SUPPORT && DEBUG_KERNEL && PCI + select TRACING + help + Mmiotrace traces Memory Mapped I/O access and is meant for + debugging and reverse engineering. It is called from the ioremap + implementation and works via page faults. Tracing is disabled by + default and can be enabled at run-time. + + See Documentation/tracers/mmiotrace.txt. + If you are not helping to develop drivers, say N. + +config MMIOTRACE_TEST + tristate "Test module for mmiotrace" + depends on MMIOTRACE && m + help + This is a dumb module for testing mmiotrace. It is very dangerous + as it will write garbage to IO memory starting at a given address. + However, it should be safe to use on e.g. unused portion of VRAM. + + Say N, unless you absolutely know what you are doing. + endmenu
Signature · 3 lines
1.5.6.5 --
Steven Rostedt
maintainerPATCH 3/3 mmiotrace: count events lost due to not recording
In reply to Steven RostedtFrom: Pekka Paalanen <[email protected]>
Impact: enhances lost events counting in mmiotrace
The tracing framework, or the ring buffer facility it uses, has a switch to stop recording data. When recording is off, the trace events will be lost. The framework does not count these, so mmiotrace has to count them itself.
--- kernel/trace/trace_mmiotrace.c | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-)
kernel/trace/trace_mmiotrace.c +10 -4
@@ -9,6 +9,7 @@#include <linux/kernel.h> #include <linux/mmiotrace.h> #include <linux/pci.h> +#include <asm/atomic.h> #include "trace.h" #include "trace_output.h"
@@ -20,6 +21,7 @@ struct header_iter {static struct trace_array *mmio_trace_array;static bool overrun_detected;static unsigned long prev_overruns; +static atomic_t dropped_count;static void mmio_reset_data (struct trace_array *tr) {
@@ -122,11 +124,11 @@ static void mmio_close(struct trace_iterator *iter)static unsigned long count_overruns (struct trace_iterator *iter) { -unsigned long cnt =0 ; +unsigned long cnt =atomic_xchg (&dropped_count,0 );unsigned long over =ring_buffer_overruns (iter->tr->buffer);if (over > prev_overruns) - cnt = over - prev_overruns; + cnt += over - prev_overruns; prev_overruns = over;return cnt; }
@@ -308,8 +310,10 @@ static void __trace_mmiotrace_rw(struct trace_array *tr, event =ring_buffer_lock_reserve (tr->buffer,sizeof (*entry), &irq_flags); -if (!event) +if (!event) { +atomic_inc (&dropped_count);return ; + } entry =ring_buffer_event_data (event);tracing_generic_entry_update (&entry->ent,0 ,preempt_count ()); entry->ent.type =TRACE_MMIO_RW ;
@@ -336,8 +340,10 @@ static void __trace_mmiotrace_map(struct trace_array *tr, event =ring_buffer_lock_reserve (tr->buffer,sizeof (*entry), &irq_flags); -if (!event) +if (!event) { +atomic_inc (&dropped_count);return ; + } entry =ring_buffer_event_data (event);tracing_generic_entry_update (&entry->ent,0 ,preempt_count ()); entry->ent.type =TRACE_MMIO_MAP ;
Signature · 3 lines
1.5.6.5 --
Re: [PATCH 3/3] mmiotrace: count events lost due to not recording
Quoted 1 line · On Thu, 08 Jan 2009 19:27:50 -0500 Steven Rostedt <[email protected]> wrote:
+static
atomic_tdropped_count;
Formally, this should be
static atomic_t dropped_count = ATOMIC_INIT(0);
but no atomic_t implementations need that, and I'm sure that if one turns up wchih _does_ need it (say, it has a spinlock inside its atomic_t) then the kernel would break all over the place.
So perhaps we should formally state that the all-zeroes pattern is an acceptable way of initialising an atomic_t.
In which case these:
y:/usr/src/linux-2.6.28> grep -r "atomic_t.*=.*ATOMIC_INIT" . | wc -l 110
become cleanup fodder.
Steven Rostedt
maintainerRe: [PATCH 3/3] mmiotrace: count events lost due to not recording
Quoted 5 lines · Andrew Morton
y:/usr/src/linux-2.6.28> grep -r "atomic_t.*=.*ATOMIC_INIT" . | wc -l 110
become cleanup fodder.
[linus.git]$ git grep "atomic_t.*=.*ATOMIC_INIT([^0]" |wc -l 13
[linus.git]$ git grep "atomic_t.*=.*ATOMIC_INIT(0" |wc -l 104
[linus.git]$ git grep "atomic_t.*=.*ATOMIC_INIT" |wc -l 117
OK, in current linus.git we have 117 atomic_t using ATOMIC_INIT, where 13 actually need the init (non zero). But 104 need to be cleaned up ;-)
-- Steve
Quoted 5 lines · On Thu, 08 Jan 2009 19:27:47 -0500 Steven Rostedt <[email protected]> wrote:
Ingo,
The following patches are in:
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
Does this mean that from now on all mmiotrace related patches should be sent to Steven? CC Ingo?
Or should they be split so that kernel/trace stuff is sent to Steven and arch/x86 stuff to Ingo?
Signature · 2 lines
Pekka Paalanen http://www.iki.fi/pq/
Quoted 14 lines · Steven Rostedt
Ingo,
The following patches are in:
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.gitbranch: tip/devel
Pekka Paalanen (3):
doc: mmiotrace.txt, buffer size control change
trace: mmiotrace to the tracer menu inKconfig
mmiotrace: count events lost due to not recording
Quoted 6 lines
----
Documentation/tracers/mmiotrace.txt | 6 ++---- arch/x86/Kconfig.debug | 24 ++---------------------- kernel/trace/Kconfig | 23 +++++++++++++++++++++++ kernel/trace/trace_mmiotrace.c | 14 ++++++++++---- 4 files changed, 37 insertions(+), 30 deletions(-)
pulled into tip/tracing/urgent, thanks Steve!
Ingo
Quoted 17 lines · On Sun, 11 Jan 2009 04:06:41 +0100 Ingo Molnar <[email protected]> wrote:
Quoted 14 lines · Steven Rostedt
Ingo,
The following patches are in:
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.gitbranch: tip/devel
Pekka Paalanen (3):
doc: mmiotrace.txt, buffer size control change
trace: mmiotrace to the tracer menu inKconfig
mmiotrace: count events lost due to not recording
Quoted 8 lines
Quoted 6 lines
----
Documentation/tracers/mmiotrace.txt | 6 ++---- arch/x86/Kconfig.debug | 24 ++---------------------- kernel/trace/Kconfig | 23 +++++++++++++++++++++++ kernel/trace/trace_mmiotrace.c | 14 ++++++++++---- 4 files changed, 37 insertions(+), 30 deletions(-)pulled into tip/tracing/urgent, thanks Steve!
Hi,
I was just diffing linus/master to Ingo's tip/master, and I see the "mmiotrace: count events lost due to not recording" being added in tip/master. The doc and Kconfig updates also, nothing is in linus'.
I thought all these were going into 2.6.29. What happened?
Thanks.
Signature · 2 lines
Pekka Paalanen http://www.iki.fi/pq/
Ingo Molnar
AppliedQuoted 29 lines · Pekka Paalanen
Quoted 17 lines · On Sun, 11 Jan 2009 04:06:41 +0100 Ingo Molnar <[email protected]> wrote:
Quoted 14 lines · Steven Rostedt
Ingo,
The following patches are in:
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.gitbranch: tip/devel
Pekka Paalanen (3):
doc: mmiotrace.txt, buffer size control change
trace: mmiotrace to the tracer menu inKconfig
mmiotrace: count events lost due to not recordingQuoted 8 lines
Quoted 6 lines
----
Documentation/tracers/mmiotrace.txt | 6 ++---- arch/x86/Kconfig.debug | 24 ++---------------------- kernel/trace/Kconfig | 23 +++++++++++++++++++++++ kernel/trace/trace_mmiotrace.c | 14 ++++++++++---- 4 files changed, 37 insertions(+), 30 deletions(-)pulled into tip/tracing/urgent, thanks Steve!
Quoted 7 lines
Hi,
I was just diffing linus/master to Ingo's tip/master, and I see the "mmiotrace: count events lost due to not recording" being added in tip/master. The doc and
Kconfigupdates also, nothing is in linus'.I thought all these were going into 2.6.29. What happened?
The urgent marker got lost. [There were a bunch of changes originally destined for .29 but then delayed to .30.]
I've queued them up for .29-rc6 into tip:tracing/urgent:
[tracing/urgent 391b170] mmiotrace: count events lost due to not recording [tracing/urgent 6bc5c36] trace: mmiotrace to the tracer menu in Kconfig [tracing/urgent f9aa28a] doc: mmiotrace.txt, buffer size control change
It never hurts to double-check the routing and status of your commits.
Thanks,
Ingo