capture: add sysprof_collector_is_active()

This can be used to check if a collector is actively running.
This commit is contained in:
Christian Hergert
2020-08-19 15:12:19 -07:00
parent 61be0a0455
commit 361b29a459
2 changed files with 14 additions and 0 deletions

View File

@ -863,3 +863,15 @@ sysprof_collector_request_counter (unsigned int n_counters)
return ret;
}
bool
sysprof_collector_is_active (void)
{
bool ret = false;
COLLECTOR_BEGIN {
ret = true;
} COLLECTOR_END;
return ret;
}

View File

@ -65,6 +65,8 @@ SYSPROF_BEGIN_DECLS
SYSPROF_AVAILABLE_IN_3_36
void sysprof_collector_init (void);
SYSPROF_AVAILABLE_IN_3_38
bool sysprof_collector_is_active (void);
SYSPROF_AVAILABLE_IN_3_36
void sysprof_collector_allocate (SysprofCaptureAddress alloc_addr,
int64_t alloc_size,