From 8ba604d9b3a0fe7be57ebd6460c69ff3af9d018e Mon Sep 17 00:00:00 2001 From: vsc Date: Tue, 17 Sep 2002 00:02:39 +0000 Subject: [PATCH] count profiling entries from meta-calls, even if that means a little more work. git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@593 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- C/exec.c | 6 ++++++ pl/profile.yap | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/C/exec.c b/C/exec.c index ffe14e57b..f74a78b63 100644 --- a/C/exec.c +++ b/C/exec.c @@ -53,7 +53,13 @@ CallPredicate(PredEntry *pen, choiceptr cut_pt) { #endif /* LOW_LEVEL_TRACE */ CP = P; P = (yamop *)(pen->CodeOfPred); + /* vsc: increment reduction counter at meta-call entry */ WRITE_UNLOCK(pen->PRWLock); + if (pen->PredFlags & ProfiledPredFlag) { + LOCK(pen->StatisticsForPred.lock); + pen->StatisticsForPred.NOfEntries++; + UNLOCK(pen->StatisticsForPred.lock); + } ENV = YENV; YENV = ASP; YENV[E_CB] = (CELL) cut_pt; diff --git a/pl/profile.yap b/pl/profile.yap index 4be13d002..1d8f4d289 100644 --- a/pl/profile.yap +++ b/pl/profile.yap @@ -17,7 +17,7 @@ :- meta_predicate profile_data(:,+,-). -profile_data(P, Parm, Data) :- P = M:D, !, +profile_data(M:D, Parm, Data) :- P = M:D, !, ( var(M) -> '$do_error'(instantiation_error,profile_data(M:D, Parm, Data))