Re: Fwd: Timestamp and Timers Questions
Cliff Frey <[email protected]> Mon, 22 Jul 2013 20:56:59 -0700
| Newsgroups | gmane.network.routing.click |
|---|---|
| Message-ID | <CAFtVOq=JNA4cqnLJZxRZmN4DpyhAWT2C3R8aGwiR8b_LhiOoXA@mail.gmail.com> |
I find the easiest way to trace through lots of #if code is to add #error statements in each branch, and see which ones are hit when compiling. When running userlevel-linux click, timestamp uses either the clock_gettime or gettimeofday library functions to get the current time. Cliff On Mon, Jul 22, 2013 at 7:57 PM, Bronson Oka <[email protected]> wrote: > Hello, > > I was just wondering if you could answer a few questions about the > implementation of the Click Router. > > I'm trying to implement a protocol Element. The implementation is for > testing and verification of the protocol, so precision and speed are a > factor. I've been looking at the Click source code for the past few weeks > trying to figure out how precise the Timers and Timestamp are. > > Form what I understand, all the Elements that depend on system time rely on > the Timestamp Element. The timestamp.hh header file has a definition for > different inline assign() functions, but there are many #if statements that > control which macros get defined and I'm not sure how to tell which ones > are actually being used when compiling the code. > > Is there a simple way to tell which #if statements are invoked? > This would make it much easier to focus on specific parts of the code. > > I would also like to ask how the Timestamp gets the system time. I saw > that the assign_now() inline function calls current_kernel_time(), but I > wasn't able to trace this call back to its origin. > > When running on Linux, does the Click Router use system calls to get the > time (such as POSIX)? > > I would also greatly appreciate it if you can offer any extra tips for > understanding the Timestamp implementation. > > Thanks for your help. > _______________________________________________ > click mailing list > [email protected] > https://amsterdam.lcs.mit.edu/mailman/listinfo/click >