* Measuring time in range of microseconds. @ 2011-12-06 8:47 Sathishkumar Duraisamy 2011-12-06 10:46 ` Peter Senna Tschudin 0 siblings, 1 reply; 8+ messages in thread From: Sathishkumar Duraisamy @ 2011-12-06 8:47 UTC (permalink / raw) To: kernelnewbies Hi, I am writing a module to measure time taken between two events. I have to measure time in microseconds. Some articles says about High resolution timers. As per the article http://elinux.org/High_Resolution_Timers, I read cat /proc/timer_list which says 10000000ns as resolution ( which is 10ms). I think with this resolution I cannot measure in the range of microseconds. I couldn't able to find support for HR timer in kernel menuconfig. I am using kernel 2.6.36.2. Can you please help me to, "How do enable this timer. Or is there any other means to measure time or simply I have to use the timer hardware directly?" -- With Thanks, Sathishkumar D http://flowersopenlab.weebly.com/ ^ permalink raw reply [flat|nested] 8+ messages in thread
* Measuring time in range of microseconds. 2011-12-06 8:47 Measuring time in range of microseconds Sathishkumar Duraisamy @ 2011-12-06 10:46 ` Peter Senna Tschudin 2011-12-06 11:06 ` Sathishkumar Duraisamy 0 siblings, 1 reply; 8+ messages in thread From: Peter Senna Tschudin @ 2011-12-06 10:46 UTC (permalink / raw) To: kernelnewbies Hi Sathishkumar, I've used RDTSC instruction as precision timer. RDTSC measures clock cycles. Example on: petersenna.com/files/rdtscbench-1.0.tar.gz More about rdtsc: http://en.wikipedia.org/wiki/Time_Stamp_Counter http://people.virginia.edu/~chg5w/page3/assets/MeasuringUnix.pdf Regards, Peter On Tue, Dec 6, 2011 at 6:47 AM, Sathishkumar Duraisamy <bewithsathish@gmail.com> wrote: > Hi, > > I am writing a module to measure time taken between two events. I have > to measure time in microseconds. Some articles says about High > resolution timers. As per the article > http://elinux.org/High_Resolution_Timers, I read cat /proc/timer_list > which says 10000000ns as resolution ( which is 10ms). I think with > this resolution I cannot measure in the range of microseconds. I > couldn't able to find support for HR timer in kernel menuconfig. > > I am using kernel 2.6.36.2. Can you please help me to, "How do enable > this timer. Or is there any other means to measure time or simply I > have to use the timer hardware directly?" > > -- > With Thanks, > Sathishkumar D > http://flowersopenlab.weebly.com/ > > _______________________________________________ > Kernelnewbies mailing list > Kernelnewbies at kernelnewbies.org > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies -- Peter Senna Tschudin peter.senna at gmail.com gpg id: 48274C36 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Measuring time in range of microseconds. 2011-12-06 10:46 ` Peter Senna Tschudin @ 2011-12-06 11:06 ` Sathishkumar Duraisamy 2011-12-06 11:17 ` Peter Senna Tschudin 0 siblings, 1 reply; 8+ messages in thread From: Sathishkumar Duraisamy @ 2011-12-06 11:06 UTC (permalink / raw) To: kernelnewbies Hi Peter, Thanks for rdtsc. But I looking to measure time inside Linux Kernel Module in ARM architecture. -- Regards, Sathishkumar D http://flowersopenlab.weebly.com/ ^ permalink raw reply [flat|nested] 8+ messages in thread
* Measuring time in range of microseconds. 2011-12-06 11:06 ` Sathishkumar Duraisamy @ 2011-12-06 11:17 ` Peter Senna Tschudin 2011-12-07 2:42 ` Fredrick 0 siblings, 1 reply; 8+ messages in thread From: Peter Senna Tschudin @ 2011-12-06 11:17 UTC (permalink / raw) To: kernelnewbies Hi Sathishkumar, rdtsc is x86 specific... Sorry. But there are other options. Compares rdtsc with hpet: http://aufather.wordpress.com/2010/09/08/high-performance-time-measuremen-in-linux/ Other reference about timers: http://the-b.org/Linux_timers I'm not sure if HPET works on ARM. []'s Peter On Tue, Dec 6, 2011 at 9:06 AM, Sathishkumar Duraisamy <bewithsathish@gmail.com> wrote: > Hi Peter, > > Thanks for rdtsc. But I looking to measure time inside Linux Kernel > Module in ARM architecture. > > -- > Regards, > Sathishkumar D > http://flowersopenlab.weebly.com/ -- Peter Senna Tschudin peter.senna at gmail.com gpg id: 48274C36 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Measuring time in range of microseconds. 2011-12-06 11:17 ` Peter Senna Tschudin @ 2011-12-07 2:42 ` Fredrick 2011-12-07 7:11 ` Sathishkumar Duraisamy 0 siblings, 1 reply; 8+ messages in thread From: Fredrick @ 2011-12-07 2:42 UTC (permalink / raw) To: kernelnewbies I think if the specific ARM platform you are working supports a oneshot clock_device, you would get the high res timer support. You can check for clock_devices defined in your platform having feature - CLOCK_EVT_FEAT_ONESHOT. -Fredrick On 12/06/2011 03:17 AM, Peter Senna Tschudin wrote: > Hi Sathishkumar, > > rdtsc is x86 specific... Sorry. > > But there are other options. > > Compares rdtsc with hpet: > http://aufather.wordpress.com/2010/09/08/high-performance-time-measuremen-in-linux/ > > Other reference about timers: > http://the-b.org/Linux_timers > > I'm not sure if HPET works on ARM. > > []'s > > Peter > > On Tue, Dec 6, 2011 at 9:06 AM, Sathishkumar Duraisamy > <bewithsathish@gmail.com> wrote: >> Hi Peter, >> >> Thanks for rdtsc. But I looking to measure time inside Linux Kernel >> Module in ARM architecture. >> >> -- >> Regards, >> Sathishkumar D >> http://flowersopenlab.weebly.com/ > > > ^ permalink raw reply [flat|nested] 8+ messages in thread
* Measuring time in range of microseconds. 2011-12-07 2:42 ` Fredrick @ 2011-12-07 7:11 ` Sathishkumar Duraisamy 2011-12-07 9:40 ` RKK 0 siblings, 1 reply; 8+ messages in thread From: Sathishkumar Duraisamy @ 2011-12-07 7:11 UTC (permalink / raw) To: kernelnewbies Hi Fredrick, On Wed, Dec 7, 2011 at 8:12 AM, Fredrick <fjohnber@zoho.com> wrote: > I think if the specific ARM platform you are working supports a oneshot > clock_device, you would get the high res timer support. > > You can check for clock_devices defined in your platform having feature - > CLOCK_EVT_FEAT_ONESHOT. I have been working on s3c6410 SOC. As per kconfig file, currently for 2.6.36, my platform doesn't support these dependencies. I have to check with recent kernels. "config HIGH_RES_TIMERS bool "High Resolution Timer Support" depends on !ARCH_USES_GETTIMEOFFSET && GENERIC_CLOCKEVENTS select TICK_ONESHOT help This option enables high resolution timer support. If your hardware is not capable then this option only increases the size of the kernel image." -- Regards, Sathishkumar D http://flowersopenlab.weebly.com/ ^ permalink raw reply [flat|nested] 8+ messages in thread
* Measuring time in range of microseconds. 2011-12-07 7:11 ` Sathishkumar Duraisamy @ 2011-12-07 9:40 ` RKK 2011-12-07 10:05 ` Sathishkumar Duraisamy 0 siblings, 1 reply; 8+ messages in thread From: RKK @ 2011-12-07 9:40 UTC (permalink / raw) To: kernelnewbies Hello Satish, On Wed, Dec 7, 2011 at 12:41 PM, Sathishkumar Duraisamy <bewithsathish@gmail.com> wrote: > Hi Fredrick, > > On Wed, Dec 7, 2011 at 8:12 AM, Fredrick <fjohnber@zoho.com> wrote: >> I think if the specific ARM platform you are working supports a oneshot >> clock_device, you would get the high res timer support. >> >> You can check for clock_devices defined in your platform having feature - >> CLOCK_EVT_FEAT_ONESHOT. > My guess is that u want to measure the time taken to execute a function in microseconds. something like start_time YOUR_FUNCTION end_time for this i use something like this declare struct timeval tv in your function and insert printk statements before and after calling to your function do_gettimeofday(&tv); printk ("Before %s (): Sec = %d micro Sec = %d\n", __FUNCTION__, tv.tv_sec, tv.tv_usec); call_to_your_function((); printk ("After %s (): Sec = %d micro Sec = %d\n", __FUNCTION__, tv.tv_sec, tv.tv_usec); -- Warm Regards, Ravi . "I don't Know is not a excuse , its an opportunity." ^ permalink raw reply [flat|nested] 8+ messages in thread
* Measuring time in range of microseconds. 2011-12-07 9:40 ` RKK @ 2011-12-07 10:05 ` Sathishkumar Duraisamy 0 siblings, 0 replies; 8+ messages in thread From: Sathishkumar Duraisamy @ 2011-12-07 10:05 UTC (permalink / raw) To: kernelnewbies Hi On Wed, Dec 7, 2011 at 3:10 PM, RKK <kulkarni.ravi4@gmail.com> wrote: > Hello Satish, > > > On Wed, Dec 7, 2011 at 12:41 PM, Sathishkumar Duraisamy > <bewithsathish@gmail.com> wrote: >> Hi Fredrick, >> >> On Wed, Dec 7, 2011 at 8:12 AM, Fredrick <fjohnber@zoho.com> wrote: >>> I think if the specific ARM platform you are working supports a oneshot >>> clock_device, you would get the high res timer support. >>> >>> You can check for clock_devices defined in your platform having feature - >>> CLOCK_EVT_FEAT_ONESHOT. >> > My guess is that u want to measure the time taken to execute a > function in microseconds. > something like > start_time > YOUR_FUNCTION > end_time Sorry. I want to measure external pulse on a GPIO pin. -- Regards, Sathishkumar D http://flowersopenlab.weebly.com/ ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2011-12-07 10:05 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-12-06 8:47 Measuring time in range of microseconds Sathishkumar Duraisamy 2011-12-06 10:46 ` Peter Senna Tschudin 2011-12-06 11:06 ` Sathishkumar Duraisamy 2011-12-06 11:17 ` Peter Senna Tschudin 2011-12-07 2:42 ` Fredrick 2011-12-07 7:11 ` Sathishkumar Duraisamy 2011-12-07 9:40 ` RKK 2011-12-07 10:05 ` Sathishkumar Duraisamy
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).