Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39CEFC433DB for ; Wed, 23 Dec 2020 17:02:43 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E75C52229C for ; Wed, 23 Dec 2020 17:02:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E75C52229C Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.58544.103069 (Exim 4.92) (envelope-from ) id 1ks7X0-0004QL-B3; Wed, 23 Dec 2020 17:02:34 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 58544.103069; Wed, 23 Dec 2020 17:02:34 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ks7X0-0004QE-7W; Wed, 23 Dec 2020 17:02:34 +0000 Received: by outflank-mailman (input) for mailman id 58544; Wed, 23 Dec 2020 17:02:33 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ks7Wy-0004Q9-U6 for xen-devel@lists.xenproject.org; Wed, 23 Dec 2020 17:02:32 +0000 Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 72847706-24f1-4342-b091-341ccbfc39ae; Wed, 23 Dec 2020 17:02:31 +0000 (UTC) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 72847706-24f1-4342-b091-341ccbfc39ae DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1608742951; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=kYgNW59ChK2fCZZH8onTJqALT3bKd6CHCZsvhPNBxOo=; b=Le2arulZUzlywYdbLQTp7isaa2P6aN7/XQtYSSKdRUfz8BxvVCBArbg7 Yr8y5ZEKDsg6bYZAH/UZOyEuVwYgDpyjmr5kMBLGZLuTylam0LgX1rc65 Hx//hty0NgQjsAqVnCVP5IlFeAX9uolhkZ1zfnP8MRdVS8muu8yJBpyFg Y=; Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: dbeZBWQAUucFcmFHL29ezytC7/1mVTgorsfr6SpmoFUzhnWiu0w7AsV6OB0/OWuOcc/WsFcqKa C6FEdV3HKC7NMrF1I5cHiQpgFuWEoP7V3nARMT8bZ8kAITobnooVGg5hFKEMPMmSyaNze6Xqwh OQr1dkvyTJjbZweTOvSzAD17n58QOgMgUHtjMzIW/HsFRUR4FLsfENmWod9mr13Gh2/mxOGEKC EWr6KC8jH+dTTn2oQ4mdh14jp3TI8dc+ugT9tlBLlvBz08jLvQcQMsJl3dr2F2B2tPt+HfqHa5 OIU= X-SBRS: 5.2 X-MesageID: 33866011 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.78,441,1599537600"; d="scan'208";a="33866011" Subject: Re: [PATCH v2] lib: drop (replace) debug_build() To: Jan Beulich CC: George Dunlap , Ian Jackson , Julien Grall , Stefano Stabellini , Wei Liu , =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= , "xen-devel@lists.xenproject.org" References: <11bb1b39-7d1d-bcf4-1bff-4472a3c79dea@suse.com> From: Andrew Cooper Message-ID: <6f9ece4d-6fef-07cf-b4d5-2b13790956e1@citrix.com> Date: Wed, 23 Dec 2020 17:02:22 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <11bb1b39-7d1d-bcf4-1bff-4472a3c79dea@suse.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Language: en-GB X-ClientProxiedBy: AMSPEX02CAS01.citrite.net (10.69.22.112) To FTLPEX02CL03.citrite.net (10.13.108.165) On 23/12/2020 16:59, Jan Beulich wrote: > On 23.12.2020 17:53, Andrew Cooper wrote: >> On 23/12/2020 16:05, Jan Beulich wrote: >>> Its expansion shouldn't be tied to NDEBUG - down the road we may want to >>> allow enabling assertions independently of CONFIG_DEBUG. Replace the few >>> uses by a new xen_build_info() helper, subsuming gcov_string at the same >>> time (while replacing the stale CONFIG_GCOV used there) and also adding >>> CONFIG_UBSAN indication. >>> >>> Signed-off-by: Jan Beulich >> Reviewed-by: Andrew Cooper , > Thanks. > >>> --- a/xen/common/version.c >>> +++ b/xen/common/version.c >>> @@ -70,6 +70,30 @@ const char *xen_deny(void) >>> return ""; >>> } >>> >>> +static const char build_info[] = >>> + "debug=" >>> +#ifdef CONFIG_DEBUG >>> + "y" >>> +#else >>> + "n" >>> +#endif >>> +#ifdef CONFIG_COVERAGE >>> +# ifdef __clang__ >>> + " llvmcov=y" >>> +# else >>> + " gcov=y" >>> +# endif >>> +#endif >>> +#ifdef CONFIG_UBSAN >>> + " ubsan=y" >>> +#endif >>> + ""; >>> + >>> +const char *xen_build_info(void) >>> +{ >>> + return build_info; >>> +} >> ... do we really need a function here? >> >> Wouldn't an extern const char build_info[] do? > It probably would, but I wanted things to remain consistent with > the siblings, many of which also return string literals (or > effectively plain numbers). The only reason they are still functions is because there was an argument over breaking the livepatch testing on older versions of Xen, and I got bored arguing. I, however, don't consider this a valid reason to block improvements. ~Andrew