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 //####COPYRIGHTBEGIN####
13 // ----------------------------------------------------------------------------
14 // Copyright (C) 2002 Bart Veer
15 // Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc.
17 // This file is part of the eCos host tools.
19 // This program is free software; you can redistribute it and/or modify it
20 // under the terms of the GNU General Public License as published by the Free
21 // Software Foundation; either version 2 of the License, or (at your option)
24 // This program is distributed in the hope that it will be useful, but WITHOUT
25 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
26 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
29 // You should have received a copy of the GNU General Public License along with
30 // this program; if not, write to the Free Software Foundation, Inc.,
31 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
33 // ----------------------------------------------------------------------------
35 //####COPYRIGHTEND####
36 //==========================================================================
37 //#####DESCRIPTIONBEGIN####
39 // Author(s): nickg from an original by hmt
40 // Contributors: nickg
42 // Purpose: Use traces to log procedure entry, and "print" stuff
43 // Description: Runtime logging messages that compile to nothing in
44 // release versions of the code, to allow
45 // as-you-go tracing of alternate builds.
46 // Usage: #include <cyg/infra/cyg_trac.h>
48 // CYG_TRACE2( PIPE_TRACE, "pipe %x, data %d", ppipe, oword );
50 // which can result, for example, in a message of the form:
51 // "TRACE: pipemgr.cxx:1340, write_pipe(): pipe 0x8004c, data 17"
53 //####DESCRIPTIONEND####
56 /****************************************************************************
61 CYG_TRACE0( bool, msg );
62 CYG_TRACE1( bool, msg, arg1 );
63 CYG_TRACE2( bool, msg, arg1, arg2 );
65 CYG_TRACE8( bool, msg, .... [with 8 args] );
67 In general, the bool controls whether or not the tracing occurs for a
68 particular invocation of the macro. The msg is a printf-style string,
69 though exactly which formats are supported depends on the underlying
70 implementation. Typically, at least %d, %x, %08x, %c and %s will be
71 supported. Of course a most compact implementation might print
73 TRACE:z1dbuff.c[92]get_nextdata(): data pointer %x offset %d: 42BD8 1C
75 or some such, leaving you to work it out for yourself.
77 It is expected that the boolean would rarely actually be a complex
78 expression; it is more likely that it would either be "1", tracing being
79 controlled for the whole compilation unit or subsystem by means of the
80 CYGDBG_USE_TRACING symbol, or a local symbol for tracing over the whole
81 file, defined to 0 or to 1. For runtime control of tracing in a debugging
82 session, it is typical to use symbols defined to expressions such as:
84 static int xxx_trace = 0;
85 #define TL1 (0 < xxx_trace)
86 #define TL2 (1 < xxx_trace)
88 so you set xxx_trace to 1 to enable those messages conditioned by TL1
89 (trace level 1) and so on.
91 CYG_TRACE1( TL1, "Major argument is %d", zz );
92 CYG_TRACE4( TL2, "...minor details %d %d %d %d", m1, m2, m3 ,m4 );
94 To assist with the case where the same symbol or expression is used
95 throughout a compilation unit, the programmer can define the symbol
96 CYG_TRACE_USER_BOOL as they choose and then use convenience macros with the
97 suffix 'B' in the obvious manner:
99 #define CYG_TRACE_USER_BOOL (xxx_trace > 0)
100 CYG_TRACE2B( "Counters are %d, %d", countlo, counthi );
102 For the case where you just want to print a load of numbers in hex, or
103 decimal, convenience suffices X, D and Y are provided. X uses %08x, D %d
104 and Y an unadorned %x for each argument.
106 CYG_TRACE3D( TL2, m1, m2, d );
108 If you want to do something similar but with a little more comment, the
109 names (strictly spellings) of the variables you are printing can be used by
110 appending a V to the X, D or Y.
112 CYG_TRACE3DV( TL2, m1, m2, d );
116 TRACE:z1dbuff.c[92]get_nextdata(): m1=23 m2=-4 d=55
118 These conveniences can be combined, and they apply equally to tracing with
119 up to 8 variables; the B for Bool goes last:
121 CYG_TRACE4DVB( i, i*i, i*i*i, i*i*i*i );
125 TRACE:table.c[12]main(): i=3 i*i=9 i*i*i=27 i*i*i*i=81
131 There are also facities for easily reporting function entry and exit,
132 printing the function arguments, and detecting returns without logging (or
135 The basic facility is
137 CYG_REPORT_FUNCTION();
139 In C, place this between the local variable declarations and the first
140 statement or errors will ensue. C++ is more flexible; place the macro as
141 the first line of all functions you wish to trace. The following
142 variations are also provided:
144 CYG_REPORT_FUNCTYPE( exitmsg ) provide a printf string for the type
145 of the returned value
146 CYG_REPORT_FUNCNAME( name ) supply a function name explicitly, for
147 if __FUNCTION__ is not supported
148 CYG_REPORT_FUNCNAMETYPE( name, exitmsg ) both of the above extensions
150 These are unconditional; the assumption is that if function reporting is
151 used at all it will be used for all functions within a compilation unit.
152 However, it is useful to be able to control function reporting at finer
153 grain without editing the source files concerned, at compile time or at
154 runtime. To support this, conditioned versions (with suffix 'C') are
155 provided for the above four macros, which only procduce trace output if the
156 macro CYG_REPORT_USER_BOOL evaluates true.
158 CYG_REPORT_FUNCTIONC()
159 CYG_REPORT_FUNCNAMEC( name )
160 CYG_REPORT_FUNCTYPEC( exitmsg )
161 CYG_REPORT_FUNCNAMETYPEC( name, exitmsg )
163 You can define CYG_REPORT_USER_BOOL to anything you like before invoking
164 these macros; using a simple -DCYG_REPORT_USER_BOOL=0 or ...=1 on the
165 compiler command line would do the trick, but there is more flexibility to
166 be gained by something like:
168 #define CYG_REPORT_USER_BOOL (reporting_bool_FOO)
170 int reporting_bool_FOO = 1;
172 int reporting_bool_FOO = 0;
175 where FOO relates to the module name. Thus an external symbol sets the
176 default, but it can be overridden in a debugging session by setting the
177 variable reporting_bool_FOO.
179 Note that the condition applied to the initial CYG_REPORT_FUNC...() macro
180 controls all function-related reporting (not tracing) from that function;
181 the underlying mechanisms still operate even if no output is created. Thus
182 no conditioned variants of CYG_REPORT_FUNCARG[s] nor of CYG_REPORT_RETURN
188 CYG_REPORT_FUNCTYPE( "recode is %d" );
190 A function return is traced using
192 CYG_REPORT_RETURN() a void return
193 CYG_REPORT_RETVAL( value ) returning a value
195 With the CYG_REPORT_FUNCTYPE example, the latter might produce a message
198 TRACE:myprog.c[40]fact(): enter
199 TRACE:myprog.c[53]fact(): retcode is 24
201 It is also useful to trace the values of the arguments to a function:
202 CYG_REPORT_FUNCARGVOID confirms that the function is void
203 CYG_REPORT_FUNCARG1( format, arg ) printf-style
205 CYG_REPORT_FUNCARG8( format, arg1...arg8 ) printf-style
207 The CYG_REPORT_FUNCARG[1-8] macros are also offered with the convenience
208 extensions: D, X, or Y, and V like the explicit tracing macros. For
211 int fact( int number )
213 CYG_REPORT_FUNCTYPE( "recode is %d" );
214 CYG_REPORT_FUNCARG1DV( number );
216 while ( --number > 1 ) result *= number
217 CYG_REPORT_RETVAL( result );
223 TRACE:myprog.c[40]fact(): enter
224 TRACE:myprog.c[40]fact(): number=4
225 TRACE:myprog.c[53]fact(): retcode is 24
227 If no exit message is provided, a default of %08x is used.
233 If CYGDBG_INFRA_DEBUG_FUNCTION_PSEUDOMACRO is *not* defined, it is assumed
234 that __PRETTY_FUNCTION__ or equivalents do not exist, so no function name
235 tracing is possible; only file and line number.
237 If CYGDBG_INFRA_DEBUG_TRACE_MESSAGE is *not* defined, the message and
238 arguments to all tracing macros are not used; only "execution was here"
239 type information, by file, function and line number, is available. This
240 can greatly reduce the size of an image with tracing disabled, which may be
241 crucial in debugging on actual shipped hardware with limited memory.
243 If configured for buffered tracing then CYG_TRACE_PRINT() can be used to
244 output the contents of the trace buffer on demand.
246 CYG_TRACE_DUMP() outputs a form of "core dump" containing info on the
247 scheduler and threads at the time. This information will be invalid if
248 the kernel is not running.
250 C/C++: in C++ the function reporting is implemented using a class object
251 with a destructor; this allows reporting of a return which has not been
252 explicitly reported, and detection of accidental multiple return reports.
253 This helps you write the function reporting correctly. In C it is not
254 possible to be so sophisticated, so the implementation is not so helpful in
255 detecting errors in the use of the tracing system.
257 Note that for all of the above variations, the internal API to the
258 functions which are called in consequence of tracing remains the same, so
259 these variations can be mixed in the same executable, by configuring the
260 tracing macros differently in different compilation units or subsystems.
269 CYG_TRACE0( bool, msg ) if bool, print msg
270 CYG_TRACE1( bool, msg, arg ) if bool, printf-style
272 CYG_TRACE8( bool, msg, arg1...arg8 ) if bool, printf-style
274 CYG_TRACE0B( msg, args... ) to CYG_TRACE8B() use CYG_TRACE_USER_BOOL
276 CYG_TRACE1X( bool, args... ) to CYG_TRACE8X() print args using %08x
277 CYG_TRACE1Y( bool, args... ) to CYG_TRACE8Y() print args using %x
278 CYG_TRACE1D( bool, args... ) to CYG_TRACE8D() print args using %d
280 CYG_TRACE1XV( bool, args... ) to CYG_TRACE8XV() print args using "arg=%08x"
281 CYG_TRACE1YV( bool, args... ) to CYG_TRACE8YV() print args using "arg=%x"
282 CYG_TRACE1DV( bool, args... ) to CYG_TRACE8DV() print args using "arg=%d"
284 CYG_TRACE1XB( args... ) to CYG_TRACE8XB() print using %08x, no bool
285 CYG_TRACE1YB( args... ) to CYG_TRACE8YB() print using %x, no bool
286 CYG_TRACE1DB( args... ) to CYG_TRACE8DB() print using %d, no bool
288 CYG_TRACE1XVB( args... ) to CYG_TRACE8XVB() use "arg=%08x", no bool
289 CYG_TRACE1YVB( args... ) to CYG_TRACE8YVB() use "arg=%x", no bool
290 CYG_TRACE1DVB( args... ) to CYG_TRACE8DVB() use "arg=%d", no bool
295 CYG_REPORT_FUNCTION() default function entry
296 CYG_REPORT_FUNCNAME( name ) name the function
297 CYG_REPORT_FUNCTYPE( exitmsg ) printf for retval
298 CYG_REPORT_FUNCNAMETYPE( name, exitmsg ) both
300 CYG_REPORT_FUNCTIONC() as above, but conditional
301 CYG_REPORT_FUNCNAMEC( name ) on CYG_REPORT_USER_BOOL
302 CYG_REPORT_FUNCTYPEC( exitmsg ) however it is defined
303 CYG_REPORT_FUNCNAMETYPEC( name, exitmsg ) ...
305 CYG_REPORT_RETURN() void function exit
306 CYG_REPORT_RETVAL( value ) returning value
308 CYG_REPORT_FUNCARGVOID() void function entry
309 CYG_REPORT_FUNCARG1( format, arg ) printf-style
311 CYG_REPORT_FUNCARG8( format, arg1...arg8 ) printf-style
313 CYG_REPORT_FUNCARG1X( arg )
315 CYG_REPORT_FUNCARG8X( arg1...arg8 ) use %08x
316 CYG_REPORT_FUNCARG1Y... use %x
317 CYG_REPORT_FUNCARG1D... use %d
319 CYG_REPORT_FUNCARG1XV... use "arg=%08x"
320 CYG_REPORT_FUNCARG1YV... use "arg=%x"
321 CYG_REPORT_FUNCARG1DV... use "arg=%d"
326 CYG_TRACE_DUMP() dumps kernel state
327 CYG_TRACE_PRINT() prints buffered tracing
330 ---------------------------------------------------------------------------
332 Internal Documentation
333 ======================
335 The required functions which are used by the tracing macros are
338 cyg_tracenomsg( const char *psz_func, const char *psz_file, cyg_uint32 linenum );
341 cyg_tracemsg( cyg_uint32 what,
342 const char *psz_func, const char *psz_file, cyg_uint32 linenum,
343 const char *psz_msg );
346 cyg_tracemsg2( cyg_uint32 what,
347 const char *psz_func, const char *psz_file, cyg_uint32 linenum,
349 CYG_ADDRWORD arg0, CYG_ADDRWORD arg1 );
350 // extended in the obvious way for 4,6,8 arguments
352 These functions should expect psz_func and psz_file to possibly be NULL in
353 case those facilities are not available in the compilation environment, and
354 do something safe in such cases. A NULL message should really be dealt
355 with safely also, just logging "execution here" info like cyg_tracenomsg().
357 Discussion of possible underlying implementations
358 -------------------------------------------------
360 It is intended that the functions that get called can simply print the info
361 they are given in as fancy a format as you like, or they could do the
362 printf-type formatting and log the resulting text in a buffer. They get
363 told the type of event (function-entry, function-arguments, function-exit
364 or plain tracing info) and so can perform fancy indenting, for example, to
365 make call stack inspection more obvious to humans. It is also intended
366 that a more compact logging arrangement be possible, for example one which
367 records, in 32-bit words (CYG_ADDRWORDs), the addresses of the file,
368 function and msg strings, the line number and the arguments. This has the
369 implication that the msg string should not be constructed dynamically but
370 be static ie. a plain quoted C string. The number of arguments also must
371 be recorded, and if it is chosen to save string arguments in the buffer
372 rather than just their addresses (which could be invalid by the time the
373 logged information is processed) some flagging of which arguments are
374 strings must be provided. The system could also be extended to deal with
375 floats of whichever size fir in a CYG_ADDRWORD; these would probably
376 require special treatment also. With these considerations in mind, the
377 maximum number of parameters in a single trace message has been set to 8,
378 so that a byte bitset could be used to indicate which arguments are
379 strings, another for those which are floats, and the count of arguments
380 also fits in a byte as number or a bitset.
383 ****************************************************************************/
385 #include <pkgconf/infra.h>
387 #include <cyg/infra/cyg_ass.h>
389 // -------------------------------------------------------------------------
390 // CYGDBG_INFRA_DEBUG_FUNCTION_PSEUDOMACRO is dealt with in cyg_ass.h.
391 // -------------------------------------------------------------------------
393 #ifdef CYGDBG_USE_TRACING
395 // -------------------------------------------------------------------------
396 // We define macros and appropriate prototypes for the trace/fail
397 // system. These are:
398 // CYG_TRACE0..8 - trace if boolean
399 // CYG_TRACEPROC - default no comment proc entry
400 // CYG_TRACEPROCOUT - default no comment proc exit
401 // CYG_TRACE_DUMP - outputs a form of "core dump", including the state
402 // of the kernel scheduler, threads, etc.
403 // CYG_TRACE_PRINT - Forces manual output of any trace info that has
406 // these are executed to deal with tracing - breakpoint?
409 cyg_tracenomsg( const char *psz_func, const char *psz_file, cyg_uint32 linenum );
412 cyg_trace_dump(void);
414 #define CYG_TRACE_DUMP() cyg_trace_dump()
416 #ifdef CYGDBG_INFRA_DEBUG_TRACE_ASSERT_BUFFER
419 cyg_trace_print(void);
421 #define CYG_TRACE_PRINT() cyg_trace_print()
424 #define CYG_TRACE_PRINT() CYG_EMPTY_STATEMENT
427 // provide every other one of these as a space/caller bloat compromise.
429 # ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE
441 cyg_tracemsg( cyg_uint32 what,
442 const char *psz_func, const char *psz_file, cyg_uint32 linenum,
443 const char *psz_msg );
446 cyg_tracemsg2( cyg_uint32 what,
447 const char *psz_func, const char *psz_file, cyg_uint32 linenum,
449 CYG_ADDRWORD arg0, CYG_ADDRWORD arg1 );
451 cyg_tracemsg4( cyg_uint32 what,
452 const char *psz_func, const char *psz_file, cyg_uint32 linenum,
454 CYG_ADDRWORD arg0, CYG_ADDRWORD arg1,
455 CYG_ADDRWORD arg2, CYG_ADDRWORD arg3 );
457 cyg_tracemsg6( cyg_uint32 what,
458 const char *psz_func, const char *psz_file, cyg_uint32 linenum,
460 CYG_ADDRWORD arg0, CYG_ADDRWORD arg1,
461 CYG_ADDRWORD arg2, CYG_ADDRWORD arg3,
462 CYG_ADDRWORD arg4, CYG_ADDRWORD arg5 );
464 cyg_tracemsg8( 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,
470 CYG_ADDRWORD arg6, CYG_ADDRWORD arg7 );
472 #endif // CYGDBG_INFRA_DEBUG_TRACE_MESSAGE
474 // -------------------------------------------------------------------------
476 # ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE
478 # define CYG_TRACE_docall0( _msg_ ) \
479 cyg_tracemsg( cyg_trace_trace, \
480 __PRETTY_FUNCTION__, __FILE__, __LINE__, _msg_ );
482 # define CYG_TRACE_docall2( _msg_, _arg0_, _arg1_ ) \
483 cyg_tracemsg2( cyg_trace_trace, \
484 __PRETTY_FUNCTION__, __FILE__, __LINE__, _msg_, \
485 (CYG_ADDRWORD)_arg0_, (CYG_ADDRWORD)_arg1_ );
487 # define CYG_TRACE_docall4( _msg_, _arg0_, _arg1_ , _arg2_, _arg3_ ) \
488 cyg_tracemsg4( cyg_trace_trace, \
489 __PRETTY_FUNCTION__, __FILE__, __LINE__, _msg_, \
490 (CYG_ADDRWORD)_arg0_, (CYG_ADDRWORD)_arg1_, \
491 (CYG_ADDRWORD)_arg2_, (CYG_ADDRWORD)_arg3_ );
493 # define CYG_TRACE_docall6( _msg_, _arg0_, _arg1_ , _arg2_, _arg3_, \
495 cyg_tracemsg6( cyg_trace_trace, \
496 __PRETTY_FUNCTION__, __FILE__, __LINE__, _msg_, \
497 (CYG_ADDRWORD)_arg0_, (CYG_ADDRWORD)_arg1_, \
498 (CYG_ADDRWORD)_arg2_, (CYG_ADDRWORD)_arg3_, \
499 (CYG_ADDRWORD)_arg4_, (CYG_ADDRWORD)_arg5_ );
501 # define CYG_TRACE_docall8( _msg_, _arg0_, _arg1_ , _arg2_, _arg3_, \
502 _arg4_, _arg5_, _arg6_, _arg7_ ) \
503 cyg_tracemsg8( cyg_trace_trace, \
504 __PRETTY_FUNCTION__, __FILE__, __LINE__, _msg_, \
505 (CYG_ADDRWORD)_arg0_, (CYG_ADDRWORD)_arg1_, \
506 (CYG_ADDRWORD)_arg2_, (CYG_ADDRWORD)_arg3_, \
507 (CYG_ADDRWORD)_arg4_, (CYG_ADDRWORD)_arg5_, \
508 (CYG_ADDRWORD)_arg6_, (CYG_ADDRWORD)_arg7_ );
510 # else // do not CYGDBG_INFRA_DEBUG_TRACE_MESSAGE
512 # define CYG_TRACE_docall0( _msg_ ) \
513 cyg_tracenomsg( __PRETTY_FUNCTION__, __FILE__, __LINE__ );
515 # define CYG_TRACE_docall2( _msg_, _arg0_, _arg1_ ) \
516 cyg_tracenomsg( __PRETTY_FUNCTION__, __FILE__, __LINE__ );
518 # define CYG_TRACE_docall4( _msg_, _arg0_, _arg1_ , _arg2_, _arg3_ ) \
519 cyg_tracenomsg( __PRETTY_FUNCTION__, __FILE__, __LINE__ );
521 # define CYG_TRACE_docall6( _msg_, _arg0_, _arg1_ , _arg2_, _arg3_, \
523 cyg_tracenomsg( __PRETTY_FUNCTION__, __FILE__, __LINE__ );
525 # define CYG_TRACE_docall8( _msg_, _arg0_, _arg1_, _arg2_, _arg3_, \
526 _arg4_, _arg5_, _arg6_, _arg7_ ) \
527 cyg_tracenomsg( __PRETTY_FUNCTION__, __FILE__, __LINE__ );
531 // -------------------------------------------------------------------------
532 // Conditioned trace; if the condition is false, fail.
534 #define CYG_TRACE0( _bool_, _msg_ ) \
537 CYG_TRACE_docall0( _msg_ ); \
540 #define CYG_TRACE1( _bool_, _msg_, a ) \
543 CYG_TRACE_docall2( _msg_, a, 0 ); \
546 #define CYG_TRACE2( _bool_, _msg_, a, b ) \
549 CYG_TRACE_docall2( _msg_, a, b ); \
552 #define CYG_TRACE3( _bool_, _msg_, a, b, c ) \
555 CYG_TRACE_docall4( _msg_, a, b, c, 0 ); \
558 #define CYG_TRACE4( _bool_, _msg_, a, b, c, d ) \
561 CYG_TRACE_docall4( _msg_, a, b, c, d ); \
564 #define CYG_TRACE5( _bool_, _msg_, a, b, c, d, e ) \
567 CYG_TRACE_docall6( _msg_, a, b, c, d, e, 0 ); \
570 #define CYG_TRACE6( _bool_, _msg_, a, b, c, d, e, f ) \
573 CYG_TRACE_docall6( _msg_, a, b, c, d, e, f ); \
576 #define CYG_TRACE7( _bool_, _msg_, a, b, c, d, e, f, g ) \
579 CYG_TRACE_docall8( _msg_, a, b, c, d, e, f, g, 0 ); \
582 #define CYG_TRACE8( _bool_, _msg_, a, b, c, d, e, f, g, h ) \
585 CYG_TRACE_docall8( _msg_, a, b, c, d, e, f, g, h ); \
588 // -------------------------------------------------------------------------
589 // Report function entry and exit.
590 // In C++ the macro CYG_REPORT_FUNCTION should appear as the first line of
591 // any function. It will generate a message whenever the function is entered
592 // and when it is exited.
593 // In C the macro should appear as the first statement after any local variable
594 // definitions. No exit message will be generated unless CYG_REPORT_RETURN is
595 // placed just before each return.
596 // Where a piece of code is to be compiled with both C and C++, the above
597 // rules for C should be followed.
599 #ifdef CYGDBG_INFRA_DEBUG_FUNCTION_REPORTS
603 class Cyg_TraceFunction_Report_
610 #ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE
612 CYG_ADDRWORD exitvalue;
613 enum { UNSET = 0, SET, VOID } exitset;
616 Cyg_TraceFunction_Report_(
617 int condition, const char *psz_func, const char *psz_file,
625 #ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE
629 cyg_tracemsg( cyg_trace_enter, func, file, lnum, "enter");
632 cyg_tracenomsg( func, file, lnum );
636 Cyg_TraceFunction_Report_(
637 int condition, const char *psz_func, const char *psz_file,
638 cyg_uint32 linenum, const char *psz_exitmsg )
644 #ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE
645 exitmsg = psz_exitmsg;
648 cyg_tracemsg( cyg_trace_enter, func, file, lnum, "enter");
650 CYG_UNUSED_PARAM( const char *, psz_exitmsg );
652 cyg_tracenomsg( func, file, lnum );
656 inline void set_exitvoid( cyg_uint32 linenum )
659 #ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE
660 CYG_ASSERT( NULL == exitmsg, "exitvoid used in typed function" );
661 CYG_ASSERT( UNSET == exitset, "exitvoid used when arg already set" );
666 inline void set_exitvalue( cyg_uint32 linenum, CYG_ADDRWORD retcode )
669 #ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE
670 CYG_ASSERT( UNSET == exitset, "exitvalue used when arg already set" );
674 CYG_UNUSED_PARAM( CYG_ADDRWORD, retcode );
678 ~Cyg_TraceFunction_Report_()
681 #ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE
682 if ( VOID == exitset )
683 cyg_tracemsg( cyg_trace_return, func, file, lnum,
685 else if ( UNSET == exitset )
686 cyg_tracemsg( cyg_trace_return, func, file, lnum,
688 else if ( NULL == exitmsg )
689 cyg_tracemsg2( cyg_trace_return, func, file, lnum,
690 "return %08x", exitvalue, 0 );
692 cyg_tracemsg2( cyg_trace_return, func, file, lnum,
693 exitmsg, exitvalue, 0 );
695 cyg_tracenomsg( func, file, lnum );
701 // These have no CYG_MACRO_START,END around because it is required
702 // that the scope of the object be the whole function body. Get it?
704 // These are the unconditional versions:
705 #define CYG_REPORT_FUNCTION() \
706 Cyg_TraceFunction_Report_ cyg_tracefunction_report_( \
707 1, __PRETTY_FUNCTION__, \
710 #define CYG_REPORT_FUNCTYPE( _exitmsg_ ) \
711 Cyg_TraceFunction_Report_ cyg_tracefunction_report_( \
712 1, __PRETTY_FUNCTION__, \
713 __FILE__, __LINE__, _exitmsg_ )
715 #define CYG_REPORT_FUNCNAME( _name_ ) \
716 Cyg_TraceFunction_Report_ cyg_tracefunction_report_( \
720 #define CYG_REPORT_FUNCNAMETYPE( _name_, _exitmsg_ ) \
721 Cyg_TraceFunction_Report_ cyg_tracefunction_report_( \
723 __FILE__, __LINE__, _exitmsg_ )
725 // These are conditioned on macro CYG_REPORT_USER_BOOL
726 // (which you better have defined)
727 #define CYG_REPORT_FUNCTIONC() \
728 Cyg_TraceFunction_Report_ cyg_tracefunction_report_( \
729 CYG_REPORT_USER_BOOL, __PRETTY_FUNCTION__, \
732 #define CYG_REPORT_FUNCTYPEC( _exitmsg_ ) \
733 Cyg_TraceFunction_Report_ cyg_tracefunction_report_( \
734 CYG_REPORT_USER_BOOL, __PRETTY_FUNCTION__, \
735 __FILE__, __LINE__, _exitmsg_ )
737 #define CYG_REPORT_FUNCNAMEC( _name_ ) \
738 Cyg_TraceFunction_Report_ cyg_tracefunction_report_( \
739 CYG_REPORT_USER_BOOL, _name_, \
742 #define CYG_REPORT_FUNCNAMETYPEC( _name_, _exitmsg_ ) \
743 Cyg_TraceFunction_Report_ cyg_tracefunction_report_( \
744 CYG_REPORT_USER_BOOL, _name_, \
745 __FILE__, __LINE__, _exitmsg_ )
748 #define CYG_REPORT_RETURN() CYG_MACRO_START \
749 cyg_tracefunction_report_.set_exitvoid( __LINE__ ); \
752 #define CYG_REPORT_RETVAL( _value_) CYG_MACRO_START \
753 cyg_tracefunction_report_.set_exitvalue( \
754 __LINE__, (CYG_ADDRWORD)(_value_) ); \
758 #else // not __cplusplus
761 struct Cyg_TraceFunction_Report_
765 const char *file; /* not strictly needed in plain 'C' */
766 cyg_uint32 lnum; /* nor this */
767 #ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE
769 CYG_ADDRWORD exitvalue;
775 #ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE
777 #define CYG_REPORT_FUNCTION_ENTER_INTERNAL() CYG_MACRO_START \
778 if ( cyg_tracefunction_report_.cond ) \
779 cyg_tracemsg( cyg_trace_enter, \
780 cyg_tracefunction_report_.func, \
781 cyg_tracefunction_report_.file, \
782 cyg_tracefunction_report_.lnum, \
786 #define CYG_REPORT_FUNCTION_CONSTRUCT( _c_, _fn_,_fl_,_l_,_xm_,_xv_,_xs_ ) \
787 { _c_, _fn_, _fl_, _l_, _xm_, _xv_, _xs_ }
789 #else // do not CYGDBG_INFRA_DEBUG_TRACE_MESSAGE
791 #define CYG_REPORT_FUNCTION_ENTER_INTERNAL() CYG_MACRO_START \
792 if ( cyg_tracefunction_report_.cond ) \
793 cyg_tracenomsg( cyg_tracefunction_report_.func, \
794 cyg_tracefunction_report_.file, \
795 cyg_tracefunction_report_.lnum ); \
798 #define CYG_REPORT_FUNCTION_CONSTRUCT( _c_, _fn_,_fl_,_l_,_xm_,_xv_,_xs_ ) \
799 { _c_, _fn_, _fl_, _l_ }
801 #endif // not CYGDBG_INFRA_DEBUG_TRACE_MESSAGE
803 // These have no CYG_MACRO_START,END around because it is required
804 // that the scope of the object be the whole function body. Get it?
806 // These are the unconditional versions:
807 #define CYG_REPORT_FUNCTION() \
808 struct Cyg_TraceFunction_Report_ cyg_tracefunction_report_ = \
809 CYG_REPORT_FUNCTION_CONSTRUCT( \
810 1, __PRETTY_FUNCTION__, __FILE__, __LINE__, NULL, 0, 0 ); \
811 CYG_REPORT_FUNCTION_ENTER_INTERNAL()
813 #define CYG_REPORT_FUNCTYPE( _exitmsg_ ) \
814 struct Cyg_TraceFunction_Report_ cyg_tracefunction_report_ = \
815 CYG_REPORT_FUNCTION_CONSTRUCT( \
816 1, __PRETTY_FUNCTION__, __FILE__, __LINE__, _exitmsg_, 0, 0 ); \
817 CYG_REPORT_FUNCTION_ENTER_INTERNAL()
819 #define CYG_REPORT_FUNCNAME( _name_ ) \
820 struct Cyg_TraceFunction_Report_ cyg_tracefunction_report_ = \
821 CYG_REPORT_FUNCTION_CONSTRUCT( \
822 1, _name_, __FILE__, __LINE__, NULL, 0, 0 ); \
823 CYG_REPORT_FUNCTION_ENTER_INTERNAL()
825 #define CYG_REPORT_FUNCNAMETYPE( _name_, _exitmsg_ ) \
826 struct Cyg_TraceFunction_Report_ cyg_tracefunction_report_ = \
827 CYG_REPORT_FUNCTION_CONSTRUCT( \
828 1, _name_, __FILE__, __LINE__, _exitmsg_, 0, 0 ); \
829 CYG_REPORT_FUNCTION_ENTER_INTERNAL()
831 // These are conditioned on macro CYG_REPORT_USER_BOOL
832 // (which you better have defined)
833 #define CYG_REPORT_FUNCTIONC() \
834 struct Cyg_TraceFunction_Report_ cyg_tracefunction_report_ = \
835 CYG_REPORT_FUNCTION_CONSTRUCT( \
836 CYG_REPORT_USER_BOOL, \
837 __PRETTY_FUNCTION__, __FILE__, __LINE__, NULL, 0, 0 ); \
838 CYG_REPORT_FUNCTION_ENTER_INTERNAL()
840 #define CYG_REPORT_FUNCTYPEC( _exitmsg_ ) \
841 struct Cyg_TraceFunction_Report_ cyg_tracefunction_report_ = \
842 CYG_REPORT_FUNCTION_CONSTRUCT( \
843 CYG_REPORT_USER_BOOL, \
844 __PRETTY_FUNCTION__, __FILE__, __LINE__, _exitmsg_, 0, 0 ); \
845 CYG_REPORT_FUNCTION_ENTER_INTERNAL()
847 #define CYG_REPORT_FUNCNAMEC( _name_ ) \
848 struct Cyg_TraceFunction_Report_ cyg_tracefunction_report_ = \
849 CYG_REPORT_FUNCTION_CONSTRUCT( \
850 CYG_REPORT_USER_BOOL, \
851 _name_, __FILE__, __LINE__, NULL, 0, 0 ); \
852 CYG_REPORT_FUNCTION_ENTER_INTERNAL()
854 #define CYG_REPORT_FUNCNAMETYPEC( _name_, _exitmsg_ ) \
855 struct Cyg_TraceFunction_Report_ cyg_tracefunction_report_ = \
856 CYG_REPORT_FUNCTION_CONSTRUCT( \
857 CYG_REPORT_USER_BOOL, \
858 _name_, __FILE__, __LINE__, _exitmsg_, 0, 0 ); \
859 CYG_REPORT_FUNCTION_ENTER_INTERNAL()
861 #ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE
863 #define CYG_REPORT_RETURN() CYG_MACRO_START \
864 CYG_ASSERT( NULL == cyg_tracefunction_report_.exitmsg, \
865 "exitvoid used in typed function" ); \
866 CYG_ASSERT( 0 == cyg_tracefunction_report_.exitset, \
867 "exitvoid used when arg already set" ); \
868 cyg_tracefunction_report_.lnum = __LINE__; \
869 cyg_tracefunction_report_.exitset = 2; \
870 if ( cyg_tracefunction_report_.cond ) \
871 cyg_tracemsg( cyg_trace_return, \
872 cyg_tracefunction_report_.func, \
873 cyg_tracefunction_report_.file, \
874 cyg_tracefunction_report_.lnum, \
878 #define CYG_REPORT_RETVAL( _value_ ) CYG_MACRO_START \
879 CYG_ASSERT( 0 == cyg_tracefunction_report_.exitset, \
880 "exitvalue used when arg already set" ); \
881 cyg_tracefunction_report_.lnum = __LINE__; \
882 cyg_tracefunction_report_.exitvalue = (CYG_ADDRWORD)(_value_); \
883 cyg_tracefunction_report_.exitset = 1; \
884 if ( cyg_tracefunction_report_.cond ) \
885 cyg_tracemsg2( cyg_trace_return, \
886 cyg_tracefunction_report_.func, \
887 cyg_tracefunction_report_.file, \
888 cyg_tracefunction_report_.lnum, \
889 cyg_tracefunction_report_.exitmsg ? \
890 cyg_tracefunction_report_.exitmsg : \
892 cyg_tracefunction_report_.exitvalue, 0 ); \
895 #else // do not CYGDBG_INFRA_DEBUG_TRACE_MESSAGE
897 #define CYG_REPORT_RETURN() CYG_MACRO_START \
898 cyg_tracefunction_report_.lnum = __LINE__; \
899 if ( cyg_tracefunction_report_.cond ) \
900 cyg_tracenomsg( cyg_tracefunction_report_.func, \
901 cyg_tracefunction_report_.file, \
902 cyg_tracefunction_report_.lnum ); \
905 #define CYG_REPORT_RETVAL( _value_ ) CYG_MACRO_START \
906 CYG_REPORT_RETURN(); \
909 #endif // not CYGDBG_INFRA_DEBUG_TRACE_MESSAGE
911 #endif // not __cplusplus
913 #ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE
915 #define CYG_REPORT_FUNCARGVOID() CYG_MACRO_START \
916 if ( cyg_tracefunction_report_.cond ) \
917 cyg_tracemsg( cyg_trace_args, \
918 cyg_tracefunction_report_.func, \
919 cyg_tracefunction_report_.file, \
920 cyg_tracefunction_report_.lnum, \
925 #define CYG_REPORT_FUNCARG1( _format_, a ) CYG_MACRO_START \
926 if ( cyg_tracefunction_report_.cond ) \
927 cyg_tracemsg2( cyg_trace_args, \
928 cyg_tracefunction_report_.func, \
929 cyg_tracefunction_report_.file, \
930 cyg_tracefunction_report_.lnum, \
932 (CYG_ADDRWORD)a , 0 \
936 #define CYG_REPORT_FUNCARG2( _format_, a,b ) CYG_MACRO_START \
937 if ( cyg_tracefunction_report_.cond ) \
938 cyg_tracemsg2( cyg_trace_args, \
939 cyg_tracefunction_report_.func, \
940 cyg_tracefunction_report_.file, \
941 cyg_tracefunction_report_.lnum, \
943 (CYG_ADDRWORD)a, (CYG_ADDRWORD)b \
947 #define CYG_REPORT_FUNCARG3( _format_, a,b,c ) CYG_MACRO_START \
948 if ( cyg_tracefunction_report_.cond ) \
949 cyg_tracemsg4( cyg_trace_args, \
950 cyg_tracefunction_report_.func, \
951 cyg_tracefunction_report_.file, \
952 cyg_tracefunction_report_.lnum, \
954 (CYG_ADDRWORD)a, (CYG_ADDRWORD)b, \
955 (CYG_ADDRWORD)c , 0 \
959 #define CYG_REPORT_FUNCARG4( _format_, a,b,c,d ) CYG_MACRO_START \
960 if ( cyg_tracefunction_report_.cond ) \
961 cyg_tracemsg4( cyg_trace_args, \
962 cyg_tracefunction_report_.func, \
963 cyg_tracefunction_report_.file, \
964 cyg_tracefunction_report_.lnum, \
966 (CYG_ADDRWORD)a, (CYG_ADDRWORD)b, \
967 (CYG_ADDRWORD)c, (CYG_ADDRWORD)d \
971 #define CYG_REPORT_FUNCARG5( _format_, a,b,c,d,e ) CYG_MACRO_START \
972 if ( cyg_tracefunction_report_.cond ) \
973 cyg_tracemsg6( cyg_trace_args, \
974 cyg_tracefunction_report_.func, \
975 cyg_tracefunction_report_.file, \
976 cyg_tracefunction_report_.lnum, \
978 (CYG_ADDRWORD)a, (CYG_ADDRWORD)b, \
979 (CYG_ADDRWORD)c, (CYG_ADDRWORD)d, \
980 (CYG_ADDRWORD)e , 0 \
984 #define CYG_REPORT_FUNCARG6( _format_, a,b,c,d,e,f ) CYG_MACRO_START \
985 if ( cyg_tracefunction_report_.cond ) \
986 cyg_tracemsg6( cyg_trace_args, \
987 cyg_tracefunction_report_.func, \
988 cyg_tracefunction_report_.file, \
989 cyg_tracefunction_report_.lnum, \
991 (CYG_ADDRWORD)a, (CYG_ADDRWORD)b, \
992 (CYG_ADDRWORD)c, (CYG_ADDRWORD)d, \
993 (CYG_ADDRWORD)e, (CYG_ADDRWORD)f \
997 #define CYG_REPORT_FUNCARG7( _format_, a,b,c,d,e,f,g ) CYG_MACRO_START \
998 if ( cyg_tracefunction_report_.cond ) \
999 cyg_tracemsg8( cyg_trace_args, \
1000 cyg_tracefunction_report_.func, \
1001 cyg_tracefunction_report_.file, \
1002 cyg_tracefunction_report_.lnum, \
1004 (CYG_ADDRWORD)a, (CYG_ADDRWORD)b, \
1005 (CYG_ADDRWORD)c, (CYG_ADDRWORD)d, \
1006 (CYG_ADDRWORD)e, (CYG_ADDRWORD)f, \
1007 (CYG_ADDRWORD)g , 0 \
1011 #define CYG_REPORT_FUNCARG8( _format_, a,b,c,d,e,f,g,h ) CYG_MACRO_START\
1012 if ( cyg_tracefunction_report_.cond ) \
1013 cyg_tracemsg8( cyg_trace_args, \
1014 cyg_tracefunction_report_.func, \
1015 cyg_tracefunction_report_.file, \
1016 cyg_tracefunction_report_.lnum, \
1018 (CYG_ADDRWORD)a, (CYG_ADDRWORD)b, \
1019 (CYG_ADDRWORD)c, (CYG_ADDRWORD)d, \
1020 (CYG_ADDRWORD)e, (CYG_ADDRWORD)f, \
1021 (CYG_ADDRWORD)g, (CYG_ADDRWORD)h \
1026 #else // do not CYGDBG_INFRA_DEBUG_TRACE_MESSAGE
1028 #define CYG_REPORT_FUNCARGVOID() CYG_EMPTY_STATEMENT
1029 #define CYG_REPORT_FUNCARG1( _format_, a ) CYG_EMPTY_STATEMENT
1030 #define CYG_REPORT_FUNCARG2( _format_, a,b ) CYG_EMPTY_STATEMENT
1031 #define CYG_REPORT_FUNCARG3( _format_, a,b,c ) CYG_EMPTY_STATEMENT
1032 #define CYG_REPORT_FUNCARG4( _format_, a,b,c,d ) CYG_EMPTY_STATEMENT
1033 #define CYG_REPORT_FUNCARG5( _format_, a,b,c,d,e ) CYG_EMPTY_STATEMENT
1034 #define CYG_REPORT_FUNCARG6( _format_, a,b,c,d,e,f ) CYG_EMPTY_STATEMENT
1035 #define CYG_REPORT_FUNCARG7( _format_, a,b,c,d,e,f,g ) CYG_EMPTY_STATEMENT
1036 #define CYG_REPORT_FUNCARG8( _format_, a,b,c,d,e,f,g,h ) CYG_EMPTY_STATEMENT
1038 #endif // not CYGDBG_INFRA_DEBUG_TRACE_MESSAGE
1040 #else // no CYGDBG_INFRA_DEBUG_FUNCTION_REPORTS
1042 #define CYG_REPORT_FUNCTION() CYG_EMPTY_STATEMENT
1043 #define CYG_REPORT_FUNCTYPE( _exitmsg_ ) CYG_EMPTY_STATEMENT
1044 #define CYG_REPORT_FUNCNAME( _name_ ) CYG_EMPTY_STATEMENT
1045 #define CYG_REPORT_FUNCNAMETYPE( _name_, _exitmsg_ ) CYG_EMPTY_STATEMENT
1047 #define CYG_REPORT_FUNCTIONC() CYG_EMPTY_STATEMENT
1048 #define CYG_REPORT_FUNCTYPEC( _exitmsg_ ) CYG_EMPTY_STATEMENT
1049 #define CYG_REPORT_FUNCNAMEC( _name_ ) CYG_EMPTY_STATEMENT
1050 #define CYG_REPORT_FUNCNAMETYPEC( _name_, _exitmsg_ ) CYG_EMPTY_STATEMENT
1052 #define CYG_REPORT_FUNCARGVOID() CYG_EMPTY_STATEMENT
1053 #define CYG_REPORT_FUNCARG1( _format_, a ) CYG_EMPTY_STATEMENT
1054 #define CYG_REPORT_FUNCARG2( _format_, a,b ) CYG_EMPTY_STATEMENT
1055 #define CYG_REPORT_FUNCARG3( _format_, a,b,c ) CYG_EMPTY_STATEMENT
1056 #define CYG_REPORT_FUNCARG4( _format_, a,b,c,d ) CYG_EMPTY_STATEMENT
1057 #define CYG_REPORT_FUNCARG5( _format_, a,b,c,d,e ) CYG_EMPTY_STATEMENT
1058 #define CYG_REPORT_FUNCARG6( _format_, a,b,c,d,e,f ) CYG_EMPTY_STATEMENT
1059 #define CYG_REPORT_FUNCARG7( _format_, a,b,c,d,e,f,g ) CYG_EMPTY_STATEMENT
1060 #define CYG_REPORT_FUNCARG8( _format_, a,b,c,d,e,f,g,h ) CYG_EMPTY_STATEMENT
1062 #define CYG_REPORT_RETURN() CYG_EMPTY_STATEMENT
1063 #define CYG_REPORT_RETVAL( _value_ ) CYG_EMPTY_STATEMENT
1065 #endif // CYGDBG_INFRA_DEBUG_FUNCTION_REPORTS
1067 #else // ! CYGDBG_USE_TRACING
1069 // -------------------------------------------------------------------------
1070 // No traces: we define empty statements for trace macros.
1072 #define CYG_TRACE0( _bool_, _msg_ ) CYG_EMPTY_STATEMENT
1073 #define CYG_TRACE1( _bool_, _msg_, a ) CYG_EMPTY_STATEMENT
1074 #define CYG_TRACE2( _bool_, _msg_, a,b ) CYG_EMPTY_STATEMENT
1075 #define CYG_TRACE3( _bool_, _msg_, a,b,c ) CYG_EMPTY_STATEMENT
1076 #define CYG_TRACE4( _bool_, _msg_, a,b,c,d ) CYG_EMPTY_STATEMENT
1077 #define CYG_TRACE5( _bool_, _msg_, a,b,c,d,e ) CYG_EMPTY_STATEMENT
1078 #define CYG_TRACE6( _bool_, _msg_, a,b,c,d,e,f ) CYG_EMPTY_STATEMENT
1079 #define CYG_TRACE7( _bool_, _msg_, a,b,c,d,e,f,g ) CYG_EMPTY_STATEMENT
1080 #define CYG_TRACE8( _bool_, _msg_, a,b,c,d,e,f,g,h ) CYG_EMPTY_STATEMENT
1082 #define CYG_REPORT_FUNCTION() CYG_EMPTY_STATEMENT
1083 #define CYG_REPORT_FUNCTYPE( _exitmsg_ ) CYG_EMPTY_STATEMENT
1084 #define CYG_REPORT_FUNCNAME( _name_ ) CYG_EMPTY_STATEMENT
1085 #define CYG_REPORT_FUNCNAMETYPE( _name_, _exitmsg_ ) CYG_EMPTY_STATEMENT
1087 #define CYG_REPORT_FUNCTIONC() CYG_EMPTY_STATEMENT
1088 #define CYG_REPORT_FUNCTYPEC( _exitmsg_ ) CYG_EMPTY_STATEMENT
1089 #define CYG_REPORT_FUNCNAMEC( _name_ ) CYG_EMPTY_STATEMENT
1090 #define CYG_REPORT_FUNCNAMETYPEC( _name_, _exitmsg_ ) CYG_EMPTY_STATEMENT
1092 #define CYG_REPORT_FUNCARGVOID() CYG_EMPTY_STATEMENT
1093 #define CYG_REPORT_FUNCARG1( _format_, a ) CYG_EMPTY_STATEMENT
1094 #define CYG_REPORT_FUNCARG2( _format_, a,b ) CYG_EMPTY_STATEMENT
1095 #define CYG_REPORT_FUNCARG3( _format_, a,b,c ) CYG_EMPTY_STATEMENT
1096 #define CYG_REPORT_FUNCARG4( _format_, a,b,c,d ) CYG_EMPTY_STATEMENT
1097 #define CYG_REPORT_FUNCARG5( _format_, a,b,c,d,e ) CYG_EMPTY_STATEMENT
1098 #define CYG_REPORT_FUNCARG6( _format_, a,b,c,d,e,f ) CYG_EMPTY_STATEMENT
1099 #define CYG_REPORT_FUNCARG7( _format_, a,b,c,d,e,f,g ) CYG_EMPTY_STATEMENT
1100 #define CYG_REPORT_FUNCARG8( _format_, a,b,c,d,e,f,g,h ) CYG_EMPTY_STATEMENT
1102 #define CYG_REPORT_RETURN() CYG_EMPTY_STATEMENT
1103 #define CYG_REPORT_RETVAL( _value_ ) CYG_EMPTY_STATEMENT
1105 #define CYG_TRACE_PRINT() CYG_EMPTY_STATEMENT
1106 #define CYG_TRACE_DUMP() CYG_EMPTY_STATEMENT
1108 #endif // ! CYGDBG_USE_TRACING
1110 // -------------------------------------------------------------------------
1112 // CYG_TRACEn{[XDY]{V}}{B}
1114 // Convenience macros: these fall into a few dimensions, with suffix letters:
1116 // X: user need not supply a format string, %08x is used
1117 // D: ditto but signed decimal, %d
1118 // Y: ditto but just plain %x
1119 // Second option, only meaningful with one of XDY:
1120 // V: "<var> = %..." is used, by stringifying the argument
1122 // B: user need not supply a bool; the symbol CYG_TRACE_USER_BOOL is
1123 // used (which we do not define, user must do this)
1125 #define CYG_TRACE0B( _msg_ ) \
1126 CYG_TRACE0( CYG_TRACE_USER_BOOL, _msg_ )
1127 #define CYG_TRACE1B( _msg_, a ) \
1128 CYG_TRACE1( CYG_TRACE_USER_BOOL, _msg_, a )
1129 #define CYG_TRACE2B( _msg_, a,b ) \
1130 CYG_TRACE2( CYG_TRACE_USER_BOOL, _msg_, a,b )
1131 #define CYG_TRACE3B( _msg_, a,b,c ) \
1132 CYG_TRACE3( CYG_TRACE_USER_BOOL, _msg_, a,b,c )
1133 #define CYG_TRACE4B( _msg_, a,b,c,d ) \
1134 CYG_TRACE4( CYG_TRACE_USER_BOOL, _msg_, a,b,c,d )
1135 #define CYG_TRACE5B( _msg_, a,b,c,d,e ) \
1136 CYG_TRACE5( CYG_TRACE_USER_BOOL, _msg_, a,b,c,d,e )
1137 #define CYG_TRACE6B( _msg_, a,b,c,d,e,f ) \
1138 CYG_TRACE6( CYG_TRACE_USER_BOOL, _msg_, a,b,c,d,e,f )
1139 #define CYG_TRACE7B( _msg_, a,b,c,d,e,f,g ) \
1140 CYG_TRACE7( CYG_TRACE_USER_BOOL, _msg_, a,b,c,d,e,f,g )
1141 #define CYG_TRACE8B( _msg_, a,b,c,d,e,f,g,h ) \
1142 CYG_TRACE8( CYG_TRACE_USER_BOOL, _msg_, a,b,c,d,e,f,g,h )
1144 // long hex versions
1146 #define CYG_TRACE1X( _bool_, a ) \
1147 CYG_TRACE1( _bool_, "%08x", a )
1148 #define CYG_TRACE2X( _bool_, a,b ) \
1149 CYG_TRACE2( _bool_, "%08x %08x", a,b )
1150 #define CYG_TRACE3X( _bool_, a,b,c ) \
1151 CYG_TRACE3( _bool_, "%08x %08x %08x", a,b,c )
1152 #define CYG_TRACE4X( _bool_, a,b,c,d ) \
1153 CYG_TRACE4( _bool_, "%08x %08x %08x %08x", a,b,c,d )
1154 #define CYG_TRACE5X( _bool_, a,b,c,d,e ) \
1155 CYG_TRACE5( _bool_, "%08x %08x %08x %08x %08x", a,b,c,d,e )
1156 #define CYG_TRACE6X( _bool_, a,b,c,d,e,f ) \
1157 CYG_TRACE6( _bool_, "%08x %08x %08x %08x %08x %08x", \
1159 #define CYG_TRACE7X( _bool_, a,b,c,d,e,f,g ) \
1160 CYG_TRACE7( _bool_, "%08x %08x %08x %08x %08x %08x %08x", \
1162 #define CYG_TRACE8X( _bool_, a,b,c,d,e,f,g,h ) \
1163 CYG_TRACE8( _bool_, "%08x %08x %08x %08x %08x %08x %08x %08x", \
1166 #define CYG_TRACE1XV( _bool_, a ) \
1167 CYG_TRACE1( _bool_, # a "=%08x ", a )
1168 #define CYG_TRACE2XV( _bool_, a,b ) \
1169 CYG_TRACE2( _bool_, \
1170 # a "=%08x " # b "=%08x " , a,b )
1171 #define CYG_TRACE3XV( _bool_, a,b,c ) \
1172 CYG_TRACE3( _bool_, \
1173 # a "=%08x " # b "=%08x " # c "=%08x " , a,b,c )
1174 #define CYG_TRACE4XV( _bool_, a,b,c,d ) \
1175 CYG_TRACE4( _bool_, \
1176 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \
1178 #define CYG_TRACE5XV( _bool_, a,b,c,d,e ) \
1179 CYG_TRACE5( _bool_, \
1180 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \
1183 #define CYG_TRACE6XV( _bool_, a,b,c,d,e,f ) \
1184 CYG_TRACE6( _bool_, \
1185 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \
1186 # e "=%08x " # f "=%08x " \
1188 #define CYG_TRACE7XV( _bool_, a,b,c,d,e,f,g ) \
1189 CYG_TRACE7( _bool_, \
1190 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \
1191 # e "=%08x " # f "=%08x " # g "=%08x " \
1193 #define CYG_TRACE8XV( _bool_, a,b,c,d,e,f,g,h ) \
1194 CYG_TRACE8( _bool_, \
1195 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \
1196 # e "=%08x " # f "=%08x " # g "=%08x " # h "=%08x " \
1199 #define CYG_TRACE1XB( a ) \
1200 CYG_TRACE1( CYG_TRACE_USER_BOOL, "%08x", a )
1201 #define CYG_TRACE2XB( a,b ) \
1202 CYG_TRACE2( CYG_TRACE_USER_BOOL, "%08x %08x", a,b )
1203 #define CYG_TRACE3XB( a,b,c ) \
1204 CYG_TRACE3( CYG_TRACE_USER_BOOL, "%08x %08x %08x", a,b,c )
1205 #define CYG_TRACE4XB( a,b,c,d ) \
1206 CYG_TRACE4( CYG_TRACE_USER_BOOL, "%08x %08x %08x %08x", a,b,c,d )
1207 #define CYG_TRACE5XB( a,b,c,d,e ) \
1208 CYG_TRACE5( CYG_TRACE_USER_BOOL, "%08x %08x %08x %08x %08x", a,b,c,d,e )
1209 #define CYG_TRACE6XB( a,b,c,d,e,f ) \
1210 CYG_TRACE6( CYG_TRACE_USER_BOOL, "%08x %08x %08x %08x %08x %08x", \
1212 #define CYG_TRACE7XB( a,b,c,d,e,f,g ) \
1213 CYG_TRACE7( CYG_TRACE_USER_BOOL, "%08x %08x %08x %08x %08x %08x %08x", \
1215 #define CYG_TRACE8XB( a,b,c,d,e,f,g,h ) \
1216 CYG_TRACE8( CYG_TRACE_USER_BOOL, "%08x %08x %08x %08x %08x %08x %08x %08x", \
1219 #define CYG_TRACE1XVB( a ) \
1220 CYG_TRACE1( CYG_TRACE_USER_BOOL, # a "=%08x ", a )
1221 #define CYG_TRACE2XVB( a,b ) \
1222 CYG_TRACE2( CYG_TRACE_USER_BOOL, \
1223 # a "=%08x " # b "=%08x " , a,b )
1224 #define CYG_TRACE3XVB( a,b,c ) \
1225 CYG_TRACE3( CYG_TRACE_USER_BOOL, \
1226 # a "=%08x " # b "=%08x " # c "=%08x " , a,b,c )
1227 #define CYG_TRACE4XVB( a,b,c,d ) \
1228 CYG_TRACE4( CYG_TRACE_USER_BOOL, \
1229 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \
1231 #define CYG_TRACE5XVB( a,b,c,d,e ) \
1232 CYG_TRACE5( CYG_TRACE_USER_BOOL, \
1233 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \
1236 #define CYG_TRACE6XVB( a,b,c,d,e,f ) \
1237 CYG_TRACE6( CYG_TRACE_USER_BOOL, \
1238 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \
1239 # e "=%08x " # f "=%08x " \
1241 #define CYG_TRACE7XVB( a,b,c,d,e,f,g ) \
1242 CYG_TRACE7( CYG_TRACE_USER_BOOL, \
1243 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \
1244 # e "=%08x " # f "=%08x " # g "=%08x " \
1246 #define CYG_TRACE8XVB( a,b,c,d,e,f,g,h ) \
1247 CYG_TRACE8( CYG_TRACE_USER_BOOL, \
1248 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \
1249 # e "=%08x " # f "=%08x " # g "=%08x " # h "=%08x " \
1254 #define CYG_TRACE1D( _bool_, a ) \
1255 CYG_TRACE1( _bool_, "%d", a )
1256 #define CYG_TRACE2D( _bool_, a,b ) \
1257 CYG_TRACE2( _bool_, "%d %d", a,b )
1258 #define CYG_TRACE3D( _bool_, a,b,c ) \
1259 CYG_TRACE3( _bool_, "%d %d %d", a,b,c )
1260 #define CYG_TRACE4D( _bool_, a,b,c,d ) \
1261 CYG_TRACE4( _bool_, "%d %d %d %d", a,b,c,d )
1262 #define CYG_TRACE5D( _bool_, a,b,c,d,e ) \
1263 CYG_TRACE5( _bool_, "%d %d %d %d %d", a,b,c,d,e )
1264 #define CYG_TRACE6D( _bool_, a,b,c,d,e,f ) \
1265 CYG_TRACE6( _bool_, "%d %d %d %d %d %d", \
1267 #define CYG_TRACE7D( _bool_, a,b,c,d,e,f,g ) \
1268 CYG_TRACE7( _bool_, "%d %d %d %d %d %d %d", \
1270 #define CYG_TRACE8D( _bool_, a,b,c,d,e,f,g,h ) \
1271 CYG_TRACE8( _bool_, "%d %d %d %d %d %d %d %d", \
1274 #define CYG_TRACE1DV( _bool_, a ) \
1275 CYG_TRACE1( _bool_, # a "=%d ", a )
1276 #define CYG_TRACE2DV( _bool_, a,b ) \
1277 CYG_TRACE2( _bool_, \
1278 # a "=%d " # b "=%d " , a,b )
1279 #define CYG_TRACE3DV( _bool_, a,b,c ) \
1280 CYG_TRACE3( _bool_, \
1281 # a "=%d " # b "=%d " # c "=%d " , a,b,c )
1282 #define CYG_TRACE4DV( _bool_, a,b,c,d ) \
1283 CYG_TRACE4( _bool_, \
1284 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \
1286 #define CYG_TRACE5DV( _bool_, a,b,c,d,e ) \
1287 CYG_TRACE5( _bool_, \
1288 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \
1291 #define CYG_TRACE6DV( _bool_, a,b,c,d,e,f ) \
1292 CYG_TRACE6( _bool_, \
1293 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \
1294 # e "=%d " # f "=%d " \
1296 #define CYG_TRACE7DV( _bool_, a,b,c,d,e,f,g ) \
1297 CYG_TRACE7( _bool_, \
1298 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \
1299 # e "=%d " # f "=%d " # g "=%d " \
1301 #define CYG_TRACE8DV( _bool_, a,b,c,d,e,f,g,h ) \
1302 CYG_TRACE8( _bool_, \
1303 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \
1304 # e "=%d " # f "=%d " # g "=%d " # h "=%d " \
1307 #define CYG_TRACE1DB( a ) \
1308 CYG_TRACE1( CYG_TRACE_USER_BOOL, "%d", a )
1309 #define CYG_TRACE2DB( a,b ) \
1310 CYG_TRACE2( CYG_TRACE_USER_BOOL, "%d %d", a,b )
1311 #define CYG_TRACE3DB( a,b,c ) \
1312 CYG_TRACE3( CYG_TRACE_USER_BOOL, "%d %d %d", a,b,c )
1313 #define CYG_TRACE4DB( a,b,c,d ) \
1314 CYG_TRACE4( CYG_TRACE_USER_BOOL, "%d %d %d %d", a,b,c,d )
1315 #define CYG_TRACE5DB( a,b,c,d,e ) \
1316 CYG_TRACE5( CYG_TRACE_USER_BOOL, "%d %d %d %d %d", a,b,c,d,e )
1317 #define CYG_TRACE6DB( a,b,c,d,e,f ) \
1318 CYG_TRACE6( CYG_TRACE_USER_BOOL, "%d %d %d %d %d %d", \
1320 #define CYG_TRACE7DB( a,b,c,d,e,f,g ) \
1321 CYG_TRACE7( CYG_TRACE_USER_BOOL, "%d %d %d %d %d %d %d", \
1323 #define CYG_TRACE8DB( a,b,c,d,e,f,g,h ) \
1324 CYG_TRACE8( CYG_TRACE_USER_BOOL, "%d %d %d %d %d %d %d %d", \
1327 #define CYG_TRACE1DVB( a ) \
1328 CYG_TRACE1( CYG_TRACE_USER_BOOL, # a "=%d ", a )
1329 #define CYG_TRACE2DVB( a,b ) \
1330 CYG_TRACE2( CYG_TRACE_USER_BOOL, \
1331 # a "=%d " # b "=%d " , a,b )
1332 #define CYG_TRACE3DVB( a,b,c ) \
1333 CYG_TRACE3( CYG_TRACE_USER_BOOL, \
1334 # a "=%d " # b "=%d " # c "=%d " , a,b,c )
1335 #define CYG_TRACE4DVB( a,b,c,d ) \
1336 CYG_TRACE4( CYG_TRACE_USER_BOOL, \
1337 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \
1339 #define CYG_TRACE5DVB( a,b,c,d,e ) \
1340 CYG_TRACE5( CYG_TRACE_USER_BOOL, \
1341 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \
1344 #define CYG_TRACE6DVB( a,b,c,d,e,f ) \
1345 CYG_TRACE6( CYG_TRACE_USER_BOOL, \
1346 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \
1347 # e "=%d " # f "=%d " \
1349 #define CYG_TRACE7DVB( a,b,c,d,e,f,g ) \
1350 CYG_TRACE7( CYG_TRACE_USER_BOOL, \
1351 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \
1352 # e "=%d " # f "=%d " # g "=%d " \
1354 #define CYG_TRACE8DVB( a,b,c,d,e,f,g,h ) \
1355 CYG_TRACE8( CYG_TRACE_USER_BOOL, \
1356 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \
1357 # e "=%d " # f "=%d " # g "=%d " # h "=%d " \
1360 // short hex versions
1362 #define CYG_TRACE1Y( _bool_, a ) \
1363 CYG_TRACE1( _bool_, "%x", a )
1364 #define CYG_TRACE2Y( _bool_, a,b ) \
1365 CYG_TRACE2( _bool_, "%x %x", a,b )
1366 #define CYG_TRACE3Y( _bool_, a,b,c ) \
1367 CYG_TRACE3( _bool_, "%x %x %x", a,b,c )
1368 #define CYG_TRACE4Y( _bool_, a,b,c,d ) \
1369 CYG_TRACE4( _bool_, "%x %x %x %x", a,b,c,d )
1370 #define CYG_TRACE5Y( _bool_, a,b,c,d,e ) \
1371 CYG_TRACE5( _bool_, "%x %x %x %x %x", a,b,c,d,e )
1372 #define CYG_TRACE6Y( _bool_, a,b,c,d,e,f ) \
1373 CYG_TRACE6( _bool_, "%x %x %x %x %x %x", \
1375 #define CYG_TRACE7Y( _bool_, a,b,c,d,e,f,g ) \
1376 CYG_TRACE7( _bool_, "%x %x %x %x %x %x %x", \
1378 #define CYG_TRACE8Y( _bool_, a,b,c,d,e,f,g,h ) \
1379 CYG_TRACE8( _bool_, "%x %x %x %x %x %x %x %x", \
1382 #define CYG_TRACE1YV( _bool_, a ) \
1383 CYG_TRACE1( _bool_, # a "=%x ", a )
1384 #define CYG_TRACE2YV( _bool_, a,b ) \
1385 CYG_TRACE2( _bool_, \
1386 # a "=%x " # b "=%x " , a,b )
1387 #define CYG_TRACE3YV( _bool_, a,b,c ) \
1388 CYG_TRACE3( _bool_, \
1389 # a "=%x " # b "=%x " # c "=%x " , a,b,c )
1390 #define CYG_TRACE4YV( _bool_, a,b,c,d ) \
1391 CYG_TRACE4( _bool_, \
1392 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \
1394 #define CYG_TRACE5YV( _bool_, a,b,c,d,e ) \
1395 CYG_TRACE5( _bool_, \
1396 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \
1399 #define CYG_TRACE6YV( _bool_, a,b,c,d,e,f ) \
1400 CYG_TRACE6( _bool_, \
1401 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \
1402 # e "=%x " # f "=%x " \
1404 #define CYG_TRACE7YV( _bool_, a,b,c,d,e,f,g ) \
1405 CYG_TRACE7( _bool_, \
1406 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \
1407 # e "=%x " # f "=%x " # g "=%x " \
1409 #define CYG_TRACE8YV( _bool_, a,b,c,d,e,f,g,h ) \
1410 CYG_TRACE8( _bool_, \
1411 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \
1412 # e "=%x " # f "=%x " # g "=%x " # h "=%x " \
1415 #define CYG_TRACE1YB( a ) \
1416 CYG_TRACE1( CYG_TRACE_USER_BOOL, "%x", a )
1417 #define CYG_TRACE2YB( a,b ) \
1418 CYG_TRACE2( CYG_TRACE_USER_BOOL, "%x %x", a,b )
1419 #define CYG_TRACE3YB( a,b,c ) \
1420 CYG_TRACE3( CYG_TRACE_USER_BOOL, "%x %x %x", a,b,c )
1421 #define CYG_TRACE4YB( a,b,c,d ) \
1422 CYG_TRACE4( CYG_TRACE_USER_BOOL, "%x %x %x %x", a,b,c,d )
1423 #define CYG_TRACE5YB( a,b,c,d,e ) \
1424 CYG_TRACE5( CYG_TRACE_USER_BOOL, "%x %x %x %x %x", a,b,c,d,e )
1425 #define CYG_TRACE6YB( a,b,c,d,e,f ) \
1426 CYG_TRACE6( CYG_TRACE_USER_BOOL, "%x %x %x %x %x %x", \
1428 #define CYG_TRACE7YB( a,b,c,d,e,f,g ) \
1429 CYG_TRACE7( CYG_TRACE_USER_BOOL, "%x %x %x %x %x %x %x", \
1431 #define CYG_TRACE8YB( a,b,c,d,e,f,g,h ) \
1432 CYG_TRACE8( CYG_TRACE_USER_BOOL, "%x %x %x %x %x %x %x %x", \
1435 #define CYG_TRACE1YVB( a ) \
1436 CYG_TRACE1( CYG_TRACE_USER_BOOL, # a "=%x ", a )
1437 #define CYG_TRACE2YVB( a,b ) \
1438 CYG_TRACE2( CYG_TRACE_USER_BOOL, \
1439 # a "=%x " # b "=%x " , a,b )
1440 #define CYG_TRACE3YVB( a,b,c ) \
1441 CYG_TRACE3( CYG_TRACE_USER_BOOL, \
1442 # a "=%x " # b "=%x " # c "=%x " , a,b,c )
1443 #define CYG_TRACE4YVB( a,b,c,d ) \
1444 CYG_TRACE4( CYG_TRACE_USER_BOOL, \
1445 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \
1447 #define CYG_TRACE5YVB( a,b,c,d,e ) \
1448 CYG_TRACE5( CYG_TRACE_USER_BOOL, \
1449 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \
1452 #define CYG_TRACE6YVB( a,b,c,d,e,f ) \
1453 CYG_TRACE6( CYG_TRACE_USER_BOOL, \
1454 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \
1455 # e "=%x " # f "=%x " \
1457 #define CYG_TRACE7YVB( a,b,c,d,e,f,g ) \
1458 CYG_TRACE7( CYG_TRACE_USER_BOOL, \
1459 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \
1460 # e "=%x " # f "=%x " # g "=%x " \
1462 #define CYG_TRACE8YVB( a,b,c,d,e,f,g,h ) \
1463 CYG_TRACE8( CYG_TRACE_USER_BOOL, \
1464 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \
1465 # e "=%x " # f "=%x " # g "=%x " # h "=%x " \
1468 // -------------------------------------------------------------------------
1470 // CYG_REPORT_FUNCARGn{[XDY]{V}}
1472 // Convenience macros two: these fall into a few dimensions, with suffix letters:
1474 // X: user need not supply a format string, %08x is used
1475 // D: ditto but signed decimal, %d
1476 // Y: ditto but just plain %x
1477 // Second option, only meaningful with one of XDY:
1478 // V: "<var> = %..." is used, by stringifying the argument
1480 // long hex versions
1482 #define CYG_REPORT_FUNCARG1X( a ) \
1483 CYG_REPORT_FUNCARG1( "%08x", a )
1484 #define CYG_REPORT_FUNCARG2X( a,b ) \
1485 CYG_REPORT_FUNCARG2( "%08x %08x", a,b )
1486 #define CYG_REPORT_FUNCARG3X( a,b,c ) \
1487 CYG_REPORT_FUNCARG3( "%08x %08x %08x", a,b,c )
1488 #define CYG_REPORT_FUNCARG4X( a,b,c,d ) \
1489 CYG_REPORT_FUNCARG4( "%08x %08x %08x %08x", a,b,c,d )
1490 #define CYG_REPORT_FUNCARG5X( a,b,c,d,e ) \
1491 CYG_REPORT_FUNCARG5( "%08x %08x %08x %08x %08x", a,b,c,d,e )
1492 #define CYG_REPORT_FUNCARG6X( a,b,c,d,e,f ) \
1493 CYG_REPORT_FUNCARG6( "%08x %08x %08x %08x %08x %08x", \
1495 #define CYG_REPORT_FUNCARG7X( a,b,c,d,e,f,g ) \
1496 CYG_REPORT_FUNCARG7( "%08x %08x %08x %08x %08x %08x %08x", \
1498 #define CYG_REPORT_FUNCARG8X( a,b,c,d,e,f,g,h ) \
1499 CYG_REPORT_FUNCARG8( "%08x %08x %08x %08x %08x %08x %08x %08x", \
1502 #define CYG_REPORT_FUNCARG1XV( a ) \
1503 CYG_REPORT_FUNCARG1( # a "=%08x ", a )
1504 #define CYG_REPORT_FUNCARG2XV( a,b ) \
1505 CYG_REPORT_FUNCARG2( \
1506 # a "=%08x " # b "=%08x " , a,b )
1507 #define CYG_REPORT_FUNCARG3XV( a,b,c ) \
1508 CYG_REPORT_FUNCARG3( \
1509 # a "=%08x " # b "=%08x " # c "=%08x " , a,b,c )
1510 #define CYG_REPORT_FUNCARG4XV( a,b,c,d ) \
1511 CYG_REPORT_FUNCARG4( \
1512 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \
1514 #define CYG_REPORT_FUNCARG5XV( a,b,c,d,e ) \
1515 CYG_REPORT_FUNCARG5( \
1516 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \
1519 #define CYG_REPORT_FUNCARG6XV( a,b,c,d,e,f ) \
1520 CYG_REPORT_FUNCARG6( \
1521 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \
1522 # e "=%08x " # f "=%08x " \
1524 #define CYG_REPORT_FUNCARG7XV( a,b,c,d,e,f,g ) \
1525 CYG_REPORT_FUNCARG7( \
1526 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \
1527 # e "=%08x " # f "=%08x " # g "=%08x " \
1529 #define CYG_REPORT_FUNCARG8XV( a,b,c,d,e,f,g,h ) \
1530 CYG_REPORT_FUNCARG8( \
1531 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \
1532 # e "=%08x " # f "=%08x " # g "=%08x " # h "=%08x " \
1538 #define CYG_REPORT_FUNCARG1D( a ) \
1539 CYG_REPORT_FUNCARG1( "%d", a )
1540 #define CYG_REPORT_FUNCARG2D( a,b ) \
1541 CYG_REPORT_FUNCARG2( "%d %d", a,b )
1542 #define CYG_REPORT_FUNCARG3D( a,b,c ) \
1543 CYG_REPORT_FUNCARG3( "%d %d %d", a,b,c )
1544 #define CYG_REPORT_FUNCARG4D( a,b,c,d ) \
1545 CYG_REPORT_FUNCARG4( "%d %d %d %d", a,b,c,d )
1546 #define CYG_REPORT_FUNCARG5D( a,b,c,d,e ) \
1547 CYG_REPORT_FUNCARG5( "%d %d %d %d %d", a,b,c,d,e )
1548 #define CYG_REPORT_FUNCARG6D( a,b,c,d,e,f ) \
1549 CYG_REPORT_FUNCARG6( "%d %d %d %d %d %d", \
1551 #define CYG_REPORT_FUNCARG7D( a,b,c,d,e,f,g ) \
1552 CYG_REPORT_FUNCARG7( "%d %d %d %d %d %d %d", \
1554 #define CYG_REPORT_FUNCARG8D( a,b,c,d,e,f,g,h ) \
1555 CYG_REPORT_FUNCARG8( "%d %d %d %d %d %d %d %d", \
1558 #define CYG_REPORT_FUNCARG1DV( a ) \
1559 CYG_REPORT_FUNCARG1( # a "=%d ", a )
1560 #define CYG_REPORT_FUNCARG2DV( a,b ) \
1561 CYG_REPORT_FUNCARG2( \
1562 # a "=%d " # b "=%d " , a,b )
1563 #define CYG_REPORT_FUNCARG3DV( a,b,c ) \
1564 CYG_REPORT_FUNCARG3( \
1565 # a "=%d " # b "=%d " # c "=%d " , a,b,c )
1566 #define CYG_REPORT_FUNCARG4DV( a,b,c,d ) \
1567 CYG_REPORT_FUNCARG4( \
1568 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \
1570 #define CYG_REPORT_FUNCARG5DV( a,b,c,d,e ) \
1571 CYG_REPORT_FUNCARG5( \
1572 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \
1575 #define CYG_REPORT_FUNCARG6DV( a,b,c,d,e,f ) \
1576 CYG_REPORT_FUNCARG6( \
1577 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \
1578 # e "=%d " # f "=%d " \
1580 #define CYG_REPORT_FUNCARG7DV( a,b,c,d,e,f,g ) \
1581 CYG_REPORT_FUNCARG7( \
1582 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \
1583 # e "=%d " # f "=%d " # g "=%d " \
1585 #define CYG_REPORT_FUNCARG8DV( a,b,c,d,e,f,g,h ) \
1586 CYG_REPORT_FUNCARG8( \
1587 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \
1588 # e "=%d " # f "=%d " # g "=%d " # h "=%d " \
1591 // short hex versions
1593 #define CYG_REPORT_FUNCARG1Y( a ) \
1594 CYG_REPORT_FUNCARG1( "%x", a )
1595 #define CYG_REPORT_FUNCARG2Y( a,b ) \
1596 CYG_REPORT_FUNCARG2( "%x %x", a,b )
1597 #define CYG_REPORT_FUNCARG3Y( a,b,c ) \
1598 CYG_REPORT_FUNCARG3( "%x %x %x", a,b,c )
1599 #define CYG_REPORT_FUNCARG4Y( a,b,c,d ) \
1600 CYG_REPORT_FUNCARG4( "%x %x %x %x", a,b,c,d )
1601 #define CYG_REPORT_FUNCARG5Y( a,b,c,d,e ) \
1602 CYG_REPORT_FUNCARG5( "%x %x %x %x %x", a,b,c,d,e )
1603 #define CYG_REPORT_FUNCARG6Y( a,b,c,d,e,f ) \
1604 CYG_REPORT_FUNCARG6( "%x %x %x %x %x %x", \
1606 #define CYG_REPORT_FUNCARG7Y( a,b,c,d,e,f,g ) \
1607 CYG_REPORT_FUNCARG7( "%x %x %x %x %x %x %x", \
1609 #define CYG_REPORT_FUNCARG8Y( a,b,c,d,e,f,g,h ) \
1610 CYG_REPORT_FUNCARG8( "%x %x %x %x %x %x %x %x", \
1613 #define CYG_REPORT_FUNCARG1YV( a ) \
1614 CYG_REPORT_FUNCARG1( # a "=%x ", a )
1615 #define CYG_REPORT_FUNCARG2YV( a,b ) \
1616 CYG_REPORT_FUNCARG2( \
1617 # a "=%x " # b "=%x " , a,b )
1618 #define CYG_REPORT_FUNCARG3YV( a,b,c ) \
1619 CYG_REPORT_FUNCARG3( \
1620 # a "=%x " # b "=%x " # c "=%x " , a,b,c )
1621 #define CYG_REPORT_FUNCARG4YV( a,b,c,d ) \
1622 CYG_REPORT_FUNCARG4( \
1623 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \
1625 #define CYG_REPORT_FUNCARG5YV( a,b,c,d,e ) \
1626 CYG_REPORT_FUNCARG5( \
1627 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \
1630 #define CYG_REPORT_FUNCARG6YV( a,b,c,d,e,f ) \
1631 CYG_REPORT_FUNCARG6( \
1632 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \
1633 # e "=%x " # f "=%x " \
1635 #define CYG_REPORT_FUNCARG7YV( a,b,c,d,e,f,g ) \
1636 CYG_REPORT_FUNCARG7( \
1637 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \
1638 # e "=%x " # f "=%x " # g "=%x " \
1640 #define CYG_REPORT_FUNCARG8YV( a,b,c,d,e,f,g,h ) \
1641 CYG_REPORT_FUNCARG8( \
1642 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \
1643 # e "=%x " # f "=%x " # g "=%x " # h "=%x " \
1647 #endif // CYGONCE_INFRA_CYG_TRAC_H multiple inclusion protection