[Bug 1908307] Re: Please ship a glibc build for profiling in libc6-prof

Balint Reczey 1908307 at bugs.launchpad.net
Mon Jan 25 18:56:48 UTC 2021


Verified 2.31-0ubuntu9.2 on Focal

ubuntu at ff-glibc-prof:~$   env LD_LIBRARY_PATH=/lib/libc6-prof/x86_64-linux-gnu sleep 1
ubuntu at ff-glibc-prof:~$ sleep 1
ubuntu at ff-glibc-prof:~$ dpkg -l libc6-prof
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name             Version         Architecture Description
+++-================-===============-============-=================================
ii  libc6-prof:amd64 2.31-0ubuntu9.2 amd64        GNU C Library: Shared Libraries

---
ubuntu at ff-glibc-prof:~$ sudo bpftrace -e 't:syscalls:sys_enter_clock_nanosleep /comm == "sleep"/ {printf("%s\n", ustack);}'
Attaching 1 probe...

        clock_nanosleep+94
        __nanosleep+23
        0x555f51fbd827

^C

ubuntu at ff-glibc-prof:~$ sudo bpftrace -e 't:syscalls:sys_enter_clock_nanosleep /comm == "sleep"/ {printf("%s\n", ustack);}'
Attaching 1 probe...

        clock_nanosleep+84

^C

ubuntu at ff-glibc-prof:~$


** Tags removed: verification-needed-focal
** Tags added: verification-done-focal

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to glibc in Ubuntu.
https://bugs.launchpad.net/bugs/1908307

Title:
  Please ship a glibc build for profiling in libc6-prof

Status in glibc package in Ubuntu:
  Fix Committed
Status in glibc source package in Focal:
  Fix Committed
Status in glibc source package in Groovy:
  Fix Committed

Bug description:
  [Impact]

  * The C library shipped in libc6 is built with GCC's default behavior
  of omitting the frame pointer that makes tracing and profiling harder.
  Building GLibc with -fno-omit-frame-pointer and shipping it in an
  optional libc6-prof binary package would help tracing and profiling
  efforts.

  [Test Case]

  * Install libc6-prof and start tracing in one shell:

    sudo bpftrace -e 't:syscalls:sys_enter_clock_nanosleep /comm == "sleep"/ {printf("%s\n", ustack);}'
    Attaching 1 probe...

          clock_nanosleep+94
          __nanosleep+23
          0x5652a2e6b827

  * Run the traced program in a different shell
   env LD_LIBRARY_PATH=/lib/libc6-prof/x86_64-linux-gnu sleep 1

  
  * Repeat it without using the libc6-prof library:


   ubuntu at ff-glibc:~$ sleep 1

   ubuntu at ff-glibc:~$ sudo bpftrace -e 't:syscalls:sys_enter_clock_nanosleep /comm == "sleep"/ {printf("%s\n", ustack); }'
   Attaching 1 probe...

          clock_nanosleep+84

  [ Where problems could occur ]

  * Glibc does not build for some architectures with the additional -fno-omit-frame-pointer option which is tracked in LP: #1898049.
  * The -fno-omit-frame-pointer option may sneak in to the regular build, this is convered in the test case.
  * Libc6-prof may be slower thanks to the -fno-omit-frame-pointer option, this is expected and this is the reason for shipping it in a separate package.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1908307/+subscriptions



More information about the foundations-bugs mailing list