* Dwfl and statistics table for multiple processes *
****************************************************/
+Dwfl_Process_Tracker *tracker = NULL;
+
/* This echoes lib/dynamicsizehash.* with some necessary modifications. */
typedef struct
{
static const Dwfl_Callbacks sample_callbacks =
{
- .find_elf = dwfl_linux_proc_find_elf,
+ .find_elf = dwfl_process_tracker_find_elf,
.find_debuginfo = dwfl_standard_find_debuginfo,
.debuginfo_path = &debuginfo_path,
};
static const Dwfl_Callbacks sample_callbacks =
{
- .find_elf = dwfl_linux_proc_find_elf,
+ .find_elf = dwfl_process_tracker_find_elf,
.find_debuginfo = nop_find_debuginfo, /* work with CFI only */
};
cached = true;
goto reuse;
}
- dwfl = dwfl_begin (&sample_callbacks);
+ dwfl = dwfl_begin_with_tracker (tracker);
int err = dwfl_linux_proc_report (dwfl, pid);
if (err < 0)
(void)maxframes;
#else
fprintf(stderr, "\n=== starting eu-stacktrace ===\n");
+ tracker = dwfl_process_tracker_begin (&sample_callbacks);
/* TODO: For now, code the processing loop for sysprof only; generalize later. */
assert (input_format == FORMAT_SYSPROF);
if (output_fd != -1)
close (output_fd);
+ dwfl_process_tracker_end (tracker);
+
return EXIT_OK;
}