RTI Connext Micro  Version 2.4.1.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
osapi_log_impl.h
Go to the documentation of this file.
1 /*
2  * FILE: osapi_log_impl.h - Implementation of Log functions
3  *
4  * Copyright 2008-2014 Real-Time Innovations, Inc.
5  *
6  * No duplications, whole or partial, manual or electronic, may be made
7  * without express written permission. Any such copies, or
8  * revisions thereof, must display this notice unaltered.
9  * This code contains trade secrets of Real-Time Innovations, Inc.
10  *
11  * Modification History
12  * --------------------
13  * 07mar2013,tk Updated
14  * 22sep2011,tk Updated
15  * 23sep2008,yy Created
16  */
17 /*ce
18  * \file
19  * \brief Implementation of log functionality
20  */
21 #include "osapi/osapi_config.h"
22 
23 #ifndef osapi_log_impl_h
24 #define osapi_log_impl_h
25 
26 #define OSAPI_TRACEKIND_NONE 0x0
27 #define OSAPI_TRACEKIND_FCALL 0x1
28 #define OSAPI_TRACEKIND_SYSCALL 0x2
29 #define OSAPI_TRACEKIND_SYSEVENT 0x4
30 #define OSAPI_TRACEKIND_RESOURCE 0x8
31 #define OSAPI_TRACEKIND_ROUTE 0x10
32 #define OSAPI_TRACEKIND_NETRESOURCE 0x20
33 #define OSAPI_TRACEKIND_NETRX 0x40
34 #define OSAPI_TRACEKIND_NETTX 0x40
35 #define OSAPI_TRACEKIND_DDS 0x80
36 #define OSAPI_TRACEKIND_DDS_DISC 0x100
37 #define OSAPI_TRACEKIND_DDS_EVENT 0x200
38 #define OSAPI_TRACEKIND_THREAD 0x400
39 #define OSAPI_TRACEKIND_UNITTEST 0x800
40 
41 #define OSAPI_TRACE_SYSCALL OSAPI_gv_TraceMask,OSAPI_gv_TraceFunctionParam,\
42 OSAPI_TRACEKIND_SYSCALL,RTI_MODULE_NAME,__FILE__,__FUNCTION__,__LINE__
43 
44 #define OSAPI_TRACE_SYSEVENT OSAPI_gv_TraceMask,OSAPI_gv_TraceFunctionParam,\
45 OSAPI_TRACEKIND_SYSEVENT,RTI_MODULE_NAME,__FILE__,__FUNCTION__,__LINE__
46 
47 #define OSAPI_TRACE_RESOURCE OSAPI_gv_TraceMask,OSAPI_gv_TraceFunctionParam,\
48 OSAPI_TRACEKIND_RESOURCE,RTI_MODULE_NAME,__FILE__,__FUNCTION__,__LINE__
49 
50 #define OSAPI_TRACE_ROUTE OSAPI_gv_TraceMask,OSAPI_gv_TraceFunctionParam,\
51 OSAPI_TRACEKIND_ROUTE,RTI_MODULE_NAME,__FILE__,__FUNCTION__,__LINE__
52 
53 #define OSAPI_TRACE_NETRESOURCE OSAPI_gv_TraceMask,OSAPI_gv_TraceFunctionParam,\
54 OSAPI_TRACEKIND_NETRESOURCE,RTI_MODULE_NAME,__FILE__,__FUNCTION__,__LINE__
55 
56 #define OSAPI_TRACE_NETRX OSAPI_gv_TraceMask,OSAPI_gv_TraceFunctionParam,\
57 OSAPI_TRACEKIND_NETRX,RTI_MODULE_NAME,__FILE__,__FUNCTION__,__LINE__
58 
59 #define OSAPI_TRACE_NETTX OSAPI_gv_TraceMask,OSAPI_gv_TraceFunctionParam,\
60 OSAPI_TRACEKIND_NETTX,RTI_MODULE_NAME,__FILE__,__FUNCTION__,__LINE__
61 
62 #define OSAPI_TRACE_DDS OSAPI_gv_TraceMask,OSAPI_gv_TraceFunctionParam,\
63 OSAPI_TRACEKIND_DDS,RTI_MODULE_NAME,__FILE__,__FUNCTION__,__LINE__
64 
65 #define OSAPI_TRACE_DDS_DISC OSAPI_gv_TraceMask,OSAPI_gv_TraceFunctionParam,\
66 OSAPI_TRACEKIND_DDS_DISC,RTI_MODULE_NAME,__FILE__,__FUNCTION__,__LINE__
67 
68 #define OSAPI_TRACE_DDS_EVENT OSAPI_gv_TraceMask,OSAPI_gv_TraceFunctionParam,\
69 OSAPI_TRACEKIND_DDS_EVENT,RTI_MODULE_NAME,__FILE__,__FUNCTION__,__LINE__
70 
71 #define OSAPI_TRACE_THREAD OSAPI_gv_TraceMask,OSAPI_gv_TraceFunctionParam,\
72 OSAPI_TRACEKIND_THREAD,RTI_MODULE_NAME,__FILE__,__FUNCTION__,__LINE__
73 
74 #define OSAPI_TRACE_UNITTEST OSAPI_gv_TraceMask,OSAPI_gv_TraceFunctionParam,\
75 OSAPI_TRACEKIND_UNITTEST,RTI_MODULE_NAME,__FILE__,__FUNCTION__,__LINE__
76 
77 #define NETIO_FORMAT(s_) "NETIO ...: " s_
78 #define UDP_FORMAT(s_) "UDP .....: " s_
79 #define INTRA_FORMAT(s_) "INTRA ...: " s_
80 #define DDSC_FORMAT(s_) "DDS .....: " s_
81 #define RTPS_FORMAT(s_) "RTPS ....: " s_
82 #define DB_FORMAT(s_) "DB ......: " s_
83 #define CDR_FORMAT(s_) "CDR .....: " s_
84 #define DPDE_FORMAT(s_) "DPDE ....: " s_
85 #define DPSE_FORMAT(s_) "DPSE ....: " s_
86 #define OSAPI_FORMAT(s_) "OSAPI ...: " s_
87 #define REDA_FORMAT(s_) "REDA ....: " s_
88 #define WHSM_FORMAT(s_) "WHSM ....: " s_
89 #define RHSM_FORMAT(s_) "RHSM ....: " s_
90 #define RT_FORMAT(s_) "RT ......: " s_
91 #define DT_FORMAT(s_) "DT ......: " s_
92 #define THREAD_FORMAT(s_) "THREAD ..: " s_
93 #define MUTEX_FORMAT(s_) "MUTEX ...: " s_
94 #define UNIT_FORMAT(s_) "UNIT ....: " s_
95 
96 #ifdef NDEBUG
97 #define OSAPI_TRACE(args)
98 #define OSAPI_TRACE_ONLY_VARIABLE(x_) (void)(x_)
99 #else
100 #define OSAPI_TRACE_ONLY_VARIABLE(x_)
101 
102 #define OSAPI_TRACE_KIND(c_) OSAPI_gv_TraceMask,OSAPI_gv_TraceFunctionParam,\
103  (c_),RTI_MODULE_NAME,__FILE__,__FUNCTION__,__LINE__
104 
105 #define OSAPI_TRACE(args) OSAPI_gv_TraceFunction args;
106 
107 #endif
108 
109 #define OSAPI_LOG_PRECONDITION_PARAM OSAPI_LOGKIND_PRECONDITION,0,\
110  OSAPI_LOG_MSG_PN_X2_STD_PARAM
111 
112 #define OSAPI_LOG_PRECONDITION_ALWAYS(cond_,action_,args_) \
113 if ((cond_)) \
114 {\
115  OSAPI_Log_precond args_;\
116  action_;\
117 }
118 
119 #ifndef NDEBUG
120 #define PRECOND_ARG(x_)
121 #define OSAPI_ENABLE_LOG_PRECONDITION
122 #else
123 #define PRECOND_ARG(x_) (void)(x_);
124 #endif
125 
126 #ifdef OSAPI_ENABLE_LOG_PRECONDITION
127 
128 #define LOG_PRECONDITION_ENABLED 1
129 
130 #define OSAPI_LOG_PRECONDITION(cond_,action_,args_) \
131 if ((cond_)) \
132 {\
133  OSAPI_Log_precond args_;\
134  action_;\
135 }
136 
137 #else
138 
139 #define OSAPI_LOG_PRECONDITION(cond_,action_,args_)
140 
141 #endif
142 
143 #endif /* osapi_log_impl_h */

RTI Connext Micro Version 2.4.1.0 Copyright © Thu Nov 20 2014 Real-Time Innovations, Inc