 --- a/tactics/tacinterp.ml
 +++ b/tactics/tacinterp.ml
 @@ -277,7 +277,7 @@ let lookup_genarg_subst  id = let (_,_,f) = lookup_genarg id in f
-
+ 
  let push_trace (loc,ck) = function
    | (n,loc',ck')::trl when ck=ck' -> (n+1,loc,ck)::trl
 -  | trl -> (1,loc,ck)::trl
 +  | trl -> Profile_ltac.entered_call(); (1,loc,ck)::trl
-
+ 
  let propagate_trace ist loc id = function
    | VFun (_,lfun,it,b) ->
 @@ -1793,7 +1793,9 @@ and eval_tactic ist = function
- 	  catch_error (push_trace(dloc,call)ist.trace)
- 	    (interp_atomic ist gl) t	in
- 	(* catch error in the evaluation *)
--	catch_error (push_trace(loc,call)ist.trace) tac gl
-+	let trace = push_trace(loc,call)ist.trace in
-+	Profile_ltac.do_profile "eval_tactic:2" trace (fun()->
-+	  catch_error trace tac gl)
+    catch_error (push_trace(dloc,call)ist.trace)
+      (interp_atomic ist gl) t  in
+  (* catch error in the evaluation *)
+- catch_error (push_trace(loc,call)ist.trace) tac gl
++ let trace = push_trace(loc,call)ist.trace in
++ Profile_ltac.do_profile "eval_tactic:2" trace (fun()->
++   catch_error trace tac gl)
    | TacFun _ | TacLetIn _ -> assert false
    | TacMatchGoal _ | TacMatch _ -> assert false
    | TacId s -> fun gl ->

+    (fun s node' -> add_node (get_node s node.children) node')
+    node'.children
+
+let time() =
+  let times = Unix.times() in
+  times.Unix.tms_utime +. times.Unix.tms_stime
+

@@ -109,6 +109,39 @@ let utf8_length s =
   done ;
   !cnt
 
+(* Variant of String.sub for UTF8 character positions *)
+let utf8_sub s start_u len_u =
+  let len_b = String.length s
+  and end_u = start_u + len_u   
+  and cnt = ref 0
+  and nc = ref 0
+  and p = ref 0 in
