Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752073AbbLLSsw (ORCPT ); Sat, 12 Dec 2015 13:48:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50158 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750724AbbLLSsv (ORCPT ); Sat, 12 Dec 2015 13:48:51 -0500 Subject: Re: [RFC] kprobe'ing conditionally executed instructions To: David Long , "Jon Medhurst (Tixy)" , masami.hiramatsu.pt@hitachi.com, Ananth N Mavinakayanahalli , anil.s.keshavamurthy@intel.com, davem@davemloft.net, Steve Capper , will.deacon@arm.com References: <566A5997.9020908@linaro.org> <566AF556.6050704@redhat.com> <566BB6FE.2050005@linaro.org> Cc: "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Sandeepa Prabhu , Pratyush Anand From: William Cohen Message-ID: <566C6C11.1030600@redhat.com> Date: Sat, 12 Dec 2015 13:48:49 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <566BB6FE.2050005@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1986 Lines: 35 On 12/12/2015 12:56 AM, David Long wrote: > On 12/11/2015 11:09 AM, William Cohen wrote: >> On 12/11/2015 12:05 AM, David Long wrote: >>> There is a moderate amount of code already in kprobes on ARM and the current ARMv8 patch to deal with conditional execution of instructions. One aspect of how this is handled is that instructions that fail their predicate and are not (technically) executed are also not treated as a hit kprobe. Steve Capper has suggested that the probe handling should still take place because we stepped through the instruction even if it was effectively a nop. This would be a significant change in how it currently works on 32-bit ARM, and a change in the patch for ARMv8 (although it's not likely to be much of a change in the kernel code). >>> >>> I need input on this. Do people have opinions? >>> >>> -dl >>> >> >> Hi Dave, >> >> Conditionally executing the kprobes would violate the assumptions made for perf and systemtap collecting data. Even if the instruction is predicated and treated as a NOP it should still reliably trigger the kprobe. However, for efficiency the simulation/emulation/single-step of the instruction could be skipped if the instruction is known to have no change on the machine state other than changing the program counter. >> >> -Will Cohen >> > > I wonder if this might explain some systemtap failures. > > -dl > Hi Dave, It is possible that some of the kprobes not triggering would cause testsuite failures, but I don't have a specific test to point to this is happening. How much of change would it be to fix the kprobes to get the correct behavior. It might be easiest to fix it and compare the test results to find possible candidates where this problem occurs. -Will -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/