[slang-users] Re: Bug in profiler.sl
John E. Davis
davis at space.mit.edu
Fri Jun 22 17:47:14 EDT 2007
=?UTF-8?Q?J=C3=B6rg?= Sommer <joerg at alea.gnuu.de> wrote:
>Yes, it works, but I can't use nonâfunction profiling aka. statement
>profiling anymore.
You can, but you did not enable the hooks to generate line by line
stats:
>% cat prof-x.sl
>require ("profile");
>
>profile_calibrate ();
>
>profile_on(0);
By using 0 as an argument, you are telling the code generator not to
generate code to call the line by line hooks. Use
profile_on (1);
to generate the code.
>define bar() {
> () = 12 + 4;
> () = 27 / 3;
>}
>define foo() {
> loop (10)
> bar();
>}
>profile_off();
>
>profile_begin ();
With no arguments, which is equivalent to profile_begin(0), you are
telling the profiler not to add line-by-line hooks. If you want those
hooks established, then use
profile_begin (1);
--John
More information about the slang-users-l
mailing list