summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntti Määttä <[email protected]>2023-01-31 11:05:03 +0200
committerAntti Määttä <[email protected]>2023-02-10 21:45:57 +0200
commit0510307ea1bfe2a1788738acb61890587e75dd5e (patch)
tree4e5a8257083cbde0284ea85e46b1f63b9cd64c9f
parent1d0da1d683cc71ea14cfd85f5e9aa227d7f75762 (diff)
tracegen: Add support for QSizeF and QRectF types
Pick-to: 6.5 Change-Id: Ie19523b84026312c3d5a597914abc2622dba3f68 Reviewed-by: Antti Määttä <[email protected]> Reviewed-by: Tomi Korpipää <[email protected]>
-rw-r--r--src/tools/tracegen/ctf.cpp12
-rw-r--r--src/tools/tracegen/etw.cpp2
-rw-r--r--src/tools/tracegen/lttng.cpp10
-rw-r--r--src/tools/tracegen/provider.cpp4
-rw-r--r--src/tools/tracegen/provider.h2
5 files changed, 29 insertions, 1 deletions
diff --git a/src/tools/tracegen/ctf.cpp b/src/tools/tracegen/ctf.cpp
index e49f5622c64..efb05e6cd70 100644
--- a/src/tools/tracegen/ctf.cpp
+++ b/src/tools/tracegen/ctf.cpp
@@ -257,6 +257,18 @@ static void writeTracepoint(QTextStream &stream,
stream << " + QStringLiteral(\"int32_t QSize_" << arg.name << "_height;\\n\\\n \")";
eventSize += QStringLiteral("8");
} break;
+ case Tracepoint::Field::QtRectF: {
+ stream << "QStringLiteral(\"float QRectF_" << arg.name << "_x;\\n\\\n \")";
+ stream << " + QStringLiteral(\"float QRectF_" << arg.name << "_y;\\n\\\n \")";
+ stream << " + QStringLiteral(\"float QRectF_" << arg.name << "_width;\\n\\\n \")";
+ stream << " + QStringLiteral(\"float QRectF_" << arg.name << "_height;\\n\\\n \")";
+ eventSize += QStringLiteral("16");
+ } break;
+ case Tracepoint::Field::QtSizeF: {
+ stream << "QStringLiteral(\"float QSizeF_" << arg.name << "_width;\\n\\\n \")";
+ stream << " + QStringLiteral(\"float QSizeF_" << arg.name << "_height;\\n\\\n \")";
+ eventSize += QStringLiteral("8");
+ } break;
case Tracepoint::Field::Unknown:
break;
case Tracepoint::Field::EnumeratedType: {
diff --git a/src/tools/tracegen/etw.cpp b/src/tools/tracegen/etw.cpp
index d24663751ba..511e01ec94d 100644
--- a/src/tools/tracegen/etw.cpp
+++ b/src/tools/tracegen/etw.cpp
@@ -45,12 +45,14 @@ static void writeEtwMacro(QTextStream &stream, const Tracepoint::Field &field)
stream << "TraceLoggingValue(" << name << ".toEncoded().constData(), \"" << name << "\")";
return;
case Tracepoint::Field::QtRect:
+ case Tracepoint::Field::QtRectF:
stream << "TraceLoggingValue(" << name << ".x(), \"x\"), "
<< "TraceLoggingValue(" << name << ".y(), \"y\"), "
<< "TraceLoggingValue(" << name << ".width(), \"width\"), "
<< "TraceLoggingValue(" << name << ".height(), \"height\")";
return;
case Tracepoint::Field::QtSize:
+ case Tracepoint::Field::QtSizeF:
stream << "TraceLoggingValue(" << name << ".width(), \"width\"), "
<< "TraceLoggingValue(" << name << ".height(), \"height\")";
return;
diff --git a/src/tools/tracegen/lttng.cpp b/src/tools/tracegen/lttng.cpp
index e1c70405ec7..60aca9fa70e 100644
--- a/src/tools/tracegen/lttng.cpp
+++ b/src/tools/tracegen/lttng.cpp
@@ -61,6 +61,16 @@ static void writeCtfMacro(QTextStream &stream, const Provider &provider, const T
<< "ctf_integer(int, width, " << name << ".width()) "
<< "ctf_integer(int, height, " << name << ".height()) ";
return;
+ case Tracepoint::Field::QtSizeF:
+ stream << "ctf_float(int, width, " << name << ".width()) "
+ << "ctf_float(int, height, " << name << ".height()) ";
+ return;
+ case Tracepoint::Field::QtRectF:
+ stream << "ctf_float(int, x, " << name << ".x()) "
+ << "ctf_float(int, y, " << name << ".y()) "
+ << "ctf_float(int, width, " << name << ".width()) "
+ << "ctf_float(int, height, " << name << ".height()) ";
+ return;
case Tracepoint::Field::QtSize:
stream << "ctf_integer(int, width, " << name << ".width()) "
<< "ctf_integer(int, height, " << name << ".height()) ";
diff --git a/src/tools/tracegen/provider.cpp b/src/tools/tracegen/provider.cpp
index 938f21eaede..3c6299102d4 100644
--- a/src/tools/tracegen/provider.cpp
+++ b/src/tools/tracegen/provider.cpp
@@ -140,7 +140,9 @@ static Tracepoint::Field::Type backendType(QString rawType)
TYPEDATA_ENTRY(QByteArray, Tracepoint::Field::QtByteArray),
TYPEDATA_ENTRY(QUrl, Tracepoint::Field::QtUrl),
TYPEDATA_ENTRY(QRect, Tracepoint::Field::QtRect),
- TYPEDATA_ENTRY(QSize, Tracepoint::Field::QtSize)
+ TYPEDATA_ENTRY(QSize, Tracepoint::Field::QtSize),
+ TYPEDATA_ENTRY(QRectF, Tracepoint::Field::QtRectF),
+ TYPEDATA_ENTRY(QSizeF, Tracepoint::Field::QtSizeF)
};
auto backendType = [](const QString &rawType) {
diff --git a/src/tools/tracegen/provider.h b/src/tools/tracegen/provider.h
index 9a3719ea632..29d83f2a400 100644
--- a/src/tools/tracegen/provider.h
+++ b/src/tools/tracegen/provider.h
@@ -33,6 +33,8 @@ struct Tracepoint
QtUrl,
QtRect,
QtSize,
+ QtRectF,
+ QtSizeF,
EnumeratedType,
FlagType,
Unknown