mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
libsysprof-analyze: add basic symbolize API
This isn't what it will look like in final form, just get the minimum there for us to use it with the bundled decoder (copied from libsysprof with adaptations).
This commit is contained in:
@ -83,11 +83,16 @@ sysprof_document_symbols_add_traceable (SysprofDocumentSymbols *self,
|
||||
SysprofAddressContext last_context;
|
||||
guint64 *addresses;
|
||||
guint n_addresses;
|
||||
gint64 time;
|
||||
int pid;
|
||||
|
||||
g_assert (SYSPROF_IS_DOCUMENT_SYMBOLS (self));
|
||||
g_assert (SYSPROF_IS_DOCUMENT_TRACEABLE (traceable));
|
||||
g_assert (SYSPROF_IS_SYMBOLIZER (symbolizer));
|
||||
|
||||
time = sysprof_document_frame_get_time (SYSPROF_DOCUMENT_FRAME (traceable));
|
||||
pid = sysprof_document_frame_get_pid (SYSPROF_DOCUMENT_FRAME (traceable));
|
||||
|
||||
/* TODO: We need to get the SysprofMountNamespace for the PID which must have
|
||||
* already been compiled. We also need the list SysprofDocumentMmap so that we
|
||||
* can get the build-id or inode to do various validation checks.
|
||||
@ -119,6 +124,13 @@ sysprof_document_symbols_add_traceable (SysprofDocumentSymbols *self,
|
||||
}
|
||||
else
|
||||
{
|
||||
g_autoptr(SysprofSymbol) symbol = _sysprof_symbolizer_symbolize (symbolizer, time, pid, address);
|
||||
|
||||
/* TODO: This isn't the API we'll use for symbolizing, it just gets
|
||||
* some plumbing in place. Additionally, we'll probably cache all these
|
||||
* values here so that we can skip calling the symbolizer at all for
|
||||
* subsequent symbols within a given range.
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user