~ubuntu-branches/ubuntu/precise/scilab/precise

« back to all changes in this revision

Viewing changes to modules/functions/help/en_US/plotprofile.xml

Tags: 5.3.0-1ubuntu1
* New upstream release
* URL in the watch file updated

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?xml version="1.0" encoding="UTF-8"?>
2
 
<!--
3
 
 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4
 
 * Copyright (C) ????-2008 - INRIA
5
 
 *
6
 
 * This file must be used under the terms of the CeCILL.
7
 
 * This source file is licensed as described in the file COPYING, which
8
 
 * you should have received as part of this distribution.  The terms
9
 
 * are also available at
10
 
 * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
11
 
 *
12
 
 -->
13
 
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:lang="en" xml:id="plotprofile">
14
 
  <info>
15
 
    <pubdate>$LastChangedDate$</pubdate>
16
 
  </info>
17
 
  <refnamediv>
18
 
    <refname>plotprofile</refname>
19
 
    <refpurpose> extracts and displays execution profiles
20
 
                     of a Scilab function</refpurpose>
21
 
  </refnamediv>
22
 
  <refsynopsisdiv>
23
 
    <title>Calling Sequence</title>
24
 
    <synopsis>plotprofile(fun)</synopsis>
25
 
  </refsynopsisdiv>
26
 
  <refsection>
27
 
    <title>Parameters</title>
28
 
    <variablelist>
29
 
      <varlistentry>
30
 
        <term>fun</term>
31
 
        <listitem>
32
 
          <para>a Scilab compiled function, or a function name (string), or an array of
33
 
                function names</para>
34
 
        </listitem>
35
 
      </varlistentry>
36
 
    </variablelist>
37
 
  </refsection>
38
 
  <refsection>
39
 
    <title>Description</title>
40
 
    <para>
41
 
    To use <literal>plotprofile</literal>, the Scilab function must have been prepared for
42
 
    profiling (see exec).</para>
43
 
    <para>
44
 
    When such a function is executed, the system
45
 
    counts how many times each line is executed and how much cpu time is
46
 
    spent executing each line. This data is stored within the
47
 
    function data structure. The function <literal>plotprofile</literal> in an interactive
48
 
    command which displays this results in a graphic window. When a line
49
 
    is clicked, the source of the function is displayed with the selected line
50
 
    highlighted.</para>
51
 
    <para>
52
 
    NOTE: you have to click on the "Exit" item in the graphics windows to
53
 
    exit from "plotprofile".</para>
54
 
    <para>
55
 
    The function code is regenerated with <literal>fun2string</literal> and dumped into
56
 
    a temporary file.</para>
57
 
  </refsection>
58
 
  <refsection>
59
 
    <title>Examples</title>
60
 
    <programlisting role="example"><![CDATA[ 
61
 
//define a function and prepare it for profiling
62
 
deff('x=foo(n)',['if n==0 then'
63
 
                 '  x=[]'
64
 
                 'else'
65
 
                 '  x=0'
66
 
                 '  for k=1:n'
67
 
                 '    s=svd(rand(n+10,n+10))'
68
 
                 '    x=x+s(1)'
69
 
                 '  end'
70
 
                 'end'],'p')
71
 
//call the function
72
 
foo(30)
73
 
 
74
 
//get execution profiles
75
 
plotprofile(foo) // click on Exit to exit
76
 
  ]]></programlisting>
77
 
  </refsection>
78
 
  <refsection>
79
 
    <title>See Also</title>
80
 
    <simplelist type="inline">
81
 
      <member>
82
 
        <link linkend="profile">profile</link>
83
 
      </member>
84
 
      <member>
85
 
        <link linkend="showprofile">showprofile</link>
86
 
      </member>
87
 
      <member>
88
 
        <link linkend="fun2string">fun2string</link>
89
 
      </member>
90
 
    </simplelist>
91
 
  </refsection>
92
 
</refentry>