summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntti Määttä <[email protected]>2023-10-05 14:46:23 +0300
committerAntti Määttä <[email protected]>2023-10-30 18:59:21 +0300
commit33b714c64ab91b37aec4a9e9f7293843e72cc56d (patch)
tree5b7ec6d74e02a53fad0bdc34a07e865b36730dd5
parent0f2558470d4a4b7983e31748f3916a057fae1f50 (diff)
Fix CTF with Integrity
Do not use filesystem functions with Integrity. Change-Id: I992f560bead00df7d2783359fcb9f38326a0072b Reviewed-by: Antti Määttä <[email protected]>
-rw-r--r--src/plugins/tracing/qctflib.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/plugins/tracing/qctflib.cpp b/src/plugins/tracing/qctflib.cpp
index 6899ef88e38..dc8bd77bd43 100644
--- a/src/plugins/tracing/qctflib.cpp
+++ b/src/plugins/tracing/qctflib.cpp
@@ -14,7 +14,10 @@
#include <qendian.h>
#include <qplatformdefs.h>
#include "qctflib_p.h"
+
+#ifndef Q_OS_INTEGRITY
#include <filesystem>
+#endif
QT_BEGIN_NAMESPACE
@@ -118,6 +121,10 @@ QCtfLibImpl::QCtfLibImpl()
m_session.tracepoints.append(allLiteral());
m_session.name = defaultLiteral();
} else {
+#ifdef Q_OS_INTEGRITY
+ qCWarning(lcDebugTrace) << "Unable to use filesystem";
+ return;
+#endif
// Check if the location is writable
if (QT_ACCESS(qPrintable(location), W_OK) != 0) {
qCWarning(lcDebugTrace) << "Unable to write to location";
@@ -161,7 +168,9 @@ QCtfLibImpl::QCtfLibImpl()
m_session.name = defaultLiteral();
}
m_location = location + u"/ust";
+#ifndef Q_OS_INTEGRITY
std::filesystem::create_directory(qPrintable(m_location), qPrintable(location));
+#endif
}
clearLocation();
}
@@ -176,6 +185,7 @@ QCtfLibImpl::QCtfLibImpl()
void QCtfLibImpl::clearLocation()
{
+#ifndef Q_OS_INTEGRITY
const std::filesystem::path location{qUtf16Printable(m_location)};
for (auto const& dirEntry : std::filesystem::directory_iterator{location})
{
@@ -196,6 +206,7 @@ void QCtfLibImpl::clearLocation()
}
}
}
+#endif
}
void QCtfLibImpl::writeMetadata(const QString &metadata, bool overwrite)