aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
diff options
context:
space:
mode:
authorPatrik Nyblom <[email protected]>2011-03-21 21:21:50 +0100
committerPatrik Nyblom <[email protected]>2011-03-21 21:21:50 +0100
commit69c258c2ce9e0b43ec0bcbba442d1779b6b37fb7 (patch)
treece59870f11a6712fe6627ce88c0e1d7c73e03dc2 /erts/emulator/beam
parentf861b4fdb3fd39e35f2951c53a73b30a98c7f973 (diff)
downloadotp-69c258c2ce9e0b43ec0bcbba442d1779b6b37fb7.tar.gz
otp-69c258c2ce9e0b43ec0bcbba442d1779b6b37fb7.tar.bz2
otp-69c258c2ce9e0b43ec0bcbba442d1779b6b37fb7.zip
Make xml valgrind messages end up in xml log
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r--erts/emulator/beam/dist.c8
-rw-r--r--erts/emulator/beam/erl_bif_info.c10
2 files changed, 14 insertions, 4 deletions
diff --git a/erts/emulator/beam/dist.c b/erts/emulator/beam/dist.c
index 02910fad90..044fd045a6 100644
--- a/erts/emulator/beam/dist.c
+++ b/erts/emulator/beam/dist.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2010. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2011. All Rights Reserved.
*
* The contents of this file are subject to the Erlang Public License,
* Version 1.1, (the "License"); you may not use this file except in
@@ -864,11 +864,15 @@ erts_dsig_send_group_leader(ErtsDSigData *dsdp, Eterm leader, Eterm remote)
#include <valgrind/valgrind.h>
#include <valgrind/memcheck.h>
+#ifndef HAVE_VALGRIND_PRINTF_XML
+#define VALGRIND_PRINTF_XML VALGRIND_PRINTF
+#endif
+
# define PURIFY_MSG(msg) \
do { \
char buf__[1]; size_t bufsz__ = sizeof(buf__); \
if (erts_sys_getenv("VALGRIND_LOG_XML", buf__, &bufsz__) >= 0) { \
- VALGRIND_PRINTF("<erlang_error_log>" \
+ VALGRIND_PRINTF_XML("<erlang_error_log>" \
"%s, line %d: %s</erlang_error_log>\n", \
__FILE__, __LINE__, msg); \
} else { \
diff --git a/erts/emulator/beam/erl_bif_info.c b/erts/emulator/beam/erl_bif_info.c
index e06fbde9fb..71206c48b2 100644
--- a/erts/emulator/beam/erl_bif_info.c
+++ b/erts/emulator/beam/erl_bif_info.c
@@ -1723,8 +1723,14 @@ info_1_tuple(Process* BIF_P, /* Pointer to current process. */
} else if (is_list(*tp)) {
#if defined(PURIFY)
#define ERTS_ERROR_CHECKER_PRINTF purify_printf
+#define ERTS_ERROR_CHECKER_PRINTF_XML purify_printf
#elif defined(VALGRIND)
#define ERTS_ERROR_CHECKER_PRINTF VALGRIND_PRINTF
+# ifndef HAVE_VALGRIND_PRINTF_XML
+# define ERTS_ERROR_CHECKER_PRINTF_XML VALGRIND_PRINTF
+# else
+# define ERTS_ERROR_CHECKER_PRINTF_XML VALGRIND_PRINTF_XML
+# endif
#endif
int buf_size = 8*1024; /* Try with 8KB first */
char *buf = erts_alloc(ERTS_ALC_T_TMP, buf_size);
@@ -1741,8 +1747,8 @@ info_1_tuple(Process* BIF_P, /* Pointer to current process. */
}
buf[buf_size - 1 - r] = '\0';
if (check_if_xml()) {
- ERTS_ERROR_CHECKER_PRINTF("<erlang_info_log>"
- "%s</erlang_info_log>\n", buf);
+ ERTS_ERROR_CHECKER_PRINTF_XML("<erlang_info_log>"
+ "%s</erlang_info_log>\n", buf);
} else {
ERTS_ERROR_CHECKER_PRINTF("%s\n", buf);
}