[Click] Questions on how-to debug elements && Click's kernel level properties

Nikitas Liogkas nikitas at CS.UCLA.EDU
Tue Mar 8 20:43:23 EST 2005


> 3)  Next, I want to insert debug messages throught click elements. 
> For example, in counter.cc I tried doing a simple printf when the
> reset function is called and added the stdlio library.  To add the new
> changes, I ran: make elemlist and make install.  The later one
> resulted in an error.  I am an experienced C programmer, but still
> have a long way to go in understanding Click.
> 
> How can I debug properly in Click?

I always use a Click-defined "printf" called click_chatter(); it has 
the same syntax as printf, but you can do more fancy stuff as well, 
such as printing the element name directly; see push() in 
simplequeue.cc for an example. What's more important, it works equally 
well at userlevel and in the kernel; in the former case, it prints to 
stdout, in the latter to /var/log/messages.

Hope this helps...

nikitas


More information about the click mailing list