Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp463464ybi; Fri, 26 Jul 2019 12:48:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqzDxb/tcp+qJjE/lNED4fkXovDxExeYyP5cQCFqW4wsvFYRgiAF5eG6z3hVSEfmDZJuga70 X-Received: by 2002:a17:902:e703:: with SMTP id co3mr1555277plb.119.1564170536785; Fri, 26 Jul 2019 12:48:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564170536; cv=none; d=google.com; s=arc-20160816; b=RU3tgc7Kraydw+JONdn2RgDETjXoOWHscseQSp3Y4w1ew88dr+6IrL0J5YK7t7/gEp 46pztSzKROnO3WdjGkEWzcFX/bhptP/oOOU7aIXY4CxQaC/G0fMxN8OHzoKYD/bdkuuS VpFBK8SivXwyETXB8AKyDcn+TGrcBkKWrqbhK9p8D0ooC+//NxEnPuOzmpAEGmnqXgBF vkyhx/14pG2gLzIuf03hWAST5rXXSVzywML+PddC11cBJTz/VANWHOEAhgs/3JWdpnFY GkUru+NHdTi/cBq/RHCWnUOqvOCR8BmtZh+bOL+0tyDG46dSvEe9ncyihyU0T2e3Y7xY CqQA== 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=e1DZzhyYUGLPGSPlIHbwYtGmkmcB3hVYL5UDUD1N6s0=; b=qoeCg32enJdzqT1eY5hnWRpmjxD4JdawWuyUUYknSujh/h7ptB8ReySEzUcW9Q4wok 65ZUrlMIxshX8w+Egv3lplvBOnQFLC5MVE0JHdZpsCxLfjVlM59itai4jsGtAqVx80BO EWw4r1T1WivJU8ts4vXluuEQrELnhw4Ga4gYRqdc1jURDXX/Exmy1u4r5XheqvnYd/9S iKjcDExe2aA2ueFZZNQvX7u7qYD8aEzab2h1zCg3thDKE9I3GjySv/LoF0POlSDqcmsR CX8zgEJ1CQqucw9BUxZkyVRf6rdOEEWjUAES7Gxl7WdjTplyZQS3+qxC/rKeP0WpSVf4 kdkg== 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 r41si19447165pjb.11.2019.07.26.12.48.41; Fri, 26 Jul 2019 12:48:56 -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 S2388120AbfGZSnO convert rfc822-to-8bit (ORCPT + 99 others); Fri, 26 Jul 2019 14:43:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:35452 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388035AbfGZSnN (ORCPT ); Fri, 26 Jul 2019 14:43:13 -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 2AE252077C; Fri, 26 Jul 2019 18:43:12 +0000 (UTC) Date: Fri, 26 Jul 2019 14:43:10 -0400 From: Steven Rostedt To: Matt Helsley Cc: LKML , Ingo Molnar , Josh Poimboeuf , Peter Zijlstra Subject: Re: [PATCH v3 04/13] recordmcount: Rewrite error/success handling Message-ID: <20190726144310.5c62925b@gandalf.local.home> In-Reply-To: <4F0912A7-345E-46EE-B58F-CF7E8EE2AB65@vmware.com> References: <316706a0e2727af0a2639b8e90366746d7a3a84a.1563992889.git.mhelsley@vmware.com> <20190726134523.4e7afd55@gandalf.local.home> <4F0912A7-345E-46EE-B58F-CF7E8EE2AB65@vmware.com> 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=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 26 Jul 2019 18:37:11 +0000 Matt Helsley wrote: > >> diff --git a/scripts/recordmcount.h b/scripts/recordmcount.h > >> index c1e1b04b4871..909a3e4775c2 100644 > >> --- a/scripts/recordmcount.h > >> +++ b/scripts/recordmcount.h > >> @@ -24,7 +24,9 @@ > >> #undef mcount_adjust > >> #undef sift_rel_mcount > >> #undef nop_mcount > >> +#undef missing_sym > >> #undef find_secsym_ndx > >> +#undef already_has_rel_mcount > > > > Why do we need these as defines? Can't you just have a single: > > > > const char *already_has_mcount = "success"; > > > > in recordmcount.c before recordmcount.h is included? > > > > And same for missing_sym. > > Yes, that’s a good point. I’ve been trying to separate the changes to > the functions from moving parts out but in this case it would make > just as much sense to add them to recordmcount.c in the first place. > > Ultimately, this ugliness gets removed as the next series removes > recordmcount.h entirely and one of the steps is moving > find_secsym_ndx() out while eliminating these redundant pieces. Yeah, this code will be cleaned up later, but let's have the steps in between look fine as well. > > > > > Another, probably more robust way of doing this, is change > > find_secsym_ndx() to return 0 on success and -1 on missing symbol, > > and just pass a pointer by reference to fill the recsym (which > > doesn't have to be a constant). > > That’s easy enough to do and I do like separating the error/success > return from returning the index. I can send that out now or tack it > onto the next RFC series I’m about to send which completes the > conversion if that’s preferable. > > Yeah, the original code applies “const” in lots of places -- I > presume it’s an attempt to eek out every last bit of performance from > the compiler. As I said before, I've applied patches 1-3, so you don't need to resend them. I finished looking at the rest, and only this patch needs to be fixed, and since you are resending, could you fix the "upside-down x-mas" tree declaration I mentioned in patch 8. Thanks Matt, -- Steve