lkml.org 
[lkml]   [2009]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
DateFri, 3 Apr 2009 13:51:00 +0200
FromIngo Molnar <>
SubjectRe: [PATCH 4/4] tracing/filters: use ring_buffer_discard_commit for discarded events

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

> > [ 240.462396] [<ffffffff802c843b>] trace_function+0xab/0xc0
>
> Oo, you have trace filters in trace_function. I'm not sure we want
> that. If we do, please make it a separate function register. That
> is, the function tracer is such a extreme hot path, that I would
> like to avoid as many branch conditionals as possible. With the
> dynamic function tracing, we can pick functions that do conditions
> when we want them, and we can pick those that do not. If you look
> at some of the register_ftrace_function callers, you will see
> where I've picked different functions to be called by the tracer
> depending on what the options are.

Actually, i like Tom's idea very much: as it allows pretty flexible
context based filtering - not just function based filtering.

So we could filter for:

- a specific PID

- or a pattern of ->comm strings ['bash' or 'sshd' or 'hackbench']

- or we could filter for non-zero preempt-counts
(i.e. critical sections only).

So this extends the function symbol based regexp mechanism in a
quite natural way, and it would be sad to not do this just because
it's ... arguably hard to implement robustly ;-)

The filter expression predicaments are pre-constructed and static at
the point of execution, so they rely on no external facility other
than some internal C code. So it should be possible to do this.

And if the tracepoint causes runtime overhead .. we need to optimize
that. We could register a different, filter-aware mcount callback
depending on whether there's any filter defined there.

Ingo


\
 
 \ /
  Last update: 2009-04-03 13:53    [from the cache]
©2003-2010