Help: problems when I do atomic lookup on the kernel side.

Liang Yang <[email protected]>
Newsgroups gmane.network.tux
Message-ID <[email protected]>
Hi,

I encounter some problems when I try to do atomic lookkup
on the kernel side. Pls help me.

I want to output the information I need in main.c in TUX, first I add
printk("cach missed=%d", missed) to the function user_get_object()
in main.c, after I rebuild TUX module and start TUX, I can't find such
information in /var/log/messages.

So I think maybe the control didn't go to the user_get_object(), then I
add printk("TUX start successfully message"); to the tux_init() in main.c.
I think Whenever TUX start, I should found this message in
/var/log/messages,
but after I rebuild TUX module and start TUX, I still can't find it.

So I think maybe the message level in printk is not high enough, so I
changed
the printk like this printk(KERN_DEBUG "TUX start successfully message"); or
even higher level as printk(KERN_EMEGR "TUX start successfully message");,
after I rebuild TUX module and start TUX, I still can't find such message in
/var/log/messages.

So I think I should use Dprintk(actually Dprintk is based on printk, but I
have to try)
instead of just printk. Then I changed printk to Dprintk like this:
Dprintk("TUX start successfully message"); and also put thisd Dprintk
statement in
tux_init in main.c. After I rebuild TUX module and start TUX, I still can't
find this message
in /var/log/messages.

So think I forgot to turn on TUX_DEBUG and should set DPrintk to 1, then I
turn on TUX_DEBUG
and try to rebuild Linux kernel and all modules. I encounter an error in
"make modules_install"
as follows:
----------------------
make[1]: Nothing to be done for `modules_install'.
make[1]: Leaving directory `/usr/src/linux-2.4.9-31/arch/i386/lib'
cd /lib/modules/2.4.9-31debug; \
mkdir -p pcmcia; \
find kernel -path '*/pcmcia/*' -name '*.o' | xargs -i -r ln -sf ../{} pcmcia
if [ -r System.map ]; then /sbin/depmod -ae -F System.map  2.4.9-31debug; fi
depmod: *** Unresolved symbols in
/lib/modules/2.4.9-31debug/kernel/net/tux/tux.o
depmod:         show_stack
make: *** [_modinst_post] Error 1
----------------------
Michael K. Johnson gave me a solution just now, he said I should add a line
EXPORT_SYMBOL_GPL(show_stack) to arch/i386/kernel/i386_ksyms.c and rebuild.
OK, I will try it now.

Here're some questions I summary:

First, can I use printk directly in source code of TUX, so I don't need to
turn on or off
of TUX_DEBUG in kernel configuration.

Second, Is fprintf the only way to output information in user space modules
since printf doesn't
work?

Third, if I already built TUX as a module, then I turned on TUX_DEBUG, can
I
just build all modules again to make it effect or do  I need to build linux
kernel
with all modules again?

Sorry to ask so many questions. But I think TUX will become more and more
popular if more and more
people like me are familiar with it.

Thank you. I really want to say thanks to all of you for so much help and
encouragement to me.

Liang
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.