This ensures that we only have one thread doing reloads of stack frame depths at a time. While we only ref the reader in the state, it should still be fine because cursors *always* make a copy of the reader for their internal use. I don't think this should fix #23, but it may reduce the chances of it happening. It's unclear to me what could cause #23 to happen, unless for some reason multiple threads were sharing the reader's internal buffer causing the frame-> dereferences to be junk. But as stated with reader copies, that should not be able to happen. Another possible avenue is that the task is cancelled and for some reason the task is clearing the task data while the thread is running. Again, that is not supposed to be possible given the design of GTask as it should not release task data until finalized.
Sysprof is a sampling profiler that uses a kernel module to generate stacktraces which are then interpreted by the userspace program "sysprof".
See the Sysprof homepage for more information.
Questions, patches and bug reports should be sent to the sysprof mailing list sysprof-list@gnome.org.
The list is archived in https://mail.gnome.org/archives/sysprof-list/.
Debugging symbols
The programs and libraries you want to profile should be compiled
with -fno-omit-frame-pointer and have debugging symbols available,
or you won't get much usable information.
Building Sysprof
You need some packages installed. The package names may vary depending on your distribution, the following command works on Fedora 25:
sudo dnf install gcc gcc-c++ ninja-build gtk3-devel
Then do the following:
meson --prefix=/usr build
cd build
ninja
sudo ninja install
WARNING: ninja install will mostly install under the configured install
prefix but installs systemd service configuration directly in the system
default location /usr/lib/systemd so it won't work without root privileges,
even if the install prefix is a user-owned directory.