Re: [PATCH 0/2] ftrace: updates to tip




* Ingo Molnar <mingo@xxxxxxx> wrote:

I was afraid you would say that :-)

Yes, we could add something to do this. It would take some thought on
a good api, and implementation. This is not an easy task by any means.
We need a way to map between a function call and a tracer, where a
function call can call more than one tracer.

Note that some other things could be consolidated under per function
metadata: for example set_graph_function - which really is a per
function attribute too. Plus a lot of new things would be enabled i
think.

a few other things that could be per-function attributes:

- Using function trace 'limits': trace a function 50 times and dont trace
it afterwards. Each invocation of that function decreases the
remaining-count by one. For example:

echo 'btrfs_join_transaction:#2' >> set_ftrace_filter

Would specify that we generate two trace entries of
btrfs_join_transaction(), then stop tracing this function.

- Using function-triggered tracing: a function could be specified (via a
filter format extension) to act as a 'start tracing' trigger. Another
extension would be 'stop tracing' trigger.

For example:

echo 'btrfs_join_transaction:+' >> set_ftrace_filter
echo 'btrfs_commit_transaction:-' >> set_ftrace_filter

The '+' is a start-tracing trigger condition, the '-' is a stop-tracing
trigger condition. All function calls between btrfs_join_transaction()
and btrfs_commit_transaction() would be traced.

The two could be combined - to generate the trace of a single btrfs
transaction, one could do:

echo 0 > tracing_enabled
echo 'btrfs_join_transaction:+#1' >> set_ftrace_filter
echo 'btrfs_commit_transaction:-#1' >> set_ftrace_filter
echo 1 > tracing_enabled

Other extensions are possible too:

- Trace length triggers. For example one could do:

echo 'btrfs_join_transaction:+*#10' >> set_ftrace_filter

To trace 10 function calls [allowed by current filter settings] after
the first btrfs_join_transaction() call - and stop tracing after those
10 trace entries.

This would allow the creation of "surgical" one-time traces - of events
and functions one is specifically interested in.

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: [PATCH 0/2] ftrace: updates to tip
    ... then stop tracing this function. ... filter format extension) to act as a 'start tracing' trigger. ... The two could be combined - to generate the trace of a single btrfs ... Now we can register multiple functions to be called by a traced function, ...
    (Linux-Kernel)
  • Re: [PATCH 0/2] ftrace: updates to tip
    ... then stop tracing this function. ... filter format extension) to act as a 'start tracing' trigger. ... The two could be combined - to generate the trace of a single btrfs ... Now we can register multiple functions to be called by a traced function, ...
    (Linux-Kernel)
  • [GIT PULL] tracing/core for v2.6.32
    ... tracing: Remove mentioning of legacy latency_trace file from documentation ... Move sched event insertion helpers in the sched switch tracer file ... Undef TRACE_EVENT_FN between trace events headers inclusion ... tracing/events: add missing type info of dynamic arrays ...
    (Linux-Kernel)
  • Re: [PATCH 2/2] utrace-based ftrace "process" engine, v3
    ... Leave at 0 for system-wide tracing. ... Determine which process event traces are potentially desired. ... Examine trace. ... I would just need to apply the utrace changes first ...
    (Linux-Kernel)
  • Re: (Using Lab-Volt System) Have the books, how do I get a trace on my 465 Tektronix oscilloscop
    ... any scope will show 60Hz sort of sinewave ... Given a trace, it will merely allow ... won't get a display, and if the sweep is really fast, you may ... each time it receives a trigger voltage of suitable level. ...
    (sci.electronics.basics)

Loading