This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/14438] clock_gettime CLOCK_THREAD_CPUTIME_ID doesn't delegate to vsyscall
- From: "siddhesh at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Sat, 27 Jul 2013 02:45:18 +0000
- Subject: [Bug libc/14438] clock_gettime CLOCK_THREAD_CPUTIME_ID doesn't delegate to vsyscall
- Auto-submitted: auto-generated
- References: <bug-14438-131 at http dot sourceware dot org/bugzilla/>
http://sourceware.org/bugzilla/show_bug.cgi?id=14438
--- Comment #5 from Siddhesh Poyarekar <siddhesh at redhat dot com> ---
It calls vdso_clock_gettime for all clockids. If vdso function has support for
some clockids but not others, for which it does a context switch into the
kernel.
sysdeps/unix/clock_gettime.c:
...
default:
#ifdef SYSDEP_GETTIME_CPU
SYSDEP_GETTIME_CPU (clock_id, tp);
#endif
...
sysdeps/unix/sysv/linux/clock_gettime.c
...
#define SYSDEP_GETTIME_CPU(clock_id, tp) \
retval = SYSCALL_GETTIME (clock_id, tp); \
break
...
sysdeps/unix/sysv/linux/x86_64/clock_gettime.c
...
# define SYSCALL_GETTIME(id, tp) \
({ long int (*f) (clockid_t, struct timespec *) = __vdso_clock_gettime; \
long int v_ret; \
PTR_DEMANGLE (f); \
v_ret = f (id, tp); \
if (INTERNAL_SYSCALL_ERROR_P (v_ret, )) { \
__set_errno (INTERNAL_SYSCALL_ERRNO (v_ret, )); \
v_ret = -1; \
} \
v_ret; })
...
--
You are receiving this mail because:
You are on the CC list for the bug.