Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1066091rwb; Fri, 28 Jul 2023 04:21:54 -0700 (PDT) X-Google-Smtp-Source: APBJJlGLnV/NAEf2QQ814+n4vVYO+KLNMejiLdYkSWGCb7ViP5xeg5OcyQW273scXvjCC5Pr+VmP X-Received: by 2002:a05:6808:90d:b0:3a1:df16:2e9e with SMTP id w13-20020a056808090d00b003a1df162e9emr2436940oih.12.1690543314118; Fri, 28 Jul 2023 04:21:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690543314; cv=none; d=google.com; s=arc-20160816; b=WhUAZwUyRYFkwlyNuLfnXRrdrEpRYysp/k7MX6JnMT0W0qUnBbJ47ebyyLVFviCY+K kZriU2frQ9ejT6smARRekccx+7l9tB0TTpSDcYagm+KTjhGY3UyvZV+Q0N6Qx2e3NIbF gt11tiTUOS8Ui24yWHbRdq4Dhl063+vzl0E7CeDdrzFmybSFzUBUl1VZWbz8xtrAWC1T 5txS1qJ6OnlpzYuYj0rtwkE09xcibNff1s3zrc4HzqWKdcceGSYTqTWd+ev6gEt0kj65 d0GpNCtKPTNJbVPT6SO5caMbutelm662zwoEqDhZPy8Ok7ZWDN3sLaSFUGXIItpv9M7f hukw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=YghHFfYCYAWFBc0EraENKwpa3nnd0b9yhfSdQDigIOc=; fh=HVRBJStvoKWbFco6Jta18xe5UAVCwWVs9OvJstciom4=; b=cRhXblJ3eGcFgXAXzGFAi8isIAuaUghtZSiRA38w1/MOqjkH1RVokVJ633n1evxnDp UG+uegQsBcKxNKZv14zD7+pfWnmC7TYrC6rMXwY0KU5tBU3d5/3nS/aoOF30jEsjxZHl ydXguzI7BQi6NLGITOwsIFndTnrfYUOlF59JaASKgok7ddK4osvHALol0796oH25eFmd v4ms5wbzjD+tAowvqNqCpS3R0oGFU6I7wbE4QHFqRihOlyPDYyLn2CLZN6zQdrnO4O9M F3tzP67mMgxdUzL2Bz/IIBq8SMJBDSG6JAAKcXhO4eSWwtXEFenG6HPnq1oXzzmYSFjW 4Zuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=DcbySZW3; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=kHOUssCU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id be3-20020a656e43000000b00563fbbe378asi2971852pgb.59.2023.07.28.04.21.41; Fri, 28 Jul 2023 04:21:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=DcbySZW3; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=kHOUssCU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233717AbjG1JxR (ORCPT + 99 others); Fri, 28 Jul 2023 05:53:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233335AbjG1Jww (ORCPT ); Fri, 28 Jul 2023 05:52:52 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9173D1BE4 for ; Fri, 28 Jul 2023 02:52:48 -0700 (PDT) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1690537966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=YghHFfYCYAWFBc0EraENKwpa3nnd0b9yhfSdQDigIOc=; b=DcbySZW3Vr69tOr7+Gp9njYVr1ItPdQ18TmSmFsFyI1RVNkTCiVPMZg2EiXRNxSSSjV9eO RmVmC9XE9agLZu4oDZ1Tg8XyOt5yWT1NLAS2Gt2dlXWANCt8xWI7jPN2at4eJscH9s+cFF 0ILklMb1TZYaULmAiC4Nu+EPp5tQxemim+LOfQdz43IT6ZQTmnHAQE/7Xs2NiY8Sm8XvnD fICg3/we6Zp/BWmThyQENzpllnJ4eZarWMsyeKqPkSG1HCnEaGZNaFtLbjclpwXaiBVVrH ueKMT9p7PNZe98UiUTpAXyLFlHVoHUa3zeDSB/qw5dPcTQsvw9dtTJvyN5g2Jg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1690537966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=YghHFfYCYAWFBc0EraENKwpa3nnd0b9yhfSdQDigIOc=; b=kHOUssCUiiT6+FRRE/GeKpH4iUf2qD4cvAoUMIpc6O1D1W131ogmqz7GG/CL9n1GQhN+b3 rrGHZ2nEitwCgpBw== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: Re: [PATCH printk v2 2/8] printk: Provide debug_store() for nbcon debugging In-Reply-To: <20230728000233.50887-3-john.ogness@linutronix.de> References: <20230728000233.50887-1-john.ogness@linutronix.de> <20230728000233.50887-3-john.ogness@linutronix.de> Date: Fri, 28 Jul 2023 11:58:44 +0206 Message-ID: <878rb01hxv.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,INVALID_DATE_TZ_ABSURD, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023-07-28, John Ogness wrote: > +/* > + * Define DEBUG_NBCON to allow for nbcon ownership transitions to be logged > + * to the ringbuffer. The debug_store() macro only logs to the lockless > + * ringbuffer and does not trigger any printing. > + */ > +#undef DEBUG_NBCON > + > +#ifdef DEBUG_NBCON > +/* Only write to ringbuffer. */ > +int __debug_store(const char *fmt, ...) > +{ > + va_list args; > + int r; > + > + va_start(args, fmt); > + r = vprintk_store(2, 7, NULL, fmt, args); > + va_end(args); > + > + return r; > +} > +#define debug_store(cond, fmt, ...) \ > + do { \ > + if (cond) \ > + __debug_store(pr_fmt("DEBUG: " fmt), ##__VA_ARGS__) \ Missing a semi-colon here. Wrapping this with a do-while was a last-minute change requested by checkpatch.pl. Probably nobody would notice because you must manually define DEBUG_NBCON by changing the source code. Fixed for v3 (assuming Petr allows me to keep this debugging code in place). > + } while (0) > +#else > +#define debug_store(cond, fmt, ...) > +#endif John