Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S978997AbdDXWsk (ORCPT ); Mon, 24 Apr 2017 18:48:40 -0400 Received: from ozlabs.org ([103.22.144.67]:32985 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S973078AbdDXWrf (ORCPT ); Mon, 24 Apr 2017 18:47:35 -0400 X-powerpc-patch-notification: thanks X-powerpc-patch-commit: 24bd909e94776ecce95291bff910f14c78ac4a43 In-Reply-To: <53ebcc66e4a7ccf1c22cd1703afb0e4738f981ea.1492606062.git.naveen.n.rao@linux.vnet.ibm.com> To: "Naveen N. Rao" From: Michael Ellerman Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Masami Hiramatsu , Ingo Molnar Subject: Re: [v4,6/6] powerpc: kprobes: prefer ftrace when probing function entry Message-Id: <3wBhLY159cz9s8Y@ozlabs.org> Date: Tue, 25 Apr 2017 08:47:33 +1000 (AEST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1020 Lines: 30 On Wed, 2017-04-19 at 12:52:28 UTC, "Naveen N. Rao" wrote: > KPROBES_ON_FTRACE avoids much of the overhead with regular kprobes as it > eliminates the need for a trap, as well as the need to emulate or > single-step instructions. > > Though OPTPROBES provides us with similar performance, we have limited > optprobes trampoline slots. As such, when asked to probe at a function > entry, default to using the ftrace infrastructure. > > With: > # cd /sys/kernel/debug/tracing > # echo 'p _do_fork' > kprobe_events > > before patch: > # cat ../kprobes/list > c0000000000daf08 k _do_fork+0x8 [DISABLED] > c000000000044fc0 k kretprobe_trampoline+0x0 [OPTIMIZED] > > and after patch: > # cat ../kprobes/list > c0000000000d074c k _do_fork+0xc [DISABLED][FTRACE] > c0000000000412b0 k kretprobe_trampoline+0x0 [OPTIMIZED] > > Signed-off-by: Naveen N. Rao Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/24bd909e94776ecce95291bff910f1 cheers