[syslinux] timestamp in COM32 module

Gene Cumm gene.cumm at gmail.com
Tue Sep 7 19:47:53 PDT 2010


On Tue, Sep 7, 2010 at 18:04, Andrew Stuart <andrew at shopcusa.com> wrote:
> On 9/5/2010 3:08 AM, Tomas Karasek wrote:
>>
>> Hello,
>> I am writing a simple module for measuring boot time. I would like to
>> get a timestamp when syslinux is run and then pass it as kernel
>> parameter and work with the timestamp later..
>>
>> It seems that POXIS time.h functions are not implemented yet(?) in
>> COMBOOT. There is times() from times.c but I do not understand what is
>> it exactly returning. it doesn't seems like what POSIX time() returns.

The COM32 times() should be returning a time at 1 ms per cycle.  Prior
to v4.02, it counted at 55 ms per cycle (a "jiffie"; associated with
RTC), approximately 18 tps (see com32/include/sys/times.h for the
macro HZ).  This is also the resolution of the new times() function.

Unfortunately, I'm uncertain on the origin point (meaning a return of
zero).  Quick experimentation can start an answer though.  I think
it's related to the instant of power-on of the machine.

>> Also, I was reading this
>>
>>
>> http://www.linuxfordevices.com/c/a/Linux-For-Devices-Articles/Benchmarking-boot-latency-on-x86/
>>
>>
>> and it sounds good, but I would be really better off with seconds since
>> beginning of epoch, plus I am not sure how the TSC count behaves on
>> multicore.
>>
>> - Is there some other way to get (some kind of) timestamp in COM32
>> environment besides RDTSC and times.c?
>>
>> - Is there a way how to get a timestamp relative to times() when Linux
>> is runnig? I.e. build a static binary that will get times() and run it
>> from init?
>>
>> Best Regards,
>> Tomas Karasek
>
> While not answering your question specifically, I might suggest you check
> the archives, on 3/20/10 Gene Cumm wrote a c32 module for timing transfers.
> The thread was titled '[MODULE] COM32 module to time null-dumping a file,
> v1.1'
>
> I don't believe it passed anything to a linux kernel, but maybe it will give
> you some ideas.
>
> HTH
>
> -Andrew

It only null-dumped a file in order to time the combined speed
capabilities from Syslinux to the file source media and returned to
the Syslinux environment.

Building something that will append a parameter indicating a time (of
some sort) should be nearly trivial.  Look at com32/modules/cmd.c for
ideas.  Obtaining epoch time might be a different story.

-- 
-Gene




More information about the Syslinux mailing list