diff options
Diffstat (limited to 'src/tools/tracegen/helpers.h')
-rw-r--r-- | src/tools/tracegen/helpers.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/tools/tracegen/helpers.h b/src/tools/tracegen/helpers.h index 4c30eaff0d..ea6db016a6 100644 --- a/src/tools/tracegen/helpers.h +++ b/src/tools/tracegen/helpers.h @@ -1,5 +1,5 @@ // Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Rafael Roquetto <rafael.roquetto@kdab.com> -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #ifndef HELPERS_H #define HELPERS_H @@ -8,14 +8,30 @@ #include <qlist.h> #include <qstring.h> +#include <qtextstream.h> enum ParamType { LTTNG, - ETW + ETW, + CTF }; +QString typeToTypeName(const QString &type); QString includeGuard(const QString &filename); QString formatFunctionSignature(const QList<Tracepoint::Argument> &args); -QString formatParameterList(const QList<Tracepoint::Argument> &args, ParamType type); +QString formatParameterList(const Provider &provider, const QList<Tracepoint::Argument> &args, const QList<Tracepoint::Field> &fields, ParamType type); + +void writeCommonPrologue(QTextStream &stream); + +template <typename T> +static QString aggregateListValues(int value, const QList<T> &list) +{ + QStringList values; + for (const T &l : list) { + if (l.value == value) + values << l.name; + } + return values.join(QLatin1Char('_')); +} #endif // HELPERS_H |