From: Ingo Molnar <mingo@elte.hu>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Steven Rostedt <rostedt@goodmis.org>,
Pekka Enberg <penberg@cs.helsinki.fi>
Subject: Re: [PATCH 1/2] tracing/ftrace: provide the base infrastructure for stat tracing
Date: Mon, 29 Dec 2008 12:56:45 +0100 [thread overview]
Message-ID: <20081229115645.GB22727@elte.hu> (raw)
In-Reply-To: <4956aff1.0405560a.0eb9.ffffd126@mx.google.com>
* Frederic Weisbecker <fweisbec@gmail.com> wrote:
> Impact: enhance the tracing API to provide statistical tracing
>
> The goal of this patch is to normalize and make more easy the
> implementation of statistical (histogram) tracing.
>
> It implements a trace_stat file into the /debugfs/tracing directory
> where one can print a one-shot output of statistics/histogram entries.
>
> A tracer has to provide two basic iterator callbacks:
>
> stat_start() => the first entry
> stat_next(prev, idx) => the next one.
>
> Note that it is adapted for arrays or hash tables or lists.... since
> it provides a pointer to the previous entry and the current index of the
> iterator.
>
> These two callbacks are called to get a snapshot of the statistics at
> each opening of the trace_stat file because. The values are so updated
> between two "cat trace_stat". And the tracer is free to lock its datas
> during the iteration to keep consistent values.
>
> Since it is almost always interesting to sort statisticals values to
> address the problems by priority, this infrastructure provides a
> "sorting" of the stat entries too if desired. A tracer has just to
> provide a stat_cmp callback to compare two entries and the stat tracing
> infrastructure will build a sorted list of the given entries.
>
> A last callback, called stat_headers, can be implemented by a tracer to
> output headers on its trace.
>
> If one of these callbacks is changed on runtime, it just have to signal
> it to the stat tracing API by calling the init_tracer_stat() helper.
>
> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
> ---
> kernel/trace/Makefile | 1 +
> kernel/trace/trace.c | 3 +-
> kernel/trace/trace.h | 17 +++
> kernel/trace/trace_stat.c | 250 +++++++++++++++++++++++++++++++++++++++++++++
> 4 files changed, 270 insertions(+), 1 deletions(-)
nice! I've put this into tip/tracing/ftrace (as it depends on Steve's
event hash rework) - and lets see how this works out with the branch
tracer in practice.
Ingo
next prev parent reply other threads:[~2008-12-29 11:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-27 21:42 Frederic Weisbecker
2008-12-27 22:55 ` Frédéric Weisbecker
2008-12-29 11:56 ` Ingo Molnar [this message]
2009-01-05 16:06 ` Steven Rostedt
2009-01-05 16:57 ` Frédéric Weisbecker
2009-01-05 17:04 ` Steven Rostedt
2009-01-06 0:33 ` Frederic Weisbecker
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=20081229115645.GB22727@elte.hu \
--to=mingo@elte.hu \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=penberg@cs.helsinki.fi \
--cc=rostedt@goodmis.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®