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.
This commit is contained in:
Matthias Clasen 2018-05-19 20:26:21 +01:00
parent 1660bac6bd
commit c541fa9555
2 changed files with 15 additions and 0 deletions

View File

@ -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)
{

View File

@ -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);