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
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
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
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
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
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:
> > >
> > >
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
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
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,
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
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
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
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
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
]
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 +
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
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
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
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
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
&
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
&
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
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
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
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
]
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 +
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
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
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
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
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
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
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
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
> > &
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
---
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
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
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
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
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?
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
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
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
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
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
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
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
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
...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
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
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
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
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
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
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
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:
> &
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
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
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
.
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
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
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
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
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
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
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.
>
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
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
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
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
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
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
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
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
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
>
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
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.
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
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
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
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
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
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
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:
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
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
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
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
++
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'
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
... 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
... 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
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
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
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
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.
> >
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
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
? 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
+
> 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
301 - 400 of 723 matches
Mail list logo