[sysprof] capture: add sysprof_collector_is_active()
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sysprof] capture: add sysprof_collector_is_active()
- Date: Wed, 19 Aug 2020 22:13:12 +0000 (UTC)
commit 361b29a4598556cb6db8fc7ca46618d70300b498
Author: Christian Hergert <chergert redhat com>
Date: Wed Aug 19 15:12:19 2020 -0700
capture: add sysprof_collector_is_active()
This can be used to check if a collector is actively running.
src/libsysprof-capture/sysprof-collector.c | 12 ++++++++++++
src/libsysprof-capture/sysprof-collector.h | 2 ++
2 files changed, 14 insertions(+)
---
diff --git a/src/libsysprof-capture/sysprof-collector.c b/src/libsysprof-capture/sysprof-collector.c
index 23a3c105..27794328 100644
--- a/src/libsysprof-capture/sysprof-collector.c
+++ b/src/libsysprof-capture/sysprof-collector.c
@@ -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;
+}
diff --git a/src/libsysprof-capture/sysprof-collector.h b/src/libsysprof-capture/sysprof-collector.h
index f989f08f..849ac628 100644
--- a/src/libsysprof-capture/sysprof-collector.h
+++ b/src/libsysprof-capture/sysprof-collector.h
@@ -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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]