From: "Ray Lee" <ray-lk@madrabbit.org>
To: "Piotr Jaroszyński" <p.jaroszynski@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: HZ from userspace
Date: Wed, 6 Aug 2008 15:20:10 -0700 [thread overview]
Message-ID: <2c0942db0808061520y50dd88fende33b8d9b9d575e5@mail.gmail.com> (raw)
In-Reply-To: <2c0942db0808061516r730496d6hbc75eb9c5b49923a@mail.gmail.com>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=UTF-8, Size: 1402 bytes --]
On Wed, Aug 6, 2008 at 3:16 PM, Ray Lee <ray-lk@madrabbit.org> wrote:> On Wed, Aug 6, 2008 at 3:07 PM, Piotr JaroszyÅski> <p.jaroszynski@gmail.com> wrote:>>>> I want to be able to convert starttime from /proc/#/stat to absolute>>>> time and it seems that I need HZ to do that as it is measured in>>>> jiffies. How can I get HZ? I have seen some discussion about this but>>>> haven't found a definite answer. procps is using some hacks do it and>>>> I would prefer to avoid them.>>>> I only need a solution for modern kernels, say 2.6.20+ if that matters.>>>>>> `man sysconf`, in particular you want sysconf(_SC_CLK_TCK).>>>> manpage says it's obsolete and i read in some discussion that it only>> returns the default and not the real HZ used.>> I believe the claim that it's out of date is out of date. manpages> 3.0.1 has an update to this, according to a message I saw on this list> a month or so ago.>> Regardless, the fields you're reading should all be showing USER_HZ> which is fixed at 100 per second regardless of the underlying kernel> HZ parameter.>> Try it.>
Here's the latest proc(5) man page from June 25, 2008. Look for_SC_CLK_TCK about a third of the way down.
http://www.kernel.org/doc/man-pages/online/pages/man5/proc.5.htmlÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
next prev parent reply other threads:[~2008-08-06 22:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-06 20:48 Piotr Jaroszyński
2008-08-06 21:49 ` Ray Lee
2008-08-06 22:07 ` Piotr Jaroszyński
2008-08-06 22:16 ` Ray Lee
2008-08-06 22:20 ` Ray Lee [this message]
2008-08-06 22:20 ` Piotr Jaroszyński
2008-08-06 22:19 ` Sven Wegener
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2c0942db0808061520y50dd88fende33b8d9b9d575e5@mail.gmail.com \
--to=ray-lk@madrabbit.org \
--cc=linux-kernel@vger.kernel.org \
--cc=p.jaroszynski@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®