Re: uprobe support mix of ftrace and perf

2018-11-26 Thread Masami Hiramatsu
Hi Oleg, On Thu, 22 Nov 2018 15:32:10 +0100 Oleg Nesterov wrote: > Hi Masami, > > On 11/20, Masami Hiramatsu wrote: > > > > Hello Oleg, > > > > I have a question about the (revert) commit 48212542067a > > ("tracing/uprobes: Revert "Support mix o

Re: [RFC][PATCH 00/14] function_graph: Rewrite to allow multiple users

2018-11-26 Thread Masami Hiramatsu
ach function > and each callback. > > What's the solution? I use the shadow stack that is already being > used to store the function return addresses. > > A big thanks to Masami Hiramatsu for suggesting this idea! > > For now, I only allow an 16 users of the function

Re: [RFC][PATCH 07/14] fgraph: Add new fgraph_ops structure to enable function graph hooks

2018-11-26 Thread Masami Hiramatsu
; + struct ftrace_ops_hash local_hash; > + struct ftrace_ops_hash *func_hash; > +#endif Hmm, can we introduce these fields when we actually use it? BTW, would you have any idea for using private field? Thank you, -- Masami Hiramatsu

Re: [PATCH v7 09/16] tracing: Add hist trigger snapshot() action test case

2018-11-26 Thread Masami Hiramatsu
27;t we stop tracing instead of disabling the event? Thank you, > + > +if ! grep -q "changed:" events/sched/sched_waking/hist; then > +fail "Failed to create onchange action inter-event histogram" > +fi > + > +if ! grep -q "comm=ping" snapshot; then > +fail "Failed to create snapshot action inter-event histogram" > +fi > + > +exit 0 > -- > 2.14.1 > -- Masami Hiramatsu

Re: [PATCH v7 00/16] tracing: Hist trigger snapshot and onchange additions

2018-11-26 Thread Masami Hiramatsu
ent/trigger-onmatch-action-hist.tc |1 + > .../trigger-onmatch-onmax-action-hist.tc |1 + > .../inter-event/trigger-onmax-action-hist.tc |1 + > .../inter-event/trigger-snapshot-action-hist.tc| 43 + > .../trigger-synthetic-event-createremove.tc|1 + > .../inter-event/trigger-trace-action-hist.tc | 42 + > 18 files changed, 1433 insertions(+), 302 deletions(-) > create mode 100644 > tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-action-hist-xfail.tc > create mode 100644 > tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onchange-action-hist.tc > create mode 100644 > tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-snapshot-action-hist.tc > create mode 100644 > tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-trace-action-hist.tc > > -- > 2.14.1 > -- Masami Hiramatsu

Re: [RFC][PATCH 11/14] function_graph: Convert ret_stack to a series of longs

2018-11-26 Thread Masami Hiramatsu
ON_PROFILE > turned off). > > Where as before it would be 32 * 40 = 1280 bytes. That looks like ~7 times > more than before. Hmm, this seems too big... I thought the shadow-stack size should be smaller than 1 page (4kB). Steve, can we give a 4k page for shadow stack and define FTRACE_R

Re: File not found: /sys/kernel/debug/tracing/events/syscalls

2018-11-27 Thread Masami Hiramatsu
> strace output: > open(\"/sys/kernel/debug/tracing/events/syscalls/sys_enter_nanosleep/id\", > O_RDONLY) = -1 ENOENT (No such file or directory) > > This problem noticed on Linux mainline kernel version 4.20.0-rc3. > > Best regards > Naresh Kamboju -- Masami Hiramatsu

[PATCH] arm64: ftrace: Fix to enable syscall events on arm64

2018-11-27 Thread Masami Hiramatsu
kernel, and some bpf testcases are failed on arm64. To fix this issue, this introduces custom arch_syscall_match_sym_name() which skips first 8 bytes when comparing the syscall and symbol names. Fixes: 4378a7d4be30 ("arm64: implement syscall wrappers") Reported-by: Naresh Kamboju Signed-off

uprobe support mix of ftrace and perf

2018-11-20 Thread Masami Hiramatsu
a tentative one, and should be fixed afterwards. Since kprobe events already supported the mix of ftrace and perf, user may confuse why they can not use the uprobe event if it is used by ftrace. (perf probe treats both events transparently, and ftrace event interface too.) Thank you, -- Masami Hiramatsu

Re: [PATCH] arm64: ftrace: Fix to enable syscall events on arm64

2018-11-27 Thread Masami Hiramatsu
e same syscall table with AArch64, * tracing compat syscalls may result in reporting bogus syscalls or even * hang-up, so just do not trace them. That's why I dropped compat syscall support. Thank you, -- Masami Hiramatsu

Re: [PATCH v7 09/16] tracing: Add hist trigger snapshot() action test case

2018-11-27 Thread Masami Hiramatsu
event may continue to be called. Does this mean hist will be updated? (and I guess preferrable behavior is to stop hist too, isn't it?) Thank you, -- Masami Hiramatsu

Re: [PATCH v2 00/12] tracing: Unifying dynamic event interface

2018-11-27 Thread Masami Hiramatsu
Ping? Hi Tom, This series, especially [09/12] tracing: Remove unneeded synth_event_mutex will effect your current working series. Please tell me your opinion. Thank you, On Mon, 5 Nov 2018 17:59:46 +0900 Masami Hiramatsu wrote: > Hi, > > This is v2 series of unifying dyna

Re: [PATCH v2 00/12] tracing: Unifying dynamic event interface

2018-11-28 Thread Masami Hiramatsu
Hi Tom, On Wed, 28 Nov 2018 17:42:22 -0600 Tom Zanussi wrote: > Hi Masami, > > On Wed, 2018-11-28 at 16:31 +0900, Masami Hiramatsu wrote: > > Ping? > > > > Hi Tom, > > > > This series, especially [09/12] tracing: Remove unneeded > > synth_eve

Re: [PATCH] arm64: ftrace: Fix to enable syscall events on arm64

2018-11-28 Thread Masami Hiramatsu
4.21 atm). OK, I'll add a comment about compat syscalls. BTW, this should be applied to 4.19 too, since without this, no one can use syscall events on arm64. Thank you, -- Masami Hiramatsu

[PATCH v2] arm64: ftrace: Fix to enable syscall events on arm64

2018-11-28 Thread Masami Hiramatsu
kernel, and some bpf testcases are failed on arm64. To fix this issue, this introduces custom arch_syscall_match_sym_name() which skips first 8 bytes when comparing the syscall and symbol names. Fixes: 4378a7d4be30 ("arm64: implement syscall wrappers") Reported-by: Naresh Kamboju Signed-off-

Re: [PATCH v7 00/16] tracing: Hist trigger snapshot and onchange additions

2018-11-29 Thread Masami Hiramatsu
On Mon, 26 Nov 2018 15:21:28 -0600 Tom Zanussi wrote: > Hi Masami, > > On Mon, 2018-11-26 at 23:09 +0900, Masami Hiramatsu wrote: > > Hi Tom, > > > > On Wed, 14 Nov 2018 14:17:57 -0600 > > Tom Zanussi wrote: > > > > > From: Tom Zanussi >

Re: [RFC][PATCH 00/14] function_graph: Rewrite to allow multiple users

2018-11-29 Thread Masami Hiramatsu
Hi Steve, On Mon, 26 Nov 2018 11:32:15 -0500 Steven Rostedt wrote: > On Mon, 26 Nov 2018 18:21:12 +0900 > Masami Hiramatsu wrote: > > > > > Note, if another fgraph_ops is registered in the same location, its > > > retfunc may be called that was set by a previous

Re: [PATCH v7 00/16] tracing: Hist trigger snapshot and onchange additions

2018-11-29 Thread Masami Hiramatsu
On Thu, 29 Nov 2018 22:52:25 +0900 Masami Hiramatsu wrote: > > For that system, I'm using Gnome terminal 3.24.2 and GNU bash, version > > 4.4.12(1)-release (x86_64-pc-linux-gnu) (Ubuntu 17.10). > > > > If I change 'echo' to '/bin/echo' in

[PATCH] sefltests/ftrace: Use /bin/echo for output with options

2018-11-29 Thread Masami Hiramatsu
m Reported-by: Tom Zanussi Suggested-by: Tom Zanussi Signed-off-by: Masami Hiramatsu --- tools/testing/selftests/ftrace/ftracetest |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/ftrace/ftracetest b/tools/testing/selftests/ftrace/ftracetest

Re: [PATCH] selftests/ftrace: Fix invalid SPDX identifiers

2018-11-29 Thread Masami Hiramatsu
orrect and valid identifiers for GPL > >> v2 > >> only code are 'GPL-2.0' or 'GPL-2.0-only'. > >> > >> Signed-off-by: Thomas Gleixner > >> Cc: Masami Hiramatsu > >> Cc: Shuah Khan (Samsung OSG) > >> > > Hi Masami, > > I am pulling this in for 4.21-rc1. Oops, I missed it. Acked-by: Masami Hiramatsu Thank you! -- Masami Hiramatsu

Re: [PATCH v2] arm64: ftrace: Fix to enable syscall events on arm64

2018-11-29 Thread Masami Hiramatsu
On Thu, 29 Nov 2018 16:53:30 + Catalin Marinas wrote: > On Thu, Nov 29, 2018 at 02:39:33PM +0900, Masami Hiramatsu wrote: > > Since commit 4378a7d4be30 ("arm64: implement syscall wrappers") > > introduced "__arm64_" prefix to all syscall wrapper symbols in

Re: [RFC][PATCH 00/14] function_graph: Rewrite to allow multiple users

2018-11-29 Thread Masami Hiramatsu
On Thu, 29 Nov 2018 11:46:52 -0500 Steven Rostedt wrote: > On Thu, 29 Nov 2018 23:29:27 +0900 > Masami Hiramatsu wrote: > > > > One way to solve this is to also have a counter array that gets updated > > > every time the index array gets updated. And save the counte

Re: [PATCH v6 08/10] x86: avoid W^X being broken during modules loading

2018-11-29 Thread Masami Hiramatsu
as executable is > > done as a separate step to avoid one core in which the old PTE is cached > > (hence writable), and another which sees the updated PTE (executable), > > which would break the W^X protection. > > > > Cc: Andy Lutomirski > > Cc: Kees Cook &g

Re: [RFC][PATCH 00/14] function_graph: Rewrite to allow multiple users

2018-11-30 Thread Masami Hiramatsu
On Thu, 29 Nov 2018 22:24:35 -0500 Steven Rostedt wrote: > On Fri, 30 Nov 2018 11:26:58 +0900 > Masami Hiramatsu wrote: > > > On Thu, 29 Nov 2018 11:46:52 -0500 > > Steven Rostedt wrote: > > > > > On Thu, 29 Nov 2018 23:29:27 +0900 > > > Masami Hi

Re: [RFC/RFT 2/2] RISC-V: kprobes/kretprobe support

2018-11-14 Thread Masami Hiramatsu
On Wed, 14 Nov 2018 22:10:52 +0100 Patrick Staehlin wrote: > On 14.11.18 16:49, Masami Hiramatsu wrote: > > On Wed, 14 Nov 2018 00:37:30 -0800 > > Masami Hiramatsu wrote: > > > >>> + > >>> +static int __kprobes patch_text(kprobe_op

Re: [RFC/RFT 2/2] RISC-V: kprobes/kretprobe support

2018-11-15 Thread Masami Hiramatsu
On Wed, 14 Nov 2018 21:52:57 +0100 Patrick Staehlin wrote: > Hi Masami, > > thank you for your remarks. > > On 14.11.18 09:37, Masami Hiramatsu wrote> > > Thank you very much for implementing kprobes on RISC-V :) > > > > On Tue, 13 Nov 2018 20:58

Re: [PATCH 1/1] stackleak: Disable ftrace for stackleak.c

2018-11-11 Thread Masami Hiramatsu
eason > ftrace can't trace stack_erasing_sysctl() or perhaps even > stackleak_track_stack() as that may be very interesting to trace. I think it is not enough for stopping kprobes. If you want to stop the kprobes (int3 version) on stackleak_erase(), you should use NOKPROBE_SYMBOL(stackleak_erase), since kprobes can work without ftrace. Thank you, -- Masami Hiramatsu

Re: [PATCH v4 01/10] Fix "x86/alternatives: Lockdep-enforce text_mutex in text_poke*()"

2018-11-11 Thread Masami Hiramatsu
this looks reasonable and good to me. Reviewed-by: Masami Hiramatsu Thank you! > > Cc: Jiri Kosina > Cc: Andy Lutomirski > Cc: Kees Cook > Cc: Dave Hansen > Cc: Masami Hiramatsu > Fixes: 9222f606506c ("x86/alternatives: Lockdep-enforce text_mutex in > text_p

Re: [PATCH tip/core/rcu 20/41] kprobes: eplace synchronize_sched() with synchronize_rcu()

2018-11-11 Thread Masami Hiramatsu
Cc: Anil S Keshavamurthy > Cc: "David S. Miller" > Cc: Masami Hiramatsu > --- > kernel/kprobes.c | 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/kernel/kprobes.c b/kernel/kprobes.c > index 90e98e233647..08e31d863191 100644 >

Re: [PATCH tip/core/rcu 20/41] kprobes: eplace synchronize_sched() with synchronize_rcu()

2018-11-13 Thread Masami Hiramatsu
On Sun, 11 Nov 2018 19:19:16 -0800 "Paul E. McKenney" wrote: > On Mon, Nov 12, 2018 at 12:00:48PM +0900, Masami Hiramatsu wrote: > > On Sun, 11 Nov 2018 11:43:49 -0800 > > "Paul E. McKenney" wrote: > > > > > Now that synchronize_rcu() waits fo

Re: [PATCH 1/1] stackleak: Disable ftrace for stackleak.c

2018-11-13 Thread Masami Hiramatsu
much the only ones that currently do self > modification of code all over the kernel. Kprobes even more so than > ftrace. Right, since kprobes uses int3 or sw breakpoint exception for hooking into the code, it consumes stack much more. Thank you, -- Masami Hiramatsu

Re: [PATCH 1/1] stackleak: Disable function tracing and kprobes for stackleak_erase()

2018-11-13 Thread Masami Hiramatsu
. > > So let's disable function tracing and kprobes for stackleak_erase(). > > Reported-by: kernel test robot > Signed-off-by: Alexander Popov Reviewed-by: Masami Hiramatsu Thank you! > --- > kernel/stackleak.c | 4 +++- > 1 file changed, 3 insertions(+),

Re: [RFC/RFT 2/2] RISC-V: kprobes/kretprobe support

2018-11-14 Thread Masami Hiramatsu
+/* SPDX-License-Identifier: GPL-2.0+ */ > + > +#ifndef _RISCV_KERNEL_KPROBES_SIMULATE_INSN_H > +#define _RISCV_KERNEL_KPROBES_SIMULATE_INSN_H > + > +void simulate_caddisp16(u32 opcode, long addr, struct pt_regs *regs); > + > +#endif /* _RISCV_KERNEL_KPROBES_SIMULATE_INSN_H */ > diff --git a/arch/riscv/kernel/traps.c b/arch/riscv/kernel/traps.c > index 24a9333dda2c..d7113178d401 100644 > --- a/arch/riscv/kernel/traps.c > +++ b/arch/riscv/kernel/traps.c > @@ -18,6 +18,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -120,8 +121,14 @@ DO_ERROR_INFO(do_trap_ecall_m, > > asmlinkage void do_trap_break(struct pt_regs *regs) > { > + bool handler_found = false; > + > +#ifdef CONFIG_KPROBES > + if (kprobe_breakpoint_handler(regs)) > + handler_found = 1; Why don't you just return from here? > +#endif > #ifdef CONFIG_GENERIC_BUG > - if (!user_mode(regs)) { > + if (!handler_found && !user_mode(regs)) { > enum bug_trap_type type; > > type = report_bug(regs->sepc, regs); > @@ -137,7 +144,9 @@ asmlinkage void do_trap_break(struct pt_regs *regs) > } > #endif /* CONFIG_GENERIC_BUG */ > > - force_sig_fault(SIGTRAP, TRAP_BRKPT, (void __user *)(regs->sepc), > current); > + if (!handler_found) > + force_sig_fault(SIGTRAP, TRAP_BRKPT, > + (void __user *)(regs->sepc), current); > } > > #ifdef CONFIG_GENERIC_BUG > diff --git a/arch/riscv/mm/fault.c b/arch/riscv/mm/fault.c > index 88401d5125bc..eff816e33479 100644 > --- a/arch/riscv/mm/fault.c > +++ b/arch/riscv/mm/fault.c > @@ -22,6 +22,7 @@ > > #include > #include > +#include > #include > #include > #include > @@ -30,11 +31,33 @@ > #include > #include > > +#ifdef CONFIG_KPROBES > +static inline int notify_page_fault(struct pt_regs *regs, unsigned int cause) please use nokprobe_inline. > +{ > + int ret = 0; > + > + /* kprobe_running() needs smp_processor_id() */ > + if (!user_mode(regs)) { > + preempt_disable(); > + if (kprobe_running() && kprobe_fault_handler(regs, cause)) > + ret = 1; > + preempt_enable(); > + } > + > + return ret; > +} > +#else > +static inline int notify_page_fault(struct pt_regs *regs, unsigned int cause) > +{ > + return 0; > +} > +#endif > + > /* > * This routine handles page faults. It determines the address and the > * problem, and then passes it off to one of the appropriate routines. > */ > -asmlinkage void do_page_fault(struct pt_regs *regs) > +asmlinkage void __kprobes do_page_fault(struct pt_regs *regs) > { > struct task_struct *tsk; > struct vm_area_struct *vma; > @@ -47,6 +70,9 @@ asmlinkage void do_page_fault(struct pt_regs *regs) > cause = regs->scause; > addr = regs->sbadaddr; > > + if (notify_page_fault(regs, cause)) > + return; > + > tsk = current; > mm = tsk->mm; > > -- > 2.17.1 > Thank you, -- Masami Hiramatsu

Re: [RFC/RFT 2/2] RISC-V: kprobes/kretprobe support

2018-11-14 Thread Masami Hiramatsu
On Wed, 14 Nov 2018 00:37:30 -0800 Masami Hiramatsu wrote: > > + > > +static int __kprobes patch_text(kprobe_opcode_t *addr, u32 opcode) > > +{ > > + if (is_compressed_insn(opcode)) > > + *(u16 *)addr = cpu_to_le16(opcode); > > + else > &

Re: [PATCH] x86/kernel: Fix more -Wmissing-prototypes warnings

2018-12-05 Thread Masami Hiramatsu
nt enable_kprobe(struct kprobe *kp); > > void dump_kprobe(struct kprobe *kp); > > +void __weak *alloc_insn_page(void); > +void __weak free_insn_page(void *page); Should we declare prototypes for __weak functions? Anyway, we should remove __weak from the prototypes. Thank you, -- Masami Hiramatsu

Re: [PATCH v7 09/14] x86/kprobes: Instruction pages initialization enhancements

2018-12-06 Thread Masami Hiramatsu
hile at it, do some small cleanup of what appears to be unnecessary > masking. Looks good to me. Acked-by: Masami Hiramatsu Thanks! > > Cc: Masami Hiramatsu > Signed-off-by: Nadav Amit > --- > arch/x86/kernel/kprobes/core.c | 24 > 1 file chang

Re: [PATCH v2 01/12] tracing/uprobes: Add busy check when cleanup all uprobes

2018-12-06 Thread Masami Hiramatsu
On Tue, 4 Dec 2018 12:43:33 -0500 Steven Rostedt wrote: > On Mon, 5 Nov 2018 18:00:15 +0900 > Masami Hiramatsu wrote: > > > Add a busy check loop in cleanup_all_probes() before > > trying to remove all events in uprobe_events as same as > > kprobe_events does. &

Re: [PATCH v2 10/12] tracing: Remove orphaned trace_add/remove_event_call functions

2018-12-06 Thread Masami Hiramatsu
On Tue, 4 Dec 2018 13:51:20 -0500 Steven Rostedt wrote: > On Mon, 5 Nov 2018 18:04:29 +0900 > Masami Hiramatsu wrote: > > > Remove trace_add_event_call() and trace_remove_event_call() > > functions since those are not used anymore. > > > > Signed-off-by:

Re: [PATCH] x86/kernel: Fix more -Wmissing-prototypes warnings

2018-12-07 Thread Masami Hiramatsu
thought that the symbol only referred from inline asm should be visible. But if it is OK for any version of supported gcc and clang, I'm good to remove it. :-) (IOW, I just concerned about older gcc) Reviewed-by: Masami Hiramatsu Thank you, > > --- > diff --git a/arch/x86

Re: [PATCH] kprobes: x86_64: blacklist non-attachable interrupt functions

2018-12-07 Thread Masami Hiramatsu
> Signed-off-by: Andrea Righi For the short term, this is OK. But this is not the best way to cover other functions which are also prohibited by arch_within_kprobe_blacklist(). I'll fix this issue later. Acked-by: Masami Hiramatsu Thank you, > --- > arch/x86/entry/entry_64.S

Re: [PATCH] x86/kernel: Fix more -Wmissing-prototypes warnings

2018-12-07 Thread Masami Hiramatsu
On Wed, 5 Dec 2018 15:24:48 +0100 Borislav Petkov wrote: > On Wed, Dec 05, 2018 at 10:49:06PM +0900, Masami Hiramatsu wrote: > > I would like to put this prototype inside arch/x86/kernel/kprobes/core.c, > > since that is locally used. > > Done. > > > Should we

Re: [PATCH] kprobes: x86_64: blacklist non-attachable interrupt functions

2018-12-07 Thread Masami Hiramatsu
: Masami Hiramatsu Blacklist symbols in arch-defined probe-prohibited areas. With this change, user can see all symbols which are prohibited to probe in debugfs. All archtectures which have custom prohibit areas should define its own arch_populate_kprobe_blacklist() function, but unless that, all

Re: [PATCH] kprobes: x86_64: blacklist non-attachable interrupt functions

2018-12-07 Thread Masami Hiramatsu
On Fri, 7 Dec 2018 18:00:26 +0100 Andrea Righi wrote: > On Sat, Dec 08, 2018 at 01:01:20AM +0900, Masami Hiramatsu wrote: > > Hi Andrea and Ingo, > > > > Here is the patch what I meant. I just ran it on qemu-x86, and seemed > > working. > > After introducin

Re: [PATCH] kprobes: x86_64: blacklist non-attachable interrupt functions

2018-12-07 Thread Masami Hiramatsu
On Fri, 7 Dec 2018 18:58:05 +0100 Andrea Righi wrote: > On Sat, Dec 08, 2018 at 01:01:20AM +0900, Masami Hiramatsu wrote: > > Hi Andrea and Ingo, > > > > Here is the patch what I meant. I just ran it on qemu-x86, and seemed > > working. > > After introducin

Re: [PATCH] x86/kernel: Fix more -Wmissing-prototypes warnings

2018-12-07 Thread Masami Hiramatsu
On Fri, 7 Dec 2018 20:48:47 +0100 Borislav Petkov wrote: > On Fri, Dec 07, 2018 at 11:42:10PM +0900, Masami Hiramatsu wrote: > > Hmm, I just thought that the symbol only referred from inline asm should > > be visible. But if it is OK for any version of supported gcc and clang,

Re: Strange hang with gcc 8 of kprobe multiple_kprobes test

2018-12-03 Thread Masami Hiramatsu
er I > run it. Yeah, thank you for digging it down. It is now much easier to me. > > I notice that when I get into the state, journald and the dbus_daemon > are constantly running. Perhaps the userspace time keeping went bad? Yeah, I think so. Maybe addl instruction becomes broken. Thank you, -- Masami Hiramatsu

Re: Strange hang with gcc 8 of kprobe multiple_kprobes test

2018-12-04 Thread Masami Hiramatsu
On Tue, 4 Dec 2018 16:40:07 +0900 Masami Hiramatsu wrote: > Hi Steve, > > On Mon, 3 Dec 2018 21:18:07 -0500 > Steven Rostedt wrote: > > > Hi Masami, > > > > I started testing some of my new code and the system got into a > > strange state. Debugging f

Re: [BUGFIX PATCH -tip] kprobes/x86: Fix to copy RIP relative instruction correctly

2018-12-04 Thread Masami Hiramatsu
On Tue, 4 Dec 2018 09:13:35 +0100 Ingo Molnar wrote: > > * Masami Hiramatsu wrote: > > > Since copy_optimized_instructions() misses to update real RIP > > address while copying several instructions to working buffer, > > it adjusts RIP-relative instruction with wr

Re: [PATCH RFC 0/3] Static calls

2018-11-10 Thread Masami Hiramatsu
> this feature. > > > > > > Indeed. > > Although I had assumed that tracepoints already had appropriate jump label > magic. As far as I know, the jump label magic is for reducing the overhead when the tracepoint is OFF (because it can skip function parameter preparation), and this static call will be good when the tracepoint is ON (enabled) because of this can avoid retpoline performance degradation. Thank you, -- Masami Hiramatsu

Re: [PATCH v2 0/7] tracing: Hist trigger snapshot and onchange additions

2018-07-07 Thread Masami Hiramatsu
> Documentation/trace/histogram.txt | 206 > kernel/trace/trace.c| 162 +- > kernel/trace/trace.h | 58 ++- > kernel/trace/trace_events_hist.c| 982 > ++-- > kernel/trace/trace_events_trigger.c | 2 +- > kernel/trace/trace_sched_wakeup.c | 2 +- > 6 files changed, 1140 insertions(+), 272 deletions(-) > > -- > 2.14.1 > -- Masami Hiramatsu

Re: [PATCH] tracing/kprobe: Release kprobe print_fmt properly

2018-07-11 Thread Masami Hiramatsu
On Wed, 11 Jul 2018 08:54:29 -0400 Steven Rostedt wrote: > > Masami, > > Can you ack this? If I don't hear from you by tomorrow, I'm going to > push it to Linus, because I'll be on PTO after that. > Sorry for later, yes, it seems correct. Acked-by: Masa

Re: [PATCH v9 7/7] kselftests: Add tests for the preemptoff and irqsoff tracers

2018-06-27 Thread Masami Hiramatsu
a > kernel module introduced previously to trigger atomic sections in the > kernel. > Looks good to me. Acked-by: Masami Hiramatsu Thanks! > Signed-off-by: Joel Fernandes (Google) > --- > tools/testing/selftests/ftrace/config | 3 + > .../test.d/preemptirq/irqsoff_tr

Re: [PATCH v3 13/14] tracing/selftest: Add selftests to test trace_marker histogram triggers

2018-05-27 Thread Masami Hiramatsu
t;${line/>$x > The ${line/>$x > -- Steve > > > fail "$line does not have >$x< in it" > > fi > > let x=$x+2 > > done > > } > > -- Masami Hiramatsu

Re: [PATCH v3 14/14] tracing/selftest: Add test to test hist trigger between kernel event and trace_marker

2018-05-27 Thread Masami Hiramatsu
that tests a trigger that is initiated by a kernel event > (sched_waking) and compared to a write to the trace_marker. > Yeah, this looks good to me :) Acked-by: Masami Hiramatsu Thanks! > Signed-off-by: Steven Rostedt (VMware) > --- > .../trigger-trace-marker-synthetic-kernel.tc

[PATCH -tip v4 00/27] kprobes: Cleanup jprobe implementation

2018-05-27 Thread Masami Hiramatsu
user to ftrace or kprobe. I didn't remove it because it might be useful for some users. Thank you, --- Masami Hiramatsu (27): Documentation/kprobes: Fix to remove remaining jprobe kprobes: Remove jprobe API implementation kprobes/x86: Remove jprobe implementation

[PATCH -tip v4 01/27] Documentation/kprobes: Fix to remove remaining jprobe

2018-05-28 Thread Masami Hiramatsu
Remove jps from the document, since jprobe is removed. Signed-off-by: Masami Hiramatsu --- Documentation/kprobes.txt |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/kprobes.txt b/Documentation/kprobes.txt index 22208bf2386d..5ae80baf3921 100644 --- a

[PATCH -tip v4 02/27] kprobes: Remove jprobe API implementation

2018-05-28 Thread Masami Hiramatsu
Remove jprobe API implementations and test cases for those APIs which is no more used. Signed-off-by: Masami Hiramatsu --- Changes in v4: - Cleanup lib/Kconfig.debug description too. Changes in v3: - Remove test cases. --- include/linux/kprobes.h |3 -- kernel/kprobes.c| 78

[PATCH -tip v4 03/27] kprobes/x86: Remove jprobe implementation

2018-05-28 Thread Masami Hiramatsu
Remove arch dependent setjump/longjump functions and unused fields in kprobe_ctlblk for jprobes from arch/x86. Signed-off-by: Masami Hiramatsu --- arch/x86/include/asm/kprobes.h |3 - arch/x86/kernel/kprobes/core.c | 96 +--- 2 files changed, 3

[PATCH -tip v4 04/27] ARC: kprobes: Remove jprobe implementation

2018-05-28 Thread Masami Hiramatsu
Remove arch dependent setjump/longjump functions and unused fields in kprobe_ctlblk for jprobes from arch/arc. Signed-off-by: Masami Hiramatsu --- arch/arc/include/asm/kprobes.h |2 -- arch/arc/kernel/kprobes.c | 38 ++ 2 files changed, 2

[PATCH -tip v4 05/27] ARM: kprobes: Remove jprobe arm implementation

2018-05-28 Thread Masami Hiramatsu
Remove arch dependent setjump/longjump functions and unused fields in kprobe_ctlblk for jprobes from arch/arm. Signed-off-by: Masami Hiramatsu --- arch/arm/include/asm/kprobes.h |2 - arch/arm/include/asm/probes.h |1 arch/arm/probes/kprobes/core.c | 114

[PATCH -tip v4 06/27] arm64: kprobes: Remove jprobe implementation

2018-05-28 Thread Masami Hiramatsu
Remove arch dependent setjump/longjump functions and unused fields in kprobe_ctlblk for jprobes from arch/arm64. Signed-off-by: Masami Hiramatsu --- arch/arm64/include/asm/kprobes.h |1 - arch/arm64/kernel/probes/kprobes.c | 68 2 files changed, 69

[PATCH -tip v4 07/27] powerpc/kprobes: Remove jprobe powerpc implementation

2018-05-28 Thread Masami Hiramatsu
Remove arch dependent setjump/longjump functions and unused fields in kprobe_ctlblk for jprobes from arch/powerpc. This also reverts commits related __is_active_jprobe() function. Signed-off-by: Masami Hiramatsu --- arch/powerpc/include/asm/kprobes.h |2 - arch/powerpc/kernel

[PATCH -tip v4 08/27] ia64: kprobes: Remove jprobe implementation

2018-05-28 Thread Masami Hiramatsu
. Signed-off-by: Masami Hiramatsu --- arch/ia64/include/asm/kprobes.h |2 - arch/ia64/kernel/Makefile |2 - arch/ia64/kernel/jprobes.S | 90 --- arch/ia64/kernel/kprobes.c | 70 -- 4 files changed, 1 insertion

[PATCH -tip v4 09/27] MIPS: kprobes: Remove jprobe implementation

2018-05-28 Thread Masami Hiramatsu
Remove arch dependent setjump/longjump functions and unused fields in kprobe_ctlblk for jprobes from arch/mips. Signed-off-by: Masami Hiramatsu --- arch/mips/include/asm/kprobes.h | 13 --- arch/mips/kernel/kprobes.c | 45 --- 2 files changed

[PATCH -tip v4 11/27] sh: kprobes: Remove jprobe implementation

2018-05-28 Thread Masami Hiramatsu
Remove arch dependent setjump/longjump functions and unused fields in kprobe_ctlblk for jprobes from arch/sh. Signed-off-by: Masami Hiramatsu --- arch/sh/include/asm/kprobes.h |4 --- arch/sh/kernel/kprobes.c | 51 - 2 files changed, 55

[PATCH -tip v4 10/27] s390/kprobes: Remove jprobe implementation

2018-05-28 Thread Masami Hiramatsu
Remove arch dependent setjump/longjump functions and unused fields in kprobe_ctlblk for jprobes from arch/s390. Signed-off-by: Masami Hiramatsu --- arch/s390/include/asm/kprobes.h |2 - arch/s390/kernel/kprobes.c | 59 +-- 2 files changed, 2

[PATCH -tip v4 12/27] sparc64: kprobes: Remove jprobe implementation

2018-05-28 Thread Masami Hiramatsu
Remove arch dependent setjump/longjump functions and unused fields in kprobe_ctlblk for jprobes from arch/sparc. Signed-off-by: Masami Hiramatsu --- arch/sparc/include/asm/kprobes.h |1 - arch/sparc/kernel/kprobes.c | 47 -- 2 files changed, 48

[PATCH -tip v4 13/27] kprobes: Don't check the ->break_handler() in generic kprobes code

2018-05-28 Thread Masami Hiramatsu
Don't check the ->break_handler() from the core kprobes code, because it was only used by jprobes which got removed. ( In followup patches we'll remove the remaining calls in low level arch handlers as well and remove the callback altogether. ) Signed-off-by: Mas

[PATCH -tip v4 15/27] ARC: kprobes: Don't call the ->break_handler() in ARC kprobes code

2018-05-28 Thread Masami Hiramatsu
Don't call the ->break_handler() from the ARC kprobes code, because it was only used by jprobes which got removed. Signed-off-by: Masami Hiramatsu --- arch/arc/kernel/kprobes.c |7 --- 1 file changed, 7 deletions(-) diff --git a/arch/arc/kernel/kprobes.c b/arch/arc/kernel/k

[PATCH -tip v4 14/27] kprobes/x86: Don't call ->break_handler() in x86 kprobes

2018-05-28 Thread Masami Hiramatsu
Don't call ->break_handler() and remove break_handler related code since that was only used by jprobe which got removed. Signed-off-by: Masami Hiramatsu --- arch/x86/include/asm/kprobes.h |2 +- arch/x86/kernel/kprobes/common.h | 10 -- arch/x86/kernel/kprobes/core.c

[PATCH -tip v4 16/27] ARM: kprobes: Don't call the ->break_handler() in arm kprobes code

2018-05-28 Thread Masami Hiramatsu
Don't call the ->break_handler() from the arm kprobes code, because it was only used by jprobes which got removed. Signed-off-by: Masami Hiramatsu --- arch/arm/probes/kprobes/core.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/arch/arm/probes/kprobes/core.c b/

[PATCH -tip v4 17/27] arm64: kprobes: Don't call the ->break_handler() in arm kprobes code

2018-05-28 Thread Masami Hiramatsu
Don't call the ->break_handler() from the arm kprobes code, because it was only used by jprobes which got removed. Signed-off-by: Masami Hiramatsu --- arch/arm64/kernel/probes/kprobes.c |8 1 file changed, 8 deletions(-) diff --git a/arch/arm64/kernel/probes/kprobes.c

[PATCH -tip v4 18/27] powerpc/kprobes: Don't call the ->break_handler() in arm kprobes code

2018-05-28 Thread Masami Hiramatsu
Don't call the ->break_handler() from the arm kprobes code, because it was only used by jprobes which got removed. This also makes skip_singlestep() a static function since only ftrace-kprobe.c is using this function. Signed-off-by: Masami Hiramatsu --- arch/powerpc/include/asm/k

[PATCH -tip v4 19/27] ia64: kprobes: Don't call the ->break_handler() in ia64 kprobes code

2018-05-28 Thread Masami Hiramatsu
Don't call the ->break_handler() from the ia64 kprobes code, because it was only used by jprobes which got removed. Signed-off-by: Masami Hiramatsu --- arch/ia64/include/uapi/asm/break.h |1 - arch/ia64/kernel/kprobes.c | 10 -- 2 files changed, 11 deletions(-) di

[PATCH -tip v4 20/27] MIPS: kprobes: Don't call the ->break_handler() in MIPS kprobes code

2018-05-28 Thread Masami Hiramatsu
Don't call the ->break_handler() from the MIPS kprobes code, because it was only used by jprobes which got removed. Signed-off-by: Masami Hiramatsu --- arch/mips/kernel/kprobes.c | 21 +++-- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/arch/mip

[PATCH -tip v4 21/27] s390/kprobes: Don't call the ->break_handler() in s390 kprobes code

2018-05-28 Thread Masami Hiramatsu
Don't call the ->break_handler() from the s390 kprobes code, because it was only used by jprobes which got removed. Signed-off-by: Masami Hiramatsu --- arch/s390/kernel/kprobes.c | 20 1 file changed, 20 deletions(-) diff --git a/arch/s390/kernel/kprobes.c b/a

[PATCH -tip v4 22/27] sh: kprobes: Don't call the ->break_handler() in SH kprobes code

2018-05-28 Thread Masami Hiramatsu
Don't call the ->break_handler() from the SH kprobes code, because it was only used by jprobes which got removed. Signed-off-by: Masami Hiramatsu --- arch/sh/kernel/kprobes.c | 14 +- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/arch/sh/kernel/kprobes.c b

[PATCH -tip v4 23/27] sparc64: kprobes: Don't call the ->break_handler() in sparc64 kprobes code

2018-05-28 Thread Masami Hiramatsu
Don't call the ->break_handler() from the sparc64 kprobes code, because it was only used by jprobes which got removed. Signed-off-by: Masami Hiramatsu --- arch/sparc/kernel/kprobes.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/arch/sparc/kernel/kpr

[PATCH -tip v4 25/27] x86: kprobes: Do not disable preempt on int3 path

2018-05-28 Thread Masami Hiramatsu
Since int3 and debug exception(for singlestep) are run with IRQ disabled and while running single stepping we drop IF from regs->flags, that path must not be preemptible. So we can remove the preempt disable/enable calls from that path. Signed-off-by: Masami Hiramatsu Suggested-by: Ingo Mol

[PATCH -tip v4 24/27] bpf: error-inject: kprobes: Clear current_kprobe and enable preempt in kprobe

2018-05-28 Thread Masami Hiramatsu
-off-by: Masami Hiramatsu --- arch/arc/kernel/kprobes.c |5 +++-- arch/arm/probes/kprobes/core.c | 10 +- arch/arm64/kernel/probes/kprobes.c | 10 +- arch/ia64/kernel/kprobes.c | 13 - arch/mips/kernel/kprobes.c |4 ++-- arch

[PATCH -tip v4 26/27] Documentation: kprobes: Add how to change the execution path

2018-05-28 Thread Masami Hiramatsu
Add a section that explaining how to change the execution path with kprobes. Signed-off-by: Masami Hiramatsu --- Documentation/kprobes.txt | 20 1 file changed, 20 insertions(+) diff --git a/Documentation/kprobes.txt b/Documentation/kprobes.txt index 3e9e99ea751b

[PATCH -tip v4 27/27] kprobes: Remove jprobe stub API

2018-05-28 Thread Masami Hiramatsu
Remove jprobe stub APIs from linux/kprobes.h since the jprobe implementation was completely gone. Signed-off-by: Masami Hiramatsu --- include/linux/kprobes.h | 50 --- 1 file changed, 50 deletions(-) diff --git a/include/linux/kprobes.h b/include

Re: [BUGFIX PATCH v3 0/4] arm: kprobes: Fix to prohibit probing on unsafe functions

2018-05-11 Thread Masami Hiramatsu
Hi Greg, Could you pick this series to stable? Thank you, On Tue, 8 May 2018 12:25:03 +0100 Russell King - ARM Linux wrote: > On Fri, May 04, 2018 at 01:14:31PM +0900, Masami Hiramatsu wrote: > > Hi, > > > > This is the 3rd version of bugfix series for kprobes on arm. &g

Re: [BUGFIX PATCH v3 0/4] arm: kprobes: Fix to prohibit probing on unsafe functions

2018-05-12 Thread Masami Hiramatsu
Hi Russell, On Tue, 8 May 2018 12:25:03 +0100 Russell King - ARM Linux wrote: > On Fri, May 04, 2018 at 01:14:31PM +0900, Masami Hiramatsu wrote: > > Hi, > > > > This is the 3rd version of bugfix series for kprobes on arm. > > This series fixes 4 different issues whi

Re: [RFC][PATCH 01/10] tracing: Do not reference event data in post call triggers

2018-05-12 Thread Masami Hiramatsu
by new post call > trigger users. > OK, so after commit the event record, the event handler should not access it. Looks good to me. Reviewed-by: Masami Hiramatsu Thanks, > Signed-off-by: Steven Rostedt (VMware) > --- > include/linux/trace_events.h| 3 +-- > kernel/t

Re: [RFC][PATCH 07/10] tracing: Have zero size length in filter logic be full string

2018-05-12 Thread Masami Hiramatsu
return 1; > - return 0; > + /* len means str is dynamic and ends with '\0' */ ^^^ !len (or len == 0)? Thank you, -- Masami Hiramatsu

Re: [BUGFIX PATCH v3 0/4] arm: kprobes: Fix to prohibit probing on unsafe functions

2018-05-12 Thread Masami Hiramatsu
On Sat, 12 May 2018 10:29:57 -0700 Florian Fainelli wrote: > On May 12, 2018 4:31:37 AM PDT, Masami Hiramatsu wrote: > >Hi Russell, > > > >On Tue, 8 May 2018 12:25:03 +0100 > >Russell King - ARM Linux wrote: > > > >> On Fri, May 04, 2018 at 01:14:31P

Re: [RFC PATCH -tip 2/4] kprobes: Remove jprobe generic code

2018-05-13 Thread Masami Hiramatsu
On Sun, 13 May 2018 21:55:38 +0200 (CEST) Thomas Gleixner wrote: > On Tue, 8 May 2018, Masami Hiramatsu wrote: > > > Remove jprobe arch independent generic code > > from kernel/kprobes.c. > > # git grep register_jprobes > include/linux/kprobes.h:static inline int reg

Re: [RFC 0/6] perf probe: Attempt to improve C++ probing

2018-05-14 Thread Masami Hiramatsu
+- > tools/perf/util/probe-finder.c | 152 > ++--- > tools/perf/util/probe-finder.h | 3 + > tools/perf/util/string.c | 57 > tools/perf/util/string2.h | 1 + > 6 files changed, 247 insertions(+), 45 deletions(-) > > -- > 2.7.4 > -- Masami Hiramatsu

Re: [RFC 0/6] perf probe: Attempt to improve C++ probing

2018-05-14 Thread Masami Hiramatsu
; My test set includes: > > ./perf probe -x . -L "std::vector >::at" > ./perf probe -x . -L "std::vector >::at:2-3" > > ./perf probe -x . -V "std::vector >::at" > ./perf probe -x . -V "std::vector >::at:2" > ./perf probe -x

Re: [PATCH 01/18] kernel: Use pr_fmt

2018-05-14 Thread Masami Hiramatsu
gn arguments to 80 columns where sensible > o Coalesce formats > > Signed-off-by: Joe Perches Kprobes part looks good to me. Acked-by: Masami Hiramatsu Thanks! -- Masami Hiramatsu

Re: [PATCH RFC] tracing: Call triggers only if event passes filter checks

2018-06-16 Thread Masami Hiramatsu
synthetic/preemptdisable/filter Have you tried if statement as below? echo "stacktrace if lat > 400" > /sys/kernel/debug/tracing/events/synthetic/preemptdisable/trigger As my understanding, filter is used for controlling "recording the event" and trigger is out of its scope. Trigger itself has own filter as "if statement", so you should use it. Thank you, -- Masami Hiramatsu

[PATCH -tip v6 00/27] kprobes: Cleanup jprobe implementation

2018-06-19 Thread Masami Hiramatsu
above patches. Result = I've tested it with kprobe sanity test on x86-64, and arm64 but for other archs, I just did cross-build test. Thank you, --- Masami Hiramatsu (27): Documentation/kprobes: Fix to remove remaining jprobe kprobes: Remove jprobe API implementation k

[PATCH -tip v6 02/27] kprobes: Remove jprobe API implementation

2018-06-19 Thread Masami Hiramatsu
Remove jprobe API implementations and test cases for those APIs which is no more used. Signed-off-by: Masami Hiramatsu --- Changes in v4: - Cleanup lib/Kconfig.debug description too. Changes in v3: - Remove test cases. --- include/linux/kprobes.h |3 -- kernel/kprobes.c| 78

[PATCH -tip v6 03/27] kprobes/x86: Remove jprobe implementation

2018-06-19 Thread Masami Hiramatsu
Remove arch dependent setjump/longjump functions and unused fields in kprobe_ctlblk for jprobes from arch/x86. Signed-off-by: Masami Hiramatsu Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: x...@kernel.org --- arch/x86/include/asm/kprobes.h |3 - arch/x86/kern

[PATCH -tip v6 05/27] ARM: kprobes: Remove jprobe arm implementation

2018-06-19 Thread Masami Hiramatsu
Remove arch dependent setjump/longjump functions and unused fields in kprobe_ctlblk for jprobes from arch/arm. Signed-off-by: Masami Hiramatsu Cc: Russell King Cc: linux-arm-ker...@lists.infradead.org --- arch/arm/include/asm/kprobes.h |2 - arch/arm/include/asm/probes.h |1 arch/arm

[PATCH -tip v6 06/27] arm64: kprobes: Remove jprobe implementation

2018-06-19 Thread Masami Hiramatsu
Remove arch dependent setjump/longjump functions and unused fields in kprobe_ctlblk for jprobes from arch/arm64. Signed-off-by: Masami Hiramatsu Acked-by: Will Deacon Cc: Catalin Marinas Cc: linux-arm-ker...@lists.infradead.org --- arch/arm64/include/asm/kprobes.h |1 - arch/arm64

[PATCH -tip v6 08/27] ia64: kprobes: Remove jprobe implementation

2018-06-19 Thread Masami Hiramatsu
. Signed-off-by: Masami Hiramatsu Cc: Tony Luck Cc: Fenghua Yu Cc: linux-i...@vger.kernel.org --- arch/ia64/include/asm/kprobes.h |2 - arch/ia64/kernel/Makefile |2 - arch/ia64/kernel/jprobes.S | 90 --- arch/ia64/kernel/kprobes.c

[PATCH -tip v6 09/27] MIPS: kprobes: Remove jprobe implementation

2018-06-19 Thread Masami Hiramatsu
Remove arch dependent setjump/longjump functions and unused fields in kprobe_ctlblk for jprobes from arch/mips. Signed-off-by: Masami Hiramatsu Cc: Ralf Baechle Cc: James Hogan Cc: linux-m...@linux-mips.org --- arch/mips/include/asm/kprobes.h | 13 --- arch/mips/kernel/kprobes.c

[PATCH -tip v6 10/27] s390/kprobes: Remove jprobe implementation

2018-06-19 Thread Masami Hiramatsu
Remove arch dependent setjump/longjump functions and unused fields in kprobe_ctlblk for jprobes from arch/s390. Signed-off-by: Masami Hiramatsu Cc: Martin Schwidefsky Cc: Heiko Carstens Cc: linux-s...@vger.kernel.org --- arch/s390/include/asm/kprobes.h |2 - arch/s390/kernel/kprobes.c

<    4   5   6   7   8   9   10   11   12   13   >