Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp3393578img; Mon, 25 Mar 2019 09:22:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqwhJarkfYSwQ+1lKrDUjuMl90SpwIA1xdT9sNe7xS0GfSc4Lt2Nc+e2NSvVu8+uKZ+VRAo2 X-Received: by 2002:a17:902:b60c:: with SMTP id b12mr25494860pls.261.1553530956968; Mon, 25 Mar 2019 09:22:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553530956; cv=none; d=google.com; s=arc-20160816; b=GM5ose/JrSM9pJ5v41oXsuY2CniUaaQNdx8sGQ0aseI7sjGbwWv1Xdwl6l0WRr6VeH dsGuX3z+fonJH+mcVj0ywkhzQNWN7sgJo3s/fwjGAfumzqKkCwhzZcIayyoS5i42os0Q eHbktzOn4RN51xOpabc+Fy+sMeE42SNea/hO0wXGzEv7WFKpZIg0Rhe3cel9FW7c0YXb xy//0yDK5OLCtNwRY1wzZtfSA/DDwrfIYm9uSoZ1/4fw2Z30vJbcFZ+Z6x/G9C9tXnqr ypQw2mMlETtyipqhJ9tnissIOuIDHRpU0qunVq6WsNh3Az9zu0DB12W2/A4nwXTL8wxj sT9w== 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=j+wuHwv4dkzp5EKUFaQpJmoeeeMnYWWYIoebzWiQ+HU=; b=yvv+2tz+MPQTU+h2DhQkgXWDev4eI3yfhEA9XmNcM1lWRaSG1L28VYnvTB0RuEK2ta 7+EVJTrlq+6vbPJSk/XgcaqwRasGpT4H9PB5ZyzvaGUUZxq4uovgcvRLOeFOyEtumL05 ZXnGIgccYl9k8QrQubdEo9CH94T9qEKFu40vELMRbWblCvNv9VLBxm0OFmudXbBo1O5m cwsNil3CauI3XQJvEPOM5kCI1d24lNp1qL95K/Nh9e+At6zUnSrI7uffWLX3SPCUSqMg eUXfO+r4WRFGK9QhECQjdq8SRtxDjFNOQtolVeZKIN+G4IlrbqcWv3PrMKtIBnx1ZANw cPnQ== 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 h12si13468653pgs.207.2019.03.25.09.22.22; Mon, 25 Mar 2019 09:22:36 -0700 (PDT) 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 S1729862AbfCYQVZ (ORCPT + 99 others); Mon, 25 Mar 2019 12:21:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:35768 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725788AbfCYQVX (ORCPT ); Mon, 25 Mar 2019 12:21:23 -0400 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 5E6FC20828; Mon, 25 Mar 2019 16:21:22 +0000 (UTC) Date: Mon, 25 Mar 2019 12:21:20 -0400 From: Steven Rostedt To: Joe Lawrence Cc: linux-kbuild@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Masahiro Yamada , Michal Marek , Nicholas Piggin Subject: Re: [PATCH] kbuild: strip whitespace in cmd_record_mcount findstring Message-ID: <20190325122120.36b69344@gandalf.local.home> In-Reply-To: <20190325160438.8982-1-joe.lawrence@redhat.com> References: <20190325160438.8982-1-joe.lawrence@redhat.com> X-Mailer: Claws Mail 3.16.0 (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 Mon, 25 Mar 2019 12:04:38 -0400 Joe Lawrence wrote: > CC_FLAGS_FTRACE may contain trailing whitespace that interferes with > findstring. > > For example, commit 6977f95e63b9 ("powerpc: avoid -mno-sched-epilog on > GCC 4.9 and newer") introduced a change such that on my ppc64le box, > CC_FLAGS_FTRACE="-pg -mprofile-kernel ". (Note the trailing space.) > When cmd_record_mcount is now invoked, findstring fails as the ftrace > flags were found at very end of _c_flags, without the trailing space. > > _c_flags=" ... -pg -mprofile-kernel" > CC_FLAGS_FTRACE="-pg -mprofile-kernel " > ^ > findstring is looking for this extra space Wow, what a bug. > > Remove the redundant whitespaces from CC_FLAGS_FTRACE in > cmd_record_mcount to avoid this problem. > > Fixes: 6977f95e63b9 ("powerpc: avoid -mno-sched-epilog on GCC 4.9 and newer"). > Signed-off-by: Joe Lawrence Acked-by: Steven Rostedt (VMware) -- Steve > --- > > Standard disclaimer: I'm not a kbuild expert, but this works around the > problem I reported where ftrace and livepatch self-tests were failing as > specified object files were not run through the recordmcount.pl script: > > ppc64le: ftrace self-tests and $(CC_FLAGS_FTRACE) broken? > https://lists.ozlabs.org/pipermail/linuxppc-dev/2019-March/187298.html > > scripts/Makefile.build | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/scripts/Makefile.build b/scripts/Makefile.build > index 2554a15ecf2b..74d402b5aa3c 100644 > --- a/scripts/Makefile.build > +++ b/scripts/Makefile.build > @@ -199,10 +199,10 @@ sub_cmd_record_mcount = perl $(srctree)/scripts/recordmcount.pl "$(ARCH)" \ > "$(if $(part-of-module),1,0)" "$(@)"; > recordmcount_source := $(srctree)/scripts/recordmcount.pl > endif # BUILD_C_RECORDMCOUNT > -cmd_record_mcount = \ > - if [ "$(findstring $(CC_FLAGS_FTRACE),$(_c_flags))" = \ > - "$(CC_FLAGS_FTRACE)" ]; then \ > - $(sub_cmd_record_mcount) \ > +cmd_record_mcount = \ > + if [ "$(findstring $(strip $(CC_FLAGS_FTRACE)),$(_c_flags))" = \ > + "$(strip $(CC_FLAGS_FTRACE))" ]; then \ > + $(sub_cmd_record_mcount) \ > fi > endif # CC_USING_RECORD_MCOUNT > endif # CONFIG_FTRACE_MCOUNT_RECORD