This has an indirect object (SysprofCallgraphSymbol) so that we can provide
plumbing to get the callgraph as well as the augmented data from the
indirection object.
This allows for callgraphs to show overview in the functions list which
contains the same augmentation that the descendants view does.
This interjects a node for unwindable traces so that cost gets accounted
to the process, but is not just at the [process] graph item as that makes
it very hard to subtract to figure out what it was.
Instead just insert an [Unwindable] node and cost-account to that.
This allows us to have augmentation at the summary level so that things
like the weighted callgraph or memprof callgraph can add their respective
summary data up the chain of function calls.
We still need to figure out the right way to plumb in the augmentation data
so that things that need to walk up the chain are possible, but this first
gets things in order to do that.
If we are trying to get the file bytes and they are compressed, we may need
to transparently decompress those bytes. That way if the API requested
"/proc/cpuinfo" but really got "/proc/cpuinfo.gz" it still gets the same
bytes to consume.
If we want /proc/kallsyms and we discover /proc/kallsyms.gz, then use the
/proc/kallsyms.gz instead and transparently decompress it. Also, list the
file in sysprof_document_list_files() as /proc/kallsyms instead of
/proc/kallsyms.gz as that is really the intention (but mark the compressed
bit for decoding the chunks).
I want to move a bunch of this "contrib" style sources into their own
area so we can statically link them but keep them separate from main
sysprof code.
We need to do what binfile was doing and make the address relative to the
text_offset. We also need to ignore the text offset of the debuglink files
and pass it the text_offset of the original ELF.
This fixes a bunch of symbolization in the callgraph.
If our entire stack was in kernel address context, inject the
"- - Kernel - -" symbol at the top of the stack trace so that accounting
gets properly assigned to the kernel. This is typical with kernel processes
such as kworker.
We may need to know the final address context so we can inject symbols as
necessary into the top of the callgraph. We know it when generating the
symbols, so just yield it to the caller too.
This creates a SysprofCallgraph object which is a GListModel of
SysprofCallgraphFrame. The SysprofCallgraphFrame is also a GListModel of
SysprofCallgraphFrame so that we can map this all into a GtkListView in
the future for tree-like visibility.
The augmentation allows for the same callgraph code to be used for multiple
scenarios such as CPU sampling as well as memory allocation tracking.
If your augmentation size is <=sizeof(void*) then you do not occur an extra
allocation and you can use the inline augmentation space.
The test-callgraph clearly shows that we still need to do the shuffling
of -- Kernel -- and -- User -- like the old callgraph code did. But that
will come soon enough.
And include a fallback in case we never got an actual Process frame which
will contain the cmdline for the process. We need to hold onto the fallback
too so that we can keep symbols lightweight by not having to reference them
so long as the document is alive.
This allows us to avoid the function call overhead for each of the
instruction pointers in the stack trace. Instead let the interface handle
the decoding of the whole set.
If we have a build-id, we might find it in a path like the following:
/usr/lib/debug/.build-id/aa/aa123456789012345678901234567890
so do that lookup before we try to resolve the debuglink name.
In modern podman, we will get lowerdir= and upperdir= in the superblock
options which we can parse to find where things are on the host. Use that
instead of relying on overlay mounts.
Additionally, if we're on a subvolume, and that subvolume matches the
prefix of the root, then skip past that. I have no idea if this is the
right thing to do, but it's what we were doing before and seems to be
able to help us get proper path resolving on Silverblue.
I highly doubt this is foolproof, but this makes Silverblue more likely to
resolve the proper fstab entry when translating to paths we can access
from the host system.