1 #ifndef CYGONCE_INFRA_CYG_TRAC_H
2 #define CYGONCE_INFRA_CYG_TRAC_H
4 //==========================================================================
8 // Macros and prototypes for the tracing system
10 //==========================================================================
11 //####ECOSGPLCOPYRIGHTBEGIN####
12 // -------------------------------------------
13 // This file is part of eCos, the Embedded Configurable Operating System.
14 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
16 // eCos is free software; you can redistribute it and/or modify it under
17 // the terms of the GNU General Public License as published by the Free
18 // Software Foundation; either version 2 or (at your option) any later version.
20 // eCos is distributed in the hope that it will be useful, but WITHOUT ANY
21 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
22 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
25 // You should have received a copy of the GNU General Public License along
26 // with eCos; if not, write to the Free Software Foundation, Inc.,
27 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
29 // As a special exception, if other files instantiate templates or use macros
30 // or inline functions from this file, or you compile this file and link it
31 // with other works to produce a work based on this file, this file does not
32 // by itself cause the resulting work to be covered by the GNU General Public
33 // License. However the source code for this file must still be made available
34 // in accordance with section (3) of the GNU General Public License.
36 // This exception does not invalidate any other reasons why a work based on
37 // this file might be covered by the GNU General Public License.
39 // Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
40 // at http://sources.redhat.com/ecos/ecos-license/
41 // -------------------------------------------
42 //####ECOSGPLCOPYRIGHTEND####
43 //==========================================================================
44 //#####DESCRIPTIONBEGIN####
46 // Author(s): nickg from an original by hmt
47 // Contributors: nickg
49 // Purpose: Use traces to log procedure entry, and "print" stuff
50 // Description: Runtime logging messages that compile to nothing in
51 // release versions of the code, to allow
52 // as-you-go tracing of alternate builds.
53 // Usage: #include <cyg/infra/cyg_trac.h>
55 // CYG_TRACE2( PIPE_TRACE, "pipe %x, data %d", ppipe, oword );
57 // which can result, for example, in a message of the form:
58 // "TRACE: pipemgr.cxx:1340, write_pipe(): pipe 0x8004c, data 17"
60 //####DESCRIPTIONEND####
63 /****************************************************************************
68 CYG_TRACE0( bool, msg );
69 CYG_TRACE1( bool, msg, arg1 );
70 CYG_TRACE2( bool, msg, arg1, arg2 );
72 CYG_TRACE8( bool, msg, .... [with 8 args] );
74 In general, the bool controls whether or not the tracing occurs for a
75 particular invocation of the macro. The msg is a printf-style string,
76 though exactly which formats are supported depends on the underlying
77 implementation. Typically, at least %d, %x, %08x, %c and %s will be
78 supported. Of course a most compact implementation might print
80 TRACE:z1dbuff.c[92]get_nextdata(): data pointer %x offset %d: 42BD8 1C
82 or some such, leaving you to work it out for yourself.
84 It is expected that the boolean would rarely actually be a complex
85 expression; it is more likely that it would either be "1", tracing being
86 controlled for the whole compilation unit or subsystem by means of the
87 CYGDBG_USE_TRACING symbol, or a local symbol for tracing over the whole
88 file, defined to 0 or to 1. For runtime control of tracing in a debugging
89 session, it is typical to use symbols defined to expressions such as:
91 static int xxx_trace = 0;
92 #define TL1 (0 < xxx_trace)
93 #define TL2 (1 < xxx_trace)
95 so you set xxx_trace to 1 to enable those messages conditioned by TL1
96 (trace level 1) and so on.
98 CYG_TRACE1( TL1, "Major argument is %d", zz );
99 CYG_TRACE4( TL2, "...minor details %d %d %d %d", m1, m2, m3 ,m4 );
101 To assist with the case where the same symbol or expression is used
102 throughout a compilation unit, the programmer can define the symbol
103 CYG_TRACE_USER_BOOL as they choose and then use convenience macros with the
104 suffix 'B' in the obvious manner:
106 #define CYG_TRACE_USER_BOOL (xxx_trace > 0)
107 CYG_TRACE2B( "Counters are %d, %d", countlo, counthi );
109 For the case where you just want to print a load of numbers in hex, or
110 decimal, convenience suffices X, D and Y are provided. X uses %08x, D %d
111 and Y an unadorned %x for each argument.
113 CYG_TRACE3D( TL2, m1, m2, d );
115 If you want to do something similar but with a little more comment, the
116 names (strictly spellings) of the variables you are printing can be used by
117 appending a V to the X, D or Y.
119 CYG_TRACE3DV( TL2, m1, m2, d );
123 TRACE:z1dbuff.c[92]get_nextdata(): m1=23 m2=-4 d=55
125 These conveniences can be combined, and they apply equally to tracing with
126 up to 8 variables; the B for Bool goes last:
128 CYG_TRACE4DVB( i, i*i, i*i*i, i*i*i*i );
132 TRACE:table.c[12]main(): i=3 i*i=9 i*i*i=27 i*i*i*i=81
138 There are also facities for easily reporting function entry and exit,
139 printing the function arguments, and detecting returns without logging (or
142 The basic facility is
144 CYG_REPORT_FUNCTION();
146 In C, place this between the local variable declarations and the first
147 statement or errors will ensue. C++ is more flexible; place the macro as
148 the first line of all functions you wish to trace. The following
149 variations are also provided:
151 CYG_REPORT_FUNCTYPE( exitmsg ) provide a printf string for the type
152 of the returned value
153 CYG_REPORT_FUNCNAME( name ) supply a function name explicitly, for
154 if __FUNCTION__ is not supported
155 CYG_REPORT_FUNCNAMETYPE( name, exitmsg ) both of the above extensions
157 These are unconditional; the assumption is that if function reporting is
158 used at all it will be used for all functions within a compilation unit.
159 However, it is useful to be able to control function reporting at finer
160 grain without editing the source files concerned, at compile time or at
161 runtime. To support this, conditioned versions (with suffix 'C') are
162 provided for the above four macros, which only procduce trace output if the
163 macro CYG_REPORT_USER_BOOL evaluates true.
165 CYG_REPORT_FUNCTIONC()
166 CYG_REPORT_FUNCNAMEC( name )
167 CYG_REPORT_FUNCTYPEC( exitmsg )
168 CYG_REPORT_FUNCNAMETYPEC( name, exitmsg )
170 You can define CYG_REPORT_USER_BOOL to anything you like before invoking
171 these macros; using a simple -DCYG_REPORT_USER_BOOL=0 or ...=1 on the
172 compiler command line would do the trick, but there is more flexibility to
173 be gained by something like:
175 #define CYG_REPORT_USER_BOOL (reporting_bool_FOO)
177 int reporting_bool_FOO = 1;
179 int reporting_bool_FOO = 0;
182 where FOO relates to the module name. Thus an external symbol sets the
183 default, but it can be overridden in a debugging session by setting the
184 variable reporting_bool_FOO.
186 Note that the condition applied to the initial CYG_REPORT_FUNC...() macro
187 controls all function-related reporting (not tracing) from that function;
188 the underlying mechanisms still operate even if no output is created. Thus
189 no conditioned variants of CYG_REPORT_FUNCARG[s] nor of CYG_REPORT_RETURN
195 CYG_REPORT_FUNCTYPE( "recode is %d" );
197 A function return is traced using
199 CYG_REPORT_RETURN() a void return
200 CYG_REPORT_RETVAL( value ) returning a value
202 With the CYG_REPORT_FUNCTYPE example, the latter might produce a message
205 TRACE:myprog.c[40]fact(): enter
206 TRACE:myprog.c[53]fact(): retcode is 24
208 It is also useful to trace the values of the arguments to a function:
209 CYG_REPORT_FUNCARGVOID confirms that the function is void
210 CYG_REPORT_FUNCARG1( format, arg ) printf-style
212 CYG_REPORT_FUNCARG8( format, arg1...arg8 ) printf-style
214 The CYG_REPORT_FUNCARG[1-8] macros are also offered with the convenience
215 extensions: D, X, or Y, and V like the explicit tracing macros. For
218 int fact( int number )
220 CYG_REPORT_FUNCTYPE( "recode is %d" );
221 CYG_REPORT_FUNCARG1DV( number );
223 while ( --number > 1 ) result *= number
224 CYG_REPORT_RETVAL( result );
230 TRACE:myprog.c[40]fact(): enter
231 TRACE:myprog.c[40]fact(): number=4
232 TRACE:myprog.c[53]fact(): retcode is 24
234 If no exit message is provided, a default of %08x is used.
240 If CYGDBG_INFRA_DEBUG_FUNCTION_PSEUDOMACRO is *not* defined, it is assumed
241 that __PRETTY_FUNCTION__ or equivalents do not exist, so no function name
242 tracing is possible; only file and line number.
244 If CYGDBG_INFRA_DEBUG_TRACE_MESSAGE is *not* defined, the message and
245 arguments to all tracing macros are not used; only "execution was here"
246 type information, by file, function and line number, is available. This
247 can greatly reduce the size of an image with tracing disabled, which may be
248 crucial in debugging on actual shipped hardware with limited memory.
250 If configured for buffered tracing then CYG_TRACE_PRINT() can be used to
251 output the contents of the trace buffer on demand.
253 CYG_TRACE_DUMP() outputs a form of "core dump" containing info on the
254 scheduler and threads at the time. This information will be invalid if
255 the kernel is not running.
257 C/C++: in C++ the function reporting is implemented using a class object
258 with a destructor; this allows reporting of a return which has not been
259 explicitly reported, and detection of accidental multiple return reports.
260 This helps you write the function reporting correctly. In C it is not
261 possible to be so sophisticated, so the implementation is not so helpful in
262 detecting errors in the use of the tracing system.
264 Note that for all of the above variations, the internal API to the
265 functions which are called in consequence of tracing remains the same, so
266 these variations can be mixed in the same executable, by configuring the
267 tracing macros differently in different compilation units or subsystems.
276 CYG_TRACE0( bool, msg ) if bool, print msg
277 CYG_TRACE1( bool, msg, arg ) if bool, printf-style
279 CYG_TRACE8( bool, msg, arg1...arg8 ) if bool, printf-style
281 CYG_TRACE0B( msg, args... ) to CYG_TRACE8B() use CYG_TRACE_USER_BOOL
283 CYG_TRACE1X( bool, args... ) to CYG_TRACE8X() print args using %08x
284 CYG_TRACE1Y( bool, args... ) to CYG_TRACE8Y() print args using %x
285 CYG_TRACE1D( bool, args... ) to CYG_TRACE8D() print args using %d
287 CYG_TRACE1XV( bool, args... ) to CYG_TRACE8XV() print args using "arg=%08x"
288 CYG_TRACE1YV( bool, args... ) to CYG_TRACE8YV() print args using "arg=%x"
289 CYG_TRACE1DV( bool, args... ) to CYG_TRACE8DV() print args using "arg=%d"
291 CYG_TRACE1XB( args... ) to CYG_TRACE8XB() print using %08x, no bool
292 CYG_TRACE1YB( args... ) to CYG_TRACE8YB() print using %x, no bool
293 CYG_TRACE1DB( args... ) to CYG_TRACE8DB() print using %d, no bool
295 CYG_TRACE1XVB( args... ) to CYG_TRACE8XVB() use "arg=%08x", no bool
296 CYG_TRACE1YVB( args... ) to CYG_TRACE8YVB() use "arg=%x", no bool
297 CYG_TRACE1DVB( args... ) to CYG_TRACE8DVB() use "arg=%d", no bool
302 CYG_REPORT_FUNCTION() default function entry
303 CYG_REPORT_FUNCNAME( name ) name the function
304 CYG_REPORT_FUNCTYPE( exitmsg ) printf for retval
305 CYG_REPORT_FUNCNAMETYPE( name, exitmsg ) both
307 CYG_REPORT_FUNCTIONC() as above, but conditional
308 CYG_REPORT_FUNCNAMEC( name ) on CYG_REPORT_USER_BOOL
309 CYG_REPORT_FUNCTYPEC( exitmsg ) however it is defined
310 CYG_REPORT_FUNCNAMETYPEC( name, exitmsg ) ...
312 CYG_REPORT_RETURN() void function exit
313 CYG_REPORT_RETVAL( value ) returning value
315 CYG_REPORT_FUNCARGVOID() void function entry
316 CYG_REPORT_FUNCARG1( format, arg ) printf-style
318 CYG_REPORT_FUNCARG8( format, arg1...arg8 ) printf-style
320 CYG_REPORT_FUNCARG1X( arg )
322 CYG_REPORT_FUNCARG8X( arg1...arg8 ) use %08x
323 CYG_REPORT_FUNCARG1Y... use %x
324 CYG_REPORT_FUNCARG1D... use %d
326 CYG_REPORT_FUNCARG1XV... use "arg=%08x"
327 CYG_REPORT_FUNCARG1YV... use "arg=%x"
328 CYG_REPORT_FUNCARG1DV... use "arg=%d"
333 CYG_TRACE_DUMP() dumps kernel state
334 CYG_TRACE_PRINT() prints buffered tracing
337 ---------------------------------------------------------------------------
339 Internal Documentation
340 ======================
342 The required functions which are used by the tracing macros are
345 cyg_tracenomsg( const char *psz_func, const char *psz_file,
346 cyg_uint32 linenum );
349 cyg_tracemsg( cyg_uint32 what, const char *psz_func, const char *psz_file,
350 cyg_uint32 linenum, const char *psz_msg );
353 cyg_tracemsg2( cyg_uint32 what,
354 const char *psz_func, const char *psz_file,
355 cyg_uint32 linenum, const char *psz_msg,
356 CYG_ADDRWORD arg0, CYG_ADDRWORD arg1 );
357 // extended in the obvious way for 4,6,8 arguments
359 These functions should expect psz_func and psz_file to possibly be NULL in
360 case those facilities are not available in the compilation environment, and
361 do something safe in such cases. A NULL message should really be dealt
362 with safely also, just logging "execution here" info like cyg_tracenomsg().
364 Discussion of possible underlying implementations
365 -------------------------------------------------
367 It is intended that the functions that get called can simply print the info
368 they are given in as fancy a format as you like, or they could do the
369 printf-type formatting and log the resulting text in a buffer. They get
370 told the type of event (function-entry, function-arguments, function-exit
371 or plain tracing info) and so can perform fancy indenting, for example, to
372 make call stack inspection more obvious to humans. It is also intended
373 that a more compact logging arrangement be possible, for example one which
374 records, in 32-bit words (CYG_ADDRWORDs), the addresses of the file,
375 function and msg strings, the line number and the arguments. This has the
376 implication that the msg string should not be constructed dynamically but
377 be static ie. a plain quoted C string. The number of arguments also must
378 be recorded, and if it is chosen to save string arguments in the buffer
379 rather than just their addresses (which could be invalid by the time the
380 logged information is processed) some flagging of which arguments are
381 strings must be provided. The system could also be extended to deal with
382 floats of whichever size fir in a CYG_ADDRWORD; these would probably
383 require special treatment also. With these considerations in mind, the
384 maximum number of parameters in a single trace message has been set to 8,
385 so that a byte bitset could be used to indicate which arguments are
386 strings, another for those which are floats, and the count of arguments
387 also fits in a byte as number or a bitset.
390 ****************************************************************************/
392 #include <pkgconf/infra.h>
394 #include <cyg/infra/cyg_ass.h>
396 // -------------------------------------------------------------------------
397 // CYGDBG_INFRA_DEBUG_FUNCTION_PSEUDOMACRO is dealt with in cyg_ass.h.
398 // -------------------------------------------------------------------------
400 #ifdef CYGDBG_USE_TRACING
402 // -------------------------------------------------------------------------
403 // We define macros and appropriate prototypes for the trace/fail
404 // system. These are:
405 // CYG_TRACE0..8 - trace if boolean
406 // CYG_TRACEPROC - default no comment proc entry
407 // CYG_TRACEPROCOUT - default no comment proc exit
408 // CYG_TRACE_DUMP - outputs a form of "core dump", including the state
409 // of the kernel scheduler, threads, etc.
410 // CYG_TRACE_PRINT - Forces manual output of any trace info that has
413 // these are executed to deal with tracing - breakpoint?
416 cyg_tracenomsg( const char *psz_func, const char *psz_file, cyg_uint32 linenum );
419 cyg_trace_dump(void);
421 #define CYG_TRACE_DUMP() cyg_trace_dump()
423 #ifdef CYGDBG_INFRA_DEBUG_TRACE_ASSERT_BUFFER
426 cyg_trace_print(void);
428 #define CYG_TRACE_PRINT() cyg_trace_print()
431 #define CYG_TRACE_PRINT() CYG_EMPTY_STATEMENT
434 // provide every other one of these as a space/caller bloat compromise.
436 # ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE
448 cyg_tracemsg( cyg_uint32 what,
449 const char *psz_func, const char *psz_file, cyg_uint32 linenum,
450 const char *psz_msg );
453 cyg_tracemsg2( cyg_uint32 what,
454 const char *psz_func, const char *psz_file, cyg_uint32 linenum,
456 CYG_ADDRWORD arg0, CYG_ADDRWORD arg1 );
458 cyg_tracemsg4( cyg_uint32 what,
459 const char *psz_func, const char *psz_file, cyg_uint32 linenum,
461 CYG_ADDRWORD arg0, CYG_ADDRWORD arg1,
462 CYG_ADDRWORD arg2, CYG_ADDRWORD arg3 );
464 cyg_tracemsg6( cyg_uint32 what,
465 const char *psz_func, const char *psz_file, cyg_uint32 linenum,
467 CYG_ADDRWORD arg0, CYG_ADDRWORD arg1,
468 CYG_ADDRWORD arg2, CYG_ADDRWORD arg3,
469 CYG_ADDRWORD arg4, CYG_ADDRWORD arg5 );
471 cyg_tracemsg8( cyg_uint32 what,
472 const char *psz_func, const char *psz_file, cyg_uint32 linenum,
474 CYG_ADDRWORD arg0, CYG_ADDRWORD arg1,
475 CYG_ADDRWORD arg2, CYG_ADDRWORD arg3,
476 CYG_ADDRWORD arg4, CYG_ADDRWORD arg5,
477 CYG_ADDRWORD arg6, CYG_ADDRWORD arg7 );
479 #endif // CYGDBG_INFRA_DEBUG_TRACE_MESSAGE
481 // -------------------------------------------------------------------------
483 # ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE
485 # define CYG_TRACE_docall0( _msg_ ) \
486 cyg_tracemsg( cyg_trace_trace, \
487 __PRETTY_FUNCTION__, __FILE__, __LINE__, _msg_ );
489 # define CYG_TRACE_docall2( _msg_, _arg0_, _arg1_ ) \
490 cyg_tracemsg2( cyg_trace_trace, \
491 __PRETTY_FUNCTION__, __FILE__, __LINE__, _msg_, \
492 (CYG_ADDRWORD)_arg0_, (CYG_ADDRWORD)_arg1_ );
494 # define CYG_TRACE_docall4( _msg_, _arg0_, _arg1_ , _arg2_, _arg3_ ) \
495 cyg_tracemsg4( cyg_trace_trace, \
496 __PRETTY_FUNCTION__, __FILE__, __LINE__, _msg_, \
497 (CYG_ADDRWORD)_arg0_, (CYG_ADDRWORD)_arg1_, \
498 (CYG_ADDRWORD)_arg2_, (CYG_ADDRWORD)_arg3_ );
500 # define CYG_TRACE_docall6( _msg_, _arg0_, _arg1_ , _arg2_, _arg3_, \
502 cyg_tracemsg6( cyg_trace_trace, \
503 __PRETTY_FUNCTION__, __FILE__, __LINE__, _msg_, \
504 (CYG_ADDRWORD)_arg0_, (CYG_ADDRWORD)_arg1_, \
505 (CYG_ADDRWORD)_arg2_, (CYG_ADDRWORD)_arg3_, \
506 (CYG_ADDRWORD)_arg4_, (CYG_ADDRWORD)_arg5_ );
508 # define CYG_TRACE_docall8( _msg_, _arg0_, _arg1_ , _arg2_, _arg3_, \
509 _arg4_, _arg5_, _arg6_, _arg7_ ) \
510 cyg_tracemsg8( cyg_trace_trace, \
511 __PRETTY_FUNCTION__, __FILE__, __LINE__, _msg_, \
512 (CYG_ADDRWORD)_arg0_, (CYG_ADDRWORD)_arg1_, \
513 (CYG_ADDRWORD)_arg2_, (CYG_ADDRWORD)_arg3_, \
514 (CYG_ADDRWORD)_arg4_, (CYG_ADDRWORD)_arg5_, \
515 (CYG_ADDRWORD)_arg6_, (CYG_ADDRWORD)_arg7_ );
517 # else // do not CYGDBG_INFRA_DEBUG_TRACE_MESSAGE
519 # define CYG_TRACE_docall0( _msg_ ) \
520 cyg_tracenomsg( __PRETTY_FUNCTION__, __FILE__, __LINE__ );
522 # define CYG_TRACE_docall2( _msg_, _arg0_, _arg1_ ) \
523 cyg_tracenomsg( __PRETTY_FUNCTION__, __FILE__, __LINE__ );
525 # define CYG_TRACE_docall4( _msg_, _arg0_, _arg1_ , _arg2_, _arg3_ ) \
526 cyg_tracenomsg( __PRETTY_FUNCTION__, __FILE__, __LINE__ );
528 # define CYG_TRACE_docall6( _msg_, _arg0_, _arg1_ , _arg2_, _arg3_, \
530 cyg_tracenomsg( __PRETTY_FUNCTION__, __FILE__, __LINE__ );
532 # define CYG_TRACE_docall8( _msg_, _arg0_, _arg1_, _arg2_, _arg3_, \
533 _arg4_, _arg5_, _arg6_, _arg7_ ) \
534 cyg_tracenomsg( __PRETTY_FUNCTION__, __FILE__, __LINE__ );
538 // -------------------------------------------------------------------------
539 // Conditioned trace; if the condition is false, fail.
541 #define CYG_TRACE0( _bool_, _msg_ ) \
544 CYG_TRACE_docall0( _msg_ ); \
547 #define CYG_TRACE1( _bool_, _msg_, a ) \
550 CYG_TRACE_docall2( _msg_, a, 0 ); \
553 #define CYG_TRACE2( _bool_, _msg_, a, b ) \
556 CYG_TRACE_docall2( _msg_, a, b ); \
559 #define CYG_TRACE3( _bool_, _msg_, a, b, c ) \
562 CYG_TRACE_docall4( _msg_, a, b, c, 0 ); \
565 #define CYG_TRACE4( _bool_, _msg_, a, b, c, d ) \
568 CYG_TRACE_docall4( _msg_, a, b, c, d ); \
571 #define CYG_TRACE5( _bool_, _msg_, a, b, c, d, e ) \
574 CYG_TRACE_docall6( _msg_, a, b, c, d, e, 0 ); \
577 #define CYG_TRACE6( _bool_, _msg_, a, b, c, d, e, f ) \
580 CYG_TRACE_docall6( _msg_, a, b, c, d, e, f ); \
583 #define CYG_TRACE7( _bool_, _msg_, a, b, c, d, e, f, g ) \
586 CYG_TRACE_docall8( _msg_, a, b, c, d, e, f, g, 0 ); \
589 #define CYG_TRACE8( _bool_, _msg_, a, b, c, d, e, f, g, h ) \
592 CYG_TRACE_docall8( _msg_, a, b, c, d, e, f, g, h ); \
595 // -------------------------------------------------------------------------
596 // Report function entry and exit.
597 // In C++ the macro CYG_REPORT_FUNCTION should appear as the first line of
598 // any function. It will generate a message whenever the function is entered
599 // and when it is exited.
600 // In C the macro should appear as the first statement after any local variable
601 // definitions. No exit message will be generated unless CYG_REPORT_RETURN is
602 // placed just before each return.
603 // Where a piece of code is to be compiled with both C and C++, the above
604 // rules for C should be followed.
606 #ifdef CYGDBG_INFRA_DEBUG_FUNCTION_REPORTS
610 class Cyg_TraceFunction_Report_
617 #ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE
619 CYG_ADDRWORD exitvalue;
620 enum { UNSET = 0, SET, VOID } exitset;
623 Cyg_TraceFunction_Report_(
624 int condition, const char *psz_func, const char *psz_file,
632 #ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE
636 cyg_tracemsg( cyg_trace_enter, func, file, lnum, "enter");
639 cyg_tracenomsg( func, file, lnum );
643 Cyg_TraceFunction_Report_(
644 int condition, const char *psz_func, const char *psz_file,
645 cyg_uint32 linenum, const char *psz_exitmsg )
651 #ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE
652 exitmsg = psz_exitmsg;
655 cyg_tracemsg( cyg_trace_enter, func, file, lnum, "enter");
657 CYG_UNUSED_PARAM( const char *, psz_exitmsg );
659 cyg_tracenomsg( func, file, lnum );
663 inline void set_exitvoid( cyg_uint32 linenum )
666 #ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE
667 CYG_ASSERT( NULL == exitmsg, "exitvoid used in typed function" );
668 CYG_ASSERT( UNSET == exitset, "exitvoid used when arg already set" );
673 inline void set_exitvalue( cyg_uint32 linenum, CYG_ADDRWORD retcode )
676 #ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE
677 CYG_ASSERT( UNSET == exitset, "exitvalue used when arg already set" );
681 CYG_UNUSED_PARAM( CYG_ADDRWORD, retcode );
685 ~Cyg_TraceFunction_Report_()
688 #ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE
689 if ( VOID == exitset )
690 cyg_tracemsg( cyg_trace_return, func, file, lnum,
692 else if ( UNSET == exitset )
693 cyg_tracemsg( cyg_trace_return, func, file, lnum,
695 else if ( NULL == exitmsg )
696 cyg_tracemsg2( cyg_trace_return, func, file, lnum,
697 "return %08x", exitvalue, 0 );
699 cyg_tracemsg2( cyg_trace_return, func, file, lnum,
700 exitmsg, exitvalue, 0 );
702 cyg_tracenomsg( func, file, lnum );
708 // These have no CYG_MACRO_START,END around because it is required
709 // that the scope of the object be the whole function body. Get it?
711 // These are the unconditional versions:
712 #define CYG_REPORT_FUNCTION() \
713 Cyg_TraceFunction_Report_ cyg_tracefunction_report_( \
714 1, __PRETTY_FUNCTION__, \
717 #define CYG_REPORT_FUNCTYPE( _exitmsg_ ) \
718 Cyg_TraceFunction_Report_ cyg_tracefunction_report_( \
719 1, __PRETTY_FUNCTION__, \
720 __FILE__, __LINE__, _exitmsg_ )
722 #define CYG_REPORT_FUNCNAME( _name_ ) \
723 Cyg_TraceFunction_Report_ cyg_tracefunction_report_( \
727 #define CYG_REPORT_FUNCNAMETYPE( _name_, _exitmsg_ ) \
728 Cyg_TraceFunction_Report_ cyg_tracefunction_report_( \
730 __FILE__, __LINE__, _exitmsg_ )
732 // These are conditioned on macro CYG_REPORT_USER_BOOL
733 // (which you better have defined)
734 #define CYG_REPORT_FUNCTIONC() \
735 Cyg_TraceFunction_Report_ cyg_tracefunction_report_( \
736 CYG_REPORT_USER_BOOL, __PRETTY_FUNCTION__, \
739 #define CYG_REPORT_FUNCTYPEC( _exitmsg_ ) \
740 Cyg_TraceFunction_Report_ cyg_tracefunction_report_( \
741 CYG_REPORT_USER_BOOL, __PRETTY_FUNCTION__, \
742 __FILE__, __LINE__, _exitmsg_ )
744 #define CYG_REPORT_FUNCNAMEC( _name_ ) \
745 Cyg_TraceFunction_Report_ cyg_tracefunction_report_( \
746 CYG_REPORT_USER_BOOL, _name_, \
749 #define CYG_REPORT_FUNCNAMETYPEC( _name_, _exitmsg_ ) \
750 Cyg_TraceFunction_Report_ cyg_tracefunction_report_( \
751 CYG_REPORT_USER_BOOL, _name_, \
752 __FILE__, __LINE__, _exitmsg_ )
755 #define CYG_REPORT_RETURN() CYG_MACRO_START \
756 cyg_tracefunction_report_.set_exitvoid( __LINE__ ); \
759 #define CYG_REPORT_RETVAL( _value_) CYG_MACRO_START \
760 cyg_tracefunction_report_.set_exitvalue( \
761 __LINE__, (CYG_ADDRWORD)(_value_) ); \
765 #else // not __cplusplus
768 struct Cyg_TraceFunction_Report_
772 const char *file; /* not strictly needed in plain 'C' */
773 cyg_uint32 lnum; /* nor this */
774 #ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE
776 CYG_ADDRWORD exitvalue;
782 #ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE
784 #define CYG_REPORT_FUNCTION_ENTER_INTERNAL() CYG_MACRO_START \
785 if ( cyg_tracefunction_report_.cond ) \
786 cyg_tracemsg( cyg_trace_enter, \
787 cyg_tracefunction_report_.func, \
788 cyg_tracefunction_report_.file, \
789 cyg_tracefunction_report_.lnum, \
793 #define CYG_REPORT_FUNCTION_CONSTRUCT( _c_, _fn_,_fl_,_l_,_xm_,_xv_,_xs_ ) \
794 { _c_, _fn_, _fl_, _l_, _xm_, _xv_, _xs_ }
796 #else // do not CYGDBG_INFRA_DEBUG_TRACE_MESSAGE
798 #define CYG_REPORT_FUNCTION_ENTER_INTERNAL() CYG_MACRO_START \
799 if ( cyg_tracefunction_report_.cond ) \
800 cyg_tracenomsg( cyg_tracefunction_report_.func, \
801 cyg_tracefunction_report_.file, \
802 cyg_tracefunction_report_.lnum ); \
805 #define CYG_REPORT_FUNCTION_CONSTRUCT( _c_, _fn_,_fl_,_l_,_xm_,_xv_,_xs_ ) \
806 { _c_, _fn_, _fl_, _l_ }
808 #endif // not CYGDBG_INFRA_DEBUG_TRACE_MESSAGE
810 // These have no CYG_MACRO_START,END around because it is required
811 // that the scope of the object be the whole function body. Get it?
813 // These are the unconditional versions:
814 #define CYG_REPORT_FUNCTION() \
815 struct Cyg_TraceFunction_Report_ cyg_tracefunction_report_ = \
816 CYG_REPORT_FUNCTION_CONSTRUCT( \
817 1, __PRETTY_FUNCTION__, __FILE__, __LINE__, NULL, 0, 0 ); \
818 CYG_REPORT_FUNCTION_ENTER_INTERNAL()
820 #define CYG_REPORT_FUNCTYPE( _exitmsg_ ) \
821 struct Cyg_TraceFunction_Report_ cyg_tracefunction_report_ = \
822 CYG_REPORT_FUNCTION_CONSTRUCT( \
823 1, __PRETTY_FUNCTION__, __FILE__, __LINE__, _exitmsg_, 0, 0 ); \
824 CYG_REPORT_FUNCTION_ENTER_INTERNAL()
826 #define CYG_REPORT_FUNCNAME( _name_ ) \
827 struct Cyg_TraceFunction_Report_ cyg_tracefunction_report_ = \
828 CYG_REPORT_FUNCTION_CONSTRUCT( \
829 1, _name_, __FILE__, __LINE__, NULL, 0, 0 ); \
830 CYG_REPORT_FUNCTION_ENTER_INTERNAL()
832 #define CYG_REPORT_FUNCNAMETYPE( _name_, _exitmsg_ ) \
833 struct Cyg_TraceFunction_Report_ cyg_tracefunction_report_ = \
834 CYG_REPORT_FUNCTION_CONSTRUCT( \
835 1, _name_, __FILE__, __LINE__, _exitmsg_, 0, 0 ); \
836 CYG_REPORT_FUNCTION_ENTER_INTERNAL()
838 // These are conditioned on macro CYG_REPORT_USER_BOOL
839 // (which you better have defined)
840 #define CYG_REPORT_FUNCTIONC() \
841 struct Cyg_TraceFunction_Report_ cyg_tracefunction_report_ = \
842 CYG_REPORT_FUNCTION_CONSTRUCT( \
843 CYG_REPORT_USER_BOOL, \
844 __PRETTY_FUNCTION__, __FILE__, __LINE__, NULL, 0, 0 ); \
845 CYG_REPORT_FUNCTION_ENTER_INTERNAL()
847 #define CYG_REPORT_FUNCTYPEC( _exitmsg_ ) \
848 struct Cyg_TraceFunction_Report_ cyg_tracefunction_report_ = \
849 CYG_REPORT_FUNCTION_CONSTRUCT( \
850 CYG_REPORT_USER_BOOL, \
851 __PRETTY_FUNCTION__, __FILE__, __LINE__, _exitmsg_, 0, 0 ); \
852 CYG_REPORT_FUNCTION_ENTER_INTERNAL()
854 #define CYG_REPORT_FUNCNAMEC( _name_ ) \
855 struct Cyg_TraceFunction_Report_ cyg_tracefunction_report_ = \
856 CYG_REPORT_FUNCTION_CONSTRUCT( \
857 CYG_REPORT_USER_BOOL, \
858 _name_, __FILE__, __LINE__, NULL, 0, 0 ); \
859 CYG_REPORT_FUNCTION_ENTER_INTERNAL()
861 #define CYG_REPORT_FUNCNAMETYPEC( _name_, _exitmsg_ ) \
862 struct Cyg_TraceFunction_Report_ cyg_tracefunction_report_ = \
863 CYG_REPORT_FUNCTION_CONSTRUCT( \
864 CYG_REPORT_USER_BOOL, \
865 _name_, __FILE__, __LINE__, _exitmsg_, 0, 0 ); \
866 CYG_REPORT_FUNCTION_ENTER_INTERNAL()
868 #ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE
870 #define CYG_REPORT_RETURN() CYG_MACRO_START \
871 CYG_ASSERT( NULL == cyg_tracefunction_report_.exitmsg, \
872 "exitvoid used in typed function" ); \
873 CYG_ASSERT( 0 == cyg_tracefunction_report_.exitset, \
874 "exitvoid used when arg already set" ); \
875 cyg_tracefunction_report_.lnum = __LINE__; \
876 cyg_tracefunction_report_.exitset = 2; \
877 if ( cyg_tracefunction_report_.cond ) \
878 cyg_tracemsg( cyg_trace_return, \
879 cyg_tracefunction_report_.func, \
880 cyg_tracefunction_report_.file, \
881 cyg_tracefunction_report_.lnum, \
885 #define CYG_REPORT_RETVAL( _value_ ) CYG_MACRO_START \
886 CYG_ASSERT( 0 == cyg_tracefunction_report_.exitset, \
887 "exitvalue used when arg already set" ); \
888 cyg_tracefunction_report_.lnum = __LINE__; \
889 cyg_tracefunction_report_.exitvalue = (CYG_ADDRWORD)(_value_); \
890 cyg_tracefunction_report_.exitset = 1; \
891 if ( cyg_tracefunction_report_.cond ) \
892 cyg_tracemsg2( cyg_trace_return, \
893 cyg_tracefunction_report_.func, \
894 cyg_tracefunction_report_.file, \
895 cyg_tracefunction_report_.lnum, \
896 cyg_tracefunction_report_.exitmsg ? \
897 cyg_tracefunction_report_.exitmsg : \
899 cyg_tracefunction_report_.exitvalue, 0 ); \
902 #else // do not CYGDBG_INFRA_DEBUG_TRACE_MESSAGE
904 #define CYG_REPORT_RETURN() CYG_MACRO_START \
905 cyg_tracefunction_report_.lnum = __LINE__; \
906 if ( cyg_tracefunction_report_.cond ) \
907 cyg_tracenomsg( cyg_tracefunction_report_.func, \
908 cyg_tracefunction_report_.file, \
909 cyg_tracefunction_report_.lnum ); \
912 #define CYG_REPORT_RETVAL( _value_ ) CYG_MACRO_START \
913 CYG_REPORT_RETURN(); \
916 #endif // not CYGDBG_INFRA_DEBUG_TRACE_MESSAGE
918 #endif // not __cplusplus
920 #ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE
922 #define CYG_REPORT_FUNCARGVOID() CYG_MACRO_START \
923 if ( cyg_tracefunction_report_.cond ) \
924 cyg_tracemsg( cyg_trace_args, \
925 cyg_tracefunction_report_.func, \
926 cyg_tracefunction_report_.file, \
927 cyg_tracefunction_report_.lnum, \
932 #define CYG_REPORT_FUNCARG1( _format_, a ) CYG_MACRO_START \
933 if ( cyg_tracefunction_report_.cond ) \
934 cyg_tracemsg2( cyg_trace_args, \
935 cyg_tracefunction_report_.func, \
936 cyg_tracefunction_report_.file, \
937 cyg_tracefunction_report_.lnum, \
939 (CYG_ADDRWORD)a , 0 \
943 #define CYG_REPORT_FUNCARG2( _format_, a,b ) CYG_MACRO_START \
944 if ( cyg_tracefunction_report_.cond ) \
945 cyg_tracemsg2( cyg_trace_args, \
946 cyg_tracefunction_report_.func, \
947 cyg_tracefunction_report_.file, \
948 cyg_tracefunction_report_.lnum, \
950 (CYG_ADDRWORD)a, (CYG_ADDRWORD)b \
954 #define CYG_REPORT_FUNCARG3( _format_, a,b,c ) CYG_MACRO_START \
955 if ( cyg_tracefunction_report_.cond ) \
956 cyg_tracemsg4( cyg_trace_args, \
957 cyg_tracefunction_report_.func, \
958 cyg_tracefunction_report_.file, \
959 cyg_tracefunction_report_.lnum, \
961 (CYG_ADDRWORD)a, (CYG_ADDRWORD)b, \
962 (CYG_ADDRWORD)c , 0 \
966 #define CYG_REPORT_FUNCARG4( _format_, a,b,c,d ) CYG_MACRO_START \
967 if ( cyg_tracefunction_report_.cond ) \
968 cyg_tracemsg4( cyg_trace_args, \
969 cyg_tracefunction_report_.func, \
970 cyg_tracefunction_report_.file, \
971 cyg_tracefunction_report_.lnum, \
973 (CYG_ADDRWORD)a, (CYG_ADDRWORD)b, \
974 (CYG_ADDRWORD)c, (CYG_ADDRWORD)d \
978 #define CYG_REPORT_FUNCARG5( _format_, a,b,c,d,e ) CYG_MACRO_START \
979 if ( cyg_tracefunction_report_.cond ) \
980 cyg_tracemsg6( cyg_trace_args, \
981 cyg_tracefunction_report_.func, \
982 cyg_tracefunction_report_.file, \
983 cyg_tracefunction_report_.lnum, \
985 (CYG_ADDRWORD)a, (CYG_ADDRWORD)b, \
986 (CYG_ADDRWORD)c, (CYG_ADDRWORD)d, \
987 (CYG_ADDRWORD)e , 0 \
991 #define CYG_REPORT_FUNCARG6( _format_, a,b,c,d,e,f ) CYG_MACRO_START \
992 if ( cyg_tracefunction_report_.cond ) \
993 cyg_tracemsg6( cyg_trace_args, \
994 cyg_tracefunction_report_.func, \
995 cyg_tracefunction_report_.file, \
996 cyg_tracefunction_report_.lnum, \
998 (CYG_ADDRWORD)a, (CYG_ADDRWORD)b, \
999 (CYG_ADDRWORD)c, (CYG_ADDRWORD)d, \
1000 (CYG_ADDRWORD)e, (CYG_ADDRWORD)f \
1004 #define CYG_REPORT_FUNCARG7( _format_, a,b,c,d,e,f,g ) CYG_MACRO_START \
1005 if ( cyg_tracefunction_report_.cond ) \
1006 cyg_tracemsg8( cyg_trace_args, \
1007 cyg_tracefunction_report_.func, \
1008 cyg_tracefunction_report_.file, \
1009 cyg_tracefunction_report_.lnum, \
1011 (CYG_ADDRWORD)a, (CYG_ADDRWORD)b, \
1012 (CYG_ADDRWORD)c, (CYG_ADDRWORD)d, \
1013 (CYG_ADDRWORD)e, (CYG_ADDRWORD)f, \
1014 (CYG_ADDRWORD)g , 0 \
1018 #define CYG_REPORT_FUNCARG8( _format_, a,b,c,d,e,f,g,h ) CYG_MACRO_START\
1019 if ( cyg_tracefunction_report_.cond ) \
1020 cyg_tracemsg8( cyg_trace_args, \
1021 cyg_tracefunction_report_.func, \
1022 cyg_tracefunction_report_.file, \
1023 cyg_tracefunction_report_.lnum, \
1025 (CYG_ADDRWORD)a, (CYG_ADDRWORD)b, \
1026 (CYG_ADDRWORD)c, (CYG_ADDRWORD)d, \
1027 (CYG_ADDRWORD)e, (CYG_ADDRWORD)f, \
1028 (CYG_ADDRWORD)g, (CYG_ADDRWORD)h \
1033 #else // do not CYGDBG_INFRA_DEBUG_TRACE_MESSAGE
1035 #define CYG_REPORT_FUNCARGVOID() CYG_EMPTY_STATEMENT
1036 #define CYG_REPORT_FUNCARG1( _format_, a ) CYG_EMPTY_STATEMENT
1037 #define CYG_REPORT_FUNCARG2( _format_, a,b ) CYG_EMPTY_STATEMENT
1038 #define CYG_REPORT_FUNCARG3( _format_, a,b,c ) CYG_EMPTY_STATEMENT
1039 #define CYG_REPORT_FUNCARG4( _format_, a,b,c,d ) CYG_EMPTY_STATEMENT
1040 #define CYG_REPORT_FUNCARG5( _format_, a,b,c,d,e ) CYG_EMPTY_STATEMENT
1041 #define CYG_REPORT_FUNCARG6( _format_, a,b,c,d,e,f ) CYG_EMPTY_STATEMENT
1042 #define CYG_REPORT_FUNCARG7( _format_, a,b,c,d,e,f,g ) CYG_EMPTY_STATEMENT
1043 #define CYG_REPORT_FUNCARG8( _format_, a,b,c,d,e,f,g,h ) CYG_EMPTY_STATEMENT
1045 #endif // not CYGDBG_INFRA_DEBUG_TRACE_MESSAGE
1047 #else // no CYGDBG_INFRA_DEBUG_FUNCTION_REPORTS
1049 #define CYG_REPORT_FUNCTION() CYG_EMPTY_STATEMENT
1050 #define CYG_REPORT_FUNCTYPE( _exitmsg_ ) CYG_EMPTY_STATEMENT
1051 #define CYG_REPORT_FUNCNAME( _name_ ) CYG_EMPTY_STATEMENT
1052 #define CYG_REPORT_FUNCNAMETYPE( _name_, _exitmsg_ ) CYG_EMPTY_STATEMENT
1054 #define CYG_REPORT_FUNCTIONC() CYG_EMPTY_STATEMENT
1055 #define CYG_REPORT_FUNCTYPEC( _exitmsg_ ) CYG_EMPTY_STATEMENT
1056 #define CYG_REPORT_FUNCNAMEC( _name_ ) CYG_EMPTY_STATEMENT
1057 #define CYG_REPORT_FUNCNAMETYPEC( _name_, _exitmsg_ ) CYG_EMPTY_STATEMENT
1059 #define CYG_REPORT_FUNCARGVOID() CYG_EMPTY_STATEMENT
1060 #define CYG_REPORT_FUNCARG1( _format_, a ) CYG_EMPTY_STATEMENT
1061 #define CYG_REPORT_FUNCARG2( _format_, a,b ) CYG_EMPTY_STATEMENT
1062 #define CYG_REPORT_FUNCARG3( _format_, a,b,c ) CYG_EMPTY_STATEMENT
1063 #define CYG_REPORT_FUNCARG4( _format_, a,b,c,d ) CYG_EMPTY_STATEMENT
1064 #define CYG_REPORT_FUNCARG5( _format_, a,b,c,d,e ) CYG_EMPTY_STATEMENT
1065 #define CYG_REPORT_FUNCARG6( _format_, a,b,c,d,e,f ) CYG_EMPTY_STATEMENT
1066 #define CYG_REPORT_FUNCARG7( _format_, a,b,c,d,e,f,g ) CYG_EMPTY_STATEMENT
1067 #define CYG_REPORT_FUNCARG8( _format_, a,b,c,d,e,f,g,h ) CYG_EMPTY_STATEMENT
1069 #define CYG_REPORT_RETURN() CYG_EMPTY_STATEMENT
1070 #define CYG_REPORT_RETVAL( _value_ ) CYG_EMPTY_STATEMENT
1072 #endif // CYGDBG_INFRA_DEBUG_FUNCTION_REPORTS
1074 #else // ! CYGDBG_USE_TRACING
1076 // -------------------------------------------------------------------------
1077 // No traces: we define empty statements for trace macros.
1079 #define CYG_TRACE0( _bool_, _msg_ ) CYG_EMPTY_STATEMENT
1080 #define CYG_TRACE1( _bool_, _msg_, a ) CYG_EMPTY_STATEMENT
1081 #define CYG_TRACE2( _bool_, _msg_, a,b ) CYG_EMPTY_STATEMENT
1082 #define CYG_TRACE3( _bool_, _msg_, a,b,c ) CYG_EMPTY_STATEMENT
1083 #define CYG_TRACE4( _bool_, _msg_, a,b,c,d ) CYG_EMPTY_STATEMENT
1084 #define CYG_TRACE5( _bool_, _msg_, a,b,c,d,e ) CYG_EMPTY_STATEMENT
1085 #define CYG_TRACE6( _bool_, _msg_, a,b,c,d,e,f ) CYG_EMPTY_STATEMENT
1086 #define CYG_TRACE7( _bool_, _msg_, a,b,c,d,e,f,g ) CYG_EMPTY_STATEMENT
1087 #define CYG_TRACE8( _bool_, _msg_, a,b,c,d,e,f,g,h ) CYG_EMPTY_STATEMENT
1089 #define CYG_REPORT_FUNCTION() CYG_EMPTY_STATEMENT
1090 #define CYG_REPORT_FUNCTYPE( _exitmsg_ ) CYG_EMPTY_STATEMENT
1091 #define CYG_REPORT_FUNCNAME( _name_ ) CYG_EMPTY_STATEMENT
1092 #define CYG_REPORT_FUNCNAMETYPE( _name_, _exitmsg_ ) CYG_EMPTY_STATEMENT
1094 #define CYG_REPORT_FUNCTIONC() CYG_EMPTY_STATEMENT
1095 #define CYG_REPORT_FUNCTYPEC( _exitmsg_ ) CYG_EMPTY_STATEMENT
1096 #define CYG_REPORT_FUNCNAMEC( _name_ ) CYG_EMPTY_STATEMENT
1097 #define CYG_REPORT_FUNCNAMETYPEC( _name_, _exitmsg_ ) CYG_EMPTY_STATEMENT
1099 #define CYG_REPORT_FUNCARGVOID() CYG_EMPTY_STATEMENT
1100 #define CYG_REPORT_FUNCARG1( _format_, a ) CYG_EMPTY_STATEMENT
1101 #define CYG_REPORT_FUNCARG2( _format_, a,b ) CYG_EMPTY_STATEMENT
1102 #define CYG_REPORT_FUNCARG3( _format_, a,b,c ) CYG_EMPTY_STATEMENT
1103 #define CYG_REPORT_FUNCARG4( _format_, a,b,c,d ) CYG_EMPTY_STATEMENT
1104 #define CYG_REPORT_FUNCARG5( _format_, a,b,c,d,e ) CYG_EMPTY_STATEMENT
1105 #define CYG_REPORT_FUNCARG6( _format_, a,b,c,d,e,f ) CYG_EMPTY_STATEMENT
1106 #define CYG_REPORT_FUNCARG7( _format_, a,b,c,d,e,f,g ) CYG_EMPTY_STATEMENT
1107 #define CYG_REPORT_FUNCARG8( _format_, a,b,c,d,e,f,g,h ) CYG_EMPTY_STATEMENT
1109 #define CYG_REPORT_RETURN() CYG_EMPTY_STATEMENT
1110 #define CYG_REPORT_RETVAL( _value_ ) CYG_EMPTY_STATEMENT
1112 #define CYG_TRACE_PRINT() CYG_EMPTY_STATEMENT
1113 #define CYG_TRACE_DUMP() CYG_EMPTY_STATEMENT
1115 #endif // ! CYGDBG_USE_TRACING
1117 // -------------------------------------------------------------------------
1119 // CYG_TRACEn{[XDY]{V}}{B}
1121 // Convenience macros: these fall into a few dimensions, with suffix letters:
1123 // X: user need not supply a format string, %08x is used
1124 // D: ditto but signed decimal, %d
1125 // Y: ditto but just plain %x
1126 // Second option, only meaningful with one of XDY:
1127 // V: "<var> = %..." is used, by stringifying the argument
1129 // B: user need not supply a bool; the symbol CYG_TRACE_USER_BOOL is
1130 // used (which we do not define, user must do this)
1132 #define CYG_TRACE0B( _msg_ ) \
1133 CYG_TRACE0( CYG_TRACE_USER_BOOL, _msg_ )
1134 #define CYG_TRACE1B( _msg_, a ) \
1135 CYG_TRACE1( CYG_TRACE_USER_BOOL, _msg_, a )
1136 #define CYG_TRACE2B( _msg_, a,b ) \
1137 CYG_TRACE2( CYG_TRACE_USER_BOOL, _msg_, a,b )
1138 #define CYG_TRACE3B( _msg_, a,b,c ) \
1139 CYG_TRACE3( CYG_TRACE_USER_BOOL, _msg_, a,b,c )
1140 #define CYG_TRACE4B( _msg_, a,b,c,d ) \
1141 CYG_TRACE4( CYG_TRACE_USER_BOOL, _msg_, a,b,c,d )
1142 #define CYG_TRACE5B( _msg_, a,b,c,d,e ) \
1143 CYG_TRACE5( CYG_TRACE_USER_BOOL, _msg_, a,b,c,d,e )
1144 #define CYG_TRACE6B( _msg_, a,b,c,d,e,f ) \
1145 CYG_TRACE6( CYG_TRACE_USER_BOOL, _msg_, a,b,c,d,e,f )
1146 #define CYG_TRACE7B( _msg_, a,b,c,d,e,f,g ) \
1147 CYG_TRACE7( CYG_TRACE_USER_BOOL, _msg_, a,b,c,d,e,f,g )
1148 #define CYG_TRACE8B( _msg_, a,b,c,d,e,f,g,h ) \
1149 CYG_TRACE8( CYG_TRACE_USER_BOOL, _msg_, a,b,c,d,e,f,g,h )
1151 // long hex versions
1153 #define CYG_TRACE1X( _bool_, a ) \
1154 CYG_TRACE1( _bool_, "%08x", a )
1155 #define CYG_TRACE2X( _bool_, a,b ) \
1156 CYG_TRACE2( _bool_, "%08x %08x", a,b )
1157 #define CYG_TRACE3X( _bool_, a,b,c ) \
1158 CYG_TRACE3( _bool_, "%08x %08x %08x", a,b,c )
1159 #define CYG_TRACE4X( _bool_, a,b,c,d ) \
1160 CYG_TRACE4( _bool_, "%08x %08x %08x %08x", a,b,c,d )
1161 #define CYG_TRACE5X( _bool_, a,b,c,d,e ) \
1162 CYG_TRACE5( _bool_, "%08x %08x %08x %08x %08x", a,b,c,d,e )
1163 #define CYG_TRACE6X( _bool_, a,b,c,d,e,f ) \
1164 CYG_TRACE6( _bool_, "%08x %08x %08x %08x %08x %08x", \
1166 #define CYG_TRACE7X( _bool_, a,b,c,d,e,f,g ) \
1167 CYG_TRACE7( _bool_, "%08x %08x %08x %08x %08x %08x %08x", \
1169 #define CYG_TRACE8X( _bool_, a,b,c,d,e,f,g,h ) \
1170 CYG_TRACE8( _bool_, "%08x %08x %08x %08x %08x %08x %08x %08x", \
1173 #define CYG_TRACE1XV( _bool_, a ) \
1174 CYG_TRACE1( _bool_, # a "=%08x ", a )
1175 #define CYG_TRACE2XV( _bool_, a,b ) \
1176 CYG_TRACE2( _bool_, \
1177 # a "=%08x " # b "=%08x " , a,b )
1178 #define CYG_TRACE3XV( _bool_, a,b,c ) \
1179 CYG_TRACE3( _bool_, \
1180 # a "=%08x " # b "=%08x " # c "=%08x " , a,b,c )
1181 #define CYG_TRACE4XV( _bool_, a,b,c,d ) \
1182 CYG_TRACE4( _bool_, \
1183 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \
1185 #define CYG_TRACE5XV( _bool_, a,b,c,d,e ) \
1186 CYG_TRACE5( _bool_, \
1187 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \
1190 #define CYG_TRACE6XV( _bool_, a,b,c,d,e,f ) \
1191 CYG_TRACE6( _bool_, \
1192 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \
1193 # e "=%08x " # f "=%08x " \
1195 #define CYG_TRACE7XV( _bool_, a,b,c,d,e,f,g ) \
1196 CYG_TRACE7( _bool_, \
1197 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \
1198 # e "=%08x " # f "=%08x " # g "=%08x " \
1200 #define CYG_TRACE8XV( _bool_, a,b,c,d,e,f,g,h ) \
1201 CYG_TRACE8( _bool_, \
1202 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \
1203 # e "=%08x " # f "=%08x " # g "=%08x " # h "=%08x " \
1206 #define CYG_TRACE1XB( a ) \
1207 CYG_TRACE1( CYG_TRACE_USER_BOOL, "%08x", a )
1208 #define CYG_TRACE2XB( a,b ) \
1209 CYG_TRACE2( CYG_TRACE_USER_BOOL, "%08x %08x", a,b )
1210 #define CYG_TRACE3XB( a,b,c ) \
1211 CYG_TRACE3( CYG_TRACE_USER_BOOL, "%08x %08x %08x", a,b,c )
1212 #define CYG_TRACE4XB( a,b,c,d ) \
1213 CYG_TRACE4( CYG_TRACE_USER_BOOL, "%08x %08x %08x %08x", a,b,c,d )
1214 #define CYG_TRACE5XB( a,b,c,d,e ) \
1215 CYG_TRACE5( CYG_TRACE_USER_BOOL, "%08x %08x %08x %08x %08x", a,b,c,d,e )
1216 #define CYG_TRACE6XB( a,b,c,d,e,f ) \
1217 CYG_TRACE6( CYG_TRACE_USER_BOOL, "%08x %08x %08x %08x %08x %08x", \
1219 #define CYG_TRACE7XB( a,b,c,d,e,f,g ) \
1220 CYG_TRACE7( CYG_TRACE_USER_BOOL, "%08x %08x %08x %08x %08x %08x %08x", \
1222 #define CYG_TRACE8XB( a,b,c,d,e,f,g,h ) \
1223 CYG_TRACE8( CYG_TRACE_USER_BOOL, "%08x %08x %08x %08x %08x %08x %08x %08x", \
1226 #define CYG_TRACE1XVB( a ) \
1227 CYG_TRACE1( CYG_TRACE_USER_BOOL, # a "=%08x ", a )
1228 #define CYG_TRACE2XVB( a,b ) \
1229 CYG_TRACE2( CYG_TRACE_USER_BOOL, \
1230 # a "=%08x " # b "=%08x " , a,b )
1231 #define CYG_TRACE3XVB( a,b,c ) \
1232 CYG_TRACE3( CYG_TRACE_USER_BOOL, \
1233 # a "=%08x " # b "=%08x " # c "=%08x " , a,b,c )
1234 #define CYG_TRACE4XVB( a,b,c,d ) \
1235 CYG_TRACE4( CYG_TRACE_USER_BOOL, \
1236 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \
1238 #define CYG_TRACE5XVB( a,b,c,d,e ) \
1239 CYG_TRACE5( CYG_TRACE_USER_BOOL, \
1240 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \
1243 #define CYG_TRACE6XVB( a,b,c,d,e,f ) \
1244 CYG_TRACE6( CYG_TRACE_USER_BOOL, \
1245 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \
1246 # e "=%08x " # f "=%08x " \
1248 #define CYG_TRACE7XVB( a,b,c,d,e,f,g ) \
1249 CYG_TRACE7( CYG_TRACE_USER_BOOL, \
1250 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \
1251 # e "=%08x " # f "=%08x " # g "=%08x " \
1253 #define CYG_TRACE8XVB( a,b,c,d,e,f,g,h ) \
1254 CYG_TRACE8( CYG_TRACE_USER_BOOL, \
1255 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \
1256 # e "=%08x " # f "=%08x " # g "=%08x " # h "=%08x " \
1261 #define CYG_TRACE1D( _bool_, a ) \
1262 CYG_TRACE1( _bool_, "%d", a )
1263 #define CYG_TRACE2D( _bool_, a,b ) \
1264 CYG_TRACE2( _bool_, "%d %d", a,b )
1265 #define CYG_TRACE3D( _bool_, a,b,c ) \
1266 CYG_TRACE3( _bool_, "%d %d %d", a,b,c )
1267 #define CYG_TRACE4D( _bool_, a,b,c,d ) \
1268 CYG_TRACE4( _bool_, "%d %d %d %d", a,b,c,d )
1269 #define CYG_TRACE5D( _bool_, a,b,c,d,e ) \
1270 CYG_TRACE5( _bool_, "%d %d %d %d %d", a,b,c,d,e )
1271 #define CYG_TRACE6D( _bool_, a,b,c,d,e,f ) \
1272 CYG_TRACE6( _bool_, "%d %d %d %d %d %d", \
1274 #define CYG_TRACE7D( _bool_, a,b,c,d,e,f,g ) \
1275 CYG_TRACE7( _bool_, "%d %d %d %d %d %d %d", \
1277 #define CYG_TRACE8D( _bool_, a,b,c,d,e,f,g,h ) \
1278 CYG_TRACE8( _bool_, "%d %d %d %d %d %d %d %d", \
1281 #define CYG_TRACE1DV( _bool_, a ) \
1282 CYG_TRACE1( _bool_, # a "=%d ", a )
1283 #define CYG_TRACE2DV( _bool_, a,b ) \
1284 CYG_TRACE2( _bool_, \
1285 # a "=%d " # b "=%d " , a,b )
1286 #define CYG_TRACE3DV( _bool_, a,b,c ) \
1287 CYG_TRACE3( _bool_, \
1288 # a "=%d " # b "=%d " # c "=%d " , a,b,c )
1289 #define CYG_TRACE4DV( _bool_, a,b,c,d ) \
1290 CYG_TRACE4( _bool_, \
1291 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \
1293 #define CYG_TRACE5DV( _bool_, a,b,c,d,e ) \
1294 CYG_TRACE5( _bool_, \
1295 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \
1298 #define CYG_TRACE6DV( _bool_, a,b,c,d,e,f ) \
1299 CYG_TRACE6( _bool_, \
1300 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \
1301 # e "=%d " # f "=%d " \
1303 #define CYG_TRACE7DV( _bool_, a,b,c,d,e,f,g ) \
1304 CYG_TRACE7( _bool_, \
1305 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \
1306 # e "=%d " # f "=%d " # g "=%d " \
1308 #define CYG_TRACE8DV( _bool_, a,b,c,d,e,f,g,h ) \
1309 CYG_TRACE8( _bool_, \
1310 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \
1311 # e "=%d " # f "=%d " # g "=%d " # h "=%d " \
1314 #define CYG_TRACE1DB( a ) \
1315 CYG_TRACE1( CYG_TRACE_USER_BOOL, "%d", a )
1316 #define CYG_TRACE2DB( a,b ) \
1317 CYG_TRACE2( CYG_TRACE_USER_BOOL, "%d %d", a,b )
1318 #define CYG_TRACE3DB( a,b,c ) \
1319 CYG_TRACE3( CYG_TRACE_USER_BOOL, "%d %d %d", a,b,c )
1320 #define CYG_TRACE4DB( a,b,c,d ) \
1321 CYG_TRACE4( CYG_TRACE_USER_BOOL, "%d %d %d %d", a,b,c,d )
1322 #define CYG_TRACE5DB( a,b,c,d,e ) \
1323 CYG_TRACE5( CYG_TRACE_USER_BOOL, "%d %d %d %d %d", a,b,c,d,e )
1324 #define CYG_TRACE6DB( a,b,c,d,e,f ) \
1325 CYG_TRACE6( CYG_TRACE_USER_BOOL, "%d %d %d %d %d %d", \
1327 #define CYG_TRACE7DB( a,b,c,d,e,f,g ) \
1328 CYG_TRACE7( CYG_TRACE_USER_BOOL, "%d %d %d %d %d %d %d", \
1330 #define CYG_TRACE8DB( a,b,c,d,e,f,g,h ) \
1331 CYG_TRACE8( CYG_TRACE_USER_BOOL, "%d %d %d %d %d %d %d %d", \
1334 #define CYG_TRACE1DVB( a ) \
1335 CYG_TRACE1( CYG_TRACE_USER_BOOL, # a "=%d ", a )
1336 #define CYG_TRACE2DVB( a,b ) \
1337 CYG_TRACE2( CYG_TRACE_USER_BOOL, \
1338 # a "=%d " # b "=%d " , a,b )
1339 #define CYG_TRACE3DVB( a,b,c ) \
1340 CYG_TRACE3( CYG_TRACE_USER_BOOL, \
1341 # a "=%d " # b "=%d " # c "=%d " , a,b,c )
1342 #define CYG_TRACE4DVB( a,b,c,d ) \
1343 CYG_TRACE4( CYG_TRACE_USER_BOOL, \
1344 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \
1346 #define CYG_TRACE5DVB( a,b,c,d,e ) \
1347 CYG_TRACE5( CYG_TRACE_USER_BOOL, \
1348 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \
1351 #define CYG_TRACE6DVB( a,b,c,d,e,f ) \
1352 CYG_TRACE6( CYG_TRACE_USER_BOOL, \
1353 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \
1354 # e "=%d " # f "=%d " \
1356 #define CYG_TRACE7DVB( a,b,c,d,e,f,g ) \
1357 CYG_TRACE7( CYG_TRACE_USER_BOOL, \
1358 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \
1359 # e "=%d " # f "=%d " # g "=%d " \
1361 #define CYG_TRACE8DVB( a,b,c,d,e,f,g,h ) \
1362 CYG_TRACE8( CYG_TRACE_USER_BOOL, \
1363 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \
1364 # e "=%d " # f "=%d " # g "=%d " # h "=%d " \
1367 // short hex versions
1369 #define CYG_TRACE1Y( _bool_, a ) \
1370 CYG_TRACE1( _bool_, "%x", a )
1371 #define CYG_TRACE2Y( _bool_, a,b ) \
1372 CYG_TRACE2( _bool_, "%x %x", a,b )
1373 #define CYG_TRACE3Y( _bool_, a,b,c ) \
1374 CYG_TRACE3( _bool_, "%x %x %x", a,b,c )
1375 #define CYG_TRACE4Y( _bool_, a,b,c,d ) \
1376 CYG_TRACE4( _bool_, "%x %x %x %x", a,b,c,d )
1377 #define CYG_TRACE5Y( _bool_, a,b,c,d,e ) \
1378 CYG_TRACE5( _bool_, "%x %x %x %x %x", a,b,c,d,e )
1379 #define CYG_TRACE6Y( _bool_, a,b,c,d,e,f ) \
1380 CYG_TRACE6( _bool_, "%x %x %x %x %x %x", \
1382 #define CYG_TRACE7Y( _bool_, a,b,c,d,e,f,g ) \
1383 CYG_TRACE7( _bool_, "%x %x %x %x %x %x %x", \
1385 #define CYG_TRACE8Y( _bool_, a,b,c,d,e,f,g,h ) \
1386 CYG_TRACE8( _bool_, "%x %x %x %x %x %x %x %x", \
1389 #define CYG_TRACE1YV( _bool_, a ) \
1390 CYG_TRACE1( _bool_, # a "=%x ", a )
1391 #define CYG_TRACE2YV( _bool_, a,b ) \
1392 CYG_TRACE2( _bool_, \
1393 # a "=%x " # b "=%x " , a,b )
1394 #define CYG_TRACE3YV( _bool_, a,b,c ) \
1395 CYG_TRACE3( _bool_, \
1396 # a "=%x " # b "=%x " # c "=%x " , a,b,c )
1397 #define CYG_TRACE4YV( _bool_, a,b,c,d ) \
1398 CYG_TRACE4( _bool_, \
1399 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \
1401 #define CYG_TRACE5YV( _bool_, a,b,c,d,e ) \
1402 CYG_TRACE5( _bool_, \
1403 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \
1406 #define CYG_TRACE6YV( _bool_, a,b,c,d,e,f ) \
1407 CYG_TRACE6( _bool_, \
1408 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \
1409 # e "=%x " # f "=%x " \
1411 #define CYG_TRACE7YV( _bool_, a,b,c,d,e,f,g ) \
1412 CYG_TRACE7( _bool_, \
1413 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \
1414 # e "=%x " # f "=%x " # g "=%x " \
1416 #define CYG_TRACE8YV( _bool_, a,b,c,d,e,f,g,h ) \
1417 CYG_TRACE8( _bool_, \
1418 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \
1419 # e "=%x " # f "=%x " # g "=%x " # h "=%x " \
1422 #define CYG_TRACE1YB( a ) \
1423 CYG_TRACE1( CYG_TRACE_USER_BOOL, "%x", a )
1424 #define CYG_TRACE2YB( a,b ) \
1425 CYG_TRACE2( CYG_TRACE_USER_BOOL, "%x %x", a,b )
1426 #define CYG_TRACE3YB( a,b,c ) \
1427 CYG_TRACE3( CYG_TRACE_USER_BOOL, "%x %x %x", a,b,c )
1428 #define CYG_TRACE4YB( a,b,c,d ) \
1429 CYG_TRACE4( CYG_TRACE_USER_BOOL, "%x %x %x %x", a,b,c,d )
1430 #define CYG_TRACE5YB( a,b,c,d,e ) \
1431 CYG_TRACE5( CYG_TRACE_USER_BOOL, "%x %x %x %x %x", a,b,c,d,e )
1432 #define CYG_TRACE6YB( a,b,c,d,e,f ) \
1433 CYG_TRACE6( CYG_TRACE_USER_BOOL, "%x %x %x %x %x %x", \
1435 #define CYG_TRACE7YB( a,b,c,d,e,f,g ) \
1436 CYG_TRACE7( CYG_TRACE_USER_BOOL, "%x %x %x %x %x %x %x", \
1438 #define CYG_TRACE8YB( a,b,c,d,e,f,g,h ) \
1439 CYG_TRACE8( CYG_TRACE_USER_BOOL, "%x %x %x %x %x %x %x %x", \
1442 #define CYG_TRACE1YVB( a ) \
1443 CYG_TRACE1( CYG_TRACE_USER_BOOL, # a "=%x ", a )
1444 #define CYG_TRACE2YVB( a,b ) \
1445 CYG_TRACE2( CYG_TRACE_USER_BOOL, \
1446 # a "=%x " # b "=%x " , a,b )
1447 #define CYG_TRACE3YVB( a,b,c ) \
1448 CYG_TRACE3( CYG_TRACE_USER_BOOL, \
1449 # a "=%x " # b "=%x " # c "=%x " , a,b,c )
1450 #define CYG_TRACE4YVB( a,b,c,d ) \
1451 CYG_TRACE4( CYG_TRACE_USER_BOOL, \
1452 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \
1454 #define CYG_TRACE5YVB( a,b,c,d,e ) \
1455 CYG_TRACE5( CYG_TRACE_USER_BOOL, \
1456 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \
1459 #define CYG_TRACE6YVB( a,b,c,d,e,f ) \
1460 CYG_TRACE6( CYG_TRACE_USER_BOOL, \
1461 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \
1462 # e "=%x " # f "=%x " \
1464 #define CYG_TRACE7YVB( a,b,c,d,e,f,g ) \
1465 CYG_TRACE7( CYG_TRACE_USER_BOOL, \
1466 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \
1467 # e "=%x " # f "=%x " # g "=%x " \
1469 #define CYG_TRACE8YVB( a,b,c,d,e,f,g,h ) \
1470 CYG_TRACE8( CYG_TRACE_USER_BOOL, \
1471 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \
1472 # e "=%x " # f "=%x " # g "=%x " # h "=%x " \
1475 // -------------------------------------------------------------------------
1477 // CYG_REPORT_FUNCARGn{[XDY]{V}}
1479 // Convenience macros two: these fall into a few dimensions, with suffix letters:
1481 // X: user need not supply a format string, %08x is used
1482 // D: ditto but signed decimal, %d
1483 // Y: ditto but just plain %x
1484 // Second option, only meaningful with one of XDY:
1485 // V: "<var> = %..." is used, by stringifying the argument
1487 // long hex versions
1489 #define CYG_REPORT_FUNCARG1X( a ) \
1490 CYG_REPORT_FUNCARG1( "%08x", a )
1491 #define CYG_REPORT_FUNCARG2X( a,b ) \
1492 CYG_REPORT_FUNCARG2( "%08x %08x", a,b )
1493 #define CYG_REPORT_FUNCARG3X( a,b,c ) \
1494 CYG_REPORT_FUNCARG3( "%08x %08x %08x", a,b,c )
1495 #define CYG_REPORT_FUNCARG4X( a,b,c,d ) \
1496 CYG_REPORT_FUNCARG4( "%08x %08x %08x %08x", a,b,c,d )
1497 #define CYG_REPORT_FUNCARG5X( a,b,c,d,e ) \
1498 CYG_REPORT_FUNCARG5( "%08x %08x %08x %08x %08x", a,b,c,d,e )
1499 #define CYG_REPORT_FUNCARG6X( a,b,c,d,e,f ) \
1500 CYG_REPORT_FUNCARG6( "%08x %08x %08x %08x %08x %08x", \
1502 #define CYG_REPORT_FUNCARG7X( a,b,c,d,e,f,g ) \
1503 CYG_REPORT_FUNCARG7( "%08x %08x %08x %08x %08x %08x %08x", \
1505 #define CYG_REPORT_FUNCARG8X( a,b,c,d,e,f,g,h ) \
1506 CYG_REPORT_FUNCARG8( "%08x %08x %08x %08x %08x %08x %08x %08x", \
1509 #define CYG_REPORT_FUNCARG1XV( a ) \
1510 CYG_REPORT_FUNCARG1( # a "=%08x ", a )
1511 #define CYG_REPORT_FUNCARG2XV( a,b ) \
1512 CYG_REPORT_FUNCARG2( \
1513 # a "=%08x " # b "=%08x " , a,b )
1514 #define CYG_REPORT_FUNCARG3XV( a,b,c ) \
1515 CYG_REPORT_FUNCARG3( \
1516 # a "=%08x " # b "=%08x " # c "=%08x " , a,b,c )
1517 #define CYG_REPORT_FUNCARG4XV( a,b,c,d ) \
1518 CYG_REPORT_FUNCARG4( \
1519 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \
1521 #define CYG_REPORT_FUNCARG5XV( a,b,c,d,e ) \
1522 CYG_REPORT_FUNCARG5( \
1523 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \
1526 #define CYG_REPORT_FUNCARG6XV( a,b,c,d,e,f ) \
1527 CYG_REPORT_FUNCARG6( \
1528 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \
1529 # e "=%08x " # f "=%08x " \
1531 #define CYG_REPORT_FUNCARG7XV( a,b,c,d,e,f,g ) \
1532 CYG_REPORT_FUNCARG7( \
1533 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \
1534 # e "=%08x " # f "=%08x " # g "=%08x " \
1536 #define CYG_REPORT_FUNCARG8XV( a,b,c,d,e,f,g,h ) \
1537 CYG_REPORT_FUNCARG8( \
1538 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \
1539 # e "=%08x " # f "=%08x " # g "=%08x " # h "=%08x " \
1545 #define CYG_REPORT_FUNCARG1D( a ) \
1546 CYG_REPORT_FUNCARG1( "%d", a )
1547 #define CYG_REPORT_FUNCARG2D( a,b ) \
1548 CYG_REPORT_FUNCARG2( "%d %d", a,b )
1549 #define CYG_REPORT_FUNCARG3D( a,b,c ) \
1550 CYG_REPORT_FUNCARG3( "%d %d %d", a,b,c )
1551 #define CYG_REPORT_FUNCARG4D( a,b,c,d ) \
1552 CYG_REPORT_FUNCARG4( "%d %d %d %d", a,b,c,d )
1553 #define CYG_REPORT_FUNCARG5D( a,b,c,d,e ) \
1554 CYG_REPORT_FUNCARG5( "%d %d %d %d %d", a,b,c,d,e )
1555 #define CYG_REPORT_FUNCARG6D( a,b,c,d,e,f ) \
1556 CYG_REPORT_FUNCARG6( "%d %d %d %d %d %d", \
1558 #define CYG_REPORT_FUNCARG7D( a,b,c,d,e,f,g ) \
1559 CYG_REPORT_FUNCARG7( "%d %d %d %d %d %d %d", \
1561 #define CYG_REPORT_FUNCARG8D( a,b,c,d,e,f,g,h ) \
1562 CYG_REPORT_FUNCARG8( "%d %d %d %d %d %d %d %d", \
1565 #define CYG_REPORT_FUNCARG1DV( a ) \
1566 CYG_REPORT_FUNCARG1( # a "=%d ", a )
1567 #define CYG_REPORT_FUNCARG2DV( a,b ) \
1568 CYG_REPORT_FUNCARG2( \
1569 # a "=%d " # b "=%d " , a,b )
1570 #define CYG_REPORT_FUNCARG3DV( a,b,c ) \
1571 CYG_REPORT_FUNCARG3( \
1572 # a "=%d " # b "=%d " # c "=%d " , a,b,c )
1573 #define CYG_REPORT_FUNCARG4DV( a,b,c,d ) \
1574 CYG_REPORT_FUNCARG4( \
1575 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \
1577 #define CYG_REPORT_FUNCARG5DV( a,b,c,d,e ) \
1578 CYG_REPORT_FUNCARG5( \
1579 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \
1582 #define CYG_REPORT_FUNCARG6DV( a,b,c,d,e,f ) \
1583 CYG_REPORT_FUNCARG6( \
1584 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \
1585 # e "=%d " # f "=%d " \
1587 #define CYG_REPORT_FUNCARG7DV( a,b,c,d,e,f,g ) \
1588 CYG_REPORT_FUNCARG7( \
1589 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \
1590 # e "=%d " # f "=%d " # g "=%d " \
1592 #define CYG_REPORT_FUNCARG8DV( a,b,c,d,e,f,g,h ) \
1593 CYG_REPORT_FUNCARG8( \
1594 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \
1595 # e "=%d " # f "=%d " # g "=%d " # h "=%d " \
1598 // short hex versions
1600 #define CYG_REPORT_FUNCARG1Y( a ) \
1601 CYG_REPORT_FUNCARG1( "%x", a )
1602 #define CYG_REPORT_FUNCARG2Y( a,b ) \
1603 CYG_REPORT_FUNCARG2( "%x %x", a,b )
1604 #define CYG_REPORT_FUNCARG3Y( a,b,c ) \
1605 CYG_REPORT_FUNCARG3( "%x %x %x", a,b,c )
1606 #define CYG_REPORT_FUNCARG4Y( a,b,c,d ) \
1607 CYG_REPORT_FUNCARG4( "%x %x %x %x", a,b,c,d )
1608 #define CYG_REPORT_FUNCARG5Y( a,b,c,d,e ) \
1609 CYG_REPORT_FUNCARG5( "%x %x %x %x %x", a,b,c,d,e )
1610 #define CYG_REPORT_FUNCARG6Y( a,b,c,d,e,f ) \
1611 CYG_REPORT_FUNCARG6( "%x %x %x %x %x %x", \
1613 #define CYG_REPORT_FUNCARG7Y( a,b,c,d,e,f,g ) \
1614 CYG_REPORT_FUNCARG7( "%x %x %x %x %x %x %x", \
1616 #define CYG_REPORT_FUNCARG8Y( a,b,c,d,e,f,g,h ) \
1617 CYG_REPORT_FUNCARG8( "%x %x %x %x %x %x %x %x", \
1620 #define CYG_REPORT_FUNCARG1YV( a ) \
1621 CYG_REPORT_FUNCARG1( # a "=%x ", a )
1622 #define CYG_REPORT_FUNCARG2YV( a,b ) \
1623 CYG_REPORT_FUNCARG2( \
1624 # a "=%x " # b "=%x " , a,b )
1625 #define CYG_REPORT_FUNCARG3YV( a,b,c ) \
1626 CYG_REPORT_FUNCARG3( \
1627 # a "=%x " # b "=%x " # c "=%x " , a,b,c )
1628 #define CYG_REPORT_FUNCARG4YV( a,b,c,d ) \
1629 CYG_REPORT_FUNCARG4( \
1630 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \
1632 #define CYG_REPORT_FUNCARG5YV( a,b,c,d,e ) \
1633 CYG_REPORT_FUNCARG5( \
1634 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \
1637 #define CYG_REPORT_FUNCARG6YV( a,b,c,d,e,f ) \
1638 CYG_REPORT_FUNCARG6( \
1639 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \
1640 # e "=%x " # f "=%x " \
1642 #define CYG_REPORT_FUNCARG7YV( a,b,c,d,e,f,g ) \
1643 CYG_REPORT_FUNCARG7( \
1644 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \
1645 # e "=%x " # f "=%x " # g "=%x " \
1647 #define CYG_REPORT_FUNCARG8YV( a,b,c,d,e,f,g,h ) \
1648 CYG_REPORT_FUNCARG8( \
1649 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \
1650 # e "=%x " # f "=%x " # g "=%x " # h "=%x " \
1654 #endif // CYGONCE_INFRA_CYG_TRAC_H multiple inclusion protection