libsysprof-profile: add malloc tracing instrument

This commit is contained in:
Christian Hergert
2023-06-06 16:30:38 -07:00
parent b0a3736ff4
commit 1e675e92e4
5 changed files with 123 additions and 4 deletions

View File

@ -143,6 +143,9 @@ main (int argc,
sysprof_profiler_add_instrument (profiler, sysprof_network_usage_new ());
sysprof_profiler_add_instrument (profiler, sysprof_sampler_new ());
if (memprof)
sysprof_profiler_add_instrument (profiler, sysprof_malloc_tracing_new ());
for (int i = 1; i < argc; i++)
{
if (strcmp (argv[i], "--") == 0 && i+1 < argc)
@ -152,11 +155,9 @@ main (int argc,
sysprof_spawnable_append_args (spawnable, (const char * const *)&argv[i+1]);
sysprof_profiler_set_spawnable (profiler, spawnable);
if (memprof)
sysprof_spawnable_add_ld_preload (spawnable,
PACKAGE_LIBDIR "/libsysprof-memory-" API_VERSION_S ".so");
trace_fd = sysprof_spawnable_add_trace_fd (spawnable, NULL);
break;
}
}