patches to Ricardo Lopes' low level profiler: enable if SIGPROF is

there, do sorting, init PROFPREDS when you start counters, keep time
stamps for eventual assert/retract, and use qsort (3) to do less work.


git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@829 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc
2003-05-20 19:11:59 +00:00
parent d22fe2107c
commit 0afb07931f
14 changed files with 2736 additions and 1655 deletions

View File

@@ -100,7 +100,7 @@ STATIC_PROTO(void a_fetch_vc, (void));
STATIC_PROTO(void a_f2, (int));
#ifdef LOW_PROF
int PROFSIZE;
yamop *prof_end;
#endif
#define CELLSIZE sizeof(CELL)
@@ -2546,7 +2546,7 @@ Yap_assemble(int mode)
entry_code = do_pass();
YAPLeaveCriticalSection();
#ifdef LOW_PROF
PROFSIZE=code_p;
Yap_prof_end=code_p;
#endif
return entry_code;
}
@@ -2590,4 +2590,7 @@ Yap_InitComma(void)
code_p->opc = opcode(_p_execute_tail);
GONEXT(e);
}
#ifdef LOW_PROF
Yap_inform_profiler_of_clause(COMMA_CODE, code_p, RepPredProp(Yap_GetPredPropByFunc(FunctorComma,2)));
#endif
}