All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH tracing/kprobes 0/7] tracing/kprobes: kprobe-based event tracer update and perf support
@ 2009-09-10 23:52 Masami Hiramatsu
  2009-09-10 23:53 ` [PATCH tracing/kprobes 1/7] x86/ptrace: Fix regs_get_argument_nth() to add correct offset Masami Hiramatsu
                   ` (8 more replies)
  0 siblings, 9 replies; 55+ messages in thread
From: Masami Hiramatsu @ 2009-09-10 23:52 UTC (permalink / raw)
  To: Frederic Weisbecker, Steven Rostedt, Ingo Molnar, lkml
  Cc: Ananth N Mavinakayanahalli, Andi Kleen, Christoph Hellwig,
	Frank Ch. Eigler, H. Peter Anvin, Jason Baron, Jim Keniston,
	K.Prasad, Lai Jiangshan, Li Zefan, Peter Zijlstra,
	Srikar Dronamraju, Tom Zanussi, systemtap, DLE

Hi Frederic,

This series fixes bugs and upgrades kprobe-based event tracer
as a dynamic event tracer on ftrace/perf tools. This also enhances
tracer output format to show each argument name and event name on
each entry.

With this series, users can add trace events dynamically on ftrace
and use those events with perf tools as below.

(Step.1) Define new events under new group

$ echo p:mygroup/myprobe do_sys_open dfd=a0 filename=a1 flags=a2 mode=a3 \
 > /debug/tracing/kprobes_events
$ echo r:mygroup/myretprobe do_sys_open rv >> /debug/tracing/kprobes_events
$ cat /debug/tracing/kprobes_events
p:myprobe do_sys_open+0 dfd=a0 filename=a1 flags=a2 mode=a3
r:myretprobe do_sys_open+0 rv=rv

(You can see that each argument has its name.)


(Step.2) Perf shows new events

$ perf list
...
   mygroup:myretprobe                         [Tracepoint event]
   mygroup:myprobe                            [Tracepoint event]
...


(Step.3) Record events with perf

$ perf record -f -e mygroup:myprobe:record -F 1 -a ls
...
[ perf record: Captured and wrote 0.081 MB perf.data (~3544 samples) ]


(Step.4) Perf trace shows the result

$ perf trace
version = 0.5
            perf-1405  [000]     0.000000: myprobe: (c04b0a5c) dfd=ffffff9c filename=810d3f7 flags=98800 mode=1
            perf-1405  [000]     0.000000: myprobe: (c04b0a5c) dfd=ffffff9c filename=bff7650c flags=8000 mode=1b6
            perf-1405  [000]     0.000000: myprobe: (c04b0a5c) dfd=ffffff9c filename=bff7650c flags=98800 mode=bff7450c
            perf-1405  [000]     0.000000: myprobe: (c04b0a5c) dfd=ffffff9c filename=bff7650c flags=8000 mode=1b6


(Step.5) You can also use return probes.

$ perf record -f -e mygroup:myretprobe:record -F 1 -a ls
...
[ perf record: Captured and wrote 0.081 MB perf.data (~3544 samples) ]
$ perf trace
version = 0.5
            perf-1408  [000]     0.000000: myretprobe: (c04b0a5c <- c04b0b7d) rv=b
            perf-1408  [000]     0.000000: myretprobe: (c04b0a5c <- c04b0b7d) rv=c
            perf-1408  [000]     0.000000: myretprobe: (c04b0a5c <- c04b0b7d) rv=d
            perf-1408  [000]     0.000000: myretprobe: (c04b0a5c <- c04b0b7d) rv=c


TODO:
- Implement perf kprobe command to help defining new probes.


Thank you,

---

Masami Hiramatsu (7):
      tracing/kprobes: Support custom subsystem for each kprobe event
      tracing/kprobes: Show event name in trace output
      tracing/kprobes: Add argument name support
      tracing/kprobes: Add event profiling support
      tracing/kprobes: Cleanup kprobe tracer code.
      tracing/kprobes: Fix probe offset to be unsigned
      x86/ptrace: Fix regs_get_argument_nth() to add correct offset


 Documentation/trace/kprobetrace.txt |   65 +++---
 arch/x86/kernel/ptrace.c            |    2 
 kernel/trace/trace_kprobe.c         |  369 +++++++++++++++++++++++------------
 3 files changed, 274 insertions(+), 162 deletions(-)

-- 
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America), Inc.
Software Solutions Division

e-mail: mhiramat@redhat.com

^ permalink raw reply	[flat|nested] 55+ messages in thread

end of thread, other threads:[~2009-10-17 10:03 UTC | newest]

Thread overview: 55+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-10 23:52 [PATCH tracing/kprobes 0/7] tracing/kprobes: kprobe-based event tracer update and perf support Masami Hiramatsu
2009-09-10 23:53 ` [PATCH tracing/kprobes 1/7] x86/ptrace: Fix regs_get_argument_nth() to add correct offset Masami Hiramatsu
2009-09-11  1:43   ` Steven Rostedt
2009-10-17  9:59   ` [tip:perf/probes] " tip-bot for Masami Hiramatsu
2009-09-10 23:53 ` [PATCH tracing/kprobes 2/7] tracing/kprobes: Fix probe offset to be unsigned Masami Hiramatsu
2009-10-17  9:59   ` [tip:perf/probes] " tip-bot for Masami Hiramatsu
2009-09-10 23:53 ` [PATCH tracing/kprobes 3/7] tracing/kprobes: Cleanup kprobe tracer code Masami Hiramatsu
2009-09-11  2:33   ` Daniel Walker
2009-09-11  2:36     ` Frederic Weisbecker
2009-10-17  9:59   ` [tip:perf/probes] " tip-bot for Masami Hiramatsu
2009-09-10 23:53 ` [PATCH tracing/kprobes 4/7] tracing/kprobes: Add event profiling support Masami Hiramatsu
2009-09-11  3:12   ` Frederic Weisbecker
2009-09-11 16:22     ` Masami Hiramatsu
2009-09-14  3:02       ` Frederic Weisbecker
2009-09-14 16:54         ` Masami Hiramatsu
2009-09-14 18:55           ` Frederic Weisbecker
2009-09-14 19:36             ` Masami Hiramatsu
2009-09-14 21:07               ` Frederic Weisbecker
2009-09-15  4:52                 ` Ananth N Mavinakayanahalli
2009-09-11 19:30     ` Masami Hiramatsu
2009-09-14  3:08       ` Frederic Weisbecker
2009-09-13 10:07     ` [BUGFIX] kprobes: prevent re-registration of the same kprobe Ananth N Mavinakayanahalli
2009-09-14  1:47       ` Masami Hiramatsu
2009-09-14 10:04         ` [BUGFIX] kprobes: prevent re-registration of the same kprobe - take2 Ananth N Mavinakayanahalli
2009-09-14 16:25           ` Masami Hiramatsu
2009-09-15  5:13             ` Ananth N Mavinakayanahalli
2009-09-15 13:29               ` Masami Hiramatsu
2009-10-17 10:02               ` [tip:perf/probes] kprobes: Prevent re-registration of the same kprobe tip-bot for Ananth N Mavinakayanahalli
2009-10-17  9:59   ` [tip:perf/probes] tracing/kprobes: Add event profiling support tip-bot for Masami Hiramatsu
2009-09-10 23:53 ` [PATCH tracing/kprobes 5/7] tracing/kprobes: Add argument name support Masami Hiramatsu
2009-09-11 14:07   ` Steven Rostedt
2009-09-11 16:11     ` Masami Hiramatsu
2009-09-11 16:32       ` Masami Hiramatsu
2009-10-17 10:00   ` [tip:perf/probes] " tip-bot for Masami Hiramatsu
2009-09-10 23:53 ` [PATCH tracing/kprobes 6/7] tracing/kprobes: Show event name in trace output Masami Hiramatsu
2009-10-17 10:00   ` [tip:perf/probes] " tip-bot for Masami Hiramatsu
2009-09-10 23:53 ` [PATCH tracing/kprobes 7/7] tracing/kprobes: Support custom subsystem for each kprobe event Masami Hiramatsu
2009-10-17 10:00   ` [tip:perf/probes] " tip-bot for Masami Hiramatsu
2009-09-11  1:33 ` [PATCH tracing/kprobes 0/7] tracing/kprobes: kprobe-based event tracer update and perf support Frederic Weisbecker
2009-09-11  1:45   ` Steven Rostedt
2009-09-11 16:03   ` Masami Hiramatsu
2009-09-14  2:59     ` Frederic Weisbecker
2009-09-14 17:16       ` Masami Hiramatsu
2009-09-14 20:52         ` Frederic Weisbecker
2009-09-14 21:10           ` Masami Hiramatsu
2009-09-14 21:09             ` Frederic Weisbecker
2009-09-11 19:03   ` Frank Ch. Eigler
2009-09-11 19:06     ` Christoph Hellwig
2009-09-11 19:50       ` Mark Wielaard
2009-09-11 20:03         ` Christoph Hellwig
2009-09-12  1:23           ` Masami Hiramatsu
2009-09-11 19:15     ` Frederic Weisbecker
2009-09-11 15:36 ` Frederic Weisbecker
2009-09-11 21:48   ` Masami Hiramatsu
2009-09-14  2:22     ` Frederic Weisbecker

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.