Re: [PATCH v2 2/2] drm/print: document DRM_ logging functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jan 02, 2020 at 11:15:19PM +0100, Sam Ravnborg wrote:
> Document the remaining DRM_ logging functions.
> As the logging functions are now all properly
> listed drop the few specific kernel-doc markers
> so we keep the relevant parts in the documentation.
> 
> Signed-off-by: Sam Ravnborg <sam@xxxxxxxxxxxx>
> Cc: Jani Nikula <jani.nikula@xxxxxxxxx>
> Cc: Sean Paul <sean@xxxxxxxxxx>
> Cc: Daniel Vetter <daniel@xxxxxxxx>
> ---
>  include/drm/drm_print.h | 84 +++++++++++++++++++++++++++++++++++++++--
>  1 file changed, 80 insertions(+), 4 deletions(-)
> 
> diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
> index 89e75eea65d2..abe247199bf7 100644
> --- a/include/drm/drm_print.h
> +++ b/include/drm/drm_print.h
> @@ -335,6 +335,82 @@ static inline struct drm_printer drm_err_printer(const char *prefix)
>   *
>   * See enum &drm_debug_category for a description of the categories.
>   *
> + * Logging when a &device * is available, but no &drm_device *
> + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> + *
> + * DRM/Drivers can use the following functions for logging when there is a
> + * struct device * available.
> + * The logging functions share the same prototype:

I'd replace the entire block with a "This stuff is deprecated" warning. We
have at least a corresponding todo.rst entry.
-Daniel

> + *
> + * .. code-block:: c
> + *
> + *   void DRM_xxx(struct device *, char * fmt, ...)
> + *
> + * .. code-block:: none
> + *
> + *   # Plain logging
> + *   DRM_DEV_INFO(dev, fmt, ...)
> + *   DRM_DEV_ERROR(dev, fmt, ...)
> + *
> + *   # Log only once
> + *   DRM_DEV_INFO_ONCE(dev, fmt, ...)
> + *
> + *   # Ratelimited - do not flood the logs
> + *   DRM_DEV_DEBUG_RATELIMITED(dev, fmt, ...)
> + *   DRM_DEV_DEBUG_DRIVER_RATELIMITED(dev, fmt, ...)
> + *   DRM_DEV_DEBUG_KMS_RATELIMITED(dev, fmt, ...)
> + *   DRM_DEV_DEBUG_PRIME_RATELIMITED(dev, fmt, ...)
> + *   DRM_DEV_ERROR_RATELIMITED(dev, fmt, ...)
> + *
> + *   # Logging with a specific category
> + *   DRM_DEV_DEBUG(dev, fmt, ...)		# Logged as CORE
> + *   DRM_DEV_DEBUG_DRIVER(dev, fmt, ...)
> + *   DRM_DEV_DEBUG_KMS(dev, fmt, ...)
> + *   DRM_DEV_DEBUG_PRIME(dev, fmt, ...)
> + *   DRM_DEV_DEBUG_ATOMIC(dev, fmt, ...)
> + *   DRM_DEV_DEBUG_VBL(dev, fmt, ...)
> + *   DRM_DEV_DEBUG_DP(dev, fmt, ...)
> + *
> + * Logging when no &device * nor &drm_device * is available
> + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> + *
> + * DRM/Drivers can use the following functions for logging when there is no
> + * extra info associated to the logging.
> + * The logging functions share the same prototype:
> + *
> + * .. code-block:: c
> + *
> + *   void DRM_xxx(char * fmt, ...)
> + *
> + * .. code-block:: none
> + *
> + *   # Plain logging
> + *   DRM_INFO(fmt, ...)
> + *   DRM_NOTE(fmt, ...)
> + *   DRM_WARN(fmt, ...)
> + *   DRM_ERROR(fmt, ...)
> + *
> + *   # Log only once
> + *   DRM_INFO_ONCE(fmt, ...)
> + *   DRM_NOTE_ONCE(fmt, ...)
> + *   DRM_WARN_ONCE(fmt, ...)
> + *
> + *   # Ratelimited - do not flood the logs
> + *   DRM_DEBUG_RATELIMITED(fmt, ...)
> + *   DRM_DEBUG_DRIVER_RATELIMITED(fmt, ...)
> + *   DRM_DEBUG_KMS_RATELIMITED(fmt, ...)
> + *   DRM_DEBUG_PRIME_RATELIMITED(fmt, ...)
> + *   DRM_ERROR_RATELIMITED(fmt, ...)
> + *
> + *   # Logging with a specific category
> + *   DRM_DEBUG(fmt, ...)		# Logged as CORE
> + *   DRM_DEBUG_DRIVER(fmt, ...)
> + *   DRM_DEBUG_KMS(fmt, ...)
> + *   DRM_DEBUG_PRIME(fmt, ...)
> + *   DRM_DEBUG_ATOMIC(fmt, ...)
> + *   DRM_DEBUG_VBL(fmt, ...)
> + *   DRM_DEBUG_LEASE(fmt, ...)
> + *   DRM_DEBUG_DP(fmt, ...)
>   */
>  
>  /**
> @@ -399,7 +475,7 @@ __printf(3, 4)
>  void drm_dev_dbg(const struct device *dev, enum drm_debug_category category,
>  		 const char *format, ...);
>  
> -/**
> +/*
>   * Error output.
>   *
>   * @dev: device pointer
> @@ -408,7 +484,7 @@ void drm_dev_dbg(const struct device *dev, enum drm_debug_category category,
>  #define DRM_DEV_ERROR(dev, fmt, ...)					\
>  	drm_dev_printk(dev, KERN_ERR, "*ERROR* " fmt, ##__VA_ARGS__)
>  
> -/**
> +/*
>   * Rate limited error output.  Like DRM_ERROR() but won't flood the log.
>   *
>   * @dev: device pointer
> @@ -436,7 +512,7 @@ void drm_dev_dbg(const struct device *dev, enum drm_debug_category category,
>  	}								\
>  })
>  
> -/**
> +/*
>   * Debug output.
>   *
>   * @dev: device pointer
> @@ -466,7 +542,7 @@ void drm_dev_dbg(const struct device *dev, enum drm_debug_category category,
>  		drm_dev_dbg(dev, category, fmt, ##__VA_ARGS__);		\
>  })
>  
> -/**
> +/*
>   * Rate limited debug output. Like DRM_DEBUG() but won't flood the log.
>   *
>   * @dev: device pointer
> -- 
> 2.20.1
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux