Re: implement CLOCK_VIRTUAL and CLOCK_PROF

2014-10-16 Thread Mark Kettenis
> From: "Todd C. Miller" > Date: Thu, 16 Oct 2014 07:33:23 -0600 > > On Wed, 15 Oct 2014 21:50:44 -0700, Philip Guenther wrote: > > > IMO we should just delete CLOCK_VIRTUAL from sys/_time.h and > > clock_gettime(2) > > Easy enough. ok kettenis@ > Index: sys/sys/_time.h > ===

Re: implement CLOCK_VIRTUAL and CLOCK_PROF

2014-10-16 Thread Stuart Henderson
On 2014/10/16 07:33, Todd C. Miller wrote: > On Wed, 15 Oct 2014 21:50:44 -0700, Philip Guenther wrote: > > > IMO we should just delete CLOCK_VIRTUAL from sys/_time.h and > > clock_gettime(2) > > Easy enough. ports should be pretty much OK with this, if there's any breakage it will be minor and

Re: implement CLOCK_VIRTUAL and CLOCK_PROF

2014-10-16 Thread Todd C. Miller
On Wed, 15 Oct 2014 21:50:44 -0700, Philip Guenther wrote: > IMO we should just delete CLOCK_VIRTUAL from sys/_time.h and clock_gettime(2) Easy enough. - todd Index: sys/sys/_time.h === RCS file: /home/cvs/openbsd/src/sys/sys/_tim

Re: implement CLOCK_VIRTUAL and CLOCK_PROF

2014-10-16 Thread Joerg Jung
> Am 16.10.2014 um 06:50 schrieb Philip Guenther : > > On Wed, Oct 15, 2014 at 2:08 PM, Todd C. Miller > wrote: >> On Wed, 15 Oct 2014 21:53:47 +0200, Alexandre Ratchov wrote: On Wed, Oct 15, 2014 at 11:37:26AM -0600, Todd C. Miller wrote: Since this came up in another thread. Trivial

Re: implement CLOCK_VIRTUAL and CLOCK_PROF

2014-10-15 Thread Philip Guenther
On Wed, Oct 15, 2014 at 2:08 PM, Todd C. Miller wrote: > On Wed, 15 Oct 2014 21:53:47 +0200, Alexandre Ratchov wrote: >> On Wed, Oct 15, 2014 at 11:37:26AM -0600, Todd C. Miller wrote: >> > Since this came up in another thread. Trivial implementations of >> > CLOCK_VIRTUAL and CLOCK_PROF, modeled

Re: implement CLOCK_VIRTUAL and CLOCK_PROF

2014-10-15 Thread Todd C. Miller
On Wed, 15 Oct 2014 21:53:47 +0200, Alexandre Ratchov wrote: > On Wed, Oct 15, 2014 at 11:37:26AM -0600, Todd C. Miller wrote: > > Since this came up in another thread. Trivial implementations of > > CLOCK_VIRTUAL and CLOCK_PROF, modeled after what FreeBSD does. > > > > out of curiousity, what

Re: implement CLOCK_VIRTUAL and CLOCK_PROF

2014-10-15 Thread Alexandre Ratchov
On Wed, Oct 15, 2014 at 11:37:26AM -0600, Todd C. Miller wrote: > Since this came up in another thread. Trivial implementations of > CLOCK_VIRTUAL and CLOCK_PROF, modeled after what FreeBSD does. > out of curiousity, what program needs these?

Re: implement CLOCK_VIRTUAL and CLOCK_PROF

2014-10-15 Thread Todd C. Miller
On Wed, 15 Oct 2014 21:04:43 +0200, Mark Kettenis wrote: > Oh, and while FreeBSD seems to implement CLOCK_VIRTUAL and CLOCK_PROF > as per-process, Solaris implements them as per-thread (but doesn't > document them). And on Solaris CLOCK_PROF is just an alias for > CLOCK_

Re: implement CLOCK_VIRTUAL and CLOCK_PROF

2014-10-15 Thread Todd C. Miller
On Wed, 15 Oct 2014 20:18:10 +0200, Mark Kettenis wrote: > Shouldn't this do a tuagg() on all the threads of the process like we > do for getrusage? Otherwise the CLOCK_VIRTUAL and CLOCK_PROF clocks > will only be updated upon a context switch. Probably. I wasn't 100% sure going the rusage rout

Re: implement CLOCK_VIRTUAL and CLOCK_PROF

2014-10-15 Thread Todd C. Miller
On Wed, 15 Oct 2014 20:36:33 +0200, Mark Kettenis wrote: > Hmm, looking at the FreeBSD man page... isn't CLOCK_PROF the same > thing as CLOCK_PROCESS_CPUTIME_ID? I was wondering that too, but I get different results as they are not calculated the same way. CLOCK_PROCESS_CPUTIME_ID always yields

Re: implement CLOCK_VIRTUAL and CLOCK_PROF

2014-10-15 Thread Mark Kettenis
he CLOCK_VIRTUAL and CLOCK_PROF clocks > > will only be updated upon a context switch. > > > > Also, you should add support for these to clock_getres(2). > > > > Oh, and documenting CLOCK_PROF in the man page would be good. > > Hmm, looking at the FreeBSD man page...

Re: implement CLOCK_VIRTUAL and CLOCK_PROF

2014-10-15 Thread Mark Kettenis
> Date: Wed, 15 Oct 2014 20:18:10 +0200 (CEST) > From: Mark Kettenis > > > From: "Todd C. Miller" > > Date: Wed, 15 Oct 2014 11:37:26 -0600 > > > > Since this came up in another thread. Trivial implementations of > > CLOCK_VIRTUAL and CLOCK_PROF, modeled after what FreeBSD does. > > Shouldn't

Re: implement CLOCK_VIRTUAL and CLOCK_PROF

2014-10-15 Thread Mark Kettenis
> From: "Todd C. Miller" > Date: Wed, 15 Oct 2014 11:37:26 -0600 > > Since this came up in another thread. Trivial implementations of > CLOCK_VIRTUAL and CLOCK_PROF, modeled after what FreeBSD does. Shouldn't this do a tuagg() on all the threads of the process like we do for getrusage? Otherwi

implement CLOCK_VIRTUAL and CLOCK_PROF

2014-10-15 Thread Todd C. Miller
Since this came up in another thread. Trivial implementations of CLOCK_VIRTUAL and CLOCK_PROF, modeled after what FreeBSD does. - todd Index: sys/sys/_time.h === RCS file: /home/cvs/openbsd/src/sys/sys/_time.h,v retrieving revision