Re: [PATCH 2/8] sg: introduce sg_log macro

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

 



On 19/10/18 08:24, Douglas Gilbert wrote:
[..]
> +/*
> + * Kernel needs to be built with CONFIG_SCSI_LOGGING to see log messages.
> + * 'depth' is a number between 1 (most severe) and 7 (most noisy, most
> + * information). All messages are logged as informational (KERN_INFO). In
> + * the unexpected situation where sdp is NULL the macro reverts to a pr_info
> + * and ignores CONFIG_SCSI_LOGGING and always prints to the log.
> + */
> +#define SG_LOG(depth, sdp, fmt, a...)				\
> +	do {								\
> +		if (IS_ERR_OR_NULL(sdp)) {				\
> +			pr_info("sg: sdp=NULL_or_ERR, " fmt, ##a);	\
> +		} else {						\
> +			SCSI_LOG_TIMEOUT(depth, sdev_prefix_printk(	\
> +					 KERN_INFO, (sdp)->device,	\
> +					 (sdp)->disk->disk_name, fmt,	\
> +					 ##a));				\
> +		}							\
> +	} while (0)

Hi Doug,
have you considered using the kernel's dynamic debug infrastructure instead?

-- 
Johannes Thumshirn                                        SUSE Labs
jthumshirn@xxxxxxx                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux