Re: [PATCH] CPU time clock support in clock_* syscalls

From: Christoph Lameter
Date: Tue Oct 05 2004 - 15:56:54 EST


On Tue, 5 Oct 2004, Roland McGrath wrote:

> > I just reviewed the code and to my surprise the simple things like
> >
> > clock_gettime(CLOCK_PROCESS_CPUTIME_ID) and
> > clock_gettime(CLOCK_THREAD_CPUTIME_ID) are not supported.
>
> You seem to be confused. A clockid_t for a CPU clock encodes a PID, which
> can be zero to indicate the current thread or current process.

Is there a standard for that? Or is it an opaque type that you have
defined this way?

> > The thread specific time measurements have nothing to do with the posix
> > standard and may best be kept separate.
>
> Nonsense. POSIX defines the notion of CPU clocks for these calls, and that
> is what I have implemented.

Posix only defines a process and a thread clock. This is much more.

> Of course glibc is in charge of what the meaning of the POSIX APIs is.
> That is true for every call.

The proper information to realize these clocks is only available on the
kernel level. A clean API for that would remove lots of code that
currently exists in glibc.

I wonder how glibc will realize access to special timer hardware. Will
glibc be able load device drivers for timer chips?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/