mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
libsysprof-profile: add augmentation phase to instruments
This allows an instrument to augment the capture with additional information before the capture is closed/flushed to storage.
This commit is contained in:
@ -256,6 +256,30 @@ _sysprof_instruments_record (GPtrArray *instruments,
|
||||
return dex_future_allv ((DexFuture **)futures->pdata, futures->len);
|
||||
}
|
||||
|
||||
DexFuture *
|
||||
_sysprof_instruments_augment (GPtrArray *instruments,
|
||||
SysprofRecording *recording)
|
||||
{
|
||||
g_autoptr(GPtrArray) futures = NULL;
|
||||
|
||||
g_return_val_if_fail (instruments != NULL, NULL);
|
||||
g_return_val_if_fail (SYSPROF_IS_RECORDING (recording), NULL);
|
||||
|
||||
futures = g_ptr_array_new_with_free_func (dex_unref);
|
||||
|
||||
for (guint i = 0; i < instruments->len; i++)
|
||||
{
|
||||
SysprofInstrument *instrument = g_ptr_array_index (instruments, i);
|
||||
|
||||
g_ptr_array_add (futures, _sysprof_instrument_augment (instrument, recording));
|
||||
}
|
||||
|
||||
if (futures->len == 0)
|
||||
return dex_future_new_for_boolean (TRUE);
|
||||
|
||||
return dex_future_allv ((DexFuture **)futures->pdata, futures->len);
|
||||
}
|
||||
|
||||
DexFuture *
|
||||
_sysprof_instruments_process_started (GPtrArray *instruments,
|
||||
SysprofRecording *recording,
|
||||
|
||||
Reference in New Issue
Block a user