lttng.ust: Improve debug-info binary tracking
This patch improves the tracking of binary loading/unloading using the
LTTng statedump and dl events.
It changes the layout of the attributes in the state system to be this:
Key Value
/vpid -
/vpid/<baddr> <active>, 1 if active, null otherwise
/vpid/<baddr>/build_id <buildid>, e.g. "
0123456789abcdef"
/vpid/<baddr>/debug_link <debug_link>, e.g. "/usr/lib/libhello.so.debug"
/vpid/<baddr>/memsz <memsz>, e.g.
2127280
/vpid/<baddr>/path <path>, e.g. "/usr/lib/libhello.so"
/vpid/<baddr>/is_pic <is_pic>, 1 or 0
which is organized a bit more logically than the current approach.
Currently, the code expects the binaries to have a build id. If this is
not the case for a particular binary, it will stay forever in the map of
pending binaries. This patch checks the has_build_id to know whether or
not we should wait for such a corresponding build_id event. While at
it, we do the same for debug link and propagate its value (although
nothing useful is done with it currently).
The "statedump start" event is now handled, which is required to
invalidate all the mappings for a certain vpid.
More tests are added, using the new synthetically generated traces from
CtfTestTrace.
Change-Id: I48c9de963129040dbd90ea492fe58eba441b28f3
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Signed-off-by: Alexandre Montplaisir <alexmonthy@efficios.com>
Reviewed-on: https://git.eclipse.org/r/73639
Reviewed-by: Hudson CI
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>