Skip to content
Snippets Groups Projects
Commit 0f28389c authored by Ben Gamari's avatar Ben Gamari
Browse files

rts/Stats: Reintroduce mut_user_time

Fix the previous backport; this function was dead code in master but is
still needed due to ProfHeap.c in ghc-8.10.
parent 9ad6e1f1
No related branches found
No related tags found
No related merge requests found
......@@ -86,6 +86,27 @@ Time stat_getElapsedTime(void)
Measure the current MUT time, for profiling
------------------------------------------------------------------------ */
static double
mut_user_time_until( Time t )
{
ACQUIRE_LOCK(&stats_mutex);
double ret = TimeToSecondsDbl(t - stats.gc_cpu_ns - stats.nonmoving_gc_cpu_ns);
RELEASE_LOCK(&stats_mutex);
return ret;
// heapCensus() time is included in GC_tot_cpu, so we don't need
// to subtract it here.
// TODO: This seems wrong to me. Surely we should be subtracting
// (at least) start_init_cpu?
}
double
mut_user_time( void )
{
Time cpu = getProcessCPUTime();
return mut_user_time_until(cpu);
}
#if defined(PROFILING)
/*
mut_user_time_during_RP() returns the MUT time during retainer profiling.
......
......@@ -66,6 +66,8 @@ void initStats0(void);
void initStats1(void);
void resetChildProcessStats(void);
double mut_user_time(void);
void statDescribeGens( void );
Time stat_getElapsedGCTime(void);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment