PERFORCE change 127157 for review
Fredrik Lindberg
fli at FreeBSD.org
Wed Oct 3 14:42:55 PDT 2007
http://perforce.freebsd.org/chv.cgi?CH=127157
Change 127157 by fli at fli_nexus on 2007/10/03 21:42:45
- Add "header protection" defines.
- Whitespace fix.
- New printout control macros.
- Add TRACE_* macros (function enter/leave).
- Cast magic value to uint32_t (silence compiler).
Affected files ...
.. //depot/projects/soc2007/fli-mdns_sd/mdnsd/debug.h#5 edit
Differences ...
==== //depot/projects/soc2007/fli-mdns_sd/mdnsd/debug.h#5 (text+ko) ====
@@ -27,11 +27,14 @@
#include <assert.h>
#include <stdint.h>
+#ifndef _DEBUG_H_
+#define _DEBUG_H_
+
/*
* Bit-field values that controls debugging output
*/
#define DEBUG_NONE 0x0000
-#define DEBUG_WQUEUE 0x0001
+#define DEBUG_WQUEUE 0x0001
#define DEBUG_EVENT 0x0002
#define DEBUG_STACK 0x0004
#define DEBUG_BUF 0x0008
@@ -41,17 +44,18 @@
#define DEBUG_CACHE 0x0080
#define DEBUG_DBR 0x0100
#define DEBUG_CFG 0x0200
-#define DEBUG_CFGPARSE 0x0400
+#define DEBUG_CFGPARSE 0x0400
#define DEBUG_VAR 0x0800
#define DEBUG_MISC 0x1000
#define DEBUG_OA 0x2000
#define DEBUG_CS 0x4000
#define DEBUG_QUERY 0x8000
+#define DEBUG_TRACE 0x10000
/*
* Structure initialization protection
*/
-#define MDNS_MAGIC_COOKIE 0xcafebabe
+#define MDNS_MAGIC_COOKIE (uint32_t)0xcafebabe
#ifdef DEBUG
#define MAGIC(f) uint32_t f
#define MDNS_INIT_SET(_md, f) (_md)->f = MDNS_MAGIC_COOKIE;
@@ -79,3 +83,9 @@
# define HEXDUMP(buf, len)
#endif
+#define TRACE_ENTER dprintf(DEBUG_TRACE, "ENTER")
+#define TRACE_LEAVE dprintf(DEBUG_TRACE, "LEAVE")
+#define TRACE_LEAVE_SUCCESS dprintf(DEBUG_TRACE, "LEAVE SUCCESS")
+#define TRACE_LEAVE_FAIL dprintf(DEBUG_TRACE, "LEAVE FAILURE")
+
+#endif /* _DEBUG_H_ */
More information about the p4-projects
mailing list