Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
06-15-2008, 09:56 PM
|
#1
|
Member
Registered: Jan 2007
Posts: 95
Rep:
|
Check for high resolution timer
Is there some program that will tell me if I am currently using a high resolution timer kernel? I recompiled my kernel for high resolution timers, because I heard it fixes a music timing problem in the SDL port of the game Cave Story (check it out if you haven't!). I'm not sure if it worked and didn't solve the problem, or didn't work, because the problem still came up a couple of times. So, is there a way I can tell if the kernel I am running has high resolution timers?
|
|
|
06-17-2008, 06:59 AM
|
#2
|
LQ Guru
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509
|
1. you can see if the startup messages contain something like "Switched to high resolution mode on CPU 0"
Code:
dmesg | grep -i "high resolution"
2. you can examine /proc/timer_list. Here is an example from a system of mine:
Code:
$ cat /proc/timer_list
Timer List Version: v0.3
HRTIMER_MAX_CLOCK_BASES: 2
now at 8126099139257 nsecs
cpu: 0
clock 0:
.index: 0
.resolution: 1 nsecs
.get_time: ktime_get_real
.offset: 1213695287591567949 nsecs
active timers:
clock 1:
.index: 1
.resolution: 1 nsecs
.get_time: ktime_get
.offset: 0 nsecs
active timers:
#0: <d5149ea8>, tick_sched_timer, S:01, tick_nohz_restart_sched_tick, swapper/0
# expires at 8126100000000 nsecs [in 860743 nsecs]
#1: <d5149ea8>, hrtick, S:01, hrtick_set, bash/6852
# expires at 8126108046966 nsecs [in 8907709 nsecs]
#2: <d5149ea8>, hrtimer_wakeup, S:01, futex_wait, firefox/4993
# expires at 8126303835084 nsecs [in 204695827 nsecs]
#3: <d5149ea8>, hrtimer_wakeup, S:01, futex_wait, thunderbird-bin/2952
# expires at 8126834713057 nsecs [in 735573800 nsecs]
#4: <d5149ea8>, it_real_fn, S:01, do_setitimer, lm_TMW.ld/2250
# expires at 8141081124879 nsecs [in 14981985622 nsecs]
#5: <d5149ea8>, hrtimer_wakeup, S:01, futex_wait, firefox/6809
# expires at 8149722588347 nsecs [in 23623449090 nsecs]
#6: <d5149ea8>, hrtimer_wakeup, S:01, futex_wait, firefox/6768
# expires at 8157305776161 nsecs [in 31206636904 nsecs]
#7: <d5149ea8>, hrtimer_wakeup, S:01, do_nanosleep, crond/2092
# expires at 8173925829711 nsecs [in 47826690454 nsecs]
#8: <d5149ea8>, it_real_fn, S:01, do_setitimer, sendmail/2072
# expires at 10839968827086 nsecs [in 2713869687829 nsecs]
#9: <d5149ea8>, it_real_fn, S:01, do_setitimer, sendmail/2081
# expires at 10840266232140 nsecs [in 2714167092883 nsecs]
#10: <d5149ea8>, hrtimer_wakeup, S:01, do_nanosleep, atd/2269
# expires at 10844500356794 nsecs [in 2718401217537 nsecs]
.expires_next : 8126100000000 nsecs
.hres_active : 1
.nr_events : 1634095
.nohz_mode : 2
.idle_tick : 8126090000000 nsecs
.tick_stopped : 0
.idle_jiffies : 7826089
.idle_calls : 1223744
.idle_sleeps : 1112495
.idle_entrytime : 8126089044561 nsecs
.idle_waketime : 8126096221672 nsecs
.idle_exittime : 8126096244128 nsecs
.idle_sleeptime : 6897217943073 nsecs
.last_jiffies : 7826089
.next_jiffies : 7826116
.idle_expires : 8126116000000 nsecs
jiffies: 7826099
Tick Device: mode: 1
Clock Event Device: pit
max_delta_ns: 27461866
min_delta_ns: 12571
mult: 5124677
shift: 32
mode: 3
next_event: 9223372036854775807 nsecs
set_next_event: pit_next_event
set_mode: init_pit_timer
event_handler: tick_handle_oneshot_broadcast
tick_broadcast_mask: 00000000
tick_broadcast_oneshot_mask: 00000000
Tick Device: mode: 1
Clock Event Device: lapic
max_delta_ns: 994239172
min_delta_ns: 1777
mult: 36237551
shift: 32
mode: 3
next_event: 8126100000000 nsecs
set_next_event: lapic_next_event
set_mode: lapic_timer_setup
event_handler: hrtimer_interrupt
I put in red the relevant things:
a. the resolution of the clock has a value of 1 nsecs
b. the attribute .hres_active has a value of 1
c. the event_handler for the tick device is hrtimer_interrupt
Hope this helps.
|
|
|
06-18-2008, 03:14 PM
|
#3
|
Member
Registered: Jan 2007
Posts: 95
Original Poster
Rep:
|
Thanks, that helped a lot.
|
|
|
05-04-2009, 07:24 AM
|
#4
|
Member
Registered: Sep 2004
Distribution: Debian Testing / Unstable
Posts: 180
Rep:
|
Yes, thank you. This is an outstanding answer. Pulseaudio broke my sound system
and this is exactly the piece of the puzzle that will help me figure out what is going on. Thanks again for the concise answer to the question (and for the good question).
|
|
|
All times are GMT -5. The time now is 04:24 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|