Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935503AbcJFWmS (ORCPT ); Thu, 6 Oct 2016 18:42:18 -0400 Received: from terminus.zytor.com ([198.137.202.10]:46366 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935415AbcJFWmJ (ORCPT ); Thu, 6 Oct 2016 18:42:09 -0400 Date: Thu, 6 Oct 2016 15:40:01 -0700 From: tip-bot for Ravi Bangoria Message-ID: Cc: tglx@linutronix.de, peterz@infradead.org, naveen.n.rao@linux.vnet.ibm.com, alexander.shishkin@linux.intel.com, linux-kernel@vger.kernel.org, hpa@zytor.com, mhiramat@kernel.org, acme@redhat.com, bsingharora@gmail.com, mingo@kernel.org, ravi.bangoria@linux.vnet.ibm.com Reply-To: hpa@zytor.com, bsingharora@gmail.com, acme@redhat.com, mhiramat@kernel.org, mingo@kernel.org, ravi.bangoria@linux.vnet.ibm.com, tglx@linutronix.de, peterz@infradead.org, naveen.n.rao@linux.vnet.ibm.com, linux-kernel@vger.kernel.org, alexander.shishkin@linux.intel.com In-Reply-To: <1475576865-6562-1-git-send-email-ravi.bangoria@linux.vnet.ibm.com> References: <1475576865-6562-1-git-send-email-ravi.bangoria@linux.vnet.ibm.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/urgent] perf uretprobe ppc64le: Fix probe location Git-Commit-ID: a1d9972e59e15538458c030affbfc298c32a47f8 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2368 Lines: 60 Commit-ID: a1d9972e59e15538458c030affbfc298c32a47f8 Gitweb: http://git.kernel.org/tip/a1d9972e59e15538458c030affbfc298c32a47f8 Author: Ravi Bangoria AuthorDate: Tue, 4 Oct 2016 15:57:45 +0530 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 5 Oct 2016 08:14:22 -0300 perf uretprobe ppc64le: Fix probe location Perf uretprobe probes on GEP(Global Entry Point) which fails to record all function calls via LEP(Local Entry Point). Fix that by probing on LEP. Objdump: 00000000100005f0 : 100005f0: 02 10 40 3c lis r2,4098 100005f4: 00 7f 42 38 addi r2,r2,32512 100005f8: a6 02 08 7c mflr r0 100005fc: 10 00 01 f8 std r0,16(r1) 10000600: f8 ff e1 fb std r31,-8(r1) Before applying patch: $ cat /sys/kernel/debug/tracing/uprobe_events r:probe_uprobe_test/doit /home/ravi/uprobe_test:0x00000000000005f0 After applying patch: $ cat /sys/kernel/debug/tracing/uprobe_events r:probe_uprobe_test/doit /home/ravi/uprobe_test:0x00000000000005f8 This is not the case with kretprobes because the kernel itself finds LEP and probes on it. Signed-off-by: Ravi Bangoria Cc: Alexander Shishkin Cc: Balbir Singh Cc: Masami Hiramatsu Cc: Naveen N. Rao Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1475576865-6562-1-git-send-email-ravi.bangoria@linux.vnet.ibm.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/arch/powerpc/util/sym-handling.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/perf/arch/powerpc/util/sym-handling.c b/tools/perf/arch/powerpc/util/sym-handling.c index ed9d5d1..1030a6e 100644 --- a/tools/perf/arch/powerpc/util/sym-handling.c +++ b/tools/perf/arch/powerpc/util/sym-handling.c @@ -82,7 +82,8 @@ void arch__fix_tev_from_maps(struct perf_probe_event *pev, * * In addition, we shouldn't specify an offset for kretprobes. */ - if (pev->point.offset || pev->point.retprobe || !map || !sym) + if (pev->point.offset || (!pev->uprobes && pev->point.retprobe) || + !map || !sym) return; lep_offset = PPC64_LOCAL_ENTRY_OFFSET(sym->arch_sym);