Re: Re: [PATCH v3 0/7] Fixes for perf probe issues on ppc

2015-04-28 Thread Masami Hiramatsu
my local tree, to give > time to Masami and Srikar, ok? OK, I reviewed all the patches in this series :) Acked-by: Masami Hiramatsu for this series. Thank you! -- Masami HIRAMATSU Linux Technology Research Center, System Productivity Research Dept. Center for Technology Innovation

Re: Re: [PATCH 3/3] kexec: Change the timing of callbacks related to "crash_kexec_post_notifiers" boot option

2015-07-14 Thread Masami Hiramatsu
t; have already been stopped and register states have already been saved. Ah, nice! I like this idea :) > > IOW, is there a reason that we can't get rid of smp_send_stop() and > use the mechanism crash_kexec() is using to stop cpus after panic()?

Re: Re: [PATCH 1/3] panic: Disable crash_kexec_post_notifiers if kdump is not available

2015-07-14 Thread Masami Hiramatsu
own broken so let's >> just revert the fool thing. > > Masami, you introduced this option. Are you fine with the revert? Is it > really being used and tested? Actually, it is tested but under very limited situation. I think we need a clear acceptance criteria, IOW, we need a

Re: [PATCH] kprobes: Mark OPTPROBES n/a for powerpc

2015-07-18 Thread Masami Hiramatsu
; | s390: | TODO | > | score: | TODO | > | sh: | TODO | > > -- Masami HIRAMATSU Linux Technology Research Center, System Productivity Research Dept. Center for Technology Innovation - Systems Engineering Hitachi, Ltd., Research & Development

Re: [PATCH V2 1/2] Documentation/features: Add na key to arch-support.txt

2015-07-18 Thread Masami Hiramatsu
ure will not be supported by the architecture "will not" sounds like someone's will. I guess it could be "feature is useless/needless on the architecture". Thank you, -- Masami HIRAMATSU Linux Technology Research Center, System Productivity Research Dept. Center for

Re: [PATCH] kprobes: Mark OPTPROBES n/a for powerpc

2015-07-21 Thread Masami Hiramatsu
On 2015/07/21 13:34, Ananth N Mavinakayanahalli wrote: > On Tue, Jul 21, 2015 at 12:53:07PM +1000, Michael Ellerman wrote: >> On Sun, 2015-07-19 at 11:21 +0900, Masami Hiramatsu wrote: >>> On 2015/07/16 19:56, Ananth N Mavinakayanahalli wrote: >>>> Kprobes uses a

[RFT PATCH -next ] [BUGFIX] kprobes: Fix "Failed to find blacklist" error on ia64 and ppc64

2014-05-07 Thread Masami Hiramatsu
Failed to find blacklist 0001013a3280a000 To fix this bug, this introduces function_entry() macro to retrieve the entry address from the given function pointer, and uses it in NOKPROBE_SYMBOL(). Signed-off-by: Masami Hiramatsu Reported-by: Tony Luck Cc: Tony Luck Cc: Fenghua Yu Cc: Benjamin

Re: [RFT PATCH -next ] [BUGFIX] kprobes: Fix "Failed to find blacklist" error on ia64 and ppc64

2014-05-07 Thread Masami Hiramatsu
Hi Tony, Benjamin and Paul, I've tried to fix this bug, but since I don't have either ppc64 nor ia64, this patch is not tested on those archs. Please review and test it on those machines. Thank you, (2014/05/07 20:55), Masami Hiramatsu wrote: > On ia64 and ppc64, the function poi

Re: [RFT PATCH -next ] [BUGFIX] kprobes: Fix "Failed to find blacklist" error on ia64 and ppc64

2014-05-07 Thread Masami Hiramatsu
(2014/05/08 13:47), Ananth N Mavinakayanahalli wrote: > On Wed, May 07, 2014 at 08:55:51PM +0900, Masami Hiramatsu wrote: > > ... > >> +#if defined(CONFIG_PPC64) && (!defined(_CALL_ELF) || _CALL_ELF == 1) >> +/* >> + * On PPC64 ABIv1 the function pointer ac

Re: [RFT PATCH -next ] [BUGFIX] kprobes: Fix "Failed to find blacklist" error on ia64 and ppc64

2014-05-09 Thread Masami Hiramatsu
(2014/05/08 15:16), Ananth N Mavinakayanahalli wrote: > On Thu, May 08, 2014 at 02:40:00PM +0900, Masami Hiramatsu wrote: >> (2014/05/08 13:47), Ananth N Mavinakayanahalli wrote: >>> On Wed, May 07, 2014 at 08:55:51PM +0900, Masami Hiramatsu wrote: >>> >>> ..

Re: Re: [RFT PATCH -next ] [BUGFIX] kprobes: Fix "Failed to find blacklist" error on ia64 and ppc64

2014-05-14 Thread Masami Hiramatsu
(2014/05/07 20:59), Masami Hiramatsu wrote: > Hi Tony, Benjamin and Paul, > > I've tried to fix this bug, but since I don't have either ppc64 nor ia64, > this patch is not tested on those archs. Please review and test it on > those machines. Ping? I need your hel

Re: [RFT PATCH -next ] [BUGFIX] kprobes: Fix "Failed to find blacklist" error on ia64 and ppc64

2014-05-26 Thread Masami Hiramatsu
(2014/05/26 20:25), Suzuki K. Poulose wrote: > On 05/07/2014 05:25 PM, Masami Hiramatsu wrote: >> On ia64 and ppc64, the function pointer does not point the >> entry address of the function, but the address of function >> discriptor (which contains the entry address and mis

[RFT PATCH -next v2] [BUGFIX] kprobes: Fix "Failed to find blacklist" error on ia64 and ppc64

2014-05-26 Thread Masami Hiramatsu
symbols instead of storing it. - Update for the latest -next. Signed-off-by: Masami Hiramatsu Reported-by: Tony Luck Cc: Suzuki K. Poulose Cc: Tony Luck Cc: Fenghua Yu Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Ananth N Mavinakayanahalli Cc: Kevin Hao Cc: linux-i...@vger.kernel.org

Re: [RFT PATCH -next v2] [BUGFIX] kprobes: Fix "Failed to find blacklist" error on ia64 and ppc64

2014-05-29 Thread Masami Hiramatsu
+2053,8 @@ static int __init > populate_kprobe_blacklist(unsigned long *start, > ent = kmalloc(sizeof(*ent), GFP_KERNEL); > if (!ent) > return -ENOMEM; > - ent->start_addr = *iter; > -

[RFT PATCH -next v3] [BUGFIX] kprobes: Fix "Failed to find blacklist" error on ia64 and ppc64

2014-05-29 Thread Masami Hiramatsu
function entry instead of function descriptor. (Suzuki's work, Thanks!) Changes in V2: - Use function_entry() macro when lookin up symbols instead of storing it. - Update for the latest -next. Signed-off-by: Masami Hiramatsu Signed-off-by: Suzuki K. Poulose Reported-by: Tony Luc

Re: [RFT PATCH -next v3] [BUGFIX] kprobes: Fix "Failed to find blacklist" error on ia64 and ppc64

2014-06-05 Thread Masami Hiramatsu
Ping? I guess this should go to 3.16 branch, shouldn't it? (2014/05/30 12:18), Masami Hiramatsu wrote: > On ia64 and ppc64, the function pointer does not point the > entry address of the function, but the address of function > discriptor (which contains the entry address and misc

Re: Re: [RFT PATCH -next v3] [BUGFIX] kprobes: Fix "Failed to find blacklist" error on ia64 and ppc64

2014-06-18 Thread Masami Hiramatsu
(2014/06/18 16:56), Michael Ellerman wrote: > On Fri, 2014-06-06 at 15:38 +0900, Masami Hiramatsu wrote: >> Ping? >> >> I guess this should go to 3.16 branch, shouldn't it? > >>> diff --git a/arch/powerpc/include/asm/types.h >>> b/arch/powerpc

Re: [RFT PATCH -next v3] [BUGFIX] kprobes: Fix "Failed to find blacklist" error on ia64 and ppc64

2014-06-18 Thread Masami Hiramatsu
(2014/06/19 10:30), Michael Ellerman wrote: > On Wed, 2014-06-18 at 17:46 +0900, Masami Hiramatsu wrote: >> (2014/06/18 16:56), Michael Ellerman wrote: >>> On Fri, 2014-06-06 at 15:38 +0900, Masami Hiramatsu wrote: >>>> Ping? >>>> >>>&g

Re: Re: [RFT PATCH -next v3] [BUGFIX] kprobes: Fix "Failed to find blacklist" error on ia64 and ppc64

2014-06-19 Thread Masami Hiramatsu
(2014/06/19 15:40), Suzuki K. Poulose wrote: > On 06/19/2014 10:22 AM, Masami Hiramatsu wrote: >> (2014/06/19 10:30), Michael Ellerman wrote: >>> On Wed, 2014-06-18 at 17:46 +0900, Masami Hiramatsu wrote: >>>> (2014/06/18 16:56), Michael Ellerman wrote: >>&

Re: Re: [RFT PATCH -next v3] [BUGFIX] kprobes: Fix "Failed to find blacklist" error on ia64 and ppc64

2014-06-19 Thread Masami Hiramatsu
(2014/06/19 18:45), Suzuki K. Poulose wrote: > On 06/19/2014 12:56 PM, Masami Hiramatsu wrote: >> (2014/06/19 15:40), Suzuki K. Poulose wrote: >>> On 06/19/2014 10:22 AM, Masami Hiramatsu wrote: >>>> (2014/06/19 10:30), Michael Ellerman wrote: >>>>&

Re: Re: Re: [RFT PATCH -next v3] [BUGFIX] kprobes: Fix "Failed to find blacklist" error on ia64 and ppc64

2014-06-19 Thread Masami Hiramatsu
(2014/06/19 20:01), Masami Hiramatsu wrote: >>>>> Ah, those messages should be shown in dmesg when booting if it doesn't >>>>> work, >>>>> because the messages are printed by initialization process of kprobe >>>>> blacklist. >

Re: [RFT PATCH -next v3] [BUGFIX] kprobes: Fix "Failed to find blacklist" error on ia64 and ppc64

2014-06-19 Thread Masami Hiramatsu
(2014/06/20 9:37), Michael Ellerman wrote: > On Thu, 2014-06-19 at 20:20 +0900, Masami Hiramatsu wrote: >> (2014/06/19 20:01), Masami Hiramatsu wrote: >> >>>>>>> Ah, those messages should be shown in dmesg when booting if it doesn't >>>>

[PATCH v4] [BUGFIX] kprobes: Fix "Failed to find blacklist" error on ia64 and ppc64

2014-06-19 Thread Masami Hiramatsu
r the latest -next. Signed-off-by: Masami Hiramatsu Reported-by: Tony Luck Tested-by: Tony Luck Cc: Michael Ellerman Cc: Suzuki K. Poulose Cc: Tony Luck Cc: Fenghua Yu Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Ananth N Mavinakayanahalli Cc: Kevin Hao Cc: linux-i...@vger.kernel.o

Re: [PATCH v4] [BUGFIX] kprobes: Fix "Failed to find blacklist" error on ia64 and ppc64

2014-06-29 Thread Masami Hiramatsu
Ping? :) (2014/06/20 11:23), Masami Hiramatsu wrote: > On ia64 and ppc64, the function pointer does not point the > entry address of the function, but the address of function > discriptor (which contains the entry address and misc > data.) Since the kprobes passes the function pointer

Re: Re: [PATCH v4] [BUGFIX] kprobes: Fix "Failed to find blacklist" error on ia64 and ppc64

2014-06-30 Thread Masami Hiramatsu
(2014/06/30 20:36), Michael Ellerman wrote: > On Mon, 2014-06-30 at 12:14 +0900, Masami Hiramatsu wrote: >> Ping? :) > > Yeah sorry. I started looking at this and got dragged into another mess. > > You seem to have duplicated the functionality of arch_deref_entry_point(), &

Re: Re: Re: [PATCH v4] [BUGFIX] kprobes: Fix "Failed to find blacklist" error on ia64 and ppc64

2014-07-01 Thread Masami Hiramatsu
(2014/07/02 13:41), Michael Ellerman wrote: > On Tue, 2014-07-01 at 11:21 +0900, Masami Hiramatsu wrote: >> (2014/06/30 20:36), Michael Ellerman wrote: >>> On Mon, 2014-06-30 at 12:14 +0900, Masami Hiramatsu wrote: >>>> Ping? :) >>> >>> Yeah sorry

[PATCH v5 1/2] kprobes/powerpc: Fix arch_deref_entry_point to support ABIv2

2014-07-02 Thread Masami Hiramatsu
Since PowerPC64 ABIv2 doesn't have function descriptor any more, arch_deref_entry_point(), which returns function entry point from function descriptor, should be updated. Signed-off-by: Masami Hiramatsu Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Anoop Thomas Mathew Cc: Jiri Kosin

[PATCH v5 2/2] [BUGFIX] kprobes: Fix "Failed to find blacklist" error on ia64 and ppc64

2014-07-02 Thread Masami Hiramatsu
- Use function_entry() macro when lookin up symbols instead of storing it. - Update for the latest -next. Signed-off-by: Masami Hiramatsu Reported-by: Tony Luck Tested-by: Tony Luck Cc: Michael Ellerman Cc: Suzuki K. Poulose Cc: Tony Luck Cc: Fenghua Yu Cc: Benjamin Herrenschmidt Cc: Paul Mackerra

Re: Re: Re: Re: [PATCH v4] [BUGFIX] kprobes: Fix "Failed to find blacklist" error on ia64 and ppc64

2014-07-02 Thread Masami Hiramatsu
(2014/07/02 15:56), Michael Ellerman wrote: > On Wed, 2014-07-02 at 15:39 +0900, Masami Hiramatsu wrote: >> (2014/07/02 13:41), Michael Ellerman wrote: >>> On Tue, 2014-07-01 at 11:21 +0900, Masami Hiramatsu wrote: >>>> (2014/06/30 20:36), Michael Ellerman wrote: >

Re: [PATCH v5 1/2] kprobes/powerpc: Fix arch_deref_entry_point to support ABIv2

2014-07-02 Thread Masami Hiramatsu
(2014/07/02 16:00), Masami Hiramatsu wrote: > Since PowerPC64 ABIv2 doesn't have function descriptor > any more, arch_deref_entry_point(), which returns function > entry point from function descriptor, should be updated. Please ignore this patch, since it is already fixed by

Re: [PATCH v5 2/2] [BUGFIX] kprobes: Fix "Failed to find blacklist" error on ia64 and ppc64

2014-07-08 Thread Masami Hiramatsu
Ping? This patch can be applied without 1/2, and will fix ia64/ppc64 problem. Thank you, (2014/07/02 16:00), Masami Hiramatsu wrote: > On ia64 and ppc64, the function pointer does not point the > entry address of the function, but the address of function > discriptor (which contains

Re: Re: [PATCH v5 2/2] [BUGFIX] kprobes: Fix "Failed to find blacklist" error on ia64 and ppc64

2014-07-14 Thread Masami Hiramatsu
(2014/07/15 11:11), Michael Ellerman wrote: > On Mon, 2014-07-14 at 10:17 -0700, Tony Luck wrote: >> On Tue, Jul 8, 2014 at 5:07 AM, Masami Hiramatsu >> wrote: >>> Ping? >>> >>> This patch can be applied without 1/2, and will fix ia64/ppc64 problem. >

Re: Re: [PATCH v5 2/2] [BUGFIX] kprobes: Fix "Failed to find blacklist" error on ia64 and ppc64

2014-07-15 Thread Masami Hiramatsu
(2014/07/15 16:16), Benjamin Herrenschmidt wrote: > On Tue, 2014-07-15 at 13:19 +1000, Michael Ellerman wrote: > >>> Signed-off-by: Masami Hiramatsu >>> Reported-by: Tony Luck >>> Tested-by: Tony Luck >>> Cc: Michael Ellerman >> >> Test

Re: Re: Re: [PATCH v5 2/2] [BUGFIX] kprobes: Fix "Failed to find blacklist" error on ia64 and ppc64

2014-07-17 Thread Masami Hiramatsu
(2014/07/16 22:28), Ingo Molnar wrote: > > * Masami Hiramatsu wrote: > >> (2014/07/15 16:16), Benjamin Herrenschmidt wrote: >>> On Tue, 2014-07-15 at 13:19 +1000, Michael Ellerman wrote: >>> >>>>> Signed-off-by: Masami Hiramatsu >>

[RESEND PATCH v5] [BUGFIX] kprobes: Fix "Failed to find blacklist" error on ia64 and ppc64

2014-07-17 Thread Masami Hiramatsu
- Use function_entry() macro when lookin up symbols instead of storing it. - Update for the latest -next. Signed-off-by: Masami Hiramatsu Signed-off-by: Suzuki K. Poulose Reported-by: Tony Luck Tested-by: Tony Luck Tested-by: Michael Ellerman Acked-by: Michael Ellerman (for powerpc) Acked-by: Ben

Re: [RESEND PATCH v5] [BUGFIX] kprobes: Fix "Failed to find blacklist" error on ia64 and ppc64

2014-07-17 Thread Masami Hiramatsu
(2014/07/17 18:38), Ingo Molnar wrote: > > * Masami Hiramatsu wrote: > >> Signed-off-by: Masami Hiramatsu >> Signed-off-by: Suzuki K. Poulose > > Looks good, but this is not a valid SOB sequence: if Suzuki wrote the > patch then he should be the first SOB (

Re: Re: [RESEND PATCH v5] [BUGFIX] kprobes: Fix "Failed to find blacklist" error on ia64 and ppc64

2014-07-17 Thread Masami Hiramatsu
(2014/07/17 20:17), Masami Hiramatsu wrote: > (2014/07/17 18:38), Ingo Molnar wrote: >> >> * Masami Hiramatsu wrote: >> >>> Signed-off-by: Masami Hiramatsu >>> Signed-off-by: Suzuki K. Poulose >> >> Looks good, but this is not a valid SOB seq

[PATCH v6] [BUGFIX] kprobes: Fix "Failed to find blacklist" error on ia64 and ppc64

2014-07-17 Thread Masami Hiramatsu
atest -next. Signed-off-by: Masami Hiramatsu Fixed-by: Suzuki K. Poulose Reported-by: Tony Luck Tested-by: Tony Luck Tested-by: Michael Ellerman Acked-by: Michael Ellerman (for powerpc) Acked-by: Benjamin Herrenschmidt Cc: Fenghua Yu Cc: Paul Mackerras Cc: Ananth N Mavinakayanahalli Cc: Ke

Re: Re: [PATCHv2 2/8] perf probe: Improve detection of file/function name in the probe pattern

2015-03-13 Thread Masami Hiramatsu
> @@ -1009,10 +1027,9 @@ static int parse_perf_probe_point(char *arg, struct >> perf_probe_event *pev) >> if (tmp == NULL) >> return -ENOMEM; >> >> -/* Check arg is function or file and copy it */ >> -if (strchr(tmp, '.')) /

Re: [PATCH 6/7] kprobes/ftrace: Use ftrace_location() when [dis]arming probes

2019-06-21 Thread Masami Hiramatsu
ftrace_function() to > identify the filter IP. This looks good to me. Acked-by: Masami Hiramatsu Thank you! > > Signed-off-by: Naveen N. Rao > --- > kernel/kprobes.c | 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/kernel/kpro

Re: [PATCH 7/7] powerpc/kprobes: Allow probing on any ftrace address

2019-06-21 Thread Masami Hiramatsu
* If pre_handler returns !0, it changes regs->nip. We have to > @@ -57,6 +82,11 @@ NOKPROBE_SYMBOL(kprobe_ftrace_handler); > > int arch_prepare_kprobe_ftrace(struct kprobe *p) > { > + if ((unsigned long)p->addr & 0x03) { > + printk("Attempt to register kprobe at an unaligned address\n"); > + return -EILSEQ; > + } > + > p->ainsn.insn = NULL; > p->ainsn.boostable = -1; > return 0; > -- > 2.22.0 > -- Masami Hiramatsu

Re: [PATCH v2 7/7] powerpc/kprobes: Allow probing on any ftrace address

2019-06-27 Thread Masami Hiramatsu
k_ftrace_location() > > In addition, we update kprobe_ftrace_handler() to detect this scenarios > and to pass the proper nip to the pre and post probe handlers. > > Signed-off-by: Naveen N. Rao Looks good to me. Reviewed-by: Masami Hiramatsu Thank you! > --- > arch/po

Re: [PATCH] mm/kprobes: Add generic kprobe_fault_handler() fallback definition

2019-07-05 Thread Masami Hiramatsu
el Ellerman > Cc: Heiko Carstens > Cc: Vasily Gorbik > Cc: Christian Borntraeger > Cc: Yoshinori Sato > Cc: Rich Felker > Cc: "David S. Miller" > Cc: Thomas Gleixner > Cc: Ingo Molnar > Cc: Borislav Petkov > Cc: "H. Peter Anvin" > Cc: &

Re: [PATCH] mm/kprobes: Add generic kprobe_fault_handler() fallback definition

2019-07-11 Thread Masami Hiramatsu
his enables stud > >> definitions for generic kporbe_fault_handler() and kprobes_built_in() can > >> just be dropped. Only on x86 it needs to be added back locally as it gets > >> used in a !CONFIG_KPROBES function do_general_protection(). > > > > If you want to remove kprobes_built_in(), you should replace it with > > IS_ENABLED(CONFIG_KPROBES), instead of this... > > Apart from kprobes_built_in() the intent was to remove !CONFIG_KPROBES > stub for kprobe_fault_handler() as well which required making generic > kprobe_page_fault() to be empty in such case. No, I meant that "IS_ENABLED(CONFIG_KPROBES)" is generic and is equal to what kprobes_built_in() does. Thank you, -- Masami Hiramatsu

Re: [PATCH v2 0/3] arm/arm64: Add support for function error injection

2019-08-06 Thread Masami Hiramatsu
asm-generic header (Will); > * Used APIs to access pt_regs elements (Will); > * Fixed typos in the comments (Will). This looks good to me. Reviewed-by: Masami Hiramatsu Thank you! > > > Leo Yan (3): > error-injection: Consolidate override function defi

Re: [PATCH 1/2] error-injection: Simplify arch specific helpers

2018-05-30 Thread Masami Hiramatsu
_2(bpf_override_return, struct pt_regs *, regs, unsigned long, rc) > { > regs_set_return_value(regs, rc); > - override_function_with_return(regs); > + instruction_pointer_set(regs, (unsigned long)&just_return_func); > return 0; > } > > diff --git a/lib/error-inject.c b/lib/error-inject.c > index c0d4600f4896..7fdc92b5babc 100644 > --- a/lib/error-inject.c > +++ b/lib/error-inject.c > @@ -20,6 +20,14 @@ struct ei_entry { > void *priv; > }; > > +asm( > + ".type just_return_func, @function\n" > + ".globl just_return_func\n" > + "just_return_func:\n" > + ARCH_FUNC_RET "\n" > + ".size just_return_func, .-just_return_func\n" > +); > + > bool within_error_injection_list(unsigned long addr) > { > struct ei_entry *ent; > -- > 2.17.0 > -- Masami Hiramatsu

Re: [PATCH 1/2] error-injection: Simplify arch specific helpers

2018-06-01 Thread Masami Hiramatsu
On Thu, 31 May 2018 15:39:03 +0530 "Naveen N. Rao" wrote: > Masami Hiramatsu wrote: > > On Tue, 29 May 2018 18:06:02 +0530 > > "Naveen N. Rao" wrote: > > > >> We already have an arch-independent way to set the instruction pointer > >>

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

2018-06-04 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 Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: "Nav

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

2018-06-04 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 Cc: Benjamin Herrenschmidt

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

2018-06-04 Thread Masami Hiramatsu
powerpc and x86, this removes all preempt_disable from kprobe_ftrace_handler because ftrace callbacks are called under preempt disabled. Signed-off-by: Masami Hiramatsu Cc: Vineet Gupta Cc: Russell King Cc: Catalin Marinas Cc: Will Deacon Cc: Tony Luck Cc: Fenghua Yu Cc: Ralf Baechle Cc

Re: [RFC PATCH -tip v5 07/27] powerpc/kprobes: Remove jprobe powerpc implementation

2018-06-07 Thread Masami Hiramatsu
On Thu, 07 Jun 2018 17:01:23 +0530 "Naveen N. Rao" wrote: > Masami Hiramatsu wrote: > > Remove arch dependent setjump/longjump functions > > and unused fields in kprobe_ctlblk for jprobes > > from arch/powerpc. This also reverts commits > > related __is_acti

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

2018-06-07 Thread Masami Hiramatsu
On Thu, 07 Jun 2018 17:07:00 +0530 "Naveen N. Rao" wrote: > Masami Hiramatsu wrote: > > Don't call the ->break_handler() from the arm kprobes code, > ^^^ powerpc > > > because it was only used by jprobes whic

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

2018-06-07 Thread Masami Hiramatsu
On Thu, 07 Jun 2018 22:07:26 +0530 "Naveen N. Rao" wrote: > Masami Hiramatsu wrote: > > On Thu, 07 Jun 2018 17:07:00 +0530 > > "Naveen N. Rao" wrote: > > > >> Masami Hiramatsu wrote: > >> &

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

2018-06-19 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 Acked-by: "Naveen N. Rao" Cc: Benjamin Herrenschmidt Cc: Paul Mac

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

2018-06-19 Thread Masami Hiramatsu
Don't call the ->break_handler() from the powerpc kprobes code, because it was only used by jprobes which got removed. This also removes skip_singlestep() and embeds it in the caller, kprobe_ftrace_handler(), which simplifies regs->nip operation around there. Signed-off-by: Masam

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

2018-06-19 Thread Masami Hiramatsu
powerpc and x86, this removes all preempt_disable from kprobe_ftrace_handler because ftrace callbacks are called under preempt disabled. Signed-off-by: Masami Hiramatsu Acked-by: "Naveen N. Rao" Cc: Vineet Gupta Cc: Russell King Cc: Catalin Marinas Cc: Will Deacon Cc: Tony Luck C

Re: [PATCH v4 2/9] perf/core: open access for CAP_SYS_PERFMON privileged process

2020-01-10 Thread Masami Hiramatsu
t allow creating kprobes, right? > > That is; I don't think CAP_SYS_PERFMON should be allowed to create > kprobes. > > As might be clear; I don't actually know what the user-ABI is for > creating kprobes. There are 2 ABIs nowadays, ftrace and ebpf. perf-probe uses ftrace interface to define new kprobe events, and those events are treated as completely same as tracepoint events. On the other hand, ebpf tries to define new probe event via perf_event interface. Above one is that interface. IOW, it creates new kprobe. Thank you, -- Masami Hiramatsu

Re: [PATCH v4 2/9] perf/core: open access for CAP_SYS_PERFMON privileged process

2020-01-10 Thread Masami Hiramatsu
On Fri, 10 Jan 2020 13:45:31 -0300 Arnaldo Carvalho de Melo wrote: > Em Sat, Jan 11, 2020 at 12:52:13AM +0900, Masami Hiramatsu escreveu: > > On Fri, 10 Jan 2020 15:02:34 +0100 Peter Zijlstra > > wrote: > > > Again, this only allows attaching to previously created kp

Re: [PATCH v4 2/9] perf/core: open access for CAP_SYS_PERFMON privileged process

2020-01-11 Thread Masami Hiramatsu
t" > > From: Arnaldo Carvalho de Melo > Message-ID: > > On January 10, 2020 9:23:27 PM GMT-03:00, Song Liu > wrote: > > > > > >> On Jan 10, 2020, at 3:47 PM, Masami Hiramatsu > >wrote: > >> > >> On Fri, 10 Jan 2020 13:45:31 -0

Re: [PATCH] powerpc/kprobes: Fix trap address when trap happened in real mode

2020-02-14 Thread Masami Hiramatsu
ude > > DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; > @@ -264,6 +265,9 @@ int kprobe_handler(struct pt_regs *regs) > if (user_mode(regs)) > return 0; > > + if (!(regs->msr & MSR_IR)) > + addr = phys_to_virt(regs->nip); > + > /* >* We don't want to be preempted for the entire >* duration of kprobe processing > -- > 2.25.0 > -- Masami Hiramatsu

Re: [PATCH] powerpc/kprobes: Fix trap address when trap happened in real mode

2020-02-16 Thread Masami Hiramatsu
On Sat, 15 Feb 2020 11:28:49 +0100 Christophe Leroy wrote: > Hi, > > Le 14/02/2020 à 14:54, Masami Hiramatsu a écrit : > > Hi, > > > > On Fri, 14 Feb 2020 12:47:49 + (UTC) > > Christophe Leroy wrote: > > > >> When a program check exceptio

Re: [PATCH] powerpc/kprobes: Fix trap address when trap happened in real mode

2020-02-17 Thread Masami Hiramatsu
On Mon, 17 Feb 2020 10:03:22 +0100 Christophe Leroy wrote: > > > Le 16/02/2020 à 13:34, Masami Hiramatsu a écrit : > > On Sat, 15 Feb 2020 11:28:49 +0100 > > Christophe Leroy wrote: > > > >> Hi, > >> > >> Le 14/02/2020 à 14:54, Masami Hi

Re: [PATCH] powerpc/kprobes: Fix trap address when trap happened in real mode

2020-02-17 Thread Masami Hiramatsu
On Mon, 17 Feb 2020 16:38:50 +0100 Christophe Leroy wrote: > > > Le 17/02/2020 à 11:27, Masami Hiramatsu a écrit : > > On Mon, 17 Feb 2020 10:03:22 +0100 > > Christophe Leroy wrote: > > > >> > >> > >> Le 16/02/2020 à 13:34, Masami Hirama

Re: [PATCH] powerpc/kprobes: Fix trap address when trap happened in real mode

2020-02-18 Thread Masami Hiramatsu
s it. If not, it returns > 0 to tell "it's no me". You are also talking about incrementing the > missed count. Who do we do that ? I rather like your first patch. If there is a kprobes, we can not skip the instruction, because there is an instruction which must be executed. (or single-skipped, but I'm not sure the emulator works correctly on real mode) Thank you, > > > > @@ -264,6 +265,13 @@ int kprobe_handler(struct pt_regs *regs) > if (user_mode(regs)) > return 0; > > +if (!(regs->msr & MSR_IR)) { > +if (!get_kprobe(phys_to_virt(regs->nip))) > +return 0; > +regs->nip += 4; > +return 1; > +} > + > /* >* We don't want to be preempted for the entire >* duration of kprobe processing > > > > > > BTW, can the emulater handle the real mode code correctly? > > I don't know, how do I test that ? > > Christophe -- Masami Hiramatsu

Re: [PATCH] powerpc/kprobes: Fix trap address when trap happened in real mode

2020-02-18 Thread Masami Hiramatsu
> What do you think about my latest proposal below ? If a trap is > >> encoutered in real mode, if checks if the matching virtual address > >> corresponds to a valid kprobe. If it is, it skips it. If not, it returns > >> 0 to tell "it's no me". You are also talking about incrementing the > >> missed count. Who do we do that ? > > > > I rather like your first patch. If there is a kprobes, we can not skip > > the instruction, because there is an instruction which must be executed. > > (or single-skipped, but I'm not sure the emulator works correctly on > > real mode) > > Oops, yes of course. Thank you, -- Masami Hiramatsu

Re: [PATCH v3] powerpc/kprobes: Ignore traps that happened in real mode

2020-02-18 Thread Masami Hiramatsu
red to handle events in real mode and functions > running in real mode should have been blacklisted, so kprobe_handler() > can safely bail out telling 'this trap is not mine' for any trap that > happened while in real-mode. > > If the trap happened with MSR_IR or MSR_D

[RFC][PATCH -tip 4/9] power: add kernel_trap_sp()

2009-03-19 Thread Masami Hiramatsu
Add kernel_trap_sp() on powerpc, based on systemtap's runtime/regs.h. Signed-off-by: Masami Hiramatsu --- arch/powerpc/include/asm/ptrace.h |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/include/asm/ptrace.h b/arch/powerpc/include/asm/ptrace.h

Re: [RFC][PATCH -tip 4/9] power: add kernel_trap_sp()

2009-03-20 Thread Masami Hiramatsu
Ananth N Mavinakayanahalli wrote: > On Fri, Mar 20, 2009 at 04:42:40PM +1100, Benjamin Herrenschmidt wrote: >> On Thu, 2009-03-19 at 17:10 -0400, Masami Hiramatsu wrote: >>> Add kernel_trap_sp() on powerpc, based on systemtap's runtime/regs.h. >>> >>> Sign

Re: [PATCH -tip tracing/kprobes] PPC: Powerpc port of the kprobe-based event tracer

2009-12-16 Thread Masami Hiramatsu
OFFSET_NAME(trap), >> +REG_OFFSET_NAME(dar), >> +REG_OFFSET_NAME(dsisr), >> +REG_OFFSET_NAME(result), >> + REG_OFFSET_END, > > Do we need to add something for FP and VMX registers here? Hmm, are FP and VMX registers actually u

Re: [PATCH -tip tracing/kprobes] PPC: Powerpc port of the kprobe-based event tracer

2009-12-18 Thread Masami Hiramatsu
https://lists.ozlabs.org/listinfo/linuxppc-dev >>>>> >>> Thanks for reviewing. >> >> We are creating a new user space API here, so I'm keen for others to take >> a good look at the interface before we commit to something we are

Re: [PATCH -tip tracing/kprobes] PPC: Powerpc port of the kprobe-based event tracer

2009-12-22 Thread Masami Hiramatsu
Enable kprobes-based dynamic events" >>>>>>> select TRACING >>>>>>> default y >>>>>>> >>>>>>> ___ >>>>>>> Linuxppc-dev mailing lis

[PATCH -tip 2/8] tracing/kprobe: Drop function argument access syntax

2010-01-05 Thread Masami Hiramatsu
Drop function argument access syntax, because the function arguments are depends on not only architecture but also compile-options and function API. And now, we have perf-probe for finding register/memory assigned to each argument. Signed-off-by: Masami Hiramatsu Cc: Ingo Molnar Cc: Frederic

[PATCH -tip 3/8] x86/ptrace: Remove unused regs_get_argument_nth API

2010-01-05 Thread Masami Hiramatsu
Because of dropping function argument syntax from kprobe-tracer, we don't need this API anymore. Signed-off-by: Masami Hiramatsu Cc: Ingo Molnar Cc: Frederic Weisbecker Cc: Roland McGrath Cc: Oleg Nesterov Cc: Mahesh Salgaonkar Cc: Benjamin Herrenschmidt Cc: Michael Neuling Cc: S

Re: [PowerPC] 2.6.33-git11 : Badness at kernel/kprobes.c:264

2010-03-08 Thread Masami Hiramatsu
t; 2.6.33-git10(64ba99267...) was OK. >>> >>> This WARN_ON was introduced by commit 4610ee1d36... >>> >>> kprobes: Introduce generic insn_slot framework >> >> FWIW, same on s390... > > This patch should fix it: >

Re: [PATCH 1/2] perf: Move arch specific code into separate arch directory

2010-04-12 Thread Masami Hiramatsu
str(n) get_arch_regstr(n) If we checked above dwarf support, we don't need this odd macro. > + > +#endif > diff --git a/tools/perf/arch/x86/util/dwarf-regs.c > b/tools/perf/arch/x86/util/dwarf-regs.c > new file mode 100644 > index 000..a794d30 > --- /dev/null > +++ b/tools/perf

Re: [PATCH 2/2] perf probe: Add PowerPC DWARF register number mappings

2010-04-12 Thread Masami Hiramatsu
; --- /dev/null > +++ b/tools/perf/arch/powerpc/include/arch_dwarf-regs.h > @@ -0,0 +1,6 @@ > +#ifndef _PREF_ARCH_X86_DWARF_REGS_H > +#define _PREF_ARCH_X86_DWARF_REGS_H _PREF_ARCH_PPC_DWARF_REGS_H? :) > + > +#define get_arch_regstr(n) get_arch_regstr(n) > + > +#endif Thank you, -- Masam

Re: [PATCH v2 1/2] perf: Move arch specific code into separate arch directory

2010-04-14 Thread Masami Hiramatsu
ou to drop dwarf support if dwarf-regs mapping doesn't exist. AFAIK, at this point, only s390 users are affected. I'd like to ask them to just port a register mapping on perf and test it too. Thank you, -- Masami Hiramatsu e-mail: mhira...@redhat.com ___

Re: [PATCH v2 1/2] perf: Move arch specific code into separate arch directory

2010-04-14 Thread Masami Hiramatsu
Heiko Carstens wrote: > On Wed, Apr 14, 2010 at 07:46:12AM -0700, Masami Hiramatsu wrote: >> Ian Munsie wrote: >>> From: Ian Munsie >>> >>> The perf userspace tool included some architecture specific code to map >>> registers from the DWARF register n

Re: [PATCH v3 1/2] perf: Move arch specific code into separate arch directory

2010-04-15 Thread Masami Hiramatsu
a separate > arch/x86 directory along with the infrastructure required to use it. > > Signed-off-by: Ian Munsie Good work! Acked-by: Masami Hiramatsu Thank you very much! > --- > Changes since v2: From Masami Hiramatsu's feedback DWARF support is disabled > altogether if

Re: [PATCH v3 2/2] perf probe: Add PowerPC DWARF register number mappings

2010-04-15 Thread Masami Hiramatsu
s on functionality in the powerpc/next tree, though it > will compile fine without it. Specifically this patch depends on commit > "powerpc: Add kprobe-based event tracer" > > Signed-off-by: Ian Munsie Acked-by: Masami Hiramatsu Thank you! > --- > tools/perf/arch/powe

Re: [PATCH v4 1/2] perf: Move arch specific code into separate arch directory

2010-04-20 Thread Masami Hiramatsu
Hi Ian, Please feel free to add my ack. :) Acked-by: Masami Hiramatsu Ingo, I think this one is important enhancement for perf to port it on other archs. Thank you, Ian Munsie wrote: > From: Ian Munsie > > The perf userspace tool included some architecture specific code to map &g

Re: [PATCH v4 2/2] perf probe: Add PowerPC DWARF register number mappings

2010-04-20 Thread Masami Hiramatsu
s on functionality in the powerpc/next tree, though it > will compile fine without it. Specifically this patch depends on commit > "powerpc: Add kprobe-based event tracer" > > Signed-off-by: Ian Munsie Acked-by: Masami Hiramatsu > --- > Changes since v3: > * Fi

Re: [BUG?]3.0-rc4+ftrace+kprobe: set kprobe at instruction 'stwu' lead to system crash/freeze

2011-06-26 Thread Masami Hiramatsu
20-5cde06e-powerpc/tmp/sysroots/powerpc >> --disable-libunwind-exceptions --disable-libssp --disable-libgomp >> --disable-libmudflap >> --with-mpfr=/opt/poky/build/eldk-2011-05-20-5cde06e-powerpc/tmp/sysroots/i686-oesdk-linux-nativesdk >> --with-mpc=/opt/poky/build/eld

Re: [PATCH v4 14/15] kprobes: remove dependency on CONFIG_MODULES

2024-04-17 Thread Masami Hiramatsu
ONFIG_MODULES > /* Module notifier call back, checking event on the module */ > static int trace_kprobe_module_callback(struct notifier_block *nb, > unsigned long val, void *data) > @@ -704,6 +712,7 @@ static struct notifier_block trace_kprobe_module_nb = { > .notifier_call = trace_kprobe_module_callback, > .priority = 1 /* Invoked after kprobe module callback */ > }; > +#endif > > static int count_symbols(void *data, unsigned long unused) > { > @@ -1933,8 +1942,10 @@ static __init int init_kprobe_trace_early(void) > if (ret) > return ret; > > +#ifdef CONFIG_MODULES > if (register_module_notifier(&trace_kprobe_module_nb)) > return -EINVAL; > +#endif > > return 0; > } > -- > 2.43.0 > > -- Masami Hiramatsu

Re: [PATCH 5/9] kprobes/ftrace: Add recursion protection to the ftrace callback

2020-10-29 Thread Masami Hiramatsu
obe_ctlblk *kcb; > + int bit; > > - /* Preempt is disabled by ftrace */ > + bit = ftrace_test_recursion_trylock(); > + if (bit < 0) > + return; > + > + preempt_disable_notrace(); > p = get_kprobe((kprobe_opcode_t *)ip); > if (unlikely(!p) || kprobe_disabled(p)) > - return; > + goto out; > > kcb = get_kprobe_ctlblk(); > if (kprobe_running()) { > @@ -52,6 +57,9 @@ void kprobe_ftrace_handler(unsigned long ip, unsigned long > parent_ip, >*/ > __this_cpu_write(current_kprobe, NULL); > } > +out: > + preempt_enable_notrace(); > + ftrace_test_recursion_unlock(bit); > } > NOKPROBE_SYMBOL(kprobe_ftrace_handler); > > -- > 2.28.0 > > -- Masami Hiramatsu

Re: [PATCH 5/9] kprobes/ftrace: Add recursion protection to the ftrace callback

2020-11-01 Thread Masami Hiramatsu
On Thu, 29 Oct 2020 09:40:01 -0400 Steven Rostedt wrote: > On Thu, 29 Oct 2020 16:58:03 +0900 > Masami Hiramatsu wrote: > > > Hi Steve, > > > > On Wed, 28 Oct 2020 07:52:49 -0400 > > Steven Rostedt wrote: > > > > > From: "Steven Rostedt

Re: [PATCH 05/11 v2] kprobes/ftrace: Add recursion protection to the ftrace callback

2020-11-03 Thread Masami Hiramatsu
nel.org/r/20201028115613.140212...@goodmis.org > > Cc: Andrew Morton > Cc: Masami Hiramatsu > Cc: Guo Ren > Cc: "James E.J. Bottomley" > Cc: Helge Deller > Cc: Michael Ellerman > Cc: Benjamin Herrenschmidt > Cc: Paul Mackerras > Cc: Heiko Carstens &

Re: [PATCH 05/11 v3] kprobes/ftrace: Add recursion protection to the ftrace callback

2020-11-06 Thread Masami Hiramatsu
ttps://lkml.kernel.org/r/20201028115613.140212...@goodmis.org > Looks good to me. Acked-by: Masami Hiramatsu Thank you! > Cc: Andrew Morton > Cc: Masami Hiramatsu > Cc: Guo Ren > Cc: "James E.J. Bottomley" > Cc: Helge Deller > Cc: Michael Ellerman > Cc: Benjami

Re: [PATCH 1/2] kprobes: Allow architectures to override optinsn page allocation

2021-05-12 Thread Masami Hiramatsu
sn_page(), that > fall back on alloc_insn_page() and free_insn_page() when not > overriden by the architecture. > Looks good to me :) Acked-by: Masami Hiramatsu > Suggested-by: Masami Hiramatsu > Signed-off-by: Christophe Leroy > --- > kernel/kprobes.c | 14 -- &g

Re: [PATCH 2/2] powerpc/kprobes: Replace ppc_optinsn by common optinsn

2021-05-12 Thread Masami Hiramatsu
s, extable: Identify > kprobes trampolines as kernel text area") > This looks good to me. Acked-by: Masami Hiramatsu > Suggested-by: Masami Hiramatsu > Signed-off-by: Christophe Leroy > --- > arch/powerpc/kernel/optprobes.c | 23 +-- > 1 file c

Re: [PATCH 1/2] kprobes: Allow architectures to override optinsn page allocation

2021-05-12 Thread Masami Hiramatsu
rnel/kprobes.c:329:13: warning: no previous prototype for > >> 'free_optinsn_page' [-Wmissing-prototypes] > 329 | void __weak free_optinsn_page(void *page) > | ^ Ah, we need a prototype for those in include/linux/kprobes.h as same as alloc_insn_page() and free_insn_page(). Thank you, -- Masami Hiramatsu

Re: [PATCH v2 1/3] module: Rename module_alloc() to text_alloc() and move to kernel proper

2020-07-14 Thread Masami Hiramatsu
es text happens to be in arch specific code. > > If you want something special for ftrace, you could just add your own > function. But for x86, a text_alloc_immediate() would work. > (BTW, I like the function names over the enums) kprobes will need the text_alloc_immediate() too, since it will use the trampoline buffer where jumps to/from kernel code/modules. Thanks, -- Masami Hiramatsu

Re: [PATCH 1/3] powerpc/ftrace: Reserve instructions from function entry for ftrace

2022-02-20 Thread Masami Hiramatsu
gt; @@ -814,7 +904,7 @@ int ftrace_modify_call(struct dyn_ftrace *rec, unsigned > long old_addr, > /* >* Out of range jumps are called from modules. >*/ > - if (!rec->arch.mod) { > + if (!ftrace_mod_addr_get(rec)) { > pr_err("No module loaded\n"); > return -EINVAL; > } > diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c > index f9feb197b2daaf..68f20cf34b0c47 100644 > --- a/kernel/trace/ftrace.c > +++ b/kernel/trace/ftrace.c > @@ -1510,6 +1510,7 @@ ftrace_ops_test(struct ftrace_ops *ops, unsigned long > ip, void *regs) > } > > > +#ifndef ftrace_cmp_recs > static int ftrace_cmp_recs(const void *a, const void *b) > { > const struct dyn_ftrace *key = a; > @@ -1521,6 +1522,7 @@ static int ftrace_cmp_recs(const void *a, const void *b) > return 1; > return 0; > } > +#endif > > static struct dyn_ftrace *lookup_rec(unsigned long start, unsigned long end) > { > -- > 2.35.1 > -- Masami Hiramatsu

Re: [PATCH 3/3] kprobes: Allow probing on any address belonging to ftrace

2022-02-20 Thread Masami Hiramatsu
opcode_t *)ftrace_addr; As I said, this must be if (ftrace_addr != addr) return -EILSEQ; This will prevent users from being confused by the results of probing that 'func' and 'func+4' are the same. (now only 'func' is allowed to be probed.) Thank you, > +#endif > + > if (addr) > return addr; > > -- > 2.35.1 > -- Masami Hiramatsu

Re: [PATCH v4 2/3] perf: kretprobes: offset from reloc_sym if kernel supports it

2017-03-06 Thread Masami Hiramatsu
On Mon, 6 Mar 2017 23:19:09 +0530 "Naveen N. Rao" wrote: > Masami, > Your patch works, thanks! However, I felt we could refactor and reuse > some of the code across kprobes.c for this purpose. Can you please see > if the below patch is fine? OK, looks good to me:) Acke

Re: [PATCH v4 2/3] perf: kretprobes: offset from reloc_sym if kernel supports it

2017-03-06 Thread Masami Hiramatsu
On Mon, 6 Mar 2017 20:34:10 +0530 "Naveen N. Rao" wrote: > On 2017/03/04 09:49AM, Masami Hiramatsu wrote: > > On Thu, 2 Mar 2017 23:25:06 +0530 > > "Naveen N. Rao" wrote: > > > > > We indicate support for accepting sym+offset with kretprobe

Re: [PATCH 5/6] perf: probes: move ftrace README parsing logic into trace-event-parse.c

2017-03-07 Thread Masami Hiramatsu
gt; + free(buf); > + > +result: > + if (type >= FTRACE_README_END) > + return false; > + > + return ftrace_readme_table[type].avail; > +} > + > +bool kretprobe_offset_is_supported(void) > +{ > + return scan_ftrace_readme(FTRACE_README_KRETPROBE_OFFSET); > +} > + > +bool probe_type_x_is_supported(void) > +{ > + return scan_ftrace_readme(FTRACE_README_PROBE_TYPE_X); > +} > diff --git a/tools/perf/util/trace-event.h b/tools/perf/util/trace-event.h > index 1fbc044f9eb0..ecda2d822daf 100644 > --- a/tools/perf/util/trace-event.h > +++ b/tools/perf/util/trace-event.h > @@ -37,6 +37,10 @@ int parse_ftrace_file(struct pevent *pevent, char *buf, > unsigned long size); > int parse_event_file(struct pevent *pevent, >char *buf, unsigned long size, char *sys); > > +int open_trace_file(const char *trace_file, bool readwrite); > +bool kretprobe_offset_is_supported(void); > +bool probe_type_x_is_supported(void); > + > unsigned long long > raw_field_value(struct event_format *event, const char *name, void *data); > > -- > 2.11.1 > -- Masami Hiramatsu

Re: [PATCH 5/6] perf: probes: move ftrace README parsing logic into trace-event-parse.c

2017-03-07 Thread Masami Hiramatsu
strglobmatch(buf, > ftrace_readme_table[i].pattern); > + scanned = true; > + > + fclose(fp); > + free(buf); > + > +result: > + if (type >= FTRACE_README_END) > + return false; > + > + return ftrace_readme_table[type].avail; > +} > + > +bool kretprobe_offset_is_supported(void) > +{ > + return scan_ftrace_readme(FTRACE_README_KRETPROBE_OFFSET); > +} > + > +bool probe_type_x_is_supported(void) > +{ > + return scan_ftrace_readme(FTRACE_README_PROBE_TYPE_X); > +} > diff --git a/tools/perf/util/trace-event.h b/tools/perf/util/trace-event.h > index 1fbc044f9eb0..ecda2d822daf 100644 > --- a/tools/perf/util/trace-event.h > +++ b/tools/perf/util/trace-event.h > @@ -37,6 +37,10 @@ int parse_ftrace_file(struct pevent *pevent, char *buf, > unsigned long size); > int parse_event_file(struct pevent *pevent, >char *buf, unsigned long size, char *sys); > > +int open_trace_file(const char *trace_file, bool readwrite); > +bool kretprobe_offset_is_supported(void); > +bool probe_type_x_is_supported(void); > + > unsigned long long > raw_field_value(struct event_format *event, const char *name, void *data); > > -- > 2.11.1 > -- Masami Hiramatsu

Re: [PATCH] powerpc: kprobes: convert __kprobes to NOKPROBE_SYMBOL()

2017-03-08 Thread Masami Hiramatsu
r > forces inlining, in which case the caller needs to be added to > NOKPROBE_SYMBOL(). Acked-by: Masami Hiramatsu OK, this is a good starting point so far. please consider that those functions really have to be protected by kprobes. As you can see on x86, I allowed some functions t

Re: [PATCH v5 5/5] perf: powerpc: choose local entry point with kretprobes

2017-03-08 Thread Masami Hiramatsu
it only > if the kernel supports specifying offsets with kretprobes. Acked-by: Masami Hiramatsu This patch is OK. And I found that most of functions in sym-handling.c are used only when libelf is supported. (e.g. probe-event.c itself is not built when we have no libelf) So, for the next clean

  1   2   >