Re: [m5-dev] Review Request: time: improve time datastructure
--- This is an automatically generated e-mail. To reply, visit: http://reviews.m5sim.org/r/425/#review739 --- Ship it! - Gabe On 2011-01-14 13:32:44, Nathan Binkert wrote: --- This is an automatically generated e-mail. To reply, visit: http://reviews.m5sim.org/r/425/ --- (Updated 2011-01-14 13:32:44) Review request for Default, Ali Saidi, Gabe Black, Steve Reinhardt, and Nathan Binkert. Summary --- time: improve time datastructure Use posix clock functions (and librt) if it is available. Inline a bunch of functions and implement more operators. Diffs - SConstruct de7601e6e19d src/base/time.hh de7601e6e19d src/base/time.cc de7601e6e19d src/sim/stat_control.cc de7601e6e19d Diff: http://reviews.m5sim.org/r/425/diff Testing --- quick regressions pass Thanks, Nathan ___ m5-dev mailing list m5-dev@m5sim.org http://m5sim.org/mailman/listinfo/m5-dev
Re: [m5-dev] Review Request: time: improve time datastructure
On 2011-01-13 23:50:52, Nathan Binkert wrote: src/base/time.cc, line 89 http://reviews.m5sim.org/r/425/diff/1/?file=9565#file9565line89 Oh, I used whatever you used. CLOCK_REALTIME is fine too, though I guess I never really cared about the fact that I could print the time as a string. I am generally more interested in using it for measuring how long things take. I hesitate to make this code more complex, but I guess I could create a set_wallclock() func that does one and a set_timer() that does the other. Yeah, CLOCK_MONOTONIC is probably better in a lot of ways since the simulation shouldn't generally care what the actual time is, and it avoids some issues. It would be nice to make gettimeofday more like clock_gettime with CLOCK_MONOTONIC than the other way around, if that's possible. You could have set() just do what it's doing now and a set_wallclock() (setWallclock() since it's a member of a class?) for the less commonly useful wall time. - Gabe --- This is an automatically generated e-mail. To reply, visit: http://reviews.m5sim.org/r/425/#review737 --- On 2011-01-13 19:43:31, Nathan Binkert wrote: --- This is an automatically generated e-mail. To reply, visit: http://reviews.m5sim.org/r/425/ --- (Updated 2011-01-13 19:43:31) Review request for Default, Ali Saidi, Gabe Black, Steve Reinhardt, and Nathan Binkert. Summary --- time: improve time datastructure Use posix clock functions (and librt) if it is available. Inline a bunch of functions and implement more operators. I needed something like this for some timing code that I needed, so I just did it right since I assume that Gabe could use this to better his patch. Diffs - SConstruct de7601e6e19d src/base/time.hh de7601e6e19d src/base/time.cc de7601e6e19d src/sim/stat_control.cc de7601e6e19d Diff: http://reviews.m5sim.org/r/425/diff Testing --- quick regressions pass Thanks, Nathan ___ m5-dev mailing list m5-dev@m5sim.org http://m5sim.org/mailman/listinfo/m5-dev
Re: [m5-dev] Review Request: time: improve time datastructure
--- This is an automatically generated e-mail. To reply, visit: http://reviews.m5sim.org/r/425/ --- (Updated 2011-01-14 13:32:44.178285) Review request for Default, Ali Saidi, Gabe Black, Steve Reinhardt, and Nathan Binkert. Summary (updated) --- time: improve time datastructure Use posix clock functions (and librt) if it is available. Inline a bunch of functions and implement more operators. Diffs (updated) - SConstruct de7601e6e19d src/base/time.hh de7601e6e19d src/base/time.cc de7601e6e19d src/sim/stat_control.cc de7601e6e19d Diff: http://reviews.m5sim.org/r/425/diff Testing --- quick regressions pass Thanks, Nathan ___ m5-dev mailing list m5-dev@m5sim.org http://m5sim.org/mailman/listinfo/m5-dev
[m5-dev] Review Request: time: improve time datastructure
--- This is an automatically generated e-mail. To reply, visit: http://reviews.m5sim.org/r/425/ --- Review request for Default, Ali Saidi, Gabe Black, Steve Reinhardt, and Nathan Binkert. Summary --- time: improve time datastructure Use posix clock functions (and librt) if it is available. Inline a bunch of functions and implement more operators. I needed something like this for some timing code that I needed, so I just did it right since I assume that Gabe could use this to better his patch. Diffs - SConstruct de7601e6e19d src/base/time.hh de7601e6e19d src/base/time.cc de7601e6e19d src/sim/stat_control.cc de7601e6e19d Diff: http://reviews.m5sim.org/r/425/diff Testing --- quick regressions pass Thanks, Nathan ___ m5-dev mailing list m5-dev@m5sim.org http://m5sim.org/mailman/listinfo/m5-dev
Re: [m5-dev] Review Request: time: improve time datastructure
--- This is an automatically generated e-mail. To reply, visit: http://reviews.m5sim.org/r/425/#review735 --- Looks pretty good, and thanks! src/base/time.hh http://reviews.m5sim.org/r/425/#comment997 Maybe define a constant for this? It's hard to count out that many zeros reliably. src/base/time.cc http://reviews.m5sim.org/r/425/#comment998 Are you sure you want to use CLOCK_MONOTONIC here? My book says this is in reference to an unspecified point in the past and is for a clock source that can't jump around if, for instance, somebody updates the system time. There isn't necessarily anything wrong with that, but I don't think that's what gettimeofday does. If you want to really have a gettimeofday substitute, I think you want to use CLOCK_REALTIME, although that's mostly just a relatively uninformed interpretation of what's in the book and may be wrong. - Gabe On 2011-01-13 19:43:31, Nathan Binkert wrote: --- This is an automatically generated e-mail. To reply, visit: http://reviews.m5sim.org/r/425/ --- (Updated 2011-01-13 19:43:31) Review request for Default, Ali Saidi, Gabe Black, Steve Reinhardt, and Nathan Binkert. Summary --- time: improve time datastructure Use posix clock functions (and librt) if it is available. Inline a bunch of functions and implement more operators. I needed something like this for some timing code that I needed, so I just did it right since I assume that Gabe could use this to better his patch. Diffs - SConstruct de7601e6e19d src/base/time.hh de7601e6e19d src/base/time.cc de7601e6e19d src/sim/stat_control.cc de7601e6e19d Diff: http://reviews.m5sim.org/r/425/diff Testing --- quick regressions pass Thanks, Nathan ___ m5-dev mailing list m5-dev@m5sim.org http://m5sim.org/mailman/listinfo/m5-dev
Re: [m5-dev] Review Request: time: improve time datastructure
--- This is an automatically generated e-mail. To reply, visit: http://reviews.m5sim.org/r/425/#review737 --- src/base/time.hh http://reviews.m5sim.org/r/425/#comment1000 heh, but the constant will have that many zeroes too! I could use 1000*1000*1000 if you prefer. I'll figure something out. src/base/time.cc http://reviews.m5sim.org/r/425/#comment999 Oh, I used whatever you used. CLOCK_REALTIME is fine too, though I guess I never really cared about the fact that I could print the time as a string. I am generally more interested in using it for measuring how long things take. I hesitate to make this code more complex, but I guess I could create a set_wallclock() func that does one and a set_timer() that does the other. - Nathan On 2011-01-13 19:43:31, Nathan Binkert wrote: --- This is an automatically generated e-mail. To reply, visit: http://reviews.m5sim.org/r/425/ --- (Updated 2011-01-13 19:43:31) Review request for Default, Ali Saidi, Gabe Black, Steve Reinhardt, and Nathan Binkert. Summary --- time: improve time datastructure Use posix clock functions (and librt) if it is available. Inline a bunch of functions and implement more operators. I needed something like this for some timing code that I needed, so I just did it right since I assume that Gabe could use this to better his patch. Diffs - SConstruct de7601e6e19d src/base/time.hh de7601e6e19d src/base/time.cc de7601e6e19d src/sim/stat_control.cc de7601e6e19d Diff: http://reviews.m5sim.org/r/425/diff Testing --- quick regressions pass Thanks, Nathan ___ m5-dev mailing list m5-dev@m5sim.org http://m5sim.org/mailman/listinfo/m5-dev