linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] ftrace: updates for 2.6.29
@ 2009-01-09  0:27 Steven Rostedt
  2009-01-09  0:27 ` [PATCH 1/3] doc: mmiotrace.txt, buffer size control change Steven Rostedt
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Steven Rostedt @ 2009-01-09  0:27 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar, Andrew Morton, Pekka Paalanen

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

-- 

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

* [PATCH 1/3] doc: mmiotrace.txt, buffer size control change
  2009-01-09  0:27 [PATCH 0/3] ftrace: updates for 2.6.29 Steven Rostedt
@ 2009-01-09  0:27 ` Steven Rostedt
  2009-01-09  0:27 ` [PATCH 2/3] trace: mmiotrace to the tracer menu in Kconfig Steven Rostedt
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Steven Rostedt @ 2009-01-09  0:27 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar, Andrew Morton, Pekka Paalanen, Steven Rostedt

[-- Attachment #1: 0001-doc-mmiotrace.txt-buffer-size-control-change.patch --]
[-- Type: text/plain, Size: 2112 bytes --]

From: Pekka Paalanen <pq@iki.fi>

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.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
---
 Documentation/tracers/mmiotrace.txt |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/Documentation/tracers/mmiotrace.txt b/Documentation/tracers/mmiotrace.txt
index cde23b4..5731c67 100644
--- a/Documentation/tracers/mmiotrace.txt
+++ b/Documentation/tracers/mmiotrace.txt
@@ -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
-- 
1.5.6.5

-- 

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

* [PATCH 2/3] trace: mmiotrace to the tracer menu in Kconfig
  2009-01-09  0:27 [PATCH 0/3] ftrace: updates for 2.6.29 Steven Rostedt
  2009-01-09  0:27 ` [PATCH 1/3] doc: mmiotrace.txt, buffer size control change Steven Rostedt
@ 2009-01-09  0:27 ` Steven Rostedt
  2009-01-09  0:27 ` [PATCH 3/3] mmiotrace: count events lost due to not recording Steven Rostedt
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Steven Rostedt @ 2009-01-09  0:27 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar, Andrew Morton, Pekka Paalanen, Steven Rostedt

[-- Attachment #1: 0002-trace-mmiotrace-to-the-tracer-menu-in-Kconfig.patch --]
[-- Type: text/plain, Size: 3324 bytes --]

From: Pekka Paalanen <pq@iki.fi>

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.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
---
 arch/x86/Kconfig.debug |   24 ++----------------------
 kernel/trace/Kconfig   |   23 +++++++++++++++++++++++
 2 files changed, 25 insertions(+), 22 deletions(-)

diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug
index 01649e1..097d79a 100644
--- a/arch/x86/Kconfig.debug
+++ b/arch/x86/Kconfig.debug
@@ -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:
diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig
index 1c0b750..9442392 100644
--- a/kernel/trace/Kconfig
+++ b/kernel/trace/Kconfig
@@ -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
-- 
1.5.6.5

-- 

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

* [PATCH 3/3] mmiotrace: count events lost due to not recording
  2009-01-09  0:27 [PATCH 0/3] ftrace: updates for 2.6.29 Steven Rostedt
  2009-01-09  0:27 ` [PATCH 1/3] doc: mmiotrace.txt, buffer size control change Steven Rostedt
  2009-01-09  0:27 ` [PATCH 2/3] trace: mmiotrace to the tracer menu in Kconfig Steven Rostedt
@ 2009-01-09  0:27 ` Steven Rostedt
  2009-01-09  1:10   ` Andrew Morton
  2009-01-09 20:04 ` [PATCH 0/3] ftrace: updates for 2.6.29 Pekka Paalanen
  2009-01-11  3:06 ` Ingo Molnar
  4 siblings, 1 reply; 10+ messages in thread
From: Steven Rostedt @ 2009-01-09  0:27 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar, Andrew Morton, Pekka Paalanen, Steven Rostedt

[-- Attachment #1: 0003-mmiotrace-count-events-lost-due-to-not-recording.patch --]
[-- Type: text/plain, Size: 2320 bytes --]

From: Pekka Paalanen <pq@iki.fi>

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.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
---
 kernel/trace/trace_mmiotrace.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/kernel/trace/trace_mmiotrace.c b/kernel/trace/trace_mmiotrace.c
index fcec59f..621c8c3 100644
--- a/kernel/trace/trace_mmiotrace.c
+++ b/kernel/trace/trace_mmiotrace.c
@@ -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;
-- 
1.5.6.5

-- 

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

* Re: [PATCH 3/3] mmiotrace: count events lost due to not recording
  2009-01-09  0:27 ` [PATCH 3/3] mmiotrace: count events lost due to not recording Steven Rostedt
@ 2009-01-09  1:10   ` Andrew Morton
  2009-01-09  1:56     ` Steven Rostedt
  0 siblings, 1 reply; 10+ messages in thread
From: Andrew Morton @ 2009-01-09  1:10 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: linux-kernel, mingo, pq, srostedt

On Thu, 08 Jan 2009 19:27:50 -0500
Steven Rostedt <rostedt@goodmis.org> wrote:

> +static atomic_t dropped_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.

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

* Re: [PATCH 3/3] mmiotrace: count events lost due to not recording
  2009-01-09  1:10   ` Andrew Morton
@ 2009-01-09  1:56     ` Steven Rostedt
  0 siblings, 0 replies; 10+ messages in thread
From: Steven Rostedt @ 2009-01-09  1:56 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, mingo, pq, srostedt


On Thu, 8 Jan 2009, Andrew Morton wrote:
> 
> 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


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

* Re: [PATCH 0/3] ftrace: updates for 2.6.29
  2009-01-09  0:27 [PATCH 0/3] ftrace: updates for 2.6.29 Steven Rostedt
                   ` (2 preceding siblings ...)
  2009-01-09  0:27 ` [PATCH 3/3] mmiotrace: count events lost due to not recording Steven Rostedt
@ 2009-01-09 20:04 ` Pekka Paalanen
  2009-01-11  3:06 ` Ingo Molnar
  4 siblings, 0 replies; 10+ messages in thread
From: Pekka Paalanen @ 2009-01-09 20:04 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: linux-kernel, Ingo Molnar, Andrew Morton

On Thu, 08 Jan 2009 19:27:47 -0500
Steven Rostedt <rostedt@goodmis.org> 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?

-- 
Pekka Paalanen
http://www.iki.fi/pq/

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

* Re: [PATCH 0/3] ftrace: updates for 2.6.29
  2009-01-09  0:27 [PATCH 0/3] ftrace: updates for 2.6.29 Steven Rostedt
                   ` (3 preceding siblings ...)
  2009-01-09 20:04 ` [PATCH 0/3] ftrace: updates for 2.6.29 Pekka Paalanen
@ 2009-01-11  3:06 ` Ingo Molnar
  2009-02-15 18:58   ` Pekka Paalanen
  4 siblings, 1 reply; 10+ messages in thread
From: Ingo Molnar @ 2009-01-11  3:06 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: linux-kernel, Andrew Morton, Pekka Paalanen


* Steven Rostedt <rostedt@goodmis.org> wrote:

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

pulled into tip/tracing/urgent, thanks Steve!

	Ingo

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

* Re: [PATCH 0/3] ftrace: updates for 2.6.29
  2009-01-11  3:06 ` Ingo Molnar
@ 2009-02-15 18:58   ` Pekka Paalanen
  2009-02-15 19:07     ` Ingo Molnar
  0 siblings, 1 reply; 10+ messages in thread
From: Pekka Paalanen @ 2009-02-15 18:58 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Steven Rostedt, linux-kernel, Andrew Morton

On Sun, 11 Jan 2009 04:06:41 +0100
Ingo Molnar <mingo@elte.hu> wrote:

> 
> * Steven Rostedt <rostedt@goodmis.org> wrote:
> 
> > 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(-)
> 
> 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.
-- 
Pekka Paalanen
http://www.iki.fi/pq/

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

* Re: [PATCH 0/3] ftrace: updates for 2.6.29
  2009-02-15 18:58   ` Pekka Paalanen
@ 2009-02-15 19:07     ` Ingo Molnar
  0 siblings, 0 replies; 10+ messages in thread
From: Ingo Molnar @ 2009-02-15 19:07 UTC (permalink / raw)
  To: Pekka Paalanen; +Cc: Steven Rostedt, linux-kernel, Andrew Morton


* Pekka Paalanen <pq@iki.fi> wrote:

> On Sun, 11 Jan 2009 04:06:41 +0100
> Ingo Molnar <mingo@elte.hu> wrote:
> 
> > 
> > * Steven Rostedt <rostedt@goodmis.org> wrote:
> > 
> > > 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(-)
> > 
> > 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?

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

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

end of thread, other threads:[~2009-02-15 19:08 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-09  0:27 [PATCH 0/3] ftrace: updates for 2.6.29 Steven Rostedt
2009-01-09  0:27 ` [PATCH 1/3] doc: mmiotrace.txt, buffer size control change Steven Rostedt
2009-01-09  0:27 ` [PATCH 2/3] trace: mmiotrace to the tracer menu in Kconfig Steven Rostedt
2009-01-09  0:27 ` [PATCH 3/3] mmiotrace: count events lost due to not recording Steven Rostedt
2009-01-09  1:10   ` Andrew Morton
2009-01-09  1:56     ` Steven Rostedt
2009-01-09 20:04 ` [PATCH 0/3] ftrace: updates for 2.6.29 Pekka Paalanen
2009-01-11  3:06 ` Ingo Molnar
2009-02-15 18:58   ` Pekka Paalanen
2009-02-15 19:07     ` Ingo Molnar

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