lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1352900468.9388.20.camel@joe-AO722>
Date:	Wed, 14 Nov 2012 05:41:08 -0800
From:	Joe Perches <joe@...ches.com>
To:	Vladimir Kondratiev <qca_vkondrat@....qualcomm.com>
Cc:	"John W . Linville" <linville@...driver.com>,
	Johannes Berg <johannes@...solutions.net>,
	Andrew Morton <akpm@...ux-foundation.org>,
	linux-wireless@...r.kernel.org,
	"Luis R . Rodriguez" <rodrigue@....qualcomm.com>,
	Jason Baron <jbaron@...hat.com>,
	Jim Cromie <jim.cromie@...il.com>,
	Greg KH <gregkh@...uxfoundation.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [RFC] dynamic_debug: introduce debug_hex_dump()

On Wed, 2012-11-14 at 14:17 +0200, Vladimir Kondratiev wrote:
> Introduce debug_hex_dump() that can be dynamically controlled, similar to
> pr_debug.

(added Jason Baron, Jim Cromie, GregKH and lkml to cc's)

[]
> diff --git a/include/linux/printk.h b/include/linux/printk.h
[]
> @@ -220,6 +220,20 @@ extern void dump_stack(void) __cold;
>  	no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
>  #endifD
>  
> +#if defined(CONFIG_DYNAMIC_DEBUG)
> +#define debug_hex_dump(prefix_str, prefix_type, rowsize,	\
> +		       groupsize, buf, len, ascii)		\
> +		       dynamic_hex_dump(prefix_str, prefix_type,\
> +					rowsize, groupsize, buf,\
> +					len, ascii)
> +#else
> +#define debug_hex_dump(prefix_str, prefix_type, rowsize,	\
> +		       groupsize, buf, len, ascii)		\
> +		       print_hex_dump(KERN_DEBUG, prefix_str,	\
> +				      prefix_type, rowsize,	\
> +				      groupsize, buf, len, ascii)
> +#endif

These should be in a different location after print_hex_dump
is declared. Also for #defines, the indentation doesn't
need to be so deep.

#if defined(CONFIG_DYNAMIC_DEBUG)
#define debug_hex_dump(prefix_str, prefix_type, rowsize,	\
		       groupsize, buf, len, ascii)		\
	dynamic_hex_dump(prefix_str, prefix_type,		\
			 rowsize, groupsize, buf, len, ascii)
#else
#define debug_hex_dump(prefix_str, prefix_type, rowsize,	\
		       groupsize, buf, len, ascii)		\
	print_hex_dump(KERN_DEBUG, prefix_str, prefix_type,	\
		       rowsize, groupsize, buf, len, ascii)
#endif

A better option might be to convert print_hex_dump_bytes()
to dynamic_debug as that's already KERN_DEBUG.  That
could be simpler overall and it makes existing calls
become dynamic as well.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ