Re: [PATCH resend] Reading POSIX CPU timer from outside the process.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Oleg Nesterov
Date: Wednesday, December 29, 2010 - 6:21 am

On 12/28, Dario Faggioli wrote:

No, please note pid_of_sub_thread above.


I think we should change glibc if clock_getcpuclockid() doesn't work,
please see below.


I guess, this is because glibc passes MAKE_PROCESS_CLOCK() id, right?
But we shouldn't add the hacks to the kernel to hide the limitations
in glibc.


Yes, please.


BTW. What is the test-case? I am looking at http://gitorious.org/clockid,
I guess it is clockid.c...

You do not need clock_getcpuclockid() at all. In fact I do not really
understand what this helper should actually do, probably it is only
needed to validate the pid. You can simply use MAKE_THREAD_CPUCLOCK()
to sample a single thread via clock_gettime().

IOW. Unless I missed something, with this patch, the only problem
is that getcpuclockid() always assumes MAKE_PROCESS_CPUCLOCK(),
I do not think this is the kernel problem.

Oleg.

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Read THREAD_CPUTIME clock from other processes., Dario Faggioli, (Thu Dec 23, 9:21 am)
Re: [PATCH] Read THREAD_CPUTIME clock from other processes., Dario Faggioli, (Thu Dec 23, 10:38 am)
Re: [PATCH] Read THREAD_CPUTIME clock from other processes., Dario Faggioli, (Thu Dec 23, 10:43 am)
Re: [PATCH resend] Reading POSIX CPU timer from outside th ..., Oleg Nesterov, (Wed Dec 29, 6:21 am)