slang-users mailing list

[2007 Date Index] [2007 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: [slang-users] Re: Bug in profiler.sl


=?UTF-8?Q?J=C3=B6rg?= Sommer <joerg@xxxxxxxxxxxx> 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



[2007 date index] [2007 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]