Sync with 5.3.0
[deliverable/titan.core.git] / help / info / profiler.html
1 <!--
2 Copyright (c) 2000-2014 Ericsson Telecom AB
3
4 All rights reserved. This program and the accompanying materials
5 are made available under the terms of the Eclipse Public License v1.0
6 which accompanies this distribution, and is available at
7 http://www.eclipse.org/legal/epl-v10.html
8 -->
9 <html>
10 <head>
11 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
12 <meta http-equiv="Content-Language" content="en-us">
13 <title>profiler</title>
14 </head>
15 <body bgcolor="#DAD3C5" vlink="#0094D2" link="#003258">
16 <table align="left" border="0" cellspacing="0" cellpadding="0" valign=top>
17 <tr>
18 <td width=105 height=40><a href="https://projects.eclipse.org/projects/tools.titan"><img src="../images/titan_transparent.gif" border=0 width=105 height=40 align="left" alt="Titan"></a></td>
19 </tr>
20 </table>
21 <table border="0" align="right" cellpadding="0" cellspacing="0">
22 <tr>
23 <td><a href="../titan_main.html" alt="contents"><img border="0" src="../images/ao.jpg" width="53" height="40"></a></td>
24 <td><a href="../titan_index.html" alt="index"><img border="0" src="../images/up.jpg" width="53" height="40"></a></td>
25 <td><a href="procedure.html" alt="previous"><img border="0" src="../images/left.jpg" width="53" height="40"></a></td>
26 <td><a href="public.html" alt="next"><img border="0" src="../images/right.jpg" width="53" height="40"></a></td>
27 </tr>
28 </table>
29 <p><br clear="all">
30 </p>
31 <hr>
32 <h1>@profiler</h1>
33 <hr align="left" width="75%">
34 <p>The keyword is used to start or stop the profiling or check if the profiling started or not.&nbsp;</p>
35 <p>By default the profiler is automatically started for each component when the program starts.&nbsp;This can be changed in the configuration file.&nbsp;</p>
36 <p>Detailed description can be found in the Programmers' Reference Guide.</p>
37
38 <blockquote>
39 <p>1. <a href="#1">Stopping the profiler</a></p>
40 <p>2. <a href="#2">Starting the profiler</a></p>
41 <p>3. <a href="#3">Checking the profiler running state</a></p>
42 </blockquote>
43
44
45
46 <p>Related keywords:</p>
47 <ul>
48 <li><a href="start.html"><b><font face="Courier New" color="#003258" size="4">start</font></b></a></li>
49 <li><a href="stop.html"><b><font face="Courier New" color="#003258" size="4">stop</font></b></a></li>
50 <li><a href="running.html"><b><font face="Courier New" color="#003258" size="4">running</font></b></a></li>
51 </ul>
52
53 <hr align="left" width="75%">
54 <h3>1. <a name="#1">Stopping the profiler</a></h3>
55
56 <div align="center">
57 <center>
58 <table border="0" width="90%" bgcolor="#FFB599" cellpadding="4">
59 <tr>
60 <td width="100%">
61 <h3 align="center"><font face="Courier New" color="#003258" size="5"><b>@profiler.stop</b></font></h3>
62 </td>
63 </tr>
64 </table>
65 </center>
66 </div>
67
68 <hr align="left" width="50%">
69 <p>The profiler can be stopped using the <font face="Courier New"><b>@profiler.stop</b></font> command.&nbsp;This only affects profiling and code coverage in the current component</p>
70 <p>When stopped the profiler does not measure new data. </p>
71 <p>This command has no effect if the profiler is already stopped.</p>
72
73 <hr align="left" width="75%">
74 <h3>2. <a name="#2">Starting the profiler</a></h3>
75
76 <hr align="left" width="75%">
77
78
79 <div align="center">
80 <center>
81 <table border="0" width="90%" bgcolor="#FFB599" cellpadding="4">
82 <tr>
83 <td width="100%">
84 <h3 align="center"><font face="Courier New" color="#003258" size="5"><b>@profiler.start</b></font></h3>
85 </td>
86 </tr>
87 </table>
88 </center>
89 </div>
90 <p>A stopped profiler can be restarted with the <font face="Courier New"><b>@profiler.start</b></font> command.&nbsp;This only affects profiling and code coverage in the current component.</p>
91 <p>Similarly, this has no effect if the profiler is already running.</p>
92
93 <p>The execution count of a function is measured at the start of the function, thus if the profiler is stopped when the function is called, its call will not be measured, even if the profiler is restarted during the function’s execution.</p>
94
95
96 <hr align="left" width="75%">
97 <h3>3. <a name="#3">Checking the profiler running state</a></h3>
98
99
100
101 <div align="center">
102 <center>
103 <table border="0" width="90%" bgcolor="#FFB599" cellpadding="4">
104 <tr>
105 <td width="100%">
106 <h3 align="center"><font face="Courier New" color="#003258" size="5"><b>@profiler.running</b></font></h3>
107 </td>
108 </tr>
109 </table>
110 </center>
111 </div>
112
113 <hr align="left" width="75%">
114 <p>The boolean value <font face="Courier New"><b>@profiler.running</b></font> stores the state of the profiler in the current component (true if it’s running or false if it’s stopped).</p>
115
116 <hr align="left" width="75%">
117 <h3>Example:</h3>
118
119 <p><font face="Courier New"> function f1(inout integer x) runs on C<br/>
120 {<br/>
121 &nbsp;&nbsp;var boolean stop_prof := not @profiler.running;<br/>
122 &nbsp;&nbsp;@profiler.start;<br/>
123 &nbsp;&nbsp;x := x + c1;<br/>
124 &nbsp;&nbsp;if (stop_prof) {<br/>
125 &nbsp;&nbsp;&nbsp;&nbsp;@profiler.stop;<br/>
126 &nbsp;&nbsp;}<br/>
127 }<br>
128 </font>
129 <p>
130
131 <p>This function is always profiled and returns the profiler to its original state.</p>
132
133 </body>
134 </html>
This page took 0.046056 seconds and 5 git commands to generate.