mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
libsysprof: avoid kallsyms in capture file
The kallsyms is huge (like 12Mb) and we want to avoid adding anything we don't need. Instead, we can rely on the symbols source to decode the symbols immediately and add them to supplemental.
This commit is contained in:
@ -51,7 +51,6 @@ struct _SysprofProcSource
|
||||
GObject parent_instance;
|
||||
SysprofCaptureWriter *writer;
|
||||
GArray *pids;
|
||||
gint kallsyms_fd;
|
||||
};
|
||||
|
||||
static void source_iface_init (SysprofSourceInterface *iface);
|
||||
@ -407,7 +406,6 @@ sysprof_proc_source_get_process_info_cb (GObject *object,
|
||||
g_assert (SYSPROF_IS_HELPERS (helpers));
|
||||
g_assert (G_IS_ASYNC_RESULT (result));
|
||||
g_assert (SYSPROF_IS_PROC_SOURCE (self));
|
||||
g_assert (self->kallsyms_fd == -1);
|
||||
|
||||
if (!sysprof_helpers_get_process_info_finish (helpers, result, &info, &error))
|
||||
{
|
||||
@ -416,14 +414,6 @@ sysprof_proc_source_get_process_info_cb (GObject *object,
|
||||
}
|
||||
|
||||
sysprof_proc_source_populate (self, info);
|
||||
|
||||
/* TODO: Make this optional? */
|
||||
sysprof_helpers_get_proc_fd (helpers,
|
||||
"/proc/kallsyms",
|
||||
NULL,
|
||||
&self->kallsyms_fd,
|
||||
NULL);
|
||||
|
||||
sysprof_source_emit_finished (SYSPROF_SOURCE (self));
|
||||
}
|
||||
|
||||
@ -450,21 +440,6 @@ sysprof_proc_source_stop (SysprofSource *source)
|
||||
|
||||
g_assert (SYSPROF_IS_PROC_SOURCE (self));
|
||||
|
||||
/* We opened kallsyms when starting the capture, now read it and
|
||||
* save it to the end of the file.
|
||||
*/
|
||||
if (self->kallsyms_fd != -1)
|
||||
{
|
||||
sysprof_capture_writer_add_file_fd (self->writer,
|
||||
SYSPROF_CAPTURE_CURRENT_TIME,
|
||||
-1,
|
||||
-1,
|
||||
"/proc/kallsyms",
|
||||
self->kallsyms_fd);
|
||||
close (self->kallsyms_fd);
|
||||
self->kallsyms_fd = -1;
|
||||
}
|
||||
|
||||
g_clear_pointer (&self->writer, sysprof_capture_writer_unref);
|
||||
}
|
||||
|
||||
@ -515,12 +490,6 @@ sysprof_proc_source_finalize (GObject *object)
|
||||
{
|
||||
SysprofProcSource *self = (SysprofProcSource *)object;
|
||||
|
||||
if (self->kallsyms_fd != -1)
|
||||
{
|
||||
close (self->kallsyms_fd);
|
||||
self->kallsyms_fd = -1;
|
||||
}
|
||||
|
||||
g_clear_pointer (&self->writer, sysprof_capture_writer_unref);
|
||||
g_clear_pointer (&self->pids, g_array_unref);
|
||||
|
||||
@ -539,7 +508,6 @@ static void
|
||||
sysprof_proc_source_init (SysprofProcSource *self)
|
||||
{
|
||||
self->pids = g_array_new (FALSE, FALSE, sizeof (GPid));
|
||||
self->kallsyms_fd = -1;
|
||||
}
|
||||
|
||||
SysprofSource *
|
||||
|
||||
Reference in New Issue
Block a user