From mboxrd@z Thu Jan 1 00:00:00 1970 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=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, 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 A2D95C33CAF for ; Mon, 13 Jan 2020 18:55:03 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 7F2E121569 for ; Mon, 13 Jan 2020 18:55:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7F2E121569 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C9CE16E143; Mon, 13 Jan 2020 18:55:02 +0000 (UTC) Received: from asavdk4.altibox.net (asavdk4.altibox.net [109.247.116.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6564C6E142; Mon, 13 Jan 2020 18:55:01 +0000 (UTC) Received: from ravnborg.org (unknown [158.248.194.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by asavdk4.altibox.net (Postfix) with ESMTPS id 3DDE58072E; Mon, 13 Jan 2020 19:54:57 +0100 (CET) Date: Mon, 13 Jan 2020 19:54:56 +0100 From: Sam Ravnborg To: Pankaj Bharadiya Subject: Re: [Intel-gfx] [PATCH 1/6] drm/print: introduce new struct drm_device based WARN* macros Message-ID: <20200113185456.GA32145@ravnborg.org> References: <20200113115557.32713-1-pankaj.laxminarayan.bharadiya@intel.com> <20200113115557.32713-2-pankaj.laxminarayan.bharadiya@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200113115557.32713-2-pankaj.laxminarayan.bharadiya@intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.3 cv=VcLZwmh9 c=1 sm=1 tr=0 a=UWs3HLbX/2nnQ3s7vZ42gw==:117 a=UWs3HLbX/2nnQ3s7vZ42gw==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=QyXUC8HyAAAA:8 a=6ais3OYN73AznueNaSQA:9 a=CjuIK1q_8ugA:10 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jani.nikula@intel.com, intel-gfx@lists.freedesktop.org, sudeep.dutt@intel.com, dri-devel@lists.freedesktop.org, pankaj.laxminaryan.bharadiya@freedesktop.org, David Airlie Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi Pankaj. On Mon, Jan 13, 2020 at 05:25:52PM +0530, Pankaj Bharadiya wrote: > Add new struct drm_device based WARN* macros. These are modeled after > the core kernel device based WARN* macros. These would be preferred > over the regular WARN* macros, where possible. > > These macros include device information in the backtrace, so we know > what device the warnings originate from. > > Knowing the device specific information in the backtrace would be > helpful in development all around. > > Signed-off-by: Pankaj Bharadiya > --- > include/drm/drm_print.h | 30 ++++++++++++++++++++++++++++++ > 1 file changed, 30 insertions(+) > > diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h > index 8f99d389792d..61a7224e697d 100644 > --- a/include/drm/drm_print.h > +++ b/include/drm/drm_print.h > @@ -553,4 +553,34 @@ void __drm_err(const char *format, ...); > #define DRM_DEBUG_PRIME_RATELIMITED(fmt, ...) \ > DRM_DEV_DEBUG_PRIME_RATELIMITED(NULL, fmt, ##__VA_ARGS__) > > +/* > + * struct drm_device based WARNs > + * > + * > + * drm_WARN*() acts like WARN*(), but with the key difference of > + * using device specific information so that we know from which device > + * warning is originating from. > + * > + * Prefer drm_device based dev_WARN* over regular WARN* > + */ ... > + drm_WARN_ONCE((drm), (x), "%s", \ > + "drm_WARN_ON_ONCE(" __stringify(x) ")") > + > #endif /* DRM_PRINT_H_ */ As this is the now recommend way to use WARN() and friends, can we have this moved upward in this file. So we at some not-so-distant-future can have all the legacy logging in the bottom of the file, and all the shiny new stuff at the top. So people browsing the file see the new stuff before the legacy stuff. Not a big deal - we can always move it later if we are inclined to do so. Very good that you follow-up with some actual usage. This is a good way to verify that you got it right. Sam _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel