1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Declaration and implementation of KISITESTER |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef KISI_TRACE_H |
|
21 #define KISI_TRACE_H |
|
22 |
|
23 |
|
24 // INCLUDES |
|
25 #include <kernel/kernel.h> |
|
26 |
|
27 // CONSTANTS |
|
28 #ifndef _DEBUG |
|
29 // #define _DEBUG // to get traces from UREL as well |
|
30 #endif |
|
31 |
|
32 |
|
33 // MACROS |
|
34 #define ASSERT_RESET ASSERT_RESET_ALWAYS |
|
35 #define _T(a) a |
|
36 |
|
37 #ifdef _DEBUG |
|
38 //#define __TRACE_PRINTF(a) PerfPrintf a |
|
39 #define __TRACE_PRINTF(a) Kern::Printf a // Backup line, do not uncomment |
|
40 #else |
|
41 #define __TRACE_PRINTF(a) |
|
42 #endif // _DEBUG |
|
43 |
|
44 |
|
45 #ifdef _DEBUG |
|
46 _LIT(KSisaExtensionName, "SISA"); |
|
47 |
|
48 void BuildTraceFunc( const TDesC& aPrefix ); |
|
49 void DataDumpTraceFunc( const TDesC& aPrefix, const TDesC8& aData ); |
|
50 |
|
51 #define BUILD_TRACE( a ) BuildTraceFunc( a ) |
|
52 #define DATA_DUMP_TRACE( a, b ) DataDumpTraceFunc( a, b ) |
|
53 |
|
54 #define TRACE_ASSERT(a) if (!(a)) __TRACE_PRINTF(("Assertion failed: file=" __FILE__ ", line=%d, compiled=" __DATE__" "__TIME__, __LINE__ )) |
|
55 #define TRACE_ASSERT_RETURN(a) if (!((a)==KErrNone)) __TRACE_PRINTF(("Assertion failed: file=" __FILE__ ", line=%d, compiled=" __DATE__" "__TIME__, __LINE__ )) |
|
56 |
|
57 #if defined COMPONENT_TRACE_FLAG |
|
58 #define COMPONENT_TRACE(a) __TRACE_PRINTF(a) |
|
59 #else |
|
60 #define COMPONENT_TRACE(a) |
|
61 #endif // COMPONENT_TRACE_FLAG |
|
62 |
|
63 #if defined API_TRACE_FLAG |
|
64 #define A_TRACE(a) __TRACE_PRINTF(a) |
|
65 #else |
|
66 #define A_TRACE(a) |
|
67 #endif // API_TRACE_FLAG |
|
68 |
|
69 #if defined EXTENDED_TRACE_FLAG |
|
70 #define E_TRACE(a) __TRACE_PRINTF(a) |
|
71 #else |
|
72 #define E_TRACE(a) |
|
73 #endif // EXTENDED_TRACE_FLAG |
|
74 |
|
75 #else |
|
76 #define TRACE_ASSERT(a) |
|
77 #define TRACE_ASSERT_RETURN(a) a |
|
78 #define COMPONENT_TRACE(a) |
|
79 #define A_TRACE(a) |
|
80 #define E_TRACE(a) |
|
81 #define BUILD_TRACE(a) |
|
82 #define DATA_DUMP_TRACE(a, b) |
|
83 #endif // _DEBUG |
|
84 |
|
85 |
|
86 // Resets are made both in UDEB and UREL (traces only in udeb) |
|
87 #define ASSERT_RESET_ALWAYS(a,b,c) if(!(a)) { __TRACE_PRINTF(("Assertion failed: file=" __FILE__ ", line=%d, compiled="__DATE__" "__TIME__, __LINE__)); Kern::Fault(b,c); } |
|
88 #define TRACE_ASSERT_ALWAYS __TRACE_PRINTF( ("Assertion failed: file=" __FILE__ ", line=%d, compiled="__DATE__" "__TIME__, __LINE__) ) |
|
89 |
|
90 |
|
91 // DATA TYPES |
|
92 // FUNCTION PROTOTYPES |
|
93 // FORWARD DECLARATIONS |
|
94 |
|
95 #endif //#ifndef KISI_TRACE_H |
|
96 // End of File |
|