From: Dave Gordon <david.s.gordon@intel.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: David Airlie <airlied@linux.ie>,
intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/3] drm: extra printk() wrapper macros
Date: Tue, 12 Jul 2016 15:53:55 +0100 [thread overview]
Message-ID: <57850483.10103@intel.com> (raw)
In-Reply-To: <20160712142537.GR23520@phenom.ffwll.local>
On 12/07/16 15:25, Daniel Vetter wrote:
> On Mon, Jul 11, 2016 at 07:01:27PM +0100, Dave Gordon wrote:
>> We had only DRM_INFO() and DRM_ERROR(), whereas the underlying printk()
>> provides several other useful intermediate levels such as NOTICE and
>> WARNING. So this patch fills out the set by providing both regular and
>> once-only macros for each of the levels INFO, NOTICE, and WARNING, using
>> a common underlying macro that does all the token-pasting.
>>
>> DRM_ERROR is unchanged, as it's not just a printk wrapper.
>>
>> Signed-off-by: Dave Gordon <david.s.gordon@intel.com>
>
> I'm not sure what exactly the brave new drm debug model should look like
> (probably some form of pimped dynamic debug printk, to be able to be
> backwards compatible with the gazillion of blog posts recommending to
> capture dmesg with drm.debug=0xe). But extending these is probably not
> what we want ...
> -Daniel
These are not debug of any sort, these message are intended to be seen
by the user (or administrator), and these macros allow us to emit the
messages at the most appropriate kernel message level.
.Dave.
>> ---
>> include/drm/drmP.h | 26 ++++++++++++++++++++------
>> 1 file changed, 20 insertions(+), 6 deletions(-)
>>
>> diff --git a/include/drm/drmP.h b/include/drm/drmP.h
>> index cf918e3e..82648b1 100644
>> --- a/include/drm/drmP.h
>> +++ b/include/drm/drmP.h
>> @@ -162,6 +162,26 @@ void drm_err(const char *format, ...);
>> /** \name Macros to make printk easier */
>> /*@{*/
>>
>> +#define _DRM_PRINTK(once, level, fmt, ...) \
>> + do { \
>> + printk##once(KERN_##level "[" DRM_NAME "] " fmt, \
>> + ##__VA_ARGS__); \
>> + } while (0)
>> +
>> +#define DRM_INFO(fmt, ...) \
>> + _DRM_PRINTK(, INFO, fmt, ##__VA_ARGS__)
>> +#define DRM_NOTE(fmt, ...) \
>> + _DRM_PRINTK(, NOTICE, fmt, ##__VA_ARGS__)
>> +#define DRM_WARN(fmt, ...) \
>> + _DRM_PRINTK(, WARNING, fmt, ##__VA_ARGS__)
>> +
>> +#define DRM_INFO_ONCE(fmt, ...) \
>> + _DRM_PRINTK(_once, INFO, fmt, __VA_ARGS__)
>> +#define DRM_NOTE_ONCE(fmt, ...) \
>> + _DRM_PRINTK(_once, NOTICE, fmt, ##__VA_ARGS__)
>> +#define DRM_WARN_ONCE(fmt, ...) \
>> + _DRM_PRINTK(_once, WARNING, fmt, ##__VA_ARGS__)
>> +
>> /**
>> * Error output.
>> *
>> @@ -187,12 +207,6 @@ void drm_err(const char *format, ...);
>> drm_err(fmt, ##__VA_ARGS__); \
>> })
>>
>> -#define DRM_INFO(fmt, ...) \
>> - printk(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__)
>> -
>> -#define DRM_INFO_ONCE(fmt, ...) \
>> - printk_once(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__)
>> -
>> /**
>> * Debug output.
>> *
>> --
>> 1.9.1
>>
>> _______________________________________________
>> Intel-gfx mailing list
>> Intel-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-07-12 14:53 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-11 18:01 [PATCH 1/3] drm: extra printk() wrapper macros Dave Gordon
2016-07-11 18:01 ` [PATCH 2/3] drm/i915/guc: downgrade some DRM_ERROR() messages to DRM_WARN() Dave Gordon
2016-07-12 9:20 ` Tvrtko Ursulin
2016-07-12 9:27 ` [Intel-gfx] " Chris Wilson
2016-07-12 9:37 ` Tvrtko Ursulin
2016-07-12 12:29 ` Dave Gordon
2016-07-11 18:01 ` [PATCH 3/3] drm/i915/guc: revisit GuC loader message levels Dave Gordon
2016-07-12 9:26 ` [Intel-gfx] " Tvrtko Ursulin
2016-07-12 15:11 ` Dave Gordon
2016-07-12 9:06 ` [PATCH 1/3] drm: extra printk() wrapper macros Tvrtko Ursulin
2016-07-12 13:28 ` Dave Gordon
2016-07-12 13:51 ` [Intel-gfx] " Tvrtko Ursulin
2016-07-12 11:06 ` Eric Engestrom
2016-07-12 14:25 ` Daniel Vetter
2016-07-12 14:53 ` Dave Gordon [this message]
2016-07-12 14:59 ` Daniel Vetter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=57850483.10103@intel.com \
--to=david.s.gordon@intel.com \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox