Re: using sysprof under Ubuntu



On 10/26/2017 05:17 PM, Michael Gratton wrote:

I'm trying to use Sysprof to profile Geary under Ubuntu 17.10, but can't get any useful results out of it — the only function that ever shows up is "acpi_video_register". A typical call trace will look like:

[./geary]                        0.00% 8.99%
   acpi_video_register     Linux 8.99% 8.99%
     --kernel--                  0.00% 0.00%

That likely indicates that your program and the libraries it depends on are compiled without enough information to get relevant stack traces.

Generally, that means -fomit-frame-pointer was used (and is often the default on various distros).

When I'm working on GNOME software, I use the following flags in my JHBuild so that I can get good stack traces.

  os.environ['CFLAGS'] = '-fno-omit-frame-pointer -ggdb -O0'

Installing debuginfo packages can also help. There is the chance that our "try to find the .so's with debug info" code might need some improvement for how Debian does multi-arch (not sure, since I don't use it).

Regardless which app is selected or if it is launched via sysprof or is already running. The sysprof2 service is being launched when record is pressed after being prompted for my password, and neither sysprof nor sysprofd outputs any messages at all to the journal while running.

The docs suggest that I need to load a sysprof module into the kernel, but Ubuntu doesn't seem to ship one. Is the module still needed?

The kernel module is indeed old documentation. These days we use the perf feature of the Linux kernel to get stack trace information. That does present certain challenges, as the Linux kernel cannot do user-space stack unwinding.

A while back, there was a Debian bug where the Sysprof package was not properly bundling the helper daemon which is typically necessary. Since the __NR_perf_event_open syscall requires UID 0 in the configuration we often need, there is a daemon to do that for us (and pass an FD back to the UI process). Without it, you'd have to run the UI as root.

Perhaps the Ubuntu package has not received the fix that was in Debian.

-- Christian


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]