os-cmpi-xen

view src/cmpitrace.h @ 121:4868ace2726b

Add initial consistence checks in test suite for Xen_MemoryPool, Xen_ProcessorPool and Xen_VirtualSystemManagementService.

Signed-off-by: Luke Szymanski <Lukasz.Szymanski@Unisys.com>
author Jim Fehlig <jfehlig@novell.com>
date Fri Jun 08 10:22:05 2007 -0600 (2007-06-08)
parents d5331bc6ed99
children
line source
1 // Copyright (C) 2006 IBM Corporation
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16 // ============================================================================
17 // Author: Dr. Gareth S. Bestor <bestor@us.ibm.com>
18 // Contributors: Adrian Schuur <schuur@de.ibm.com>
19 // Summary: SBLIM_TRACE support for SBLIM Project CMPI providers.
20 // Description:
21 // TODO
22 // For more information about the SBLIM Project see:
23 // http://sblim.sourceforge.net/
24 // ============================================================================
26 #if !defined(__CMPITRACE_H__)
27 #define __CMPITRACE_H__
29 #include <stdlib.h>
31 #define _SBLIM_TRACE_LEVEL_ALL 0xff
32 #define _SBLIM_TRACE_LEVEL_DEBUG _SBLIM_TRACE_LEVEL_ALL
33 #define _SBLIM_TRACE_LEVEL_INFO 0x03
34 #define _SBLIM_TRACE_LEVEL_WARNING 0x02
35 #define _SBLIM_TRACE_LEVEL_ERROR 0x01
38 #ifdef SBLIM_DEBUG
40 /* Setup _SBLIM_TRACE() macros. */
42 #define _SBLIM_TRACE( LEVEL, STR ) { \
43 if ((LEVEL <= _SBLIM_TRACE_LEVEL) && (LEVEL > 0)) \
44 _sblim_trace(LEVEL, __FILE__, __LINE__, _sblim_format_trace STR); }
46 #define _SBLIM_ENTER( f ) \
47 char * __func_ = f; \
48 _SBLIM_TRACE(_SBLIM_TRACE_LEVEL_INFO,("Entering %s()", __func_));
50 #define _SBLIM_EXIT() { \
51 _SBLIM_TRACE(_SBLIM_TRACE_LEVEL_INFO,("Exiting %s()", __func_)); \
52 return; }
54 #define _SBLIM_RETURN( v ) { \
55 _SBLIM_TRACE(_SBLIM_TRACE_LEVEL_INFO,("Exiting %s()", __func_)); \
56 return v; }
58 #define _SBLIM_RETURNSTATUS( s ) { \
59 _SBLIM_TRACE(_SBLIM_TRACE_LEVEL_INFO,("Exiting %s()=%s", __func_, (s.rc == CMPI_RC_OK)? "OK":"Failed")); \
60 return s; }
62 #define _SBLIM_ABORT() { \
63 _SBLIM_TRACE(_SBLIM_TRACE_LEVEL_INFO,("Aborting %s()", __func_)); \
64 abort(); }
66 #define _SBLIM_TRACE_FUNCTION( LEVEL, f ) \
67 if ((LEVEL <= _SBLIM_TRACE_LEVEL) && (LEVEL > 0)) { f; }
69 #else /* #ifdef SBLIM_DEBUG */
71 /* Disable _SBLIM_TRACE() macros. */
73 #define _SBLIM_TRACE( LEVEL, STR )
74 #define _SBLIM_ENTER( n, f )
75 #define _SBLIM_EXIT() {return;}
76 #define _SBLIM_RETURN( v ) {return v;}
77 #define _SBLIM_RETURNSTATUS( s ) {return s;}
78 #define _SBLIM_ABORT() {abort();}
79 #define _SBLIM_TRACE_FUNCTION( LEVEL, f )
81 #endif /* #ifdef SBLIM_DEBUG */
83 extern int _SBLIM_TRACE_LEVEL;
84 extern void _sblim_trace( int level, char * file, int line, char * msg );
85 extern char * _sblim_format_trace( char * fmt, ... );
88 #endif /* __CMPITRACE_H__ */