* Jiffies from userspace
@ 2002-02-01 20:33 Jim
2002-02-01 20:58 ` Eli Carter
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Jim @ 2002-02-01 20:33 UTC (permalink / raw)
To: linux-kernel
Sorry if this question seems stupid, but would this be a
reasonable way to get an estimate of the "current" value of the
kernel's jiffies:
set -- `cat /proc/self/stat`; echo ${22}
... my reasoning:
The cat will start a new process, field 22? of its "stat" node
under proc should have the jiffies value at the time the process
was started; so the echo command execute "shortly" thereafter.
But am I right about the struct of stat: Is that really in ${22}?
(I'm not actually planning on using this technique, it's just a
curiosity. The only practical use I can see for it might be for
doing a sanity check on gettime; checking this for an increasing
value has a hedge against settime discontinuities).
knfsd: follow symlinks?
Also, an unrelated question: is there a way to get the knfsd to
resolve symlinks on the server side? (Basically to configure it
such that it doesn't present symlinks on the underlying fs as
symlinks to the client --- but rather it internally follows them,
and presents the target link/inode data to network clients). ISTR
that the older user nfsd used to have some option like that.
(I realize this second question would be better posed as a separate
message; oh well).
--
Jim Dennis
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Jiffies from userspace
2002-02-01 20:33 Jiffies from userspace Jim
@ 2002-02-01 20:58 ` Eli Carter
2002-02-01 21:01 ` Mark Zealey
2002-02-02 15:21 ` Athanasius
2 siblings, 0 replies; 4+ messages in thread
From: Eli Carter @ 2002-02-01 20:58 UTC (permalink / raw)
To: Jim; +Cc: linux-kernel
Jim wrote:
>
> Sorry if this question seems stupid, but would this be a
> reasonable way to get an estimate of the "current" value of the
> kernel's jiffies:
>
> set -- `cat /proc/self/stat`; echo ${22}
>
> ... my reasoning:
>
> The cat will start a new process, field 22? of its "stat" node
> under proc should have the jiffies value at the time the process
> was started; so the echo command execute "shortly" thereafter.
>
> But am I right about the struct of stat: Is that really in ${22}?
>
> (I'm not actually planning on using this technique, it's just a
> curiosity. The only practical use I can see for it might be for
> doing a sanity check on gettime; checking this for an increasing
> value has a hedge against settime discontinuities).
'cat /proc/uptime' might be more what you want...
Eli
--------------------. Real Users find the one combination of bizarre
Eli Carter \ input values that shuts down the system for days.
eli.carter(a)inet.com `-------------------------------------------------
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Jiffies from userspace
2002-02-01 20:33 Jiffies from userspace Jim
2002-02-01 20:58 ` Eli Carter
@ 2002-02-01 21:01 ` Mark Zealey
2002-02-02 15:21 ` Athanasius
2 siblings, 0 replies; 4+ messages in thread
From: Mark Zealey @ 2002-02-01 21:01 UTC (permalink / raw)
To: linux-kernel
On Fri, Feb 01, 2002 at 12:33:21PM -0800, Jim wrote:
>
> Sorry if this question seems stupid, but would this be a
> reasonable way to get an estimate of the "current" value of the
> kernel's jiffies:
>
> set -- `cat /proc/self/stat`; echo ${22}
>
> ... my reasoning:
>
> The cat will start a new process, field 22? of its "stat" node
> under proc should have the jiffies value at the time the process
> was started; so the echo command execute "shortly" thereafter.
Maybe, another idea would be to look at /proc/interrupts, on the timer one
(IRQ0)...
--
Mark Zealey
mark@zealos.org
mark@itsolve.co.uk
UL++++>$ G!>(GCM/GCS/GS/GM) dpu? s:-@ a16! C++++>$ P++++>+++++$ L+++>+++++$
!E---? W+++>$ N- !o? !w--- O? !M? !V? !PS !PE--@ PGP+? r++ !t---?@ !X---?
!R- b+ !tv b+ DI+ D+? G+++ e>+++++ !h++* r!-- y--
(www.geekcode.com)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Jiffies from userspace
2002-02-01 20:33 Jiffies from userspace Jim
2002-02-01 20:58 ` Eli Carter
2002-02-01 21:01 ` Mark Zealey
@ 2002-02-02 15:21 ` Athanasius
2 siblings, 0 replies; 4+ messages in thread
From: Athanasius @ 2002-02-02 15:21 UTC (permalink / raw)
To: Jim; +Cc: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 848 bytes --]
On Fri, Feb 01, 2002 at 12:33:21PM -0800, Jim wrote:
> reasonable way to get an estimate of the "current" value of the
> kernel's jiffies:
>
> set -- `cat /proc/self/stat`; echo ${22}
>
> The cat will start a new process, field 22? of its "stat" node
> under proc should have the jiffies value at the time the process
> was started; so the echo command execute "shortly" thereafter.
>
> But am I right about the struct of stat: Is that really in ${22}?
Assuming so try:
awk '{print $22}' /proc/self/stat
for a 'single process' version.
-Ath
--
- Athanasius = Athanasius(at)gurus.tf / http://www.clan-lovely.org/~athan/
Finger athan(at)fysh.org for PGP key
"And it's me who is my enemy. Me who beats me up.
Me who makes the monsters. Me who strips my confidence." Paula Cole - ME
[-- Attachment #2: Type: application/pgp-signature, Size: 240 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2002-02-02 15:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-01 20:33 Jiffies from userspace Jim
2002-02-01 20:58 ` Eli Carter
2002-02-01 21:01 ` Mark Zealey
2002-02-02 15:21 ` Athanasius
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox