Merge commit 'eaa2d123f0a643664721593d248ece6bcd85f1e6'

* commit 'eaa2d123f0a643664721593d248ece6bcd85f1e6':
  log: Print a full backtrace along with error messages under Valgrind

Conflicts:
	libavutil/log.c
	libavutil/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2015-04-20 23:30:33 +02:00
commit 954b5e340e
3 changed files with 19 additions and 1 deletions

7
configure vendored
View File

@ -395,6 +395,8 @@ Developer options (useful when working on FFmpeg itself):
(group) and PROB the probability associated with
NAME (default 0.5).
--random-seed=VALUE seed value for --enable/disable-random
--disable-valgrind-backtrace do not print a backtrace under Valgrind
(only applies to --disable-optimizations builds)
NOTE: Object files are built at the place where configure is launched.
EOF
@ -1512,6 +1514,7 @@ CONFIG_LIST="
pod2man
raise_major
thumb
valgrind_backtrace
xmm_clobber_test
"
@ -1686,6 +1689,7 @@ HEADERS_LIST="
termios_h
udplite_h
unistd_h
valgrind_valgrind_h
windows_h
winsock2_h
"
@ -2068,6 +2072,7 @@ simd_align_16_if_any="altivec neon sse"
# system capabilities
symver_if_any="symver_asm_label symver_gnu_asm"
valgrind_backtrace_deps="!optimizations valgrind_valgrind_h"
# threading support
atomics_gcc_if_any="sync_val_compare_and_swap atomic_compare_exchange"
@ -2796,6 +2801,7 @@ enable runtime_cpudetect
enable safe_bitstream_reader
enable static
enable swscale_alpha
enable valgrind_backtrace
sws_max_filter_size_default=256
set_default sws_max_filter_size
@ -4933,6 +4939,7 @@ check_header sys/time.h
check_header sys/un.h
check_header termios.h
check_header unistd.h
check_header valgrind/valgrind.h
check_header vdpau/vdpau.h
check_header vdpau/vdpau_x11.h
check_header VideoDecodeAcceleration/VDADecoder.h

View File

@ -47,6 +47,12 @@ static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
#define LINE_SZ 1024
#if HAVE_VALGRIND_VALGRIND_H
#include <valgrind/valgrind.h>
/* this is the log level at which valgrind will output a full backtrace */
#define BACKTRACE_LOGLEVEL AV_LOG_ERROR
#endif
static int av_log_level = AV_LOG_INFO;
static int flags;
@ -334,6 +340,11 @@ void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl)
colored_fputs(av_clip(level >> 3, 0, NB_LEVELS - 1), tint >> 8, part[2].str);
sanitize(part[3].str);
colored_fputs(av_clip(level >> 3, 0, NB_LEVELS - 1), tint >> 8, part[3].str);
#if CONFIG_VALGRIND_BACKTRACE
if (level <= BACKTRACE_LOGLEVEL)
VALGRIND_PRINTF_BACKTRACE("");
#endif
end:
av_bprint_finalize(part+3, NULL);
#if HAVE_PTHREADS

View File

@ -57,7 +57,7 @@
#define LIBAVUTIL_VERSION_MAJOR 54
#define LIBAVUTIL_VERSION_MINOR 23
#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_MICRO 101
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
LIBAVUTIL_VERSION_MINOR, \