|
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-02B40662-B5F3-59BD-832B-9A28FE3B51C7" xml:lang="en"><title>Debug</title><shortdesc>This topic describes how to use debug messages in the USB |
|
13 client controller.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
14 <p>As the USB PDD runs in kernel mode, debug <codeph>printf</codeph> are implemented using the <codeph>KTRACE</codeph> macro. |
|
15 This macro takes two arguments: </p> |
|
16 <ul> |
|
17 <li id="GUID-E3A1AA52-12D9-58EE-A459-46FAA7F5001C"><p>The debug message |
|
18 type </p> </li> |
|
19 <li id="GUID-2D7B1C30-563C-5346-8DBC-943839008874"><p>A kernel object |
|
20 that takes a message string as a constructor. </p> </li> |
|
21 </ul> |
|
22 <p>Two debug message types are used: </p> |
|
23 <ul> |
|
24 <li id="GUID-962DAE50-32C5-53AB-A203-E08CA57252D5"><p> <codeph>KPANIC</codeph> for error messages </p> </li> |
|
25 <li id="GUID-6F6409F4-37B1-5713-A763-61B477545706"><p> <codeph>KUSBPSL</codeph> for PSL information messages </p> </li> |
|
26 </ul> |
|
27 <p>The following code samples illustrate their use: </p> |
|
28 <codeblock id="GUID-A130740F-20FA-5825-9BDB-9CE234971757" xml:space="preserve">_KTRACE_OPT(KPANIC, Kern::Printf("Error: USB Controller not present"));</codeblock> |
|
29 <codeblock id="GUID-6A8812CE-791C-5C62-AC67-29FF5098D9E4" xml:space="preserve">_KTRACE_OPT(KUSBPSL, Kern::Printf("Received new Ep0 Setup packet"));</codeblock> |
|
30 <note>Do not use the <codeph>KUSB</codeph> flag. This flag is used |
|
31 within the PDD PIL and the USB LDD only.</note> |
|
32 </conbody></concept> |