Re: accessing internal h/w timers



techietone wrote:
Hello All!

Can we have access to internal h/w timers on an embedded board having
linux. The purpose behind this is to keep track of time - any of the
time related system calls are not usful; as the jiffies value itself is
beyond the required resolution.


See the thread "Linux system clock tick?" in this forum.

When in Kernel space, AFAIK, jiffies (frequency defined by the "HZ" constant in 1/sec) _is_ the resolution of the hardware timer used by the Kernel. The frequency used depends on the architecture (and can be changed by modifying a .h file and recompiling the Kernel). With not too fast CPUs it's 100 Hz, faster values not recommended.

In user space jiffies/HZ is always 100 Hz and changing it is not recommended. I don't think you can access the Kernel jiffies from user space.

Anyway, pure Linux is not meant to be a hard realtime system, so relying on fast timer stuff - especially in user space - usually fails.

-Michael
.



Relevant Pages

  • Re: with 2.6.7 setitimer called in sequence returns strange values on i686
    ... > Everything was working fine untill I've installed 2.6.7 kernel. ... I've reset timer to 10 seconds and setitimer tells ... jiffies is allocated to force the requirement that timer expires not ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: [RFC][PATCH] new timeofday core subsystem (v.A0)
    ... >>The only way curent way to enter the kernel from glibc with a fastcall is ... >>The functions in the timer source structure is a central problem for IA64. ... >>attached that can simply be copied into userspace if wanted. ... If the timesource freq is a power of 2, ...
    (Linux-Kernel)
  • RE: timer interrupt stucks using tickless kernel
    ... The posblem is that the timer is getting ... kernel boot log would be useful. ... Initializing cgroup subsys cpuset ... ctnetlink v0.93: registering with nfnetlink. ...
    (Linux-Kernel)
  • [patch 1/2] infrastructure to debug (dynamic) objects
    ... problem spot are kernel timers, where the detection of the problem ... While working on a timer related bug report I had to hack in ... This debug hack was fine for temporary use, ...
    (Linux-Kernel)
  • Re: [patch 07/17] LTTng instrumentation - timer
    ... Instrument timer activity to keep ... information about the "real time" flow within the kernel. ... Those tracepoints are used by LTTng. ... This is a very dangerous trace point - we're holding xtime lock here. ...
    (Linux-Kernel)