just use this or something which suits your fancy... #ifdef YOUR_DRIVER_DEBUG static int driver_debug = 1; #else static int driver_debug = 0; #endif #undef debug_driver #define debug_driver(fmt, arg...) do { \ if (driver_debug) \ printk (KERN_DEBUG __FILE__ ":" fmt "\n", ##arg); \ } while (0) hth. anupam <aksingh@hss.hns.com> writes: > Hi, > > Had a general question -- do driver writers log there messages, > because > it is a massive performance hit, do they have printk's in their code > when > they release it ? > It is certainly desirable to have something of this sort(atleast > some > messages being logged), incase there is some problem with the > driver(detected in field) then the logs can really help . > > thanks > Amit > > Amit Kumar Singh/HSS@HSS@nl.linux.org on 06/10/2004 07:09:24 PM > > Sent by: kernelnewbies-bounce@nl.linux.org > > To: kernelnewbies@nl.linux.org > cc: > > Subject: logging using printk, klogd > > Hi, > > The book rubini says -- "if u dont want to clobber the system logs > with > monitoring messages from your driver, then run klogd with the -f > option or > change /etc/syslog.conf to suit your needs" > > but "man klogd" says running klogd -f diverts the lof messages to > that > file, what it mean, as far as i understand is that all system logs wld > be > diverted to this file, instead of going to syslogd, so how does it > matter, > you still are clobbering the system logs with monitor messages from > your > driver ?? !!. Are not the two statements conflicting ? > > Is there a way to divert just you own driver's log messages to a > paritcular > file using printk and klogd/syslogd, such that this file wont have any > system messages. ? > > thanks > Amit > > -- > Kernelnewbies: Help each other learn about the Linux kernel. > Archive: [1]http://mail.nl.linux.org/kernelnewbies/ > FAQ: [2]http://kernelnewbies.org/faq/ > > -- > Kernelnewbies: Help each other learn about the Linux kernel. > Archive: [3]http://mail.nl.linux.org/kernelnewbies/ > FAQ: [4]http://kernelnewbies.org/faq/ > > References > > 1. http://mail.nl.linux.org/kernelnewbies/ > 2. http://kernelnewbies.org/faq/ > 3. http://mail.nl.linux.org/kernelnewbies/ > 4. http://kernelnewbies.org/faq/ -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/