[tip:perf/core] doc: trace/kprobes: add information about NOKPROBE_SYMBOL

2017-03-15 Thread tip-bot for Naveen N. Rao
Commit-ID: c1ac094d5061e757624a47217d2195ba24a75450 Gitweb: http://git.kernel.org/tip/c1ac094d5061e757624a47217d2195ba24a75450 Author: Naveen N. Rao AuthorDate: Wed, 8 Mar 2017 22:34:14 +0530 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 14 Mar 2017 15:17:40 -0300 doc: trace

[tip:perf/core] kprobes: Convert kprobe_exceptions_notify to use NOKPROBE_SYMBOL

2017-03-15 Thread tip-bot for Naveen N. Rao
Commit-ID: 5f6bee34707973ea7879a7857fd63ddccc92fff3 Gitweb: http://git.kernel.org/tip/5f6bee34707973ea7879a7857fd63ddccc92fff3 Author: Naveen N. Rao AuthorDate: Wed, 8 Mar 2017 22:34:15 +0530 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 14 Mar 2017 15:17:40 -0300 kprobes

[tip:perf/core] perf powerpc: Choose local entry point with kretprobes

2017-03-15 Thread tip-bot for Naveen N. Rao
Commit-ID: 44ca9341f65295c56e904cce4c84f5778f5c8537 Gitweb: http://git.kernel.org/tip/44ca9341f65295c56e904cce4c84f5778f5c8537 Author: Naveen N. Rao AuthorDate: Wed, 8 Mar 2017 13:56:10 +0530 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 14 Mar 2017 15:17:39 -0300 perf powerpc

Re: [PATCH v5 2/5] powerpc: kretprobes: override default function entry offset

2017-03-15 Thread Naveen N. Rao
On 2017/03/14 10:18AM, Arnaldo Carvalho de Melo wrote: > Em Thu, Mar 09, 2017 at 05:37:38PM +1100, Michael Ellerman escreveu: > > "Naveen N. Rao" writes: > > > On 2017/03/08 11:29AM, Arnaldo Carvalho de Melo wrote: > > >> > I wasn't sure if you w

Re: [PATCH v5 2/5] powerpc: kretprobes: override default function entry offset

2017-03-09 Thread Naveen N. Rao
On 2017/03/09 05:37PM, Michael Ellerman wrote: > "Naveen N. Rao" writes: > > On 2017/03/08 11:29AM, Arnaldo Carvalho de Melo wrote: > >> > I wasn't sure if you were planning on picking up KPROBES_ON_FTRACE for > >> > v4.11. If so, it woul

Re: [PATCH v5 2/5] powerpc: kretprobes: override default function entry offset

2017-03-08 Thread Naveen N. Rao
On 2017/03/08 11:29AM, Arnaldo Carvalho de Melo wrote: > Em Wed, Mar 08, 2017 at 07:54:12PM +0530, Naveen N. Rao escreveu: > > Hi Michael, > > > > On 2017/03/08 09:43PM, Michael Ellerman wrote: > > > "Naveen N. Rao" writes: > > > > > >

[TRIVIAL PATCH 0/2] kprobes: a couple of trivial changes

2017-03-08 Thread Naveen N. Rao
Two trivial fixes for kprobes: - one, to document NOKPROBE_SYMBOL() in kprobe tracer doc - two, change __kprobes to NOKPROBE_SYMBOL() for kprobe_exceptions_notify() I noticed the latter while making this change for arch/powerpc. - Naveen Naveen N. Rao (2): doc: trace/kprobes: add

[TRIVIAL PATCH 1/2] doc: trace/kprobes: add information about NOKPROBE_SYMBOL

2017-03-08 Thread Naveen N. Rao
Update kprobe tracer documentation to also mention that NOKPROBE_SYMBOL() and nokprobe_inline add symbols to the kprobes blacklist. Signed-off-by: Naveen N. Rao --- Documentation/trace/kprobetrace.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Documentation/trace

[TRIVIAL PATCH 2/2] kprobes: Convert kprobe_exceptions_notify to use NOKPROBE_SYMBOL

2017-03-08 Thread Naveen N. Rao
ge over to using NOKPROBE_SYMBOL(). Signed-off-by: Naveen N. Rao --- kernel/kprobes.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/kprobes.c b/kernel/kprobes.c index 699c5bc51a92..b52d952d6d41 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c @@ -1740,11 +1740,

Re: [PATCH v5 2/5] powerpc: kretprobes: override default function entry offset

2017-03-08 Thread Naveen N. Rao
Hi Michael, On 2017/03/08 09:43PM, Michael Ellerman wrote: > "Naveen N. Rao" writes: > > > With ABIv2, we offset 8 bytes into a function to get at the local entry > > point. > > > > Acked-by: Ananth N Mavinakayanahalli > > Acked-by: Mich

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

2017-03-08 Thread Naveen N. Rao
On 2017/03/08 11:31AM, Masami Hiramatsu wrote: > On Wed, 8 Mar 2017 13:56:10 +0530 > "Naveen N. Rao" wrote: > > > perf now uses an offset from _text/_stext for kretprobes if the kernel > > supports it, rather than the actual function name. As such, let's cho

Re: [RESEND PATCH 1/6] trace/kprobes: fix check for kretprobe offset within function entry

2017-03-08 Thread Naveen N. Rao
On 2017/03/07 03:47PM, Steven Rostedt wrote: > > Please start a new thread. When sending patches as replies to other > patch threads, especially this deep into the thread, they will most > likely get ignored. Sorry, got carried off. I will re-post in a new series. - Naveen

[PATCH v5 0/5] kretprobe fixes

2017-03-08 Thread Naveen N. Rao
linux-kernel@vger.kernel.org/msg1347013.html -- Naveen N. Rao (5): trace/kprobes: fix check for kretprobe offset within function entry powerpc: kretprobes: override default function entry offset perf: probe: factor out the ftrace README scanning perf: kretprobes: offset from reloc_sym if k

[PATCH v5 3/5] perf: probe: factor out the ftrace README scanning

2017-03-08 Thread Naveen N. Rao
Signed-off-by: Naveen N. Rao --- tools/perf/util/probe-file.c | 70 +++- 1 file changed, 37 insertions(+), 33 deletions(-) diff --git a/tools/perf/util/probe-file.c b/tools/perf/util/probe-file.c index 1a62daceb028..8a219cd831b7 100644 --- a/tools/perf

[PATCH v5 4/5] perf: kretprobes: offset from reloc_sym if kernel supports it

2017-03-08 Thread Naveen N. Rao
] c04433d0 r do_open+0x0[DISABLED] c04ba058 r do_open+0x8[DISABLED] Acked-by: Masami Hiramatsu Signed-off-by: Naveen N. Rao --- tools/perf/util/probe-event.c | 12 +--- tools/perf/util/probe-file.c | 7 +++ tools/perf/util/probe-file.h | 1 +

[PATCH v5 1/5] trace/kprobes: fix check for kretprobe offset within function entry

2017-03-08 Thread Naveen N. Rao
nux/tools/perf$ sudo cat /sys/kernel/debug/kprobes/list c0041370 k kretprobe_trampoline+0x0[OPTIMIZED] c04ba0b8 r do_open+0x8[DISABLED] c0443430 r do_open+0x0[DISABLED] Acked-by: Masami Hiramatsu Signed-off-by: Naveen N. Rao --- include/linu

[PATCH v5 2/5] powerpc: kretprobes: override default function entry offset

2017-03-08 Thread Naveen N. Rao
With ABIv2, we offset 8 bytes into a function to get at the local entry point. Acked-by: Ananth N Mavinakayanahalli Acked-by: Michael Ellerman Signed-off-by: Naveen N. Rao --- arch/powerpc/kernel/kprobes.c | 9 + 1 file changed, 9 insertions(+) diff --git a/arch/powerpc/kernel

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

2017-03-08 Thread Naveen N. Rao
aveen N. Rao --- tools/perf/arch/powerpc/util/sym-handling.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tools/perf/arch/powerpc/util/sym-handling.c b/tools/perf/arch/powerpc/util/sym-handling.c index 1030a6e504bb..39dbe512b9fc 100644 --- a/tools/perf

[PATCH v2 6/6] perf: powerpc: choose local entry point with kretprobes

2017-03-07 Thread Naveen N. Rao
aveen N. Rao --- Changes: - updated to address build issues due to dropping patch 5/6. tools/perf/arch/powerpc/util/sym-handling.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tools/perf/arch/powerpc/util/sym-handling.c b/tools/perf/arch/powerpc/uti

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

2017-03-07 Thread Naveen N. Rao
On 2017/03/07 04:51PM, Masami Hiramatsu wrote: > On Tue, 7 Mar 2017 16:17:40 +0530 > "Naveen N. Rao" wrote: > > > probe-file.c needs libelf, but scanning ftrace README does not require > > that. As such, move the ftrace README scanning logic out of probe-file.c &

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

2017-03-07 Thread Naveen N. Rao
On 2017/03/07 03:03PM, Masami Hiramatsu wrote: > On Tue, 7 Mar 2017 16:17:40 +0530 > "Naveen N. Rao" wrote: > > > probe-file.c needs libelf, but scanning ftrace README does not require > > that. As such, move the ftrace README scanning logic out of probe-file.c &

[RESEND PATCH 2/6] powerpc: kretprobes: override default function entry offset

2017-03-07 Thread Naveen N. Rao
With ABIv2, we offset 8 bytes into a function to get at the local entry point. Acked-by: Ananth N Mavinakayanahalli Acked-by: Michael Ellerman Signed-off-by: Naveen N. Rao --- arch/powerpc/kernel/kprobes.c | 9 + 1 file changed, 9 insertions(+) diff --git a/arch/powerpc/kernel

[RESEND PATCH 6/6] perf: powerpc: choose local entry point with kretprobes

2017-03-07 Thread Naveen N. Rao
asami Hiramatsu Signed-off-by: Naveen N. Rao --- tools/perf/arch/powerpc/util/sym-handling.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/perf/arch/powerpc/util/sym-handling.c b/tools/perf/arch/powerpc/util/sym-handling.c index 1030a6e504bb..e93b3db25012 1

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

2017-03-07 Thread Naveen N. Rao
On 2017/03/06 10:06PM, Masami Hiramatsu wrote: > 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

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

2017-03-07 Thread Naveen N. Rao
probe-file.c needs libelf, but scanning ftrace README does not require that. As such, move the ftrace README scanning logic out of probe-file.c and into trace-event-parse.c. Signed-off-by: Naveen N. Rao --- tools/perf/util/probe-file.c| 87 +++- tools

[RESEND PATCH 4/6] perf: kretprobes: offset from reloc_sym if kernel supports it

2017-03-07 Thread Naveen N. Rao
] c04433d0 r do_open+0x0[DISABLED] c04ba058 r do_open+0x8[DISABLED] Acked-by: Masami Hiramatsu Signed-off-by: Naveen N. Rao --- tools/perf/util/probe-event.c | 12 +--- tools/perf/util/probe-file.c | 7 +++ tools/perf/util/probe-file.h | 1 +

[RESEND PATCH 3/6] perf: probe: factor out the ftrace README scanning

2017-03-07 Thread Naveen N. Rao
Signed-off-by: Naveen N. Rao --- tools/perf/util/probe-file.c | 70 +++- 1 file changed, 37 insertions(+), 33 deletions(-) diff --git a/tools/perf/util/probe-file.c b/tools/perf/util/probe-file.c index 1a62daceb028..8a219cd831b7 100644 --- a/tools/perf

[RESEND PATCH 1/6] trace/kprobes: fix check for kretprobe offset within function entry

2017-03-07 Thread Naveen N. Rao
nux/tools/perf$ sudo cat /sys/kernel/debug/kprobes/list c0041370 k kretprobe_trampoline+0x0[OPTIMIZED] c04ba0b8 r do_open+0x8[DISABLED] c0443430 r do_open+0x0[DISABLED] Acked-by: Masami Hiramatsu Signed-off-by: Naveen N. Rao --- include/linu

[tip:perf/core] perf probe: Generalize probe event file open routine

2017-03-07 Thread tip-bot for Naveen N. Rao
Commit-ID: e491bc2f0dd9f1b4a23ba6f3da88f6b695c4a4c9 Gitweb: http://git.kernel.org/tip/e491bc2f0dd9f1b4a23ba6f3da88f6b695c4a4c9 Author: Naveen N. Rao AuthorDate: Thu, 23 Feb 2017 17:07:23 +0530 Committer: Arnaldo Carvalho de Melo CommitDate: Fri, 3 Mar 2017 19:07:18 -0300 perf probe

[tip:perf/core] trace/kprobes: Allow return probes with offsets and absolute addresses

2017-03-07 Thread tip-bot for Naveen N. Rao
Commit-ID: 35b6f55aa9ba65141f2def0997e23aab13715d3f Gitweb: http://git.kernel.org/tip/35b6f55aa9ba65141f2def0997e23aab13715d3f Author: Naveen N. Rao AuthorDate: Wed, 22 Feb 2017 19:23:39 +0530 Committer: Arnaldo Carvalho de Melo CommitDate: Fri, 3 Mar 2017 19:07:18 -0300 trace/kprobes

[tip:perf/core] kretprobes: Ensure probe location is at function entry

2017-03-07 Thread tip-bot for Naveen N. Rao
Commit-ID: 90ec5e89e393c76e19afc845d8f88a5dc8315919 Gitweb: http://git.kernel.org/tip/90ec5e89e393c76e19afc845d8f88a5dc8315919 Author: Naveen N. Rao AuthorDate: Wed, 22 Feb 2017 19:23:37 +0530 Committer: Arnaldo Carvalho de Melo CommitDate: Fri, 3 Mar 2017 19:07:17 -0300 kretprobes

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

2017-03-06 Thread Naveen N. Rao
kernel/debug/kprobes/list c0041370 k kretprobe_trampoline+0x0[OPTIMIZED] c04ba0b8 r do_open+0x8[DISABLED] c0443430 r do_open+0x0[DISABLED] Signed-off-by: Naveen N. Rao --- include/linux/kprobes.h | 1 + kernel/kprob

[PATCH 2/2] arm64: kprobes: remove kprobe_exceptions_notify

2017-03-06 Thread Naveen N. Rao
Commit fc62d0207ae0 ("kprobes: Introduce weak variant of kprobe_exceptions_notify()") introduces a generic empty version of the function for architectures that don't need special handling, like arm64. As such, remove the arch/arm64/ specific handler. Signed-off-by: Naveen N. Rao

Re: [PATCH 2/3] arm: kprobes: remove kprobe_exceptions_notify

2017-03-06 Thread Naveen N. Rao
On 2017/03/06 06:38PM, Russell King - ARM Linux wrote: > On Mon, Mar 06, 2017 at 11:37:20PM +0530, Naveen N. Rao wrote: > > On 2017/02/08 01:24AM, Naveen N Rao wrote: > > > ... as the weak variant will do. > > > > > > Signed-off-by: Naveen N. Rao > > &

[PATCH 1/2] arm: kprobes: remove kprobe_exceptions_notify

2017-03-06 Thread Naveen N. Rao
Commit fc62d0207ae0 ("kprobes: Introduce weak variant of kprobe_exceptions_notify()") introduces a generic empty version of the function for architectures that don't need special handling, like arm. As such, remove the arch/arm/ specific handler. Signed-off-by: Naveen N. Rao ---

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

2017-03-06 Thread Naveen N. Rao
On 2017/03/04 01:34PM, Masami Hiramatsu wrote: > On Sat, 4 Mar 2017 11:35:51 +0900 > Masami Hiramatsu wrote: > > > On Sat, 4 Mar 2017 09:49:11 +0900 > > Masami Hiramatsu wrote: > > > > > On Thu, 2 Mar 2017 23:25:06 +0530 > > > "Naveen N. R

Re: [PATCH 2/3] arm: kprobes: remove kprobe_exceptions_notify

2017-03-06 Thread Naveen N. Rao
On 2017/02/08 01:24AM, Naveen N Rao wrote: > ... as the weak variant will do. > > Signed-off-by: Naveen N. Rao > --- > arch/arm/probes/kprobes/core.c | 10 -- > arch/arm64/kernel/probes/kprobes.c | 6 -- > 2 files changed, 16 deletions(-) With the ge

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

2017-03-06 Thread Naveen N. Rao
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 kretprobes through a > > line in ftrace README. Parse the same to identify support and choose

[PATCH v4 1/3] perf: probe: factor out the ftrace README scanning

2017-03-02 Thread Naveen N. Rao
Simplify and separate out the ftrace README scanning logic into a separate helper. This is used subsequently to scan for all patterns of interest and to cache the result. Since we are only interested in availability of probe argument type x, we will only scan for that. Signed-off-by: Naveen N

Re: [PATCH v2 4/5] perf: kretprobes: offset from reloc_sym if kernel supports it

2017-03-02 Thread Naveen N. Rao
On 2017/02/24 05:11PM, Arnaldo Carvalho de Melo wrote: > Em Sat, Feb 25, 2017 at 02:29:17AM +0900, Masami Hiramatsu escreveu: > > On Fri, 24 Feb 2017 00:46:08 +0530 > > "Naveen N. Rao" wrote: > > > Thanks. I hope that's an Ack for this patchset?

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

2017-03-02 Thread Naveen N. Rao
We indicate support for accepting sym+offset with kretprobes through a line in ftrace README. Parse the same to identify support and choose the appropriate format for kprobe_events. Signed-off-by: Naveen N. Rao --- tools/perf/util/probe-event.c | 12 +--- tools/perf/util/probe-file.c

[PATCH v4 3/3] perf: powerpc: choose local entry point with kretprobes

2017-03-02 Thread Naveen N. Rao
aveen N. Rao --- tools/perf/arch/powerpc/util/sym-handling.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/perf/arch/powerpc/util/sym-handling.c b/tools/perf/arch/powerpc/util/sym-handling.c index 1030a6e504bb..cc7c2697c036 100644 --- a/tools/perf/arch/po

Re: [PATCH v3 1/2] perf: probe: generalize probe event file open routine

2017-03-01 Thread Naveen N. Rao
On 2017/02/25 01:46AM, Masami Hiramatsu wrote: > On Thu, 23 Feb 2017 17:07:23 +0530 > "Naveen N. Rao" wrote: > > > ...into a generic function for opening trace files. > > Even if it repeats subject, please write complete description... Agh, ok sure. I will try

Re: [PATCH v2 4/5] perf: kretprobes: offset from reloc_sym if kernel supports it

2017-03-01 Thread Naveen N. Rao
On 2017/02/25 08:55AM, Masami Hiramatsu wrote: > On Fri, 24 Feb 2017 17:11:03 -0300 > Arnaldo Carvalho de Melo wrote: > > > Em Sat, Feb 25, 2017 at 02:29:17AM +0900, Masami Hiramatsu escreveu: > > > On Fri, 24 Feb 2017 00:46:08 +0530 > > > "Naveen N. Rao&quo

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

2017-03-01 Thread Naveen N. Rao
On 2017/02/25 02:12AM, Masami Hiramatsu wrote: > On Thu, 23 Feb 2017 17:07:24 +0530 > "Naveen N. Rao" wrote: > > > We indicate support for accepting sym+offset with kretprobes through a > > line in ftrace README. Parse the same to identify support and choose

Re: [PATCH v2 3.5/5] trace/kprobes: Add back warning about offset in return probes

2017-03-01 Thread Naveen N. Rao
On 2017/02/27 11:52AM, Steven Rostedt (VMware) wrote: > Let's not remove the warning about offsets and return probes when the > offset is invalid. Good point! Thanks, Steve! > > Signed-off-by: Steven Rostedt (VMware) Acked-by: Naveen N. Rao > --- > diff --git a/kern

Re: [PATCH v2 4/5] perf: kretprobes: offset from reloc_sym if kernel supports it

2017-02-23 Thread Naveen N. Rao
On 2017/02/23 06:10PM, Masami Hiramatsu wrote: > On Wed, 22 Feb 2017 19:23:40 +0530 > "Naveen N. Rao" wrote: > > > We indicate support for accepting sym+offset with kretprobes through a > > line in ftrace README. Parse the same to identify support and choose

[PATCH v3 2/2] perf: kretprobes: offset from reloc_sym if kernel supports it

2017-02-23 Thread Naveen N. Rao
We indicate support for accepting sym+offset with kretprobes through a line in ftrace README. Parse the same to identify support and choose the appropriate format for kprobe_events. Signed-off-by: Naveen N. Rao --- tools/perf/util/probe-event.c | 49

[PATCH v3 1/2] perf: probe: generalize probe event file open routine

2017-02-23 Thread Naveen N. Rao
...into a generic function for opening trace files. Signed-off-by: Naveen N. Rao --- tools/perf/util/probe-file.c | 20 +++- tools/perf/util/probe-file.h | 1 + 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/tools/perf/util/probe-file.c b/tools/perf/util/probe

[PATCH v2 4/5] perf: kretprobes: offset from reloc_sym if kernel supports it

2017-02-22 Thread Naveen N. Rao
We indicate support for accepting sym+offset with kretprobes through a line in ftrace README. Parse the same to identify support and choose the appropriate format for kprobe_events. Signed-off-by: Naveen N. Rao --- tools/perf/util/probe-event.c | 47

[PATCH v2 3/5] trace/kprobes: allow return probes with offsets and absolute addresses

2017-02-22 Thread Naveen N. Rao
with kretprobes. Allow its use with the trace infrastructure. To distinguish kernels that support this, update ftrace README to explicitly call this out. Signed-off-by: Naveen N. Rao --- kernel/trace/trace.c| 1 + kernel/trace/trace_kprobe.c | 8 2 files changed, 1 insertion

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

2017-02-22 Thread Naveen N. Rao
aveen N. Rao --- tools/perf/arch/powerpc/util/sym-handling.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/perf/arch/powerpc/util/sym-handling.c b/tools/perf/arch/powerpc/util/sym-handling.c index 1030a6e504bb..73dbdc83286c 100644 --- a/tools/perf/arch/powerpc

[PATCH v2 2/5] powerpc: kretprobes: override default function entry offset

2017-02-22 Thread Naveen N. Rao
With ABIv2, we offset 8 bytes into a function to get at the local entry point. Signed-off-by: Naveen N. Rao --- arch/powerpc/kernel/kprobes.c | 9 + 1 file changed, 9 insertions(+) diff --git a/arch/powerpc/kernel/kprobes.c b/arch/powerpc/kernel/kprobes.c index 735ff3d3f77d

[PATCH v2 0/5] kretprobe fixes

2017-02-22 Thread Naveen N. Rao
include a line in ftrace README. Patch 4 is new. Patch 5 is updated to consider ftrace README. Thanks, Naveen Naveen N. Rao (5): kretprobes: ensure probe location is at function entry powerpc: kretprobes: override default function entry offset trace/kprobes: allow return probes with offsets and a

[PATCH v2 1/5] kretprobes: ensure probe location is at function entry

2017-02-22 Thread Naveen N. Rao
from a function entry, as determined through a kallsyms_lookup(). Introduce arch_function_offset_within_entry() as a way for architectures to override this. Signed-off-by: Naveen N. Rao --- include/linux/kprobes.h | 1 + kernel/kprobes.c| 13 + 2 files changed, 14 insertions

Re: [PATCH 0/2] powerpc: kretprobe updates

2017-02-22 Thread Naveen N. Rao
On 2017/02/21 10:07PM, Masami Hiramatsu wrote: > On Mon, 20 Feb 2017 15:20:24 +0530 > "Naveen N. Rao" wrote: > > > On 2017/02/19 01:42PM, Masami Hiramatsu wrote: > > > On Fri, 17 Feb 2017 17:42:54 -0300 > > > Arnaldo Carvalho de Melo wrote: > &

[PATCH v2 3/5] kprobes: Skip preparing optprobe if the probe is ftrace-based

2017-02-21 Thread Naveen N. Rao
From: Masami Hiramatsu Skip preparing optprobe if the probe is ftrace-based, since anyway, it must not be optimized (or already optimized by ftrace). Tested-by: Naveen N. Rao Signed-off-by: Masami Hiramatsu --- kernel/kprobes.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions

[PATCH v2 5/5] powerpc: kprobes: prefer ftrace when probing function entry

2017-02-21 Thread Naveen N. Rao
044fc0 k kretprobe_trampoline+0x0[OPTIMIZED] and after patch: # cat ../kprobes/list c00d074c k _do_fork+0xc[DISABLED][FTRACE] c00412b0 k kretprobe_trampoline+0x0[OPTIMIZED] Signed-off-by: Naveen N. Rao --- arch/powerpc/kernel/kprobes.c | 17

[PATCH v2 4/5] powerpc: kprobes: add support for KPROBES_ON_FTRACE

2017-02-21 Thread Naveen N. Rao
on the x86 code by Masami. Signed-off-by: Naveen N. Rao --- .../debug/kprobes-on-ftrace/arch-support.txt | 2 +- arch/powerpc/Kconfig | 1 + arch/powerpc/include/asm/kprobes.h | 10 ++ arch/powerpc/kernel/Makefile | 3

[PATCH v2 2/5] powerpc: ftrace: restore LR from pt_regs

2017-02-21 Thread Naveen N. Rao
. Live patch and function graph continue to work fine with this change. Signed-off-by: Naveen N. Rao --- arch/powerpc/kernel/entry_64.S | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S index 8fd8718722a1

[PATCH v2 1/5] powerpc: ftrace: minor cleanup

2017-02-21 Thread Naveen N. Rao
ither livepatch_handler() nor ftrace_graph_caller() return back here. Signed-off-by: Naveen N. Rao --- arch/powerpc/kernel/entry_64.S | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S index 6432d4bf08c8..8fd8718

Re: [PATCH 0/2] powerpc: kretprobe updates

2017-02-20 Thread Naveen N. Rao
On 2017/02/17 05:42PM, Arnaldo Carvalho de Melo wrote: > Em Fri, Feb 17, 2017 at 07:44:33PM +0900, Masami Hiramatsu escreveu: > > On Thu, 16 Feb 2017 13:47:37 +0530 > > "Naveen N. Rao" wrote: > > > > > I am posting the powerpc bits in the same thread so as

Re: [PATCH 0/2] powerpc: kretprobe updates

2017-02-20 Thread Naveen N. Rao
On 2017/02/19 01:42PM, Masami Hiramatsu wrote: > On Fri, 17 Feb 2017 17:42:54 -0300 > Arnaldo Carvalho de Melo wrote: > > > Em Fri, Feb 17, 2017 at 07:44:33PM +0900, Masami Hiramatsu escreveu: > > > On Thu, 16 Feb 2017 13:47:37 +0530 > > > "Naveen N. Rao&qu

Re: [PATCH 0/2] powerpc: kretprobe updates

2017-02-20 Thread Naveen N. Rao
On 2017/02/17 05:42PM, Arnaldo Carvalho de Melo wrote: > Em Fri, Feb 17, 2017 at 07:44:33PM +0900, Masami Hiramatsu escreveu: > > On Thu, 16 Feb 2017 13:47:37 +0530 > > "Naveen N. Rao" wrote: > > > > > I am posting the powerpc bits in the same thread so as

Re: [PATCH 1/3] powerpc: kprobes: add support for KPROBES_ON_FTRACE

2017-02-16 Thread Naveen N. Rao
On 2017/02/15 04:11PM, Masami Hiramatsu wrote: > Hi Naveen, > > On Wed, 15 Feb 2017 00:28:34 +0530 > "Naveen N. Rao" wrote: > > > diff --git a/arch/powerpc/kernel/optprobes.c > > b/arch/powerpc/kernel/optprobes.c > > index e51a045f3d3b..a8f414

Re: [PATCH 1/3] powerpc: kprobes: add support for KPROBES_ON_FTRACE

2017-02-16 Thread Naveen N. Rao
On 2017/02/15 09:58AM, Ananth N Mavinakayanahalli wrote: > On Wed, Feb 15, 2017 at 12:28:34AM +0530, Naveen N. Rao wrote: > > Allow kprobes to be placed on ftrace _mcount() call sites. This > > optimization avoids the use of a trap, by riding on ftrace > > infrastructure. >

[PATCH 3/5] powerpc: kprobes: fix handling of function offsets on ABIv2

2017-02-16 Thread Naveen N. Rao
ine+0x0[OPTIMIZED] Acked-by: Ananth N Mavinakayanahalli Signed-off-by: Naveen N. Rao --- arch/powerpc/kernel/kprobes.c | 4 ++-- include/linux/kprobes.h | 2 +- kernel/kprobes.c | 7 --- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/kernel/kprob

[PATCH 5/5] powerpc: kprobes: emulate instructions on kprobe handler re-entry

2017-02-16 Thread Naveen N. Rao
On kprobe handler re-entry, try to emulate the instruction rather than single stepping always. As a related change, remove the duplicate saving of msr as that is already done in set_current_kprobe() Acked-by: Ananth N Mavinakayanahalli Signed-off-by: Naveen N. Rao --- arch/powerpc/kernel

[PATCH 4/5] powerpc: kprobes: factor out code to emulate instruction into a helper

2017-02-16 Thread Naveen N. Rao
This helper will be used in a subsequent patch to emulate instructions on re-entering the kprobe handler. No functional change. Acked-by: Ananth N Mavinakayanahalli Signed-off-by: Naveen N. Rao --- arch/powerpc/kernel/kprobes.c | 52 ++- 1 file changed

[PATCH 2/5] kprobes: convert kprobe_lookup_name() to a function

2017-02-16 Thread Naveen N. Rao
The macro is now pretty long and ugly on powerpc. In the light of further changes needed here, convert it to a __weak variant to be over-ridden with a nicer looking function. Suggested-by: Masami Hiramatsu Signed-off-by: Naveen N. Rao --- arch/powerpc/include/asm/kprobes.h | 53

[PATCH 1/5] powerpc: introduce a new helper to obtain function entry points

2017-02-16 Thread Naveen N. Rao
kprobe_lookup_name() is specific to the kprobe subsystem and may not always return the function entry point (in a subsequent patch for KPROBES_ON_FTRACE). For looking up function entry points, introduce a separate helper and use the same in optprobes.c Signed-off-by: Naveen N. Rao --- arch

[PATCH 0/2] powerpc: kretprobe updates

2017-02-16 Thread Naveen N. Rao
I am posting the powerpc bits in the same thread so as to keep these changes together. I am not sure how this should be taken upstream as there are atleast three different trees involved: one for the core kprobes infrastructure, one for powerpc and one for perf. Thanks, Naveen Naveen N. Rao (2

[PATCH 2/2] perf: powerpc: choose LEP with kretprobes

2017-02-16 Thread Naveen N. Rao
perf now uses an offset from _text/_stext for kretprobes, rather than the actual function name. As such, let's choose the LEP for powerpc ABIv2 so as to ensure the probe gets hit. Signed-off-by: Naveen N. Rao --- tools/perf/arch/powerpc/util/sym-handling.c | 5 + 1 file changed, 1 inse

[PATCH 1/2] powerpc: kretprobes: override default function entry offset

2017-02-16 Thread Naveen N. Rao
With ABIv2, we offset 8 bytes into a function to get at the local entry point. Signed-off-by: Naveen N. Rao --- arch/powerpc/kernel/kprobes.c | 9 + 1 file changed, 9 insertions(+) diff --git a/arch/powerpc/kernel/kprobes.c b/arch/powerpc/kernel/kprobes.c index fce05a38851c

Re: [PATCH 1/3] kretprobes: ensure probe location is at function entry

2017-02-15 Thread Naveen N. Rao
On 2017/02/16 08:39AM, Masami Hiramatsu wrote: > On Wed, 15 Feb 2017 23:47:52 +0530 > "Naveen N. Rao" wrote: > > > kretprobes can be registered by specifying an absolute address or by > > specifying offset to a symbol. However, we need to ensure this falls at >

[PATCH 1/3] kretprobes: ensure probe location is at function entry

2017-02-15 Thread Naveen N. Rao
from a function entry, as determined through a kallsyms_lookup(). Introduce arch_function_offset_within_entry() as a way for architectures to override this. Signed-off-by: Naveen N. Rao --- powerpc64 ABIv2 will need to use the over-ride as we want to use the local entry point which will be at an

[PATCH 3/3] perf: revert "perf probe: Fix probing kretprobes"

2017-02-15 Thread Naveen N. Rao
ld use the same scheme we use for kprobes: offset'ing from _text/_stext. Signed-off-by: Naveen N. Rao --- tools/perf/util/probe-event.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c index 6a6f44dd594b.

[PATCH 2/3] trace/kprobes: allow return probes with offsets and absolute addresses

2017-02-15 Thread Naveen N. Rao
with kretprobes. Allow its use with the trace infrastructure. Signed-off-by: Naveen N. Rao --- kernel/trace/trace_kprobe.c | 8 1 file changed, 8 deletions(-) diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c index 7ad9e53ad174..2768cb60ebd7 100644 --- a/kernel

Re: [PATCH 1/3] powerpc: kprobes: fix handling of function offsets on ABIv2

2017-02-15 Thread Naveen N. Rao
On 2017/02/16 12:17AM, Masami Hiramatsu wrote: > On Tue, 14 Feb 2017 14:08:01 +0530 > "Naveen N. Rao" wrote: > > > commit 239aeba76409 ("perf powerpc: Fix kprobe and kretprobe handling > > with kallsyms on ppc64le") changed how we use the offset fiel

Re: [PATCH] kretprobes: reject registration if a symbol offset is specified

2017-02-15 Thread Naveen N. Rao
Hi Masami, On 2017/02/14 07:32PM, Masami Hiramatsu wrote: > On Tue, 14 Feb 2017 14:01:18 +0530 > "Naveen N. Rao" wrote: > > > Users shouldn't be able to specify an offset with kretprobes, as we always > > want to probe at function entry. Otherwise, we won

[PATCH 2/3] powerpc: introduce a new helper to obtain function entry points

2017-02-14 Thread Naveen N. Rao
kprobe_lookup_name() is specific to the kprobe subsystem and may not always return the function entry point (in a subsequent patch). For looking up function entry points, introduce a separate helper and use the same in optprobes.c Signed-off-by: Naveen N. Rao --- arch/powerpc/include/asm/code

[PATCH 3/3] powerpc: kprobes: prefer ftrace when probing function entry

2017-02-14 Thread Naveen N. Rao
044fc0 k kretprobe_trampoline+0x0[OPTIMIZED] and after patch: # cat ../kprobes/list c00d074c k _do_fork+0xc[DISABLED][FTRACE] c00412b0 k kretprobe_trampoline+0x0[OPTIMIZED] Signed-off-by: Naveen N. Rao --- arch/powerpc/include/asm/k

[PATCH 1/3] powerpc: kprobes: add support for KPROBES_ON_FTRACE

2017-02-14 Thread Naveen N. Rao
on the x86 code by Masami. Signed-off-by: Naveen N. Rao --- arch/powerpc/Kconfig | 1 + arch/powerpc/include/asm/kprobes.h | 10 arch/powerpc/kernel/Makefile | 3 ++ arch/powerpc/kernel/kprobes-ftrace.c | 100 +++ arch/powerpc

Re: [PATCH v2 1/2] powerpc: Emulation support for load/store instructions on LE

2017-02-14 Thread Naveen N. Rao
On 2017/02/14 01:32PM, Ravi Bangoria wrote: > emulate_step() uses a number of underlying kernel functions that were > initially not enabled for LE. This has been rectified since. So, fix > emulate_step() for LE for the corresponding instructions. > > Reported-by: Anton Blanchard > Signed-off-by:

[PATCH 1/3] powerpc: kprobes: fix handling of function offsets on ABIv2

2017-02-14 Thread Naveen N. Rao
00d0758 k _do_fork+0x18[DISABLED] c00412b0 k kretprobe_trampoline+0x0[OPTIMIZED] and after: # cat ../kprobes/list c00d04c8 k _do_fork+0x8[DISABLED] c00d04d0 k _do_fork+0x10[DISABLED] c00412b0 k kretprobe_trampoline+0

[PATCH 3/3] powerpc: kprobes: emulate instructions on kprobe handler re-entry

2017-02-14 Thread Naveen N. Rao
On kprobe handler re-entry, try to emulate the instruction rather than single stepping always. As a related change, remove the duplicate saving of msr as that is already done in set_current_kprobe() Signed-off-by: Naveen N. Rao --- arch/powerpc/kernel/kprobes.c | 9 - 1 file changed, 8

[PATCH 2/3] powerpc: kprobes: factor out code to emulate instruction into a helper

2017-02-14 Thread Naveen N. Rao
This helper will be used in a subsequent patch to emulate instructions on re-entering the kprobe handler. No functional change. Signed-off-by: Naveen N. Rao --- arch/powerpc/kernel/kprobes.c | 52 ++- 1 file changed, 31 insertions(+), 21 deletions

[PATCH] kretprobes: reject registration if a symbol offset is specified

2017-02-14 Thread Naveen N. Rao
permitted And dmesg: [48253.757629] register_kretprobe failed, returned -22 Signed-off-by: Naveen N. Rao --- kernel/kprobes.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/kprobes.c b/kernel/kprobes.c index 60a702a05684..83ad7e440417 100644 --- a/kernel/kprobes.c ++

Re: [PATCH 1/3] kprobes: introduce weak variant of kprobe_exceptions_notify

2017-02-13 Thread Naveen N. Rao
On 2017/02/10 02:41PM, Michael Ellerman wrote: > "Naveen N. Rao" writes: > > > kprobe_exceptions_notify() is not used on some of the architectures such > > as arm[64] and powerpc anymore. Introduce a weak variant for such > > architectures. > > I'

[PATCH 1/3] kprobes: introduce weak variant of kprobe_exceptions_notify

2017-02-07 Thread Naveen N. Rao
kprobe_exceptions_notify() is not used on some of the architectures such as arm[64] and powerpc anymore. Introduce a weak variant for such architectures. Signed-off-by: Naveen N. Rao --- kernel/kprobes.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/kernel/kprobes.c b/kernel

[PATCH 3/3] powerpc: kprobes: remove kprobe_exceptions_notify()

2017-02-07 Thread Naveen N. Rao
... as the weak variant will do. Signed-off-by: Naveen N. Rao --- arch/powerpc/kernel/kprobes.c | 9 - 1 file changed, 9 deletions(-) diff --git a/arch/powerpc/kernel/kprobes.c b/arch/powerpc/kernel/kprobes.c index 45e4f82b230d..fce05a38851c 100644 --- a/arch/powerpc/kernel/kprobes.c

[PATCH 2/3] arm: kprobes: remove kprobe_exceptions_notify

2017-02-07 Thread Naveen N. Rao
... as the weak variant will do. Signed-off-by: Naveen N. Rao --- arch/arm/probes/kprobes/core.c | 10 -- arch/arm64/kernel/probes/kprobes.c | 6 -- 2 files changed, 16 deletions(-) diff --git a/arch/arm/probes/kprobes/core.c b/arch/arm/probes/kprobes/core.c index a4ec240ee7ba

Re: [PATCH V3 3/4] arch/powerpc: Implement Optprobes

2017-02-06 Thread Naveen N. Rao
On 2017/02/07 10:05AM, Masami Hiramatsu wrote: > On Sat, 4 Feb 2017 01:09:49 +0530 > "Naveen N. Rao" wrote: > > > Hi Michael, > > Thanks for the review! I'll defer to Anju on most of the aspects, but... > > > > On 2017/02/01 09:53PM, Micha

Re: [PATCH V3 3/4] arch/powerpc: Implement Optprobes

2017-02-03 Thread Naveen N. Rao
Hi Michael, Thanks for the review! I'll defer to Anju on most of the aspects, but... On 2017/02/01 09:53PM, Michael Ellerman wrote: > Anju T Sudhakar writes: > > > +static void optimized_callback(struct optimized_kprobe *op, > > + struct pt_regs *regs) > > +{ > > + str

[PATCH] powerpc: kprobes: fixes for kprobe_lookup_name on BE

2017-01-31 Thread Naveen N. Rao
rough other headers, and - two, with a missing const qualifier for a local variable which ends up referring a string literal. Again, this is unique to how kprobe_lookup_name is being invoked in optprobes.c Signed-off-by: Naveen N. Rao --- arch/powerpc/include/asm/kprobes.h | 3 ++- 1 file chang

Re: [PATCH V3 3/4] arch/powerpc: Implement Optprobes

2017-01-30 Thread Naveen N. Rao
is purpose. > > > > Instructions which can be emulated using analyse_instr() are suppliants > > for optimization. Before optimization ensure that the address range > > between the detour buffer allocated and the instruction being probed > > is within ± 32MB. > >

Re: [PATCH V3 3/4] arch/powerpc: Implement Optprobes

2017-01-04 Thread Naveen N. Rao
probed > > is within ± 32MB. > > > > Signed-off-by: Anju T Sudhakar > > Signed-off-by: Naveen N. Rao > > Looks good to me :) > > Acked-by: Masami Hiramatsu Thanks, Masami! Ben/Michael, Can you please take a look and let us know your thoughts on this? - Naveen

Re: [PATCH V2 0/4] OPTPROBES for powerpc

2016-12-16 Thread Naveen N. Rao
On 2016/12/17 01:46AM, Balbir Singh wrote: > > > On 15/12/16 03:18, Anju T Sudhakar wrote: > > This is the V2 patchset of the kprobes jump optimization > > (a.k.a OPTPROBES)for powerpc. Kprobe being an inevitable tool > > for kernel developers, enhancing the performance of kprobe has > > got much

Re: [PATCH v7 0/6] perf annotate: Cross arch support + few fixes

2016-11-16 Thread Naveen N. Rao
? We'd very much like to use this for better code annotation and browsing. FWIW, I have tested this on powerpc. Tested-by: Naveen N. Rao Thanks, Naveen

Re: [PATCH 0/3] powerpc: Emulation support for load/store instructions on LE

2016-11-03 Thread Naveen N. Rao
+ > 6 files changed, 460 insertions(+), 20 deletions(-) > create mode 100644 arch/powerpc/lib/test_emulate_step.c Patch 2 can be folded into the third patch. Apart from that, and the minor nit with patch 3, for this series: Reviewed-by: Naveen N. Rao Thanks, Naveen

<    1   2   3   4   5   6   7   8   >