2014-01-28 11:30:36 +04:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2014 Mellanox Technologies, Inc.
|
|
|
|
* All rights reserved.
|
2015-01-16 22:34:11 +03:00
|
|
|
* Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
|
2014-01-28 11:30:36 +04:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "oshmem_config.h"
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include "oshmem/constants.h"
|
|
|
|
#include "oshmem/util/oshmem_util.h"
|
|
|
|
|
2014-03-05 12:49:14 +04:00
|
|
|
void oshmem_output_verbose(int level, int output_id, const char* prefix,
|
|
|
|
const char* file, int line, const char* function, const char* format, ...)
|
2014-01-28 11:30:36 +04:00
|
|
|
{
|
|
|
|
va_list args;
|
|
|
|
char *buff, *str;
|
2015-01-16 22:34:11 +03:00
|
|
|
int ret = 0;
|
2014-01-28 11:30:36 +04:00
|
|
|
|
2014-05-19 17:32:32 +04:00
|
|
|
if (level < opal_output_get_verbosity(output_id)) {
|
|
|
|
UNREFERENCED_PARAMETER(ret);
|
2014-01-28 11:30:36 +04:00
|
|
|
|
2014-05-19 17:32:32 +04:00
|
|
|
va_start(args, format);
|
2014-01-28 11:30:36 +04:00
|
|
|
|
2014-05-19 17:32:32 +04:00
|
|
|
ret = vasprintf(&str, format, args);
|
|
|
|
assert(-1 != ret);
|
2014-01-28 11:30:36 +04:00
|
|
|
|
2014-05-19 17:32:32 +04:00
|
|
|
ret = asprintf(&buff, "%s %s", prefix, str);
|
|
|
|
assert(-1 != ret);
|
2014-01-28 11:30:36 +04:00
|
|
|
|
2014-05-19 17:32:32 +04:00
|
|
|
opal_output(output_id, buff, file, line, function);
|
2014-01-28 11:30:36 +04:00
|
|
|
|
2014-05-19 17:32:32 +04:00
|
|
|
va_end(args);
|
2014-01-28 11:30:36 +04:00
|
|
|
|
2014-05-19 17:32:32 +04:00
|
|
|
free(buff);
|
|
|
|
free(str);
|
|
|
|
}
|
2014-01-28 11:30:36 +04:00
|
|
|
}
|
2014-03-05 12:49:14 +04:00
|
|
|
|
2015-11-09 18:46:30 +03:00
|
|
|
|
2014-03-05 12:49:14 +04:00
|
|
|
void oshmem_output(int output_id, const char* prefix, const char* file,
|
|
|
|
int line, const char* function, const char* format, ...)
|
|
|
|
{
|
|
|
|
va_list args;
|
|
|
|
char *buff, *str;
|
|
|
|
int ret = 0;
|
|
|
|
|
|
|
|
UNREFERENCED_PARAMETER(ret);
|
|
|
|
|
|
|
|
va_start(args, format);
|
|
|
|
|
|
|
|
ret = vasprintf(&str, format, args);
|
|
|
|
assert(-1 != ret);
|
|
|
|
|
|
|
|
ret = asprintf(&buff, "%s %s", prefix, str);
|
|
|
|
assert(-1 != ret);
|
|
|
|
|
|
|
|
opal_output(output_id, buff, file, line, function);
|
|
|
|
|
|
|
|
va_end(args);
|
|
|
|
|
|
|
|
free(buff);
|
|
|
|
free(str);
|
|
|
|
}
|