Re: [PATCH -tip tracing/kprobes 0/9] tracing/kprobes, perf: perf probe and kprobe-tracer bugfixes

From: Ashwin Chaugule
Date: Mon Oct 19 2009 - 19:10:15 EST


On Fri, Oct 16, 2009 at 8:07 PM, Masami Hiramatsu <mhiramat@xxxxxxxxxx> wrote:

>  arch/x86/lib/x86-opcode-map.txt         |   23 ++++-
>  kernel/trace/trace_kprobe.c             |   39 ++++++--
>  tools/perf/Documentation/perf-probe.txt |   48 ++++++++++
>  tools/perf/Makefile                     |    5 +
>  tools/perf/builtin-probe.c              |   70 ++++++---------
>  tools/perf/command-list.txt             |    1
>  tools/perf/util/probe-finder.c          |  149 ++++++++++++++-----------------
>  tools/perf/util/probe-finder.h          |   17 ----
>  tools/perf/util/util.h                  |    9 ++
>  9 files changed, 206 insertions(+), 155 deletions(-)
>  create mode 100644 tools/perf/Documentation/perf-probe.txt
>

Masami,
I really like your idea with kprobes ! I havent yet run
this stuff on my machine, but I've been planning to utilize kprobes
with perfevents too. Please let me know if the following functionality
is already possible with your patches.

The basic idea I had was to be able to profile any function in the
kernel using kprobes and use the perfevents framework to monitor
things like incorrect branch predictions, cache misses etc. for the
scope of that function. That way, we can fine tune kernel functions
that are in the hot path of kernel control flow, using gcc tricks,
inline assembly, or even architecture specific tricks.

Alternately, I think even dynamic trace could provide similar insight
with perfevents ? If none of this is already done, I plan to work on
this in my spare time and would like to team up with anyone else
interested.

Cheers,
Ashwin
--
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/