summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2018-05-19 20:26:21 +0100
committerMatthias Clasen <mclasen@redhat.com>2019-05-07 09:37:59 -0700
commitc541fa955538b8485b6c9d36c982cc64669af8ce (patch)
tree7cfaa225f6133ad636ec9583b9ab7ba1fc5c205d
parent1660bac6bda835e8ec5eb46ed28eff4de48abad2 (diff)
downloadgtk+-c541fa955538b8485b6c9d36c982cc64669af8ce.tar.gz
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.
-rw-r--r--gsk/gskprofiler.c13
-rw-r--r--gsk/gskprofilerprivate.h2
2 files changed, 15 insertions, 0 deletions
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);