From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752477AbdBNIlm (ORCPT ); Tue, 14 Feb 2017 03:41:42 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:55753 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752188AbdBNIll (ORCPT ); Tue, 14 Feb 2017 03:41:41 -0500 Date: Tue, 14 Feb 2017 14:11:34 +0530 From: Ananth N Mavinakayanahalli To: "Naveen N. Rao" Cc: Masami Hiramatsu , Michael Ellerman , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH 1/3] powerpc: kprobes: fix handling of function offsets on ABIv2 Reply-To: ananth@linux.vnet.ibm.com References: <1b7d5ea08a7e11fbf1fb08dd3536219c94b13591.1487060527.git.naveen.n.rao@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1b7d5ea08a7e11fbf1fb08dd3536219c94b13591.1487060527.git.naveen.n.rao@linux.vnet.ibm.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17021408-0020-0000-0000-00000B5D5A03 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006613; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000203; SDB=6.00821722; UDB=6.00401920; IPR=6.00599175; BA=6.00005135; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00014274; XFM=3.00000011; UTC=2017-02-14 08:41:39 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17021408-0021-0000-0000-00005A16EFBC Message-Id: <20170214084134.GG29806@in.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-02-14_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1702140088 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 14, 2017 at 02:08:01PM +0530, Naveen N. Rao wrote: > commit 239aeba76409 ("perf powerpc: Fix kprobe and kretprobe handling > with kallsyms on ppc64le") changed how we use the offset field in struct > kprobe on ABIv2. perf now offsets from the GEP (Global entry point) if an > offset is specified and otherwise chooses the LEP (Local entry point). > > Fix the same in kernel for kprobe API users. We do this by extending > kprobe_lookup_name() to accept an additional parameter to indicate the > offset specified with the kprobe registration. If offset is 0, we return > the local function entry and return the global entry point otherwise. > > With: > # cd /sys/kernel/debug/tracing/ > # echo "p _do_fork" >> kprobe_events > # echo "p _do_fork+0x10" >> kprobe_events > > before this patch: > # cat ../kprobes/list > c0000000000d0748 k _do_fork+0x8 [DISABLED] > c0000000000d0758 k _do_fork+0x18 [DISABLED] > c0000000000412b0 k kretprobe_trampoline+0x0 [OPTIMIZED] > > and after: > # cat ../kprobes/list > c0000000000d04c8 k _do_fork+0x8 [DISABLED] > c0000000000d04d0 k _do_fork+0x10 [DISABLED] > c0000000000412b0 k kretprobe_trampoline+0x0 [OPTIMIZED] > > Signed-off-by: Naveen N. Rao Acked-by: Ananth N Mavinakayanahalli