All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: Re: [PATCH 00/18] tracing/ring-buffer: fixes for latency tracer [2.6.32]
Date: Sun, 6 Sep 2009 06:19:46 +0200	[thread overview]
Message-ID: <20090906041946.GA18071@elte.hu> (raw)
In-Reply-To: <20090904235527.520961911@goodmis.org>


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

> Finally (something I should have realized from day 1, not 4 days 
> later) I realized I already had a marker. The latency tracers 
> always record the timestamp of when the trace began. I can simply 
> ignore any trace event that happened before that timestamp. This 
> ended up working out very well. The code is quite simple and 
> solid.

Yes - that trick came from the original latency tracer and i added 
it for that purpose.

The flip side is that if there's anything wrong with timestamps 
(and this does happen frequently as well) we suddenly have an empty 
trace and no explanation about what happened.

>   git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
> tip/tracing/core
> 
> 
> Steven Rostedt (18):
>       ring-buffer: do not reset while in a commit
>       ring-buffer: do not swap buffers during a commit
>       ring-buffer: remove unnecessary cpu_relax
>       ring-buffer: fix ring_buffer_read crossing pages
>       ring-buffer: remove ring_buffer_event_discard
>       ring-buffer: do not count discarded events
>       ring-buffer: disable all cpu buffers when one finds a problem
>       tracing: print out start and stop in latency traces
>       tracing: disable update max tracer while reading trace
>       tracing: disable buffers and synchronize_sched before resetting
>       tracing: remove users of tracing_reset
>       tracing: use timestamp to determine start of latency traces
>       tracing: make tracing_reset safe for external use
>       tracing: pass around ring buffer instead of tracer
>       tracing: add trace_array_printk for internal tracers to use
>       tracing: report error in trace if we fail to swap latency buffer
>       ring-buffer: check for swapped buffers in start of committing
>       ring-buffer: only enable ring_buffer_swap_cpu when needed
> 
> ----
>  include/linux/ftrace_event.h         |   15 ++-
>  include/linux/ring_buffer.h          |   23 +--
>  include/trace/ftrace.h               |   15 ++-
>  kernel/trace/Kconfig                 |    8 +
>  kernel/trace/blktrace.c              |   12 +-
>  kernel/trace/kmemtrace.c             |    4 +-
>  kernel/trace/ring_buffer.c           |  172 +++++++++++++-------
>  kernel/trace/trace.c                 |  297 ++++++++++++++++++++++++----------
>  kernel/trace/trace.h                 |   26 ++--
>  kernel/trace/trace_boot.c            |   16 +-
>  kernel/trace/trace_events.c          |    6 +-
>  kernel/trace/trace_functions_graph.c |   14 +-
>  kernel/trace/trace_irqsoff.c         |    3 +-
>  kernel/trace/trace_mmiotrace.c       |   10 +-
>  kernel/trace/trace_power.c           |   22 ++-
>  kernel/trace/trace_sched_switch.c    |   18 ++-
>  kernel/trace/trace_sched_wakeup.c    |    7 +-
>  kernel/trace/trace_syscalls.c        |   18 ++-
>  18 files changed, 444 insertions(+), 242 deletions(-)

Pulled, thanks a lot Steve!

We should also think about how to expose the function tracer, and 
in particular latency tracing functionality, via perf.

The most natural approach would be to expose it as a 'generic 
event' - and simply stream function tracing events as they happen.

The latency tracer itself could be exposed either as a generic 
event, or as a software counter. The difference there is that it 
needs a per counter 'max latency' state that controls whether a new 
trace is sent down the pipe.

This would allow very flexible tooling: for example one could do a 
dump of the maximum latency a particular workflow experiences [in a 
scheduling invariant manner] - without having to trace the full 
system. I.e. individual apps could be validated separately and 
latency impact on individual apps could be tracked more accurately 
as well.

(beyond the other usecases such as tracking cache-miss rates in 
addition to latencies - this would allow the observation of 
worst-case cachemisses correlating with large latencies, etc.)

Steve, Frederic, does any of you have interest (and time ;-) to 
look into that? It should probably have its own tooling variant, 
not be part of 'perf trace' per se (which is the generic tracing 
tool).
 
'perf latencytrace' or so - because latency tracing has its own 
special needs (for the same reason do we have a separate latency 
tracer ftrace plugin).

	Ingo

      parent reply	other threads:[~2009-09-06  4:20 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-04 23:55 [PATCH 00/18] tracing/ring-buffer: fixes for latency tracer [2.6.32] Steven Rostedt
2009-09-04 23:55 ` [PATCH 01/18] ring-buffer: do not reset while in a commit Steven Rostedt
2009-09-04 23:55 ` [PATCH 02/18] ring-buffer: do not swap buffers during " Steven Rostedt
2009-09-04 23:55 ` [PATCH 03/18] ring-buffer: remove unnecessary cpu_relax Steven Rostedt
2009-09-04 23:55 ` [PATCH 04/18] ring-buffer: fix ring_buffer_read crossing pages Steven Rostedt
2009-09-04 23:55 ` [PATCH 05/18] ring-buffer: remove ring_buffer_event_discard Steven Rostedt
2009-09-04 23:55 ` [PATCH 06/18] ring-buffer: do not count discarded events Steven Rostedt
2009-09-04 23:55 ` [PATCH 07/18] ring-buffer: disable all cpu buffers when one finds a problem Steven Rostedt
2009-09-04 23:55 ` [PATCH 08/18] tracing: print out start and stop in latency traces Steven Rostedt
2009-09-04 23:55 ` [PATCH 09/18] tracing: disable update max tracer while reading trace Steven Rostedt
2009-09-04 23:55 ` [PATCH 10/18] tracing: disable buffers and synchronize_sched before resetting Steven Rostedt
2009-09-04 23:55 ` [PATCH 11/18] tracing: remove users of tracing_reset Steven Rostedt
2009-09-04 23:55 ` [PATCH 12/18] tracing: use timestamp to determine start of latency traces Steven Rostedt
2009-09-04 23:55 ` [PATCH 13/18] tracing: make tracing_reset safe for external use Steven Rostedt
2009-09-04 23:55 ` [PATCH 14/18] tracing: pass around ring buffer instead of tracer Steven Rostedt
2009-09-04 23:55 ` [PATCH 15/18] tracing: add trace_array_printk for internal tracers to use Steven Rostedt
2009-09-04 23:55 ` [PATCH 16/18] tracing: report error in trace if we fail to swap latency buffer Steven Rostedt
2009-09-04 23:55 ` [PATCH 17/18] ring-buffer: check for swapped buffers in start of committing Steven Rostedt
2009-09-04 23:55 ` [PATCH 18/18] ring-buffer: only enable ring_buffer_swap_cpu when needed Steven Rostedt
2009-09-05 15:06 ` [PATCH 00/18] tracing/ring-buffer: fixes for latency tracer [2.6.32] Arnaldo Carvalho de Melo
2009-09-07 10:20   ` Jan Blunck
2009-09-07 10:20     ` Jan Blunck
2009-09-07 10:28     ` Frederic Weisbecker
2009-09-07 10:41       ` Jan Blunck
2009-09-07 11:22         ` Frederic Weisbecker
2009-09-08 14:42     ` Jan Blunck
2009-09-08 14:42       ` Jan Blunck
2009-09-08 15:39       ` Steven Rostedt
2009-09-08 15:39         ` Steven Rostedt
2009-09-06  4:19 ` Ingo Molnar [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090906041946.GA18071@elte.hu \
    --to=mingo@elte.hu \
    --cc=acme@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.