Re: [PATCH v3 2/2] Add XFS messages to printk index

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

 



On Fri, Mar 25, 2022 at 10:19:46AM -0700, Jonathan Lassoff wrote:
> In order for end users to quickly react to new issues that come up in
> production, it is proving useful to leverage the printk indexing system.
> This printk index enables kernel developers to use calls to printk()
> with changeable ad-hoc format strings, while still enabling end users
> to detect changes from release to release.
> 
> So that detailed XFS messages are captures by this printk index, this
> patch wraps the xfs_<level> and xfs_alert_tag functions.
> 
> Signed-off-by: Jonathan Lassoff <jof@xxxxxxxxxx>

Looks good. Minor whitespace/ordering nit below....

Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>

> diff --git a/fs/xfs/xfs_message.h b/fs/xfs/xfs_message.h
> index 2f609800e806..6f9a1b67c4d7 100644
> --- a/fs/xfs/xfs_message.h
> +++ b/fs/xfs/xfs_message.h
> @@ -6,34 +6,45 @@
>  
>  struct xfs_mount;
>  
> +#define xfs_printk_index_wrap(kern_level, mp, fmt, ...)		\
> +({								\
> +	printk_index_subsys_emit("%sXFS%s: ", kern_level, fmt);	\
> +	xfs_printk_level(kern_level, mp, fmt, ##__VA_ARGS__);	\
> +})
>  extern __printf(3, 4)
>  void xfs_printk_level(
>  	const char *kern_level,
>  	const struct xfs_mount *mp,
>  	const char *fmt, ...);
>  #define xfs_emerg(mp, fmt, ...) \
> -	xfs_printk_level(KERN_EMERG, mp, fmt, ##__VA_ARGS__)
> +	xfs_printk_index_wrap(KERN_EMERG, mp, fmt, ##__VA_ARGS__)

Empty lines, again. Also, put the xfs_printk_index_wrap() after
the function prototype so it groups with the macros that use it.

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux