From: Wolfgang Denk Date: Sun, 23 Mar 2003 15:32:24 +0100 Subject: [U-Boot-Users] [RFD] Consistent debugging output structure In-Reply-To: Your message of "Sat, 22 Mar 2003 11:28:47 +0100." <20030322102847.GF28544@pengutronix.de> Message-ID: <20030323143229.46BEBC58BA@atlas.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de In message <20030322102847.GF28544@pengutronix.de> you wrote: > On Wed, Mar 19, 2003 at 07:32:07PM +0100, Robert Schwebel wrote: > > I would like to discuss the current state of the u-boot debug output > > code. Nearly every C file in the source tree implements it's own way > > of outputting debug messages during development, and most of them do > > it by using Yet Another #ifdef Desert (TM). > > I've already discussed that with Wolfgang (no idea why the mail needed > several days to hit the list) and he wants to use the debug() macro > instead, which is ok for me. > > What we don't agree on is if we need several debug levels. What do the > others think? For more complex drivers like the ethernet ones this is > really useful. I think that several debug levels built into a debug mechanism (usually combined with some logging features) makes a lot of sense for an application-type system or product. It is useful when the software structure is pretty much constant, and when there is a separation between "developers" and "users". I want the U-Boot design to keep an eye on efficiency and small memory footprint. Several debug levels may seem useful here and there (in which case they are trivial to add based on the existing debug() macro), but in general they are just overkill. Those parts where debug printout is really needed are too much CPU and board dependend anyway. Yes, I agree, new code should not introduce it's own "#ifdef DEBUG" stuff any more, but use debug() instead - but this is IMHO one of the "nice to have" issues, not a really important issue. Best regards, Wolfgang Denk -- Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: wd at denx.de I know engineers. They love to change things. - Dr. McCoy