Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1586169 > unrolled thread

[PATCH v2 0/5] kretprobe fixes

Started by"Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
First post2017-02-22 15:00 +0100
Last post2017-02-22 15:00 +0100
Articles 2 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH v2 0/5] kretprobe fixes "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> - 2017-02-22 15:00 +0100
    [PATCH v2 5/5] perf: powerpc: choose local entry point with kretprobes "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> - 2017-02-22 15:00 +0100

#1586169 — [PATCH v2 0/5] kretprobe fixes

From"Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
Date2017-02-22 15:00 +0100
Subject[PATCH v2 0/5] kretprobe fixes
Message-ID<tdFCx-2v3-3@gated-at.bofh.it>
I'm including all patches (generic and powerpc changes) in
this series as suggested by Masami.

v1 patches:
https://marc.info/?l=linux-kernel&m=148718276424380
https://marc.info/?l=linux-kernel&m=148723314105453&w=2

Patches 1 and 2 are the same as v1.
Patch 3 is updated to 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 absolute addresses
  perf: kretprobes: offset from reloc_sym if kernel supports it
  perf: powerpc: choose local entry point with kretprobes

 arch/powerpc/kernel/kprobes.c               |  9 ++++++
 include/linux/kprobes.h                     |  1 +
 kernel/kprobes.c                            | 13 ++++++++
 kernel/trace/trace.c                        |  1 +
 kernel/trace/trace_kprobe.c                 |  8 -----
 tools/perf/arch/powerpc/util/sym-handling.c |  9 +++---
 tools/perf/util/probe-event.c               | 47 ++++++++++++++++++++++++-----
 tools/perf/util/probe-event.h               |  2 ++
 8 files changed, 71 insertions(+), 19 deletions(-)

-- 
2.11.0

[toc] | [next] | [standalone]


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

From"Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
Date2017-02-22 15:00 +0100
Subject[PATCH v2 5/5] perf: powerpc: choose local entry point with kretprobes
Message-ID<tdFCy-2v3-19@gated-at.bofh.it>
In reply to#1586169
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 choose
the LEP for powerpc ABIv2 so as to ensure the probe gets hit. Do it only
if the kernel supports specifying offsets with kretprobes.

Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
---
 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/util/sym-handling.c
+++ b/tools/perf/arch/powerpc/util/sym-handling.c
@@ -79,11 +79,12 @@ void arch__fix_tev_from_maps(struct perf_probe_event *pev,
 	 * However, if the user specifies an offset, we fall back to using the
 	 * GEP since all userspace applications (objdump/readelf) show function
 	 * disassembly with offsets from the GEP.
-	 *
-	 * In addition, we shouldn't specify an offset for kretprobes.
 	 */
-	if (pev->point.offset || (!pev->uprobes && pev->point.retprobe) ||
-	    !map || !sym)
+	if (pev->point.offset || !map || !sym)
+		return;
+
+	/* For kretprobes, add an offset only if the kernel supports it */
+	if (!pev->uprobes && pev->point.retprobe && !is_kretprobe_offset_supported())
 		return;
 
 	lep_offset = PPC64_LOCAL_ENTRY_OFFSET(sym->arch_sym);
-- 
2.11.0

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web