[gtk/tracing: 1332/1335] gsk: Add some more profiler apis
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/tracing: 1332/1335] gsk: Add some more profiler apis
- Date: Wed, 6 Feb 2019 14:18:51 +0000 (UTC)
commit 1bfa4743e4417c1202c356a1930a84672da32a4b
Author: Matthias Clasen <mclasen redhat com>
Date: Sat May 19 20:26:21 2018 +0100
gsk: Add some more profiler apis
Add a way to extract the start time of timers.
This will let us reuse the profiler timers for tracing.
gsk/gskprofiler.c | 13 +++++++++++++
gsk/gskprofilerprivate.h | 2 ++
2 files changed, 15 insertions(+)
---
diff --git a/gsk/gskprofiler.c b/gsk/gskprofiler.c
index 253a0b6282..a18362a6c8 100644
--- a/gsk/gskprofiler.c
+++ b/gsk/gskprofiler.c
@@ -365,6 +365,19 @@ gsk_profiler_timer_get (GskProfiler *profiler,
return timer->value;
}
+gint64
+gsk_profiler_timer_get_start (GskProfiler *profiler,
+ GQuark timer_id)
+{
+ NamedTimer *timer;
+
+ timer = gsk_profiler_get_timer (profiler, timer_id);
+ if (timer == NULL)
+ return 0;
+
+ return timer->start_time;
+}
+
void
gsk_profiler_reset (GskProfiler *profiler)
{
diff --git a/gsk/gskprofilerprivate.h b/gsk/gskprofilerprivate.h
index ca0f44518b..ff71d4c947 100644
--- a/gsk/gskprofilerprivate.h
+++ b/gsk/gskprofilerprivate.h
@@ -40,6 +40,8 @@ gint64 gsk_profiler_counter_get (GskProfiler *profiler,
GQuark counter_id);
gint64 gsk_profiler_timer_get (GskProfiler *profiler,
GQuark timer_id);
+gint64 gsk_profiler_timer_get_start (GskProfiler *profiler,
+ GQuark timer_id);
void gsk_profiler_reset (GskProfiler *profiler);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]