a04c [Solved] what units are used in kern.cp_times? - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Development > Userland Programming & Scripting

Userland Programming & Scripting C, Shell, Perl, Sed & Awk

Reply
 
Thread Tools Display Modes
  #1  
Old April 13th, 2012, 06:38
hsn hsn is offline
Junior Member
 
Join Date: Mar 2011
Posts: 24
Thanks: 1
Thanked 0 Times in 0 Posts
Default what units are used in kern.cp_times?

I need to get CPU miliseconds used since boot. Total user + system + interrupt time. My idea is to get it from the cp_times counter, but I could not figure out what time units are used.

Code:
kern.cp_times: 99980046 216471 24984081 1176383 1487354560 71668989 126252 23494859 10703 1518410383
 131623419 250473 23864059 96 1457972935 118043958 142876 19560244 58 1475964202 122076248 131112 18928452
 113 1472575112 112635562 103018 16450420 111 1484522108 92257836 132166 24627838 306285 1496387411
 49457466 59102 14902169 989885 1548302924
Source code is in sys/kern/kern_clock.c

Last edited by hsn; April 26th, 2012 at 11:35. Reason: Proper formatting: http://forums.freebsd.org/showthread.php?t=8816
Reply With Quote
  #2  
Old April 13th, 2012, 09:41
SirDice's Avatar
SirDice SirDice is online now
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,702
Thanks: 47
Thanked 2,022 Times in 1,861 Posts
Default

I'm not sure but it's probably a jiffy.
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
  #3  
Old April 14th, 2012, 08:59
hsn hsn is offline
Junior Member
 
Join Date: Mar 2011
Posts: 24
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Units seems to be closest to stathz, but in reality they are slightly faster then 133 Hz.

Code:
ponto:(admin)main/swg>sysctl kern.clockrate
kern.clockrate: { hz = 1000, tick = 1000, profhz = 2000, stathz = 133 }

Last edited by DutchDaemon; April 15th, 2012 at 02:08. Reason: Proper formatting: http://forums.freebsd.org/showthread.php?t=8816
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Solved] Kern.maxfiles rbizzell33 General 33 April 27th, 2010 09:47
kern.maxfilesperproc not affected henosx General 4 April 16th, 2010 23:41
kern.securelevel usage z662 General 0 January 20th, 2010 18:18
Maximum kern.hz ? DigiSoft General 7 January 20th, 2010 02:30
kern.hz DemoDoG General 2 December 30th, 2008 14:35


All times are GMT +1. The time now is 17:34.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0