+extern int shared_region_trace_level;
+#define SHARED_REGION_TRACE_NONE 0 /* no trace */
+#define SHARED_REGION_TRACE_ERROR 1 /* trace abnormal events */
+#define SHARED_REGION_TRACE_CONFLICT 2 /* trace library conflicts */
+#define SHARED_REGION_TRACE_INFO 3 /* trace all events */
+#define SHARED_REGION_TRACE(level, args) \
+ MACRO_BEGIN \
+ if (level <= shared_region_trace_level) { \
+ printf args; \
+ } \
+ MACRO_END