2005-09-07 22:52:28 +04:00
|
|
|
/* @file */
|
|
|
|
/*
|
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University.
|
|
|
|
* All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
|
|
|
* All rights reserved.
|
|
|
|
* 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$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "ompi_config.h"
|
|
|
|
#include "opal/util/output.h"
|
|
|
|
|
|
|
|
#include "opal/util/trace.h"
|
|
|
|
|
|
|
|
int opal_trace_handle;
|
|
|
|
|
2005-09-09 14:46:54 +04:00
|
|
|
/*
|
|
|
|
* Local state
|
|
|
|
*/
|
|
|
|
static opal_output_stream_t tracer;
|
|
|
|
|
|
|
|
|
2005-09-07 22:52:28 +04:00
|
|
|
void opal_trace_init(void)
|
|
|
|
{
|
2005-09-07 23:43:40 +04:00
|
|
|
#if OPAL_ENABLE_TRACE
|
2005-09-07 22:52:28 +04:00
|
|
|
|
2005-09-09 14:46:54 +04:00
|
|
|
/* get a file setup for opal_output to use for the trace */
|
|
|
|
OBJ_CONSTRUCT(&tracer, opal_output_stream_t);
|
|
|
|
tracer.lds_file_suffix = "trace";
|
|
|
|
tracer.lds_want_file = true;
|
2005-09-07 22:52:28 +04:00
|
|
|
|
2005-09-09 14:46:54 +04:00
|
|
|
opal_trace_handle = opal_output_open(&tracer);
|
2005-09-07 22:52:28 +04:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
void opal_trace_finalize(void)
|
|
|
|
{
|
2005-09-07 23:43:40 +04:00
|
|
|
#if OPAL_ENABLE_TRACE
|
2005-09-07 22:52:28 +04:00
|
|
|
opal_output_close(opal_trace_handle);
|
2005-09-09 14:46:54 +04:00
|
|
|
OBJ_DESTRUCT(&tracer);
|
2005-09-07 22:52:28 +04:00
|
|
|
#endif
|
|
|
|
}
|