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
[email protected] +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