From 756c65d3676d2b3ce5c7b56145e5f0f7cf7178ad Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 10 Sep 2020 15:43:22 +0200 Subject: Fix build with -trace lttng Fix superfluous space in qtgui.tracepoints and make tracegen more lenient towards unknown types (the ETW implementation outright ignores those). Pick-to: 5.15 Fixes: QTBUG-86546 Change-Id: I71cc323afa1009dbaefe20e55818ecb6c0b09c59 Reviewed-by: Alexandru Croitor Reviewed-by: Milian Wolff --- src/tools/tracegen/lttng.cpp | 3 ++- src/tools/tracegen/panic.cpp | 13 +++++++++++++ src/tools/tracegen/panic.h | 1 + 3 files changed, 16 insertions(+), 1 deletion(-) (limited to 'src/tools') diff --git a/src/tools/tracegen/lttng.cpp b/src/tools/tracegen/lttng.cpp index 1aef1b3d17..e628fbd680 100644 --- a/src/tools/tracegen/lttng.cpp +++ b/src/tools/tracegen/lttng.cpp @@ -98,7 +98,8 @@ static void writeCtfMacro(QTextStream &stream, const Tracepoint::Field &field) << "ctf_integer(int, height, " << name << ".height()) "; return; case Tracepoint::Field::Unknown: - panic("Cannot deduce CTF type for '%s %s", qPrintable(paramType), qPrintable(name)); + justified_worry("Cannot deduce CTF type for '%s %s'", qPrintable(paramType), + qPrintable(name)); break; } } diff --git a/src/tools/tracegen/panic.cpp b/src/tools/tracegen/panic.cpp index d1e207764e..ac95b2e9e8 100644 --- a/src/tools/tracegen/panic.cpp +++ b/src/tools/tracegen/panic.cpp @@ -57,3 +57,16 @@ void panic(const char *fmt, ...) exit(EXIT_FAILURE); } + +void justified_worry(const char *fmt, ...) +{ + va_list ap; + + fprintf(stderr, "tracegen: warning: "); + + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + va_end(ap); + + fputc('\n', stderr); +} diff --git a/src/tools/tracegen/panic.h b/src/tools/tracegen/panic.h index c6b195af00..58e56c0116 100644 --- a/src/tools/tracegen/panic.h +++ b/src/tools/tracegen/panic.h @@ -41,5 +41,6 @@ #define PANIC_H void panic(const char *fmt, ...); +void justified_worry(const char *fmt, ...); #endif // PANIC_H -- cgit v1.2.3