"hwclock -w" takes 24 seconds

Steve Bennett steveb at workware.net.au
Wed Apr 14 06:01:08 UTC 2010


On 13/04/2010, at 11:09 AM, Rob Landley wrote:

> On Tuesday 13 April 2010 10:08:56 Kim B. Heino wrote:
>> BusyBox 1.16.1 on a small armv4tl system:
>> 
>> $ time hwclock -w
>> real    0m 24.34s
>> user    0m 0.00s
>> sys     0m 0.00s
>> 
>> $ time hwclock -w
>> real    0m 24.07s
>> user    0m 0.01s
>> sys     0m 0.00s
>> 
>> $ time hwclock -w
>> real    0m 24.20s
>> user    0m 0.00s
>> sys     0m 0.00s
>> 
>> rem_usec seems to be about 996600 after every iteration. Changing sync
>> resolution from 1ms to 5ms helps, but there has to be better solution.
>> Denys?
> 
> I can confirm this on my armv4tl system image:
> 
>  wget http://impactlinux/com/fwl/downloads/binaries/system-image-armv4tl.tar.bz2
>  tar xvjf system-image-armv4tl.tar.bz2
>  cd system-image-armv4tl
>  ./run-emulator.sh
> 
> wait through the boot messages...
> 
>  (armv4tl) /home # time hwclock -w
>  real        0m 24.98s
>  user       0m 0.01s
>  sys         0m 0.01s
> 
> This assumes you have qemu 0.12.x installed.
> 
> Rob
> 
> P.S: As expected, application emulation is useless here:
> 
>  $ qemu-arm ./hwclock
>  Unsupported ioctl: cmd=0xffffffff80247009
>  hwclock: RTC_RD_TIME: Function not implemented

Interesting.

BusyBox v1.17.0.git

armv5teb
~ # strace hwclock -w
... blah blah ...
open("/etc/adjtime", O_RDONLY)          = -1 ENOENT (No such file or directory)
open("/dev/rtc", O_WRONLY)              = -1 ENOENT (No such file or directory)
open("/dev/rtc0", O_WRONLY)             = 3
gettimeofday({1271224598, 269609}, NULL) = 0
open("/etc/config/TZ", O_RDONLY)        = 4
read(4, "EST-10\n", 68)                 = 7
read(4, "", 61)                         = 0
close(4)                                = 0

... lots of these ...

open("/etc/config/TZ", O_RDONLY)        = 4
read(4, "EST-10\n", 68)                 = 7
read(4, "", 61)                         = 0
close(4)                                = 0
gettimeofday({1271224622, 14271}, NULL) = 0
nanosleep({0, 984729000}, NULL)         = 0
gettimeofday({1271224623, 8166}, NULL)  = 0
open("/etc/config/TZ", O_RDONLY)        = 4
read(4, "EST-10\n", 68)                 = 7
read(4, "", 61)                         = 0
close(4)                                = 0
gettimeofday({1271224623, 14276}, NULL) = 0
ioctl(3, RTC_SET_TIME, {tm_sec=3, tm_min=57, tm_hour=15, tm_mday=14, tm_mon=3, tm_year=110, ...}) = 0
exit(0)                                 = ?

Cheers,
Steve
--
µWeb: Embedded Web Framework - http://uweb.workware.net.au/



More information about the busybox mailing list