diff options
-rw-r--r-- | src/tools/tracegen/lttng.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/tools/tracegen/lttng.cpp b/src/tools/tracegen/lttng.cpp index b812682217..ff94bba3f3 100644 --- a/src/tools/tracegen/lttng.cpp +++ b/src/tools/tracegen/lttng.cpp @@ -20,8 +20,19 @@ static void writeCtfMacro(QTextStream &stream, const Provider &provider, const T const int arrayLen = field.arrayLen; if (arrayLen > 0) { - stream << "ctf_array(" <<paramType << ", " - << name << ", " << name << ", " << arrayLen << ")"; + if (paramType == QStringLiteral("double") || paramType == QStringLiteral("float")) { + const char *newline = nullptr; + for (int i = 0; i < arrayLen; i++) { + stream << newline; + stream << "ctf_float(" <<paramType << ", " << name << "_" << QString::number(i) << ", " + << name << "[" << QString::number(i) << "]" << ")"; + newline = "\n "; + } + + } else { + stream << "ctf_array(" <<paramType << ", " + << name << ", " << name << ", " << arrayLen << ")"; + } return; } |