2005-09-07 22:52:28 +04:00
|
|
|
/*
|
2005-11-05 22:57:48 +03:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
2006-08-23 04:29:35 +04:00
|
|
|
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
2005-11-05 22:57:48 +03:00
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2005-09-07 22:52:28 +04:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef OPAL_TRACE_H_
|
|
|
|
#define OPAL_TRACE_H_
|
|
|
|
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "opal_config.h"
|
2005-09-07 22:52:28 +04:00
|
|
|
|
2005-09-07 23:43:40 +04:00
|
|
|
#ifndef OPAL_ENABLE_TRACE
|
|
|
|
#define OPAL_ENABLE_TRACE 0
|
2005-09-07 22:52:28 +04:00
|
|
|
#endif
|
|
|
|
|
2005-09-07 23:43:40 +04:00
|
|
|
#if OPAL_ENABLE_TRACE
|
2005-09-07 22:52:28 +04:00
|
|
|
|
|
|
|
#include "opal/util/output.h"
|
|
|
|
|
2005-09-09 22:27:17 +04:00
|
|
|
#define OPAL_TRACE(verbose) \
|
2005-09-20 00:22:22 +04:00
|
|
|
do { \
|
2005-09-09 22:27:17 +04:00
|
|
|
opal_output_verbose(verbose, opal_trace_handle, "TRACE: %s @ %s:%d", \
|
2005-09-20 00:22:22 +04:00
|
|
|
__func__, __FILE__, __LINE__); \
|
2005-09-07 22:52:28 +04:00
|
|
|
} while (0)
|
2005-09-20 00:22:22 +04:00
|
|
|
|
2005-09-20 21:09:11 +04:00
|
|
|
#define OPAL_TRACE_ARG1(verbose, foo) \
|
2005-09-20 00:22:22 +04:00
|
|
|
do { \
|
|
|
|
opal_output_verbose(verbose, opal_trace_handle, "TRACE: %s @ %s:%d arg: %lu", \
|
|
|
|
__func__, __FILE__, __LINE__, (unsigned long)foo); \
|
|
|
|
} while (0)
|
2005-09-20 21:09:11 +04:00
|
|
|
|
|
|
|
#define OPAL_TRACE_ARG2(verbose, foo, foo2) \
|
|
|
|
do { \
|
|
|
|
opal_output_verbose(verbose, opal_trace_handle, "TRACE: %s @ %s:%d arg: %lu\n\t0x%x", \
|
|
|
|
__func__, __FILE__, __LINE__, (unsigned long)foo, (unsigned long)foo2); \
|
|
|
|
} while (0)
|
|
|
|
|
2005-09-07 22:52:28 +04:00
|
|
|
#else
|
|
|
|
|
2005-09-09 23:59:33 +04:00
|
|
|
#define OPAL_TRACE(verbose)
|
2005-09-20 21:09:11 +04:00
|
|
|
#define OPAL_TRACE_ARG1(verbose, foo)
|
|
|
|
#define OPAL_TRACE_ARG2(verbose, foo, foo2)
|
2005-09-07 22:52:28 +04:00
|
|
|
|
|
|
|
#endif /* ENABLE_TRACE */
|
|
|
|
|
2009-08-20 15:42:18 +04:00
|
|
|
BEGIN_C_DECLS
|
2006-08-22 21:52:19 +04:00
|
|
|
|
2006-08-23 04:29:35 +04:00
|
|
|
OPAL_DECLSPEC extern int opal_trace_handle;
|
2006-08-20 19:54:04 +04:00
|
|
|
OPAL_DECLSPEC void opal_trace_init(void);
|
|
|
|
OPAL_DECLSPEC void opal_trace_finalize(void);
|
2005-09-07 22:52:28 +04:00
|
|
|
|
2009-08-20 15:42:18 +04:00
|
|
|
END_C_DECLS
|
2005-09-07 22:52:28 +04:00
|
|
|
|
|
|
|
#endif /* OPAL_TRACE_H */
|