00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00033 #ifndef TR_DUMP_H
00034 #define TR_DUMP_H
00035
00036
00037 #include "pipe/p_compiler.h"
00038
00039
00040 boolean trace_dump_trace_begin(void);
00041 boolean trace_dump_enabled(void);
00042 void trace_dump_trace_end(void);
00043 void trace_dump_call_begin(const char *klass, const char *method);
00044 void trace_dump_call_end(void);
00045 void trace_dump_arg_begin(const char *name);
00046 void trace_dump_arg_end(void);
00047 void trace_dump_ret_begin(void);
00048 void trace_dump_ret_end(void);
00049 void trace_dump_bool(int value);
00050 void trace_dump_int(long long int value);
00051 void trace_dump_uint(long long unsigned value);
00052 void trace_dump_float(double value);
00053 void trace_dump_bytes(const void *data, long unsigned size);
00054 void trace_dump_string(const char *str);
00055 void trace_dump_enum(const char *value);
00056 void trace_dump_array_begin(void);
00057 void trace_dump_array_end(void);
00058 void trace_dump_elem_begin(void);
00059 void trace_dump_elem_end(void);
00060 void trace_dump_struct_begin(const char *name);
00061 void trace_dump_struct_end(void);
00062 void trace_dump_member_begin(const char *name);
00063 void trace_dump_member_end(void);
00064 void trace_dump_null(void);
00065 void trace_dump_ptr(const void *value);
00066
00067
00068
00069
00070
00071
00072 #define trace_dump_arg(_type, _arg) \
00073 do { \
00074 trace_dump_arg_begin(#_arg); \
00075 trace_dump_##_type(_arg); \
00076 trace_dump_arg_end(); \
00077 } while(0)
00078
00079 #define trace_dump_ret(_type, _arg) \
00080 do { \
00081 trace_dump_ret_begin(); \
00082 trace_dump_##_type(_arg); \
00083 trace_dump_ret_end(); \
00084 } while(0)
00085
00086 #define trace_dump_array(_type, _obj, _size) \
00087 do { \
00088 unsigned long idx; \
00089 trace_dump_array_begin(); \
00090 for(idx = 0; idx < (_size); ++idx) { \
00091 trace_dump_elem_begin(); \
00092 trace_dump_##_type((_obj)[idx]); \
00093 trace_dump_elem_end(); \
00094 } \
00095 trace_dump_array_end(); \
00096 } while(0)
00097
00098 #define trace_dump_struct_array(_type, _obj, _size) \
00099 do { \
00100 unsigned long idx; \
00101 trace_dump_array_begin(); \
00102 for(idx = 0; idx < (_size); ++idx) { \
00103 trace_dump_elem_begin(); \
00104 trace_dump_##_type(&(_obj)[idx]); \
00105 trace_dump_elem_end(); \
00106 } \
00107 trace_dump_array_end(); \
00108 } while(0)
00109
00110 #define trace_dump_member(_type, _obj, _member) \
00111 do { \
00112 trace_dump_member_begin(#_member); \
00113 trace_dump_##_type((_obj)->_member); \
00114 trace_dump_member_end(); \
00115 } while(0)
00116
00117 #define trace_dump_arg_array(_type, _arg, _size) \
00118 do { \
00119 trace_dump_arg_begin(#_arg); \
00120 trace_dump_array(_type, _arg, _size); \
00121 trace_dump_arg_end(); \
00122 } while(0)
00123
00124 #define trace_dump_member_array(_type, _obj, _member) \
00125 do { \
00126 trace_dump_member_begin(#_member); \
00127 trace_dump_array(_type, (_obj)->_member, sizeof((_obj)->_member)/sizeof((_obj)->_member[0])); \
00128 trace_dump_member_end(); \
00129 } while(0)
00130
00131
00132 #endif