It's a GtkFilter implementation that takes a marks catalog, and filters
frames based on whether the timestamps of the frames hit any mark in
the catalog.
Internally this uses an augmented RB tree based on sys/tree.h. The
augment is a timestamp interval. This tree is used to store the mark
intervals and perform the hit test.
This can probably be optimized / improved by building the tree on
demand but as is, this code seems to be able to handle dozens of
thousands of marks without any visible choke.
In map_head_and_body_twice(), the second mmap call fails:
mmap2(NULL, 135168, PROT_READ|PROT_WRITE, MAP_SHARED, 3, 0) = 0xf64a2000
mmap2(0xf64b3000, 65536, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_FIXED, 3, 0x1000) = -1 EINVAL (Invalid argument)
Due to cache issues, all shared mapping of a page must be equivalently
mapped. This requires page mappings to be at the same virtual address
modulo 4 MB. Due to a kernel limitation, all mappings to a file must
be equivalent.
The test can be fixed by rounding the buffer_size used in the mapped
ring buffer to 4 MB on hppa. This makes the two mmap mappings equivalent.
Bug-Debian: https://bugs.debian.org/1021853
This adds a property instead of the global to key off if the debuginfod
resolver should be used to bundle symbols into the capture at the
augmentation point post-capture.
This defaults to off because we do not want to auto-include them when
recording from the GTK UI (as we'd spend a bunch of time not showing a
window) but we do want to include them from sysprof-cli as that could
be running on a remote machine/container/vm with different debug URLs.
In the future, that could be improved with a different UI flow though.
Related: #130
This ensures that the document loader can apply settings from the recording
template (thusly applying future options such as debuginfod or extra debug
directories).
Related: #130
These are both available in other ways from the window. The close button
will quit the app if it's the last window. The Open File button at the
bottom handles Open and makes it more clear you can tweak things using the
profiler settings now.
Related: #130
This sets things up to save the state to disk if the greeter suceeded at
creating a profiler instance so that it may be used again on the next
run. Additionally, when loading the greeter it attempts to load from disk
the saved state.
We may want to extend this in the future to allow using sysprof-cli with
a recording template instead of command line options.