|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE concept |
|
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
|
12 <concept id="GUID-ABE77283-EED8-5A33-B574-3B771EF11086" xml:lang="en"><title>How |
|
13 to Use ULogger with Comms</title><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
14 <p>This tutorial summarises one approach for enabling, retrieving and post-processing |
|
15 the <xref href="GUID-B25AB5A9-52A6-50C2-8656-F8ADEE260FC9.dita">ULogger</xref> logs |
|
16 for Comms. ULogger is part of the Unified Trace framework which replaces other |
|
17 logging mechanisms for Symbian OS including Flogger and CDU. </p> |
|
18 <p>The Unified Trace framework has greater flexibility and speed compared |
|
19 to Flogger and CDU. </p> |
|
20 <section><title>Introduction</title> <p>The Comms logging which has been migrated |
|
21 to ULogger is as follows: </p> <ul> |
|
22 <li id="GUID-677DDC92-E655-50AD-85A3-7B6817F9E12A"><p>Comms Framework Node |
|
23 messages - creation and destruction of Nodes and messages between Nodes. </p> </li> |
|
24 <li id="GUID-E496D531-2CF2-5042-8820-BC8CE75CE4C6"><p>Mesh Machine messages </p> </li> |
|
25 <li id="GUID-E4892E5F-845B-5672-AB90-944A8B7DAEBE"><p>data to support the |
|
26 SVG generation </p> </li> |
|
27 </ul> <p>This logging replaces some of what was logged through the "<codeph>LOG |
|
28 CFNode *</codeph> ", "<codeph>LOG Mesh *</codeph> " and "<codeph>LOG ESock |
|
29 *</codeph> " tags. In the case of the <codeph>ESock</codeph> tag, the logging |
|
30 which is written to ULogger is also written to CDU. </p> <p>This usage description |
|
31 assumes that the development tools already include ULogger support. </p> </section> |
|
32 <section><title>Procedure - Using ULogger</title> <p><b>Requirements</b></p> <p> |
|
33 For this tutorial, the code under observation must be run from <xref href="GUID-D90C86C6-B85D-5941-9919-3725A9FFD548.dita">EShell</xref>. </p> <p> |
|
34 The following binaries must include logging: </p> <ul> |
|
35 <li><p> <filepath>nodemessages.dll</filepath> |
|
36 </p> </li> |
|
37 <li><p> <filepath>meshmachine.dll</filepath> |
|
38 </p> </li> |
|
39 <li><p> <filepath>commsfw.dll</filepath> </p> </li> |
|
40 <li><p> <filepath>serverden.dll</filepath> </p> </li> |
|
41 <li><p> <filepath>esocksvr.dll</filepath> </p> </li> |
|
42 </ul><p> To enable logging for a binary either use the UDEB version of the |
|
43 binary or rebuild the binary with the <codeph>SYMBIAN_TRACE_ENABLED</codeph> macro |
|
44 defined. </p></section> |
|
45 <section><title>Steps</title> <ol> |
|
46 <li id="GUID-E3B09A4E-C87A-45F9-8DE6-653BA1A2E426"><p> <b>Start |
|
47 Eshell</b> - ULogger only supports asynchronous logging, so |
|
48 from EShell start a second instance of EShell. </p> <codeblock xml:space="preserve">start eshell</codeblock> <p> |
|
49 This allows ULogger to be stopped even if the code under |
|
50 observation does not exit normally. </p> </li> |
|
51 <li id="GUID-8A912D95-8D99-4D2A-9A5E-C51132924DAC"><p> <b>Set |
|
52 the ULogger Filters</b> - To allow Comms logging enable the |
|
53 following filters: </p><table id="GUID-56D45DFD-FD08-4B16-AB72-E5DD51C888E1"> |
|
54 <tgroup cols="2"><colspec colname="col1"/><colspec colname="col2"/> |
|
55 <thead> |
|
56 <row> |
|
57 <entry>Level</entry> |
|
58 <entry>Description</entry> |
|
59 </row> |
|
60 </thead> |
|
61 <tbody> |
|
62 <row> |
|
63 <entry> <p> 194 </p></entry> |
|
64 <entry> <p> Node Messages </p></entry> |
|
65 </row> |
|
66 <row> |
|
67 <entry> <p> 195 </p></entry> |
|
68 <entry> <p> Mesh Machine </p></entry> |
|
69 </row> |
|
70 <row> |
|
71 <entry> <p> 196 </p></entry> |
|
72 <entry> <p> SVG Logging - provides extra logging so |
|
73 that 194 and 195 can be displayed in an SVG file |
|
74 </p></entry> |
|
75 </row> |
|
76 </tbody> |
|
77 </tgroup> |
|
78 </table> <p> The following filter is also useful: |
|
79 </p> <table id="GUID-F2BA543D-0396-4552-9546-EF332B6BD747"> |
|
80 <tgroup cols="2"><colspec colname="col1"/><colspec colname="col2"/> |
|
81 <thead> |
|
82 <row> |
|
83 <entry>Level</entry> |
|
84 <entry>Description</entry> |
|
85 </row> |
|
86 </thead> |
|
87 <tbody> |
|
88 <row> |
|
89 <entry> <p> 3</p></entry> |
|
90 <entry> <p> Kernel Thread ID's - Thread and process |
|
91 creation </p></entry> |
|
92 </row> |
|
93 </tbody> |
|
94 </tgroup> |
|
95 </table> <p> Set these filters with the following command: |
|
96 </p> <codeblock xml:space="preserve">ulogger -efv 194 195 3 196 |
|
97 </codeblock> </li> |
|
98 <li id="GUID-72C31641-7F65-4AA8-83BB-752E7A6EE77E"><p> <b>Start |
|
99 ULogger</b> - The following command starts ULogger with the |
|
100 filter: </p> <codeblock xml:space="preserve"> |
|
101 |
|
102 ulogger -rv</codeblock> </li> |
|
103 <li id="GUID-CEDCDC01-1E86-4A67-9822-D94370DAF5E8"><p> <b>Run |
|
104 the code under observation</b> - In the first Eshell session, |
|
105 run the code to be tested or debugged. </p> </li> |
|
106 <li id="GUID-8EA473A7-6609-48C2-8E66-BA56D0178669"><p> <b>Stop |
|
107 ULogger</b> - To stop ULogger and generate the logs, use the |
|
108 command: </p> <codeblock xml:space="preserve">ulogger -qv</codeblock> </li> |
|
109 <li id="GUID-AC7549F8-4010-45D6-8C76-9322C16C86A1"><p> <b>Process |
|
110 the binary logs into text</b> - The log file created by ULogger |
|
111 is in a binary format and is located in the <filepath>c:\logs</filepath> folder |
|
112 on the device. </p> <p> To use the log file, |
|
113 the file must be converted to a text format. |
|
114 </p> <p> The Comms software has a decoder to interpret the |
|
115 ULogger output for Comms. This decoder is an MS Windows-compatible |
|
116 application and is located in <filepath>…\os\commsfw\commsfwtools\</filepath>. |
|
117 </p> <p> An example command to run the decoder |
|
118 is: </p> <codeblock xml:space="preserve">utracedecoder - -message-def esockmessages.definition.txt ulogger.log > log.txt</codeblock> <p> |
|
119 The decoder uses a definition file to decipher the binary data |
|
120 in the log, and the decoder has definition files configured |
|
121 for the current scope of Comms logging. This example uses |
|
122 the ESock messages definition file, which is located in |
|
123 <filepath>…\os\commsfw\commsfwtools\commstools\utracedecoder\data\esockmessages.definition.txt</filepath>. |
|
124 </p> <p> The output in log.txt |
|
125 contains an interpretation of the original binary logs. |
|
126 </p> </li> |
|
127 <li id="GUID-73E7C874-4487-492C-875C-642ECEBDF74F"><p> <b>Generating |
|
128 the SVG diagram</b> - The exchange of messages between Nodes |
|
129 can be rendered into a diagram. </p> <p> From <filepath>…\os\commsfw\commsfwtools\commstools\svg</filepath> run |
|
130 <filepath>parseit.bat</filepath> specifying the path to the |
|
131 generated log.txt file: </p> <codeblock xml:space="preserve">parseit.bat /log M:\path_to_log_file\log.txt</codeblock><fig id="GUID-F6E85A8D-09B3-40A1-B3DC-5B968C3F1A4C"> |
|
132 <desc>Example SVG output from the Message Sequence Display Tool </desc> |
|
133 <image href="GUID-D7E5FECF-0B29-5908-A163-37036DF165E1_d0e90460_href.png" placement="inline"/> |
|
134 </fig> <p> Key to the SVG diagram: </p> <ol> |
|
135 <li id="GUID-64C07144-E5BD-465E-915F-1A867AD62FAB"><p> |
|
136 Vertical black lines are tagged with names to represent node |
|
137 lifetimes. For example: <codeph>IPCpr</codeph> |
|
138 </p> </li> |
|
139 <li id="GUID-4BEE656D-9DEB-402B-B3A9-3A5C822B5E99"><p> |
|
140 Vertical lines forking from the node lifetime lines are |
|
141 MeshMachine activity lifetimes. </p> </li> |
|
142 <li id="GUID-BA5C28EF-856F-45CD-B6B8-AD1C0D663CA1"><p> |
|
143 Black horizontal lines are message deliveries. </p> </li> |
|
144 <li id="GUID-61D41E05-7269-4A95-843D-E536141E56E0"><p> |
|
145 Green horizontal lines are message postings. </p> </li> |
|
146 </ol> <p> New message types can be added to the definition |
|
147 files. See the documentation with the utracedecoder component. |
|
148 </p> </li> |
|
149 </ol></section> |
|
150 </conbody><related-links> |
|
151 <link href="GUID-A3E77067-7982-5803-A274-0C8F2562B483.dita"><linktext>Unified Trace |
|
152 Solution</linktext></link> |
|
153 <link href="GUID-9006B4EE-194E-50FA-A803-F9EAA13E14AA.dita"><linktext>How to Use |
|
154 the ULogger Configuration File</linktext></link> |
|
155 </related-links></concept> |