Question: Profiling with sub-procedures

Hi!

 

Is there a way to use the profiling function for procedures within a procedure? I have this code as an example:

Test:=proc(a,b)::real;

local c;Ergebnis;

Test2:= proc(d,e) #Prozedur zum Schreiben der Ausgaben

    f:=d+e;
    g:=f*d;
    5+3;
    3/0;
end proc:
 c:=a+b;
 Ergebnis:=Test2(a,c)
 end proc:

infolevel[Test]:= 2:
CodeTools:-Profiling:-Profile(Test):
Test(3,4);
CodeTools:-Profiling:-PrintProfiles(Test);

just profiling Test2, the subprocedure, doesn't do anything. Obviously, in this example, the division by zero is the problem, however, I am interested in a general solution to detect more complicated problems within a sub-procedure. Is there a way to also profile it, and thus see where the computation stops?

Please Wait...