* Bug #12087 fixed - profile help page did not mention add_profiling. 40/9840/3
Iai Masafumi ax [Wed, 28 Nov 2012 16:05:22 +0000 (17:05 +0100)]
Change-Id: I0112195e9f93c1fbb59521c7fff939eef4a4d3bc

scilab/CHANGES_5.4.X
scilab/modules/functions/help/en_US/profiling/profile.xml

index 0feda8a..991309c 100644 (file)
@@ -126,9 +126,11 @@ Bug fixes
 
 * Bug #12077 fixed - In help, attribute bgcolor was not handled in tables.
 
+* Bug #12087 fixed - profile help page did not mention add_profiling.
+
 * Bug #12115 fixed - phaseplot(frq,db,phi) did not work.
 
-* Bug #12119 fixed - bar and barh had wrong x/y bounds
+* Bug #12119 fixed - bar and barh had wrong x/y bounds.
 
 
                     Changes between version 5.3.3 and 5.4.0
index da4671f..f700abe 100644 (file)
@@ -39,8 +39,8 @@
     <refsection>
         <title>Description</title>
         <para>
-            To use <literal>profile</literal> the Scilab function must have been prepared for
-            profiling (see exec).
+            To use <literal>profile</literal>, profiling instructions need to be added to the Scilab function
+            function by <link linkend="add_profiling">add_profiling</link>.
         </para>
         <para>
             For such function, When such a function is executed the systems counts
     </refsection>
     <refsection>
         <title>Examples</title>
-        <programlisting role="example"><![CDATA[ 
-//define function and prepare it for profiling
-deff('x=foo(n)',['if n==0 then'
-                 '  x=[]'
-                 'else'
-                 '  x=0'
-                 '  for k=1:n'
-                 '    s=svd(rand(n+10,n+10))'
-                 '    x=x+s(1)'
-                 '  end'
-                 'end'],'p')
+        <programlisting role="example"><![CDATA[
+function x=foo(a, n)
+ x=0;
+ for i=1:n
+   if x<10 then
+     x=x+a
+   else
+     x=x+1
+   end
+ end
+ x=x^2+1
+endfunction
 
-//call the function
-foo(10)
-
-//get execution profiles
-profile(foo)
-
-//call the function
-foo(20)
-profile(foo) //execution profiles are cumulated
+add_profiling("foo")
+foo(0.1,100) //run the function
+profile(foo) //extract profile information
  ]]></programlisting>
     </refsection>
     <refsection role="see also">
         <title>See Also</title>
         <simplelist type="inline">
             <member>
-                <link linkend="exec">exec</link>
+                <link linkend="add_profiling">add_profiling</link>
             </member>
             <member>
                 <link linkend="deff">deff</link>