Runtime discrepancy clock_gettime + funcition instrumentation

Florian Weimer fweimer@redhat.com
Thu Jul 29 08:20:46 GMT 2021


* Christian Weiss:

> Dear Florian,
>
> Thank you for the quick reply. As far as I understand, I can check if vdso is used by using strace on the binary. Doing so I get:
>
> ```[cweiss@amd022 overhead]$ strace ./test_time_static_gcc.x 1 2>&1 | grep -i clock_gettime
> clock_gettime(CLOCK_MONOTONIC, {tv_sec=89045, tv_nsec=95268751}) = 0
> clock_gettime(CLOCK_MONOTONIC, {tv_sec=89145, tv_nsec=95813405}) = 0
> clock_gettime(CLOCK_MONOTONIC, {tv_sec=89145, tv_nsec=95863144}) = 0
> clock_gettime(CLOCK_MONOTONIC, {tv_sec=89145, tv_nsec=95933573}) = 0
> [cweiss@amd022 overhead]$ strace ./test_time_dyn_gcc.x 1 2>&1 | grep -i clock_gettime```
>
> Am I right that this implies that vdso is not used in the static
> binary, but in the dynamic one? Is there a way to activate it in the
> static case or do I just have to live with that?

Later glibc versions support vDSO in static binaries.  glibc 2.17 as
used by Red Hat Enterprise Linux 7 apparently does not.  (Your
observations match my recollections, but I haven't double-checked them.)

Thanks,
Florian



More information about the Libc-help mailing list