Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp153002ybl; Tue, 7 Jan 2020 16:06:57 -0800 (PST) X-Google-Smtp-Source: APXvYqwBIgnyIh5UBFSu0eBPZLqIqOhUhopevuZoi7dj2c3V38136sz4FxYHoso1+9se0s8P4bCR X-Received: by 2002:aca:1103:: with SMTP id 3mr874168oir.70.1578442017012; Tue, 07 Jan 2020 16:06:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578442017; cv=none; d=google.com; s=arc-20160816; b=RMMkEA5hr1Q3gOf6r7dzQMzf+L2ZbUe8nKY1WrqaEIqlLyb1Y8Sp4PIMg3wk1kbgN/ 3hXYRE7EJzB9kqAK7XHb7VCUSkUTPuLsxDsaPTrS3QBtmA2I+woaBAcDfct7hazFeGqM A4vPFTB3sPmUc4mRMVqc7yX7fWm1ST5VDNmpHEXn/LCMIBh4EIxSrWL35Mr+SJvoUo6O xTwtG/Wa7B/Ao2MJbFWTU9Wud7cHwlPeSa2ItJbAoIfaNHoM9dtjPuvi5y3bxRFQm1NB /xZth3Y01pNuADgcW2hponUtAkDNtYaIIyy/JOYon5Wj3OprFIxfAk3rFpQis0DpLQ3X 064A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=MiYBstgxho/61AH5ayKzv0qIiVtwHtWOOrAJNV4jS/c=; b=SVmjD1MQDrHQWi3B4P4cJj05v8udV3zqx/q7GFTRqwCYyhcsvtrLeDE7sXy1TtVOXk 5HBW2WleU6UYVofS6l5NdSVS0XaGjJSxHE+WZ78L+f2JlqOLbrCdaOEfaBODQqt7HxKH 9CQ/uYnW/EULRuMTvhVU2+exp7QHku7x4FBSBbrkiZCXJ7CAKrlIz/ZvL6e+HNY9Wnxf plpVR0zv7IET/9ZL8EmhtdlZWwmqsz+5ltak9xk5wdfkKPtChXH7e9UdHtBkTEUCHgTh c67r+CwGGudOznYN1Iy0SmLsWMuUu0zSPRDFceM0cIFWK8UMu4OrMp2cmkmg6GCPUIq4 /jAg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 94si876199ott.8.2020.01.07.16.06.44; Tue, 07 Jan 2020 16:06:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726955AbgAHAFu (ORCPT + 99 others); Tue, 7 Jan 2020 19:05:50 -0500 Received: from mail.kernel.org ([198.145.29.99]:51966 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725601AbgAHAFu (ORCPT ); Tue, 7 Jan 2020 19:05:50 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E385720692; Wed, 8 Jan 2020 00:05:48 +0000 (UTC) Date: Tue, 7 Jan 2020 19:05:47 -0500 From: Steven Rostedt To: Jisheng Zhang Cc: Catalin Marinas , Will Deacon , Ingo Molnar , "Naveen N. Rao" , Anil S Keshavamurthy , "David S. Miller" , Masami Hiramatsu , Mark Rutland , Jonathan Corbet , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-doc@vger.kernel.org" Subject: Re: [PATCH v7 2/3] ftrace: introduce FTRACE_IP_EXTENSION Message-ID: <20200107190547.3a748fce@gandalf.local.home> In-Reply-To: <20191225172836.7f381759@xhacker.debian> References: <20191225172625.69811b3e@xhacker.debian> <20191225172836.7f381759@xhacker.debian> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 25 Dec 2019 09:42:52 +0000 Jisheng Zhang wrote: > On some architectures, the DYNAMIC_FTRACE_WITH_REGS is implemented by > gcc's -fpatchable-function-entry option. Take arm64 for example, arm64 > makes use of GCC -fpatchable-function-entry=2 option to insert two > nops. When the function is traced, the first nop will be modified to > the LR saver, then the second nop to "bl ". we need to > update ftrace_location() to recognise these two instructions as being > part of ftrace. To do this, we introduce FTRACE_IP_EXTENSION to let > ftrace_location search IP, IP + FTRACE_IP_EXTENSION range. > > Signed-off-by: Jisheng Zhang > Suggested-by: Steven Rostedt (VMware) You can also add: Reviewed-by: Steven Rostedt (VMware) and when Masami is happy with your patches, it should go through the tip tree. Thanks! -- Steve > --- > include/linux/ftrace.h | 4 ++++ > kernel/trace/ftrace.c | 2 +- > 2 files changed, 5 insertions(+), 1 deletion(-) > > diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h > index 7247d35c3d16..05a03b2a2f39 100644 > --- a/include/linux/ftrace.h > +++ b/include/linux/ftrace.h > @@ -20,6 +20,10 @@ > > #include > > +#ifndef FTRACE_IP_EXTENSION > +#define FTRACE_IP_EXTENSION 0 > +#endif > + > /* > * If the arch supports passing the variable contents of > * function_trace_op as the third parameter back from the > diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c > index 74439ab5c2b6..a8cfea502369 100644 > --- a/kernel/trace/ftrace.c > +++ b/kernel/trace/ftrace.c > @@ -1590,7 +1590,7 @@ unsigned long ftrace_location_range(unsigned long start, unsigned long end) > */ > unsigned long ftrace_location(unsigned long ip) > { > - return ftrace_location_range(ip, ip); > + return ftrace_location_range(ip, ip + FTRACE_IP_EXTENSION); > } > > /**