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]
Date:	Fri, 21 Sep 2007 10:45:27 -0700
From:	Joe Perches <joe@...ches.com>
To:	Valdis.Kletnieks@...edu
Cc:	Rob Landley <rob@...dley.net>, Indan Zupancic <indan@....nu>,
	linux-tiny@...enic.com,
	Michael Opdenacker <michael@...e-electrons.com>,
	CE Linux Developers List <celinux-dev@...e.celinuxforum.org>,
	linux kernel <linux-kernel@...r.kernel.org>
Subject: Re: [Announce] Linux-tiny project revival

On Fri, 2007-09-21 at 13:16 -0400, Valdis.Kletnieks@...edu wrote:
> What about something *really* hardcore ugly like:
> #ifdef __FILE__
> #undef __FILE__
> #define __FILE__ ""
> #endif
> (or similar preprocessor blecherousness) if you want to *really* shrink
> that binary down?

I prefer removing all __FILE__, __FUNCTION__, __LINE__ uses
from printks and defining something that modifies pr_<level>.

Something like:

#define PR_FILE
#define PR_FUNCTION
#define PR_LINE

#if    defined PR_FILE &&  defined PR_FUNCTION &&  defined PR_LINE
#define PR_FMT "(%s:%s:%u) "
#define PR_ARG , __FILE__ , __FUNCTION__ , __LINE__ 
#elif  defined PR_FILE &&  defined PR_FUNCTION && !defined PR_LINE
#define PR_FMT "(%s:%s) "
#define PR_ARG , __FILE__ , __FUNCTION__ 
#elif  defined PR_FILE && !defined PR_FUNCTION &&  defined PR_LINE
#define PR_FMT "(%s:%u) "
#define PR_ARG , __FILE__ , __LINE__ 
#elif  defined PR_FILE && !defined PR_FUNCTION && !defined PR_LINE
#define PR_FMT "(%s) "
#define PR_ARG , __FILE__ 
#elif !defined PR_FILE &&  defined PR_FUNCTION &&  defined PR_LINE
#define PR_FMT "(%s:%u) "
#define PR_ARG , __FUNCTION__ , __LINE__ 
#elif !defined PR_FILE &&  defined PR_FUNCTION && !defined PR_LINE
#define PR_FMT "(%s) "
#define PR_ARG , __FUNCTION__ 
#elif !defined PR_FILE && !defined PR_FUNCTION && defined PR_LINE
#define PR_FMT "(%u) "
#define PR_ARG , __LINE__ 
#else
#define PR_FMT
#define PR_ARG
#endif

#define pr_info(fmt, arg) printk(KERN_INFO PR_FMT fmt PR_ARG, ##arg)


-
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