[PATCH -tip v7 4/6] kprobes: cleanup fix_riprel() using insn decoder on x86

2009-05-22 Thread Masami Hiramatsu
Cleanup fix_riprel() in arch/x86/kernel/kprobes.c by using x86 instruction decoder. Signed-off-by: Masami Hiramatsu Cc: Ananth N Mavinakayanahalli Cc: Jim Keniston Cc: Ingo Molnar --- arch/x86/kernel/kprobes.c | 128 - 1 files changed, 23

[PATCH -tip v7 3/6] kprobes: checks probe address is instruction boudary on x86

2009-05-22 Thread Masami Hiramatsu
-off-by: Masami Hiramatsu Cc: Ananth N Mavinakayanahalli Cc: Jim Keniston Cc: Ingo Molnar --- arch/x86/kernel/kprobes.c | 69 + 1 files changed, 69 insertions(+), 0 deletions(-) diff --git a/arch/x86/kernel/kprobes.c b/arch/x86/kernel/kprobes.c

[PATCH -tip v7 5/6] x86: add pt_regs register and stack access APIs

2009-05-22 Thread Masami Hiramatsu
truct pt_regs *reg, unsigned nth) Get Nth argument at function call. (N >= 0) Changes from v5: - Rename valid_stack_address to within_kernel_stack. - Rename get_stack_nth to get_kernel_stack_nth. Signed-off-by: Masami Hiramatsu Cc: Steven Rostedt Cc: Ananth N Mavinakayanahalli Cc: Ingo Moln

[PATCH -tip v7 1/6] x86: instruction decoder API

2009-05-22 Thread Masami Hiramatsu
: - fix patch title. Signed-off-by: Masami Hiramatsu Signed-off-by: Jim Keniston Cc: H. Peter Anvin Cc: Steven Rostedt Cc: Ananth N Mavinakayanahalli Cc: Ingo Molnar Cc: Frederic Weisbecker Cc: Andi Kleen Cc: Vegard Nossum Cc: Avi Kivity Cc: Przemysław Pawełczyk --- arch/x86/include/asm

[PATCH -tip v7 2/6] x86: x86 instruction decoder build-time selftest

2009-05-22 Thread Masami Hiramatsu
are no differences. Signed-off-by: Masami Hiramatsu Signed-off-by: Jim Keniston Cc: H. Peter Anvin Cc: Steven Rostedt Cc: Ananth N Mavinakayanahalli Cc: Ingo Molnar Cc: Frederic Weisbecker Cc: Andi Kleen Cc: Vegard Nossum Cc: Avi Kivity Cc: Przemysław Pawełczyk Cc: Sam Ravnborg

[PATCH -tip v7 6/6] tracing: add kprobe-based event tracer

2009-05-22 Thread Masami Hiramatsu
upport patch. - Add kprobe_trace_entry and kretprobe_trace_entry for recording kprobe events. - Support common arguments filtering via tracing/events/ftrace/kprobe(or kretprobe)/filter. - Add a selftest. Signed-off-by: Masami Hiramatsu Cc: Christoph Hellwig Cc: Steven Rostedt Cc: An

[PATCH -tip v7 0/6] tracing: kprobe-based event tracer and x86 instruction decoder

2009-05-22 Thread Masami Hiramatsu
1b/0x1d <-do_sys_open: 0x3 0x81367a3a Each line shows when the kernel hits a probe, and <- SYMBOL means kernel returns from SYMBOL(e.g. "sys_open+0x1b/0x1d <- do_sys_open" means kernel returns from do_sys_open to sys_open+0x1b). Thank you, --- Masami Hiramatsu (6

[PATCH -tip v8 6/7] tracing: ftrace dynamic ftrace_event_call support

2009-05-28 Thread Masami Hiramatsu
: Masami Hiramatsu Cc: Steven Rostedt Cc: Ingo Molnar Cc: Tom Zanussi Cc: Frederic Weisbecker --- include/linux/ftrace_event.h | 13 ++ include/trace/ftrace.h | 22 + kernel/trace/trace_events.c | 54 +- kernel/trace

[PATCH -tip v8 3/7] kprobes: checks probe address is instruction boudary on x86

2009-05-28 Thread Masami Hiramatsu
Ensure safeness of inserting kprobes by checking whether the specified address is at the first byte of a instruction on x86. This is done by decoding probed function from its head to the probe point. Signed-off-by: Masami Hiramatsu Cc: Ananth N Mavinakayanahalli Cc: Jim Keniston Cc: Ingo

[PATCH -tip v8 5/7] x86: add pt_regs register and stack access APIs

2009-05-28 Thread Masami Hiramatsu
truct pt_regs *reg, unsigned nth) Get Nth argument at function call. (N >= 0) Signed-off-by: Masami Hiramatsu Cc: Steven Rostedt Cc: Ananth N Mavinakayanahalli Cc: Ingo Molnar Cc: Frederic Weisbecker Cc: Roland McGrath --- arch/x86/include/asm

[PATCH -tip v8 2/7] x86: x86 instruction decoder build-time selftest

2009-05-28 Thread Masami Hiramatsu
are no differences. Changes from v7: - Add data, addr, rep, lock prefixes to skip instructions list. - Add license comments. Signed-off-by: Masami Hiramatsu Signed-off-by: Jim Keniston Cc: H. Peter Anvin Cc: Steven Rostedt Cc: Ananth N Mavinakayanahalli Cc: Ingo Molnar Cc: Frederic Weisbecker

[PATCH -tip v8 4/7] kprobes: cleanup fix_riprel() using insn decoder on x86

2009-05-28 Thread Masami Hiramatsu
Cleanup fix_riprel() in arch/x86/kernel/kprobes.c by using x86 instruction decoder. Signed-off-by: Masami Hiramatsu Cc: Ananth N Mavinakayanahalli Cc: Jim Keniston Cc: Ingo Molnar --- arch/x86/kernel/kprobes.c | 128 - 1 files changed, 23

[PATCH -tip v8 1/7] x86: instruction decoder API

2009-05-28 Thread Masami Hiramatsu
: - fix patch title. Signed-off-by: Masami Hiramatsu Signed-off-by: Jim Keniston Cc: H. Peter Anvin Cc: Steven Rostedt Cc: Ananth N Mavinakayanahalli Cc: Ingo Molnar Cc: Frederic Weisbecker Cc: Andi Kleen Cc: Vegard Nossum Cc: Avi Kivity Cc: Przemysław Pawełczyk --- arch/x86/include/asm

[PATCH -tip v8 0/7] tracing: kprobe-based event tracer and x86 instruction decoder

2009-05-28 Thread Masami Hiramatsu
38282.286969: do_sys_open+0x0/0xd6: 0xff9c 0x4041c6 0x98800 0x10 <...>-1447 [001] 1038282.286976: sys_open+0x1b/0x1d <- do_sys_open: 0x3 0x81367a3a Each line shows when the kernel hits a probe, and <- SYMBOL means kernel returns from SYMBOL(e.g. "sys_op

[PATCH -tip v8 7/7] tracing: add kprobe-based event tracer

2009-05-28 Thread Masami Hiramatsu
vent Tracer + = + + Documentation is written by Masami Hiramatsu + + +Overview + +This tracer is similar to the events tracer which is based on Tracepoint +infrastructure. Instead of Tracepoint, this tracer is based on kprobes(kprobe +and kretprobe). It probes anywhere where kprobes can

Re: [PATCH -tip v8 7/7] tracing: add kprobe-based event tracer

2009-05-30 Thread Masami Hiramatsu
Steven Rostedt wrote: > > > On Thu, 28 May 2009, Masami Hiramatsu wrote: > >> +#undef SHOW_FIELD >> +#define SHOW_FIELD(type, item, name) >> \ >> +do {\ &g

Re: [PATCH -tip v8 7/7] tracing: add kprobe-based event tracer

2009-05-30 Thread Masami Hiramatsu
Christoph Hellwig wrote: > On Thu, May 28, 2009 at 08:03:53PM -0400, Masami Hiramatsu wrote: >> Add kprobes-based event tracer on ftrace. > > Wouldn't it make more sense to call this the dynamic event tracer? > > The use of kprobes is more an implementation detail than

Re: [PATCH -tip v8 5/7] x86: add pt_regs register and stack access APIs

2009-05-30 Thread Masami Hiramatsu
return regs->ax; > case 1: > return regs->dx; > case 2: > return regs->cx; > } Oops, thanks, > >> +#define REG_OFFSET(r) offsetof(struct pt_regs, r) >> +#define

Re: [PATCH -tip v8 0/7] tracing: kprobe-based event tracer and x86 instruction decoder

2009-05-31 Thread Masami Hiramatsu
rom dwarf register mapping.) So, below command adds probe at fs/open.c:1024 and trace 'files' variable :-) $ echo p _stext+0xd1f72 %r12 > /debug/tracing/kprobe_events Thank you, -- Masami Hiramatsu Software Engineer Hitachi Computer Products (America) Inc. Software Solutions Div

[PATCH -tip v9 1/7] x86: instruction decoder API

2009-06-01 Thread Masami Hiramatsu
: - fix patch title. Signed-off-by: Masami Hiramatsu Signed-off-by: Jim Keniston Cc: H. Peter Anvin Cc: Steven Rostedt Cc: Ananth N Mavinakayanahalli Cc: Ingo Molnar Cc: Frederic Weisbecker Cc: Andi Kleen Cc: Vegard Nossum Cc: Avi Kivity Cc: Przemysław Pawełczyk --- arch/x86/include/asm

[PATCH -tip v9 0/7] tracing: kprobe-based event tracer and x86 instruction decoder

2009-06-01 Thread Masami Hiramatsu
: sys_open+0x1b/0x1d <- do_sys_open: 0x3 0x81367a3a Each line shows when the kernel hits a probe, and <- SYMBOL means kernel returns from SYMBOL(e.g. "sys_open+0x1b/0x1d <- do_sys_open" means kernel returns from do_sys_open to sys_open+0x1b). Thank you, --- Masami Hira

[PATCH -tip v9 6/7] tracing: ftrace dynamic ftrace_event_call support

2009-06-01 Thread Masami Hiramatsu
: - Lock event_mutex in trace_add/remove_event_call(). - Add __trace_add/remove_event_call() for internal use. - Rename "dummy" variables to "unused". Signed-off-by: Masami Hiramatsu Cc: Steven Rostedt Cc: Ingo Molnar Cc: Tom Zanussi Cc: Frederic Weisbecker --- include/

[PATCH -tip v9 4/7] kprobes: cleanup fix_riprel() using insn decoder on x86

2009-06-01 Thread Masami Hiramatsu
Cleanup fix_riprel() in arch/x86/kernel/kprobes.c by using x86 instruction decoder. Signed-off-by: Masami Hiramatsu Cc: Ananth N Mavinakayanahalli Cc: Jim Keniston Cc: Ingo Molnar --- arch/x86/kernel/kprobes.c | 128 - 1 files changed, 23

[PATCH -tip v9 2/7] x86: x86 instruction decoder build-time selftest

2009-06-01 Thread Masami Hiramatsu
are no differences. Changes from v7: - Add data, addr, rep, lock prefixes to skip instructions list. - Add license comments. Signed-off-by: Masami Hiramatsu Signed-off-by: Jim Keniston Cc: H. Peter Anvin Cc: Steven Rostedt Cc: Ananth N Mavinakayanahalli Cc: Ingo Molnar Cc: Frederic Weisbecker

[PATCH -tip v9 5/7] x86: add pt_regs register and stack access APIs

2009-06-01 Thread Masami Hiramatsu
k. (N >= 0) - regs_get_argument_nth(struct pt_regs *reg, unsigned nth) Get Nth argument at function call. (N >= 0) Changes from v8: - Add regs_ prefix to the APIs - Add kerneldoc comments. - Cleanup regs_get_argument_nth() code. - Remove REG_OFFSET macro. Signed-off-by: Masami Hiramatsu Cc: Chris

[PATCH -tip v9 7/7] tracing: add kprobe-based event tracer

2009-06-01 Thread Masami Hiramatsu
fig. - Fix debugfs file path. Signed-off-by: Masami Hiramatsu Cc: Christoph Hellwig Cc: Steven Rostedt Cc: Ananth N Mavinakayanahalli Cc: Ingo Molnar Cc: Frederic Weisbecker Cc: Tom Zanussi --- Documentation/trace/kprobes.txt | 138 kernel/trace/Kconfig | 11 k

[PATCH -tip v9 3/7] kprobes: checks probe address is instruction boudary on x86

2009-06-01 Thread Masami Hiramatsu
Ensure safeness of inserting kprobes by checking whether the specified address is at the first byte of a instruction on x86. This is done by decoding probed function from its head to the probe point. Signed-off-by: Masami Hiramatsu Cc: Ananth N Mavinakayanahalli Cc: Jim Keniston Cc: Ingo

[RESEND][ PATCH -tip -v9 2/7] x86: x86 instruction decoder build-time selftest

2009-06-12 Thread Masami Hiramatsu
are no differences. Signed-off-by: Masami Hiramatsu Signed-off-by: Jim Keniston Cc: H. Peter Anvin Cc: Steven Rostedt Cc: Ananth N Mavinakayanahalli Cc: Srikar Dronamraju Cc: Ingo Molnar Cc: Frederic Weisbecker Cc: Andi Kleen Cc: Vegard Nossum Cc: Avi Kivity Cc: Przemysław Pawełczyk Cc

[RESEND][ PATCH -tip -v9 3/7] kprobes: checks probe address is instruction boudary on x86

2009-06-12 Thread Masami Hiramatsu
Ensure safeness of inserting kprobes by checking whether the specified address is at the first byte of a instruction on x86. This is done by decoding probed function from its head to the probe point. Signed-off-by: Masami Hiramatsu Acked-by: Ananth N Mavinakayanahalli Cc: Jim Keniston Cc: Ingo

[RESEND][ PATCH -tip -v9 1/7] x86: instruction decoder API

2009-06-12 Thread Masami Hiramatsu
: Masami Hiramatsu Signed-off-by: Jim Keniston Cc: H. Peter Anvin Cc: Steven Rostedt Cc: Ananth N Mavinakayanahalli Cc: Srikar Dronamraju Cc: Ingo Molnar Cc: Frederic Weisbecker Cc: Andi Kleen Cc: Vegard Nossum Cc: Avi Kivity Cc: Przemysław Pawełczyk --- arch/x86/include/asm/inat.h

[RESEND][ PATCH -tip -v9 5/7] x86: add pt_regs register and stack access APIs

2009-06-12 Thread Masami Hiramatsu
k. (N >= 0) - regs_get_argument_nth(struct pt_regs *reg, unsigned nth) Get Nth argument at function call. (N >= 0) Signed-off-by: Masami Hiramatsu Cc: Christoph Hellwig Cc: Steven Rostedt Cc: Ananth N Mavinakayanahalli Cc: Ingo Molnar Cc: Frederic Weisbecker Cc: Roland McGrath Cc: linux-a...

[RESEND][ PATCH -tip -v9 7/7] tracing: add kprobe-based event tracer

2009-06-12 Thread Masami Hiramatsu
argument. (N >= 0) rv: Fetch return value. ra: Fetch return address. +|-offs(FETCHARG) : fetch memory at FETCHARG +|- offs address. See Documentation/trace/kprobes.txt for details. Signed-off-by: Masami Hiramatsu Acked-by: Ananth N Mavinakayanahalli Cc: Christoph Hellwig

[RESEND][ PATCH -tip -v9 0/7] tracing: kprobe-based event tracer and x86 instruction decoder

2009-06-12 Thread Masami Hiramatsu
x4041c6 0x98800 0x10 <...>-1447 [001] 1038282.286976: sys_open+0x1b/0x1d <- do_sys_open: 0x3 0x81367a3a Each line shows when the kernel hits a probe, and <- SYMBOL means kernel returns from SYMBOL(e.g. "sys_open+0x1b/0x1d <- do_sys_open" means kernel r

[RESEND][ PATCH -tip -v9 6/7] tracing: ftrace dynamic ftrace_event_call support

2009-06-12 Thread Masami Hiramatsu
: Masami Hiramatsu Cc: Steven Rostedt Cc: Ingo Molnar Cc: Tom Zanussi Cc: Frederic Weisbecker --- include/linux/ftrace_event.h | 13 +--- include/trace/ftrace.h | 22 +++-- kernel/trace/trace_events.c | 70 -- kernel/trace

[RESEND][ PATCH -tip -v9 4/7] kprobes: cleanup fix_riprel() using insn decoder on x86

2009-06-12 Thread Masami Hiramatsu
Cleanup fix_riprel() in arch/x86/kernel/kprobes.c by using x86 instruction decoder. Signed-off-by: Masami Hiramatsu Cc: Ananth N Mavinakayanahalli Cc: Jim Keniston Cc: Ingo Molnar --- arch/x86/kernel/kprobes.c | 128 - 1 files changed, 23

[PATCH -tip -v10 2/7] x86: x86 instruction decoder build-time selftest

2009-06-30 Thread Masami Hiramatsu
are no differences. Signed-off-by: Masami Hiramatsu Signed-off-by: Jim Keniston Cc: H. Peter Anvin Cc: Steven Rostedt Cc: Ananth N Mavinakayanahalli Cc: Srikar Dronamraju Cc: Ingo Molnar Cc: Frederic Weisbecker Cc: Andi Kleen Cc: Vegard Nossum Cc: Avi Kivity Cc: Przemysław Pawełczyk Cc

[PATCH -tip -v10 5/7] x86: add pt_regs register and stack access APIs

2009-06-30 Thread Masami Hiramatsu
k. (N >= 0) - regs_get_argument_nth(struct pt_regs *reg, unsigned nth) Get Nth argument at function call. (N >= 0) Changes from v9: -Fix a typo in a comment. Signed-off-by: Masami Hiramatsu Cc: Christoph Hellwig Cc: Steven Rostedt Cc: Ananth N Mavinakayanahalli Cc: Ingo Molnar Cc: Frederic Weisbe

[PATCH -tip -v10 6/7] tracing: ftrace dynamic ftrace_event_call support

2009-06-30 Thread Masami Hiramatsu
: Masami Hiramatsu Cc: Steven Rostedt Cc: Ingo Molnar Cc: Tom Zanussi Cc: Frederic Weisbecker --- include/linux/ftrace_event.h | 13 +--- include/trace/ftrace.h | 22 +++-- kernel/trace/trace_events.c | 70 -- kernel/trace

[PATCH -tip -v10 3/7] kprobes: checks probe address is instruction boudary on x86

2009-06-30 Thread Masami Hiramatsu
Ensure safeness of inserting kprobes by checking whether the specified address is at the first byte of a instruction on x86. This is done by decoding probed function from its head to the probe point. Signed-off-by: Masami Hiramatsu Acked-by: Ananth N Mavinakayanahalli Cc: Jim Keniston Cc: Ingo

[PATCH -tip -v10 4/7] kprobes: cleanup fix_riprel() using insn decoder on x86

2009-06-30 Thread Masami Hiramatsu
Cleanup fix_riprel() in arch/x86/kernel/kprobes.c by using x86 instruction decoder. Signed-off-by: Masami Hiramatsu Cc: Ananth N Mavinakayanahalli Cc: Jim Keniston Cc: Ingo Molnar --- arch/x86/kernel/kprobes.c | 128 - 1 files changed, 23

[PATCH -tip -v10 0/7] tracing: kprobe-based event tracer and x86 instruction decoder

2009-06-30 Thread Masami Hiramatsu
Each line shows when the kernel hits a probe, and <- SYMBOL means kernel returns from SYMBOL(e.g. "sys_open+0x1b/0x1d <- do_sys_open" means kernel returns from do_sys_open to sys_open+0x1b). Thank you, --- Masami Hiramatsu (7): tracing: add kprobe-based event tracer

[PATCH -tip -v10 1/7] x86: instruction decoder API

2009-06-30 Thread Masami Hiramatsu
: Masami Hiramatsu Signed-off-by: Jim Keniston Acked-by: H. Peter Anvin Cc: Steven Rostedt Cc: Ananth N Mavinakayanahalli Cc: Srikar Dronamraju Cc: Ingo Molnar Cc: Frederic Weisbecker Cc: Andi Kleen Cc: Vegard Nossum Cc: Avi Kivity Cc: Przemysław Pawełczyk --- arch/x86/include/asm/inat.h

[PATCH -tip -v10 7/7] tracing: add kprobe-based event tracer

2009-06-30 Thread Masami Hiramatsu
argument. (N >= 0) rv: Fetch return value. ra: Fetch return address. +|-offs(FETCHARG) : fetch memory at FETCHARG +|- offs address. See Documentation/trace/kprobes.txt for details. Changes from v9: - Select CONFIG_GENERIC_TRACER when CONFIG_KPROBE_TRACER=y. Signed-off-by: Masam

Re: [PATCH -tip -v10 5/7] x86: add pt_regs register and stack access APIs

2009-07-06 Thread Masami Hiramatsu
Andi Kleen wrote: > Masami Hiramatsu writes: > >> Add following APIs for accessing registers and stack entries from pt_regs. > > You forgot to state who calls these functions/why are they added? > Who only has strings for registers? Oh, yes. This patch is needed for kprob

[PATCH -tip -v10 5/7] x86: add pt_regs register and stack access APIs

2009-07-06 Thread Masami Hiramatsu
Andi Kleen wrote: > On Mon, Jul 06, 2009 at 03:28:02PM -0400, Masami Hiramatsu wrote: >> I'm not so sure about your idea. >> Would you mean below code? >> >> int offs_table[NR_REGPARMS] = { > > not REGPARMS of course > >> [0] = offsetof(

Re: [PATCH -tip -v10 7/7] tracing: add kprobe-based event tracer

2009-07-07 Thread Masami Hiramatsu
, func) >> +TRACE_FIELD(unsigned long, ret_ip, ret_ip) >> +TRACE_FIELD(int, nargs, nargs) >> +TRACE_FIELD_SPECIAL(unsigned long args[TRACE_KPROBE_ARGS], >> +args, TRACE_KPROBE_ARGS, args) >> +

Re: [PATCH -tip -v10 7/7] tracing: add kprobe-based event tracer

2009-07-07 Thread Masami Hiramatsu
Frederic Weisbecker wrote: > On Tue, Jul 07, 2009 at 03:55:28PM -0400, Masami Hiramatsu wrote: >> Frederic Weisbecker wrote: >>>> diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h >>>> index 206cb7d..65945eb 100644 >>>> --- a/kernel/

Re: [PATCH -tip -v10 7/7] tracing: add kprobe-based event tracer

2009-07-07 Thread Masami Hiramatsu
Frederic Weisbecker wrote: > On Tue, Jul 07, 2009 at 04:42:32PM -0400, Masami Hiramatsu wrote: >> Frederic Weisbecker wrote: >>> On Tue, Jul 07, 2009 at 03:55:28PM -0400, Masami Hiramatsu wrote: >>>> Frederic Weisbecker wrote: >>>>>> diff --g

Re: [PATCH -tip -v10 7/7] tracing: add kprobe-based event tracer

2009-07-07 Thread Masami Hiramatsu
Frederic Weisbecker wrote: > On Tue, Jul 07, 2009 at 05:31:25PM -0400, Masami Hiramatsu wrote: >> Frederic Weisbecker wrote: >>> On Tue, Jul 07, 2009 at 04:42:32PM -0400, Masami Hiramatsu wrote: >>>> Frederic Weisbecker wrote: >>>>> On Tue, Jul 07, 200

Re: [PATCH -tip -v10 7/7] tracing: add kprobe-based event tracer

2009-07-07 Thread Masami Hiramatsu
Masami Hiramatsu wrote: > Frederic Weisbecker wrote: >> On Tue, Jul 07, 2009 at 05:31:25PM -0400, Masami Hiramatsu wrote: >>> Frederic Weisbecker wrote: >>>> On Tue, Jul 07, 2009 at 04:42:32PM -0400, Masami Hiramatsu wrote: >>>>> Frederic Weisbecker wro

[PATCH -tip -v11 03/11] kprobes: checks probe address is instruction boudary on x86

2009-07-09 Thread Masami Hiramatsu
Ensure safeness of inserting kprobes by checking whether the specified address is at the first byte of a instruction on x86. This is done by decoding probed function from its head to the probe point. Signed-off-by: Masami Hiramatsu Acked-by: Ananth N Mavinakayanahalli Cc: Jim Keniston Cc: Ingo

[PATCH -tip -v11 06/11] tracing: ftrace dynamic ftrace_event_call support

2009-07-09 Thread Masami Hiramatsu
: Masami Hiramatsu Acked-by: Frederic Weisbecker Cc: Steven Rostedt Cc: Ingo Molnar Cc: Tom Zanussi --- include/linux/ftrace_event.h | 13 +--- include/trace/ftrace.h | 22 +++-- kernel/trace/trace_events.c | 70 -- kernel/trace

[PATCH -tip -v11 04/11] kprobes: cleanup fix_riprel() using insn decoder on x86

2009-07-09 Thread Masami Hiramatsu
Cleanup fix_riprel() in arch/x86/kernel/kprobes.c by using x86 instruction decoder. Signed-off-by: Masami Hiramatsu Cc: Ananth N Mavinakayanahalli Cc: Jim Keniston Cc: Ingo Molnar --- arch/x86/kernel/kprobes.c | 128 - 1 files changed, 23

[PATCH -tip -v11 01/11] x86: instruction decoder API

2009-07-09 Thread Masami Hiramatsu
: Masami Hiramatsu Signed-off-by: Jim Keniston Acked-by: H. Peter Anvin Cc: Steven Rostedt Cc: Ananth N Mavinakayanahalli Cc: Srikar Dronamraju Cc: Ingo Molnar Cc: Frederic Weisbecker Cc: Andi Kleen Cc: Vegard Nossum Cc: Avi Kivity Cc: Przemysław Pawełczyk --- arch/x86/include/asm/inat.h

[PATCH -tip -v11 05/11] x86: add pt_regs register and stack access APIs

2009-07-09 Thread Masami Hiramatsu
get_argument_nth(). - Use "unsigned int" instead of "unsigned". Signed-off-by: Masami Hiramatsu Reviewed-by: Frederic Weisbecker Cc: Andi Kleen Cc: Christoph Hellwig Cc: Steven Rostedt Cc: Ananth N Mavinakayanahalli Cc: Ingo Molnar Cc: Frederic Weisbecker Cc: Rolan

[PATCH -tip -v11 07/11] tracing: Introduce TRACE_FIELD_ZERO() macro

2009-07-09 Thread Masami Hiramatsu
Use TRACE_FIELD_ZERO(type, item) instead of TRACE_FIELD_ZERO_CHAR(item). This also includes a fix of TRACE_ZERO_CHAR() macro. Signed-off-by: Masami Hiramatsu Cc: Steven Rostedt Cc: Ingo Molnar Cc: Tom Zanussi Cc: Frederic Weisbecker --- kernel/trace/trace_event_types.h |4 ++-- kernel

[PATCH -tip -v11 02/11] x86: x86 instruction decoder build-time selftest

2009-07-09 Thread Masami Hiramatsu
are no differences. Changes from v10: - Use "unsigned int" instead of "unsigned". Signed-off-by: Masami Hiramatsu Signed-off-by: Jim Keniston Cc: H. Peter Anvin Cc: Steven Rostedt Cc: Ananth N Mavinakayanahalli Cc: Srikar Dronamraju Cc: Ingo Molnar Cc: Frederic Weisbe

[PATCH -tip -v11 10/11] tracing: Generate names for each kprobe event automatically

2009-07-09 Thread Masami Hiramatsu
Generate names for each kprobe event based on the probe point, and remove generic k*probe event types because there is no user of those types. Signed-off-by: Masami Hiramatsu Cc: Ananth N Mavinakayanahalli Cc: Christoph Hellwig Cc: Steven Rostedt Cc: Ingo Molnar Cc: Frederic Weisbecker Cc

[PATCH -tip -v11 08/11] tracing: add kprobe-based event tracer

2009-07-09 Thread Masami Hiramatsu
- Make kprobe_trace_entry and kretprobe_trace_entry variable array. - Use TRACE_FIELD_ZERO() - Rename the document to kprobetrace.txt. Signed-off-by: Masami Hiramatsu Acked-by: Ananth N Mavinakayanahalli Cc: Christoph Hellwig Cc: Steven Rostedt Cc: Ingo Molnar Cc: Frederic Weisbecker Cc: Tom Zan

[PATCH -tip -v11 11/11] tracing: Add kprobes event profiling interface

2009-07-09 Thread Masami Hiramatsu
Add profiling interaces for each kprobes event. Signed-off-by: Masami Hiramatsu Cc: Ananth N Mavinakayanahalli Cc: Christoph Hellwig Cc: Steven Rostedt Cc: Ingo Molnar Cc: Frederic Weisbecker Cc: Tom Zanussi --- Documentation/trace/kprobetrace.txt |8 ++ kernel/trace

[PATCH -tip -v11 00/11] tracing: kprobe-based event tracer and x86 instruction decoder

2009-07-09 Thread Masami Hiramatsu
n the kernel hits a probe, and <- SYMBOL means kernel returns from SYMBOL(e.g. "sys_open+0x1b/0x1d <- do_sys_open" means kernel returns from do_sys_open to sys_open+0x1b). Thank you, --- Masami Hiramatsu (11): tracing: Add kprobes event profiling interface tracing

[PATCH -tip -v11 09/11] tracing: Kprobe-tracer supports more than 6 arguments

2009-07-09 Thread Masami Hiramatsu
Support up to 128 arguments for each kprobes event. Signed-off-by: Masami Hiramatsu Cc: Ananth N Mavinakayanahalli Cc: Christoph Hellwig Cc: Steven Rostedt Cc: Ingo Molnar Cc: Frederic Weisbecker Cc: Tom Zanussi --- Documentation/trace/kprobetrace.txt |2 +- kernel/trace

Re: [PATCH -tip -v11 11/11] tracing: Add kprobes event profiling interface

2009-07-10 Thread Masami Hiramatsu
gt;> +if (tp == NULL) >> +return 0; >> + > > tp will never be NULL, which is guaranteed by seq_file OK, fixed. >> +seq_printf(m, "%s", tp->call.name); >> + >> +seq_printf(m, "\t%8lu %8lu\n", tp->nhits, >

Re: [PATCH -tip -v11 08/11] tracing: add kprobe-based event tracer

2009-07-10 Thread Masami Hiramatsu
t; +if (!trace_seq_puts(s, " <- ")) >> +goto partial; >> + >> +if (!seq_print_ip_sym(s, field->func, flags & ~TRACE_ITER_SYM_OFFSET)) >> + goto partial; >> + > > and $pf? > >> +if (!trace_seq_puts(

[PATCH -tip -v12 04/11] kprobes: cleanup fix_riprel() using insn decoder on x86

2009-07-16 Thread Masami Hiramatsu
Cleanup fix_riprel() in arch/x86/kernel/kprobes.c by using x86 instruction decoder. Signed-off-by: Masami Hiramatsu Cc: Ananth N Mavinakayanahalli Cc: Jim Keniston Cc: Ingo Molnar --- arch/x86/kernel/kprobes.c | 128 - 1 files changed, 23

[PATCH -tip -v12 06/11] tracing: ftrace dynamic ftrace_event_call support

2009-07-16 Thread Masami Hiramatsu
: - Call remove_subsystem_dir() when unregistering an event call. Signed-off-by: Masami Hiramatsu Acked-by: Frederic Weisbecker Cc: Steven Rostedt Cc: Ingo Molnar Cc: Tom Zanussi --- include/linux/ftrace_event.h | 13 +--- include/trace/ftrace.h | 22 ++--- kernel

[PATCH -tip -v12 07/11] tracing: Introduce TRACE_FIELD_ZERO() macro

2009-07-16 Thread Masami Hiramatsu
Use TRACE_FIELD_ZERO(type, item) instead of TRACE_FIELD_ZERO_CHAR(item). This also includes a fix of TRACE_ZERO_CHAR() macro. Signed-off-by: Masami Hiramatsu Cc: Steven Rostedt Cc: Ingo Molnar Cc: Tom Zanussi Cc: Frederic Weisbecker --- kernel/trace/trace_event_types.h |4 ++-- kernel

[PATCH -tip -v12 01/11] x86: instruction decoder API

2009-07-16 Thread Masami Hiramatsu
: Masami Hiramatsu Signed-off-by: Jim Keniston Acked-by: H. Peter Anvin Cc: Steven Rostedt Cc: Ananth N Mavinakayanahalli Cc: Srikar Dronamraju Cc: Ingo Molnar Cc: Frederic Weisbecker Cc: Andi Kleen Cc: Vegard Nossum Cc: Avi Kivity Cc: Przemysław Pawełczyk --- arch/x86/include/asm/inat.h

[PATCH -tip -v12 05/11] x86: add pt_regs register and stack access APIs

2009-07-16 Thread Masami Hiramatsu
get_argument_nth(). - Use "unsigned int" instead of "unsigned". Signed-off-by: Masami Hiramatsu Reviewed-by: Frederic Weisbecker Cc: Andi Kleen Cc: Christoph Hellwig Cc: Steven Rostedt Cc: Ananth N Mavinakayanahalli Cc: Ingo Molnar Cc: Frederic Weisbecker Cc: Rolan

[PATCH -tip -v12 09/11] tracing: Kprobe-tracer supports more than 6 arguments

2009-07-16 Thread Masami Hiramatsu
Support up to 128 arguments for each kprobes event. Signed-off-by: Masami Hiramatsu Cc: Ananth N Mavinakayanahalli Cc: Christoph Hellwig Cc: Steven Rostedt Cc: Ingo Molnar Cc: Frederic Weisbecker Cc: Tom Zanussi --- Documentation/trace/kprobetrace.txt |2 +- kernel/trace

[PATCH -tip -v12 10/11] tracing: Generate names for each kprobe event automatically

2009-07-16 Thread Masami Hiramatsu
Generate names for each kprobe event based on the probe point, and remove generic k*probe event types because there is no user of those types. Signed-off-by: Masami Hiramatsu Cc: Ananth N Mavinakayanahalli Cc: Christoph Hellwig Cc: Steven Rostedt Cc: Ingo Molnar Cc: Frederic Weisbecker Cc

[PATCH -tip -v12 00/11] tracing: kprobe-based event tracer and x86 instruction decoder

2009-07-16 Thread Masami Hiramatsu
Each line shows when the kernel hits a probe, and <- SYMBOL means kernel returns from SYMBOL(e.g. "sys_open+0x1b/0x1d <- do_sys_open" means kernel returns from do_sys_open to sys_open+0x1b). Thank you, --- Masami Hiramatsu (11): tracing: Add kprobes event profiling i

[PATCH -tip -v12 11/11] tracing: Add kprobes event profiling interface

2009-07-16 Thread Masami Hiramatsu
Add profiling interaces for each kprobes event. Changes from v11: - Fix a typo and remove redundant check. Signed-off-by: Masami Hiramatsu Cc: Ananth N Mavinakayanahalli Cc: Christoph Hellwig Cc: Steven Rostedt Cc: Ingo Molnar Cc: Frederic Weisbecker Cc: Tom Zanussi Cc: Li Zefan

[PATCH -tip -v12 02/11] x86: x86 instruction decoder build-time selftest

2009-07-16 Thread Masami Hiramatsu
are no differences. Changes from v10: - Use "unsigned int" instead of "unsigned". Signed-off-by: Masami Hiramatsu Signed-off-by: Jim Keniston Cc: H. Peter Anvin Cc: Steven Rostedt Cc: Ananth N Mavinakayanahalli Cc: Srikar Dronamraju Cc: Ingo Molnar Cc: Frederic Weisbe

[PATCH -tip -v12 08/11] tracing: add kprobe-based event tracer

2009-07-16 Thread Masami Hiramatsu
cess string bug in trace_arg_string(). - Remove redundant checks. - Fix buffer overflow in probes_write(). - Fix probes_write() to support inputs ended without a new-line. Signed-off-by: Masami Hiramatsu Acked-by: Ananth N Mavinakayanahalli Cc: Christoph Hellwig Cc: Steven Rostedt Cc: Ingo

[PATCH -tip -v12 03/11] kprobes: checks probe address is instruction boudary on x86

2009-07-16 Thread Masami Hiramatsu
Ensure safeness of inserting kprobes by checking whether the specified address is at the first byte of a instruction on x86. This is done by decoding probed function from its head to the probe point. Signed-off-by: Masami Hiramatsu Acked-by: Ananth N Mavinakayanahalli Cc: Jim Keniston Cc: Ingo

Re: [PATCH -tip -v12 01/11] x86: instruction decoder API

2009-07-16 Thread Masami Hiramatsu
On 2009年07月16日 12:19, H. Peter Anvin wrote: > Masami Hiramatsu wrote: >> >> These opcode maps do NOT include most of SSE and FP opcodes, because >> those opcodes are not used in the kernel. >> > > That is not true. Ah, these opcode maps include some SSE/FP s

Re: [PATCH -tip -v12 01/11] x86: instruction decoder API

2009-07-16 Thread Masami Hiramatsu
? Thank you, > > Same for the other files that requred the types.h hack. > > Sam > -- Masami Hiramatsu Software Engineer Hitachi Computer Products (America), Inc. Software Solutions Division e-mail: mhira...@redhat.com -- To unsubscribe from this list: send the line "unsub

Re: [PATCH -tip -v12 02/11] x86: x86 instruction decoder build-time selftest

2009-07-16 Thread Masami Hiramatsu
Sam Ravnborg wrote: > On Thu, Jul 16, 2009 at 11:57:06AM -0400, Masami Hiramatsu wrote: >> Add a user-space selftest of x86 instruction decoder at kernel build time. >> When CONFIG_X86_DECODER_SELFTEST=y, Kbuild builds a test harness of x86 >> instruction decoder and perfo

Re: [PATCH -tip -v12 02/11] x86: x86 instruction decoder build-time selftest

2009-07-16 Thread Masami Hiramatsu
Masami Hiramatsu wrote: >> You are using the native objdump here. >> But I assume this fails miserably when you build x86 on a powerpc host. >> In other words - you broke an allyesconfig build for -next... >> We have $(OBJDUMP) for this. > > Ah, I see... Would you k

Re: [PATCH -tip -v12 02/11] x86: x86 instruction decoder build-time selftest

2009-07-16 Thread Masami Hiramatsu
st is little-endian? > If it does then it would fail on a power-pc target despite using the > correct objdump. Hmm, as far as I can see, the result of get_next() macro with the types more than two bytes(s16, s32...) might be effected. But it doesn't effect get_insn_len test because those

Re: [PATCH -tip -v12 01/11] x86: instruction decoder API

2009-07-16 Thread Masami Hiramatsu
Sam Ravnborg wrote: > On Thu, Jul 16, 2009 at 01:28:54PM -0400, Masami Hiramatsu wrote: >> Sam Ravnborg wrote: >>>> diff --git a/arch/x86/include/asm/inat.h b/arch/x86/include/asm/inat.h >>>> new file mode 100644 >>>> index 000..01e079a >>>

Re: trace_printk() support in trace-cmd

2010-12-13 Thread Masami Hiramatsu
lly, pagefaults could happen on fetching variables. But fetching argument routines should handle it... I'd like to check it, could you tell me details? for example, that exception log, kprobe-tracer's event definition(you can see it via debugfs/tracing/kprobe-events) and the result of `perf probe

Re: trace_printk() support in trace-cmd

2010-12-16 Thread Masami Hiramatsu
(2010/12/16 19:20), Avi Kivity wrote: > On 12/13/2010 01:20 PM, Masami Hiramatsu wrote: >> (2010/12/13 2:47), Avi Kivity wrote: >> > On 12/12/2010 07:43 PM, Arnaldo Carvalho de Melo wrote: >> >> Em Sun, Dec 12, 2010 at 07:42:06PM +0200, Avi Kivity escreveu: >

Re: Re: RFC: paravirtualizing perf_clock

2013-10-29 Thread Masami Hiramatsu
x27;t depends on the arch specific feature. However, since physical timer(clock) interfaces and virtualization interfaces strongly depends on the arch, I guess the optimized implementations will become different on each arch. For example, maybe we can export tsc-offset to the guest to adjust clock o

Re: RFC: paravirtualizing perf_clock

2013-10-31 Thread Masami Hiramatsu
(2013/10/30 23:03), David Ahern wrote: > On 10/29/13 11:59 PM, Masami Hiramatsu wrote: >> (2013/10/29 11:58), David Ahern wrote: >>> To back out a bit, my end goal is to be able to create and merge >>> perf-events from any context on a KVM-based host -- guest usersp

[PATCH -tip -v13 03/11] kprobes: checks probe address is instruction boudary on x86

2009-07-24 Thread Masami Hiramatsu
Ensure safeness of inserting kprobes by checking whether the specified address is at the first byte of a instruction on x86. This is done by decoding probed function from its head to the probe point. Signed-off-by: Masami Hiramatsu Acked-by: Ananth N Mavinakayanahalli Cc: Jim Keniston Cc: Ingo

[PATCH -tip -v13 04/11] kprobes: cleanup fix_riprel() using insn decoder on x86

2009-07-24 Thread Masami Hiramatsu
Cleanup fix_riprel() in arch/x86/kernel/kprobes.c by using x86 instruction decoder. Signed-off-by: Masami Hiramatsu Cc: Ananth N Mavinakayanahalli Cc: Jim Keniston Cc: Ingo Molnar --- arch/x86/kernel/kprobes.c | 128 - 1 files changed, 23

[PATCH -tip -v13 07/11] tracing: Introduce TRACE_FIELD_ZERO() macro

2009-07-24 Thread Masami Hiramatsu
Use TRACE_FIELD_ZERO(type, item) instead of TRACE_FIELD_ZERO_CHAR(item). This also includes a fix of TRACE_ZERO_CHAR() macro. Signed-off-by: Masami Hiramatsu Cc: Steven Rostedt Cc: Ingo Molnar Cc: Tom Zanussi Cc: Frederic Weisbecker --- kernel/trace/trace_event_types.h |4 ++-- kernel

[PATCH -tip -v13 06/11] tracing: ftrace dynamic ftrace_event_call support

2009-07-24 Thread Masami Hiramatsu
: Masami Hiramatsu Acked-by: Frederic Weisbecker Cc: Steven Rostedt Cc: Ingo Molnar Cc: Tom Zanussi --- include/linux/ftrace_event.h | 13 +--- include/trace/ftrace.h | 22 ++--- kernel/trace/trace_events.c | 72 -- kernel/trace

[PATCH -tip -v13 05/11] x86: add pt_regs register and stack access APIs

2009-07-24 Thread Masami Hiramatsu
the kernel stack. - regs_get_kernel_stack_nth(struct pt_regs *reg, unsigned int nth) Get Nth entry of the kernel stack. (N >= 0) - regs_get_argument_nth(struct pt_regs *reg, unsigned int nth) Get Nth argument at function call. (N >= 0) Signed-off-by: Masami Hiramatsu Reviewed-by: Fre

[PATCH -tip -v13 09/11] tracing: Kprobe-tracer supports more than 6 arguments

2009-07-24 Thread Masami Hiramatsu
Support up to 128 arguments for each kprobes event. Signed-off-by: Masami Hiramatsu Cc: Ananth N Mavinakayanahalli Cc: Christoph Hellwig Cc: Steven Rostedt Cc: Ingo Molnar Cc: Frederic Weisbecker Cc: Tom Zanussi --- Documentation/trace/kprobetrace.txt |2 +- kernel/trace

[PATCH -tip -v13 08/11] tracing: add kprobe-based event tracer

2009-07-24 Thread Masami Hiramatsu
vent Tracer + = + + Documentation is written by Masami Hiramatsu + + +Overview + +This tracer is similar to the events tracer which is based on Tracepoint +infrastructure. Instead of Tracepoint, this tracer is based on kprobes(kprobe +an

[PATCH -tip -v13 10/11] tracing: Generate names for each kprobe event automatically

2009-07-24 Thread Masami Hiramatsu
Generate names for each kprobe event based on the probe point, and remove generic k*probe event types because there is no user of those types. Signed-off-by: Masami Hiramatsu Cc: Ananth N Mavinakayanahalli Cc: Christoph Hellwig Cc: Steven Rostedt Cc: Ingo Molnar Cc: Frederic Weisbecker Cc

[PATCH -tip -v13 00/11] tracing: kprobe-based event tracer and x86 instruction decoder

2009-07-24 Thread Masami Hiramatsu
rch/x86/lib/inat.c create mode 100644 arch/x86/lib/insn.c create mode 100644 arch/x86/lib/x86-opcode-map.txt create mode 100644 arch/x86/tools/Makefile create mode 100644 arch/x86/tools/distill.awk create mode 100644 arch/x86/tools/gen-insn-attr-x86.awk create mode 100644 arch/x86/tools/test_get_len.

[PATCH -tip -v13 11/11] tracing: Add kprobes event profiling interface

2009-07-24 Thread Masami Hiramatsu
Add profiling interaces for each kprobes event. This interface provides how many times each probe hit or missed. Changes from v12: - Reformat profile data. Signed-off-by: Masami Hiramatsu Cc: Ananth N Mavinakayanahalli Cc: Christoph Hellwig Cc: Steven Rostedt Cc: Ingo Molnar Cc: Frederic

[PATCH -tip -v13 01/11] x86: instruction decoder API

2009-07-24 Thread Masami Hiramatsu
: - Use arch/x86/tools dir instead of arch/x86/scripts. - Remove all EXPORT_SYMBOL_GPL() and linux/module.h. - Replace all types defined in linux/types.h. - Use inline functions instead of macros. - Add VIA's RNG/ACE instructions. Signed-off-by: Masami Hiramatsu Signed-off-by: Jim Ken

[PATCH -tip -v13 02/11] x86: x86 instruction decoder build-time selftest

2009-07-24 Thread Masami Hiramatsu
are no differences. Changes from v12: - Remove user_include.h. - Use $(OBJDUMP) instead of native objdump. - Use hostprogs-y and include insn.c and inat.c directly from test_gen_insn.c. Signed-off-by: Masami Hiramatsu Signed-off-by: Jim Keniston Cc: Sam Ravnborg Cc: H. Peter Anvin Cc: Steven

[PATCH -tip v14 02/12] x86: x86 instruction decoder build-time selftest

2009-08-13 Thread Masami Hiramatsu
are no differences. Signed-off-by: Masami Hiramatsu Signed-off-by: Jim Keniston Cc: Ananth N Mavinakayanahalli Cc: Avi Kivity Cc: Andi Kleen Cc: Christoph Hellwig Cc: Frank Ch. Eigler Cc: Frederic Weisbecker Cc: H. Peter Anvin Cc: Ingo Molnar Cc: Jason Baron Cc: K.Prasad Cc: Lai

[PATCH -tip v14 01/12] x86: instruction decoder API

2009-08-13 Thread Masami Hiramatsu
: Masami Hiramatsu Signed-off-by: Jim Keniston Acked-by: H. Peter Anvin Cc: Ananth N Mavinakayanahalli Cc: Avi Kivity Cc: Andi Kleen Cc: Christoph Hellwig Cc: Frank Ch. Eigler Cc: Frederic Weisbecker Cc: Ingo Molnar Cc: Jason Baron Cc: K.Prasad Cc: Lai Jiangshan Cc: Li Zefan Cc: Przemysław

  1   2   >