[Click] How do I debug a click element?

Beyers Cronje bcronje at cs.co.za
Thu Mar 31 07:43:57 EST 2005


Hi Bita

Use 'make install' after adding your click_chatter lines to compile the changes. 
In kernel mode you can only use printk(), click_chatter actually makes use of printk().

Regards

Beyers

-----Original Message-----
From: click-bounces at amsterdam.lcs.mit.edu
[mailto:click-bounces at amsterdam.lcs.mit.edu]On Behalf Of betamaz
Sent: Thursday, March 31, 2005 3:20 AM
To: click at amsterdam.lcs.mit.edu
Subject: [Click] How do I debug a click element?


Hi,

I am trying to figure out what functions of an element .cc file get
called when the element gets called from a configuration file.  To do
this, I am inserting debug messages in a file, by using the
click_chatter( ) function. In order to run the configuration and see
the messages I have tried recompiling by using
'/click-1.4.3/configure' and '/click-1.4.3/Makefile' then looked for
my debug messages in standard out and /var/log/messages.  In both
cases I didnt see my debug messages.  Also, the later case of running
'make' took way too long for recompiling and thus I prefer to avoid.

1) What would be a better/faster method to recompiling only changed
elements of click?

2) Previously, i had tried to use printf statements, which resulted in
compilation errors when running '/click-1.4.3/configure'.  It was
suggested to me to debug using click_chatter rather than printf
statements.  In the message archives, I saw a few examples of printf
statments being used to debug when creating new elements.  I would
appreciate an explanation of why printf statments will work in new
elements but not in debugging the old.


Thank you,
Bita.
----------------------------------------
For example: I am trying the simple test-device.click configuration:
      FromDevice(eth0) -> Print(ok:eth0) -> Discard;

and changing one of the fromdevice.cc to the following:
void
FromDevice::static_initialize()
{
    from_device_map.initialize();
#ifdef HAVE_CLICK_KERNEL
    packet_notifier.notifier_call = packet_notifier_hook;
    packet_notifier.priority = 1;
    packet_notifier.next = 0;
#endif
    device_notifier.notifier_call = device_notifier_hook;
    device_notifier.priority = 1;
    device_notifier.next = 0;
    register_netdevice_notifier(&device_notifier);

    // CLICK_DEBUG
    click_chatter("CLICK_DEBUG: initializing fromdevice.cc");
    // -
}
_______________________________________________
click mailing list
click at amsterdam.lcs.mit.edu
https://amsterdam.lcs.mit.edu/mailman/listinfo/click

This is an email from Bytes Technology Group. It is confidential to the 
ordinary user of the email address to which it is addressed 
and may contain copyright and/or legally privileged information.
No one else may read, print, store, copy, forward or act in 
reliance upon all or any part of it or its attachments. If you 
received this email in error please notify its sender.



More information about the click mailing list