Why Dprintk(printf) doesn't work in user space modules?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
I want to output the value of variables in my user space module for the
debugging purpose, I try to use printf or Dprintk(actually it is a macro
definiton of printf). But I can't find where the output goes. It doesn't
appear on the console windows , nor does it be logged in the
/var/www/log/messages. 

If I use write(req->sock,...), I can find the output information in the
web page. 

I enabled CONFIG_TUX_DEBUG and rebuild the kernel and set the Dprintk
and all_userspace in /proc/sys/net/tux. But Dprintk or printf still
doesn't work.

Usually printf will output the information to the screen, does TUX
changes the output direction of printf? I know for TUX itself, it use
Dprintk based on printk since it is a kernel space dameon, but for all
user space module programs, Dprintk is implemented by printf. How can
printf print information to syslog? You can find the definition of
Dprintk for user modules in tuxmodule.h in /usr/include. I found another
very strange thing in tuxmodule.h, just look this(pasted from
tuxmodule.h). TUX_DEBUG is defined 0 by default, e.g. Dprintk do
nothing. So should I change the
value of TUX_DEBUG from 0 to 1 before I compile my user space module
program if want to output some debugging information?

#define TUX_DEBUG 0

#if TUX_DEBUG
# define Dprintk(x...) do { printf(x); fflush(stdout); } while (0)
#else
# define Dprintk(x...) do { } while (0)
#endif


Liang





[Index of Archives]     [Apache Users]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Packaging]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Docs]