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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1332236676.7847.83.camel@joe2Laptop>
Date:	Tue, 20 Mar 2012 02:44:36 -0700
From:	Joe Perches <joe@...ches.com>
To:	Jiri Slaby <jslaby@...e.cz>
Cc:	Valdis.Kletnieks@...edu, tytso@....edu, anca.emanuel@...il.com,
	adilger.kernel@...ger.ca, linux-ext4@...r.kernel.org,
	David Miller <davem@...emloft.net>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/9] ext4: Use pr_fmt and pr_<level>

On Tue, 2012-03-20 at 09:47 +0100, Jiri Slaby wrote:
> Joe writes: "notify a particular set of per subsystem messages that
> pr_<level> could easily provide"
> 
> Maybe the concept is not explained well enough that we do not follow?

Basically, when pr_fmt(fmt) is #defined to something
other than "#define pr_fmt(fmt) fmt", it could be used
as a mechanism to do more than standardize prefixes.

__builtin_strcmp is pretty useful.

You can do things like:
(I'm just typing, this may have errors)

#define _first_macro_arg(arg1) arg1
#define first_macro_arg(arg1, ...) _first_macro_arg(arg1)

#define pr_info(fmt, ...)					\
do {								\
	if (!__builtin_strcmp(first_macro_arg(pr_fmt(fmt)),	\
			      KBUILD_MODNAME ": " fmt)))	\
		advanced_printk(fmt, ##__VA_ARGS__);		\
	else							\
		printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__);	\
while (0)

etc...

Anyway, it's been a couple of years since I prototyped
something like that and tested file sizes.

The size delta of an allyesconfig was:

-rwxr-xr-x 1 joe joe 926968471 2010-06-29 10:39 vmlinux.allyesconfig.printk_level_with_module
-rwxr-xr-x 1 joe joe 927196127 2010-06-23 02:40 vmlinux.allyesconfig.pr_level

It reduced an allyesconfig by .1%
It wasn't a huge saving.

I'll play with it again and send an rfc
patch in a couple of days.

Maybe I'll prototype a pr_notify mechanism too.

cheers, Joe

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ