[PATCH] qapitrace: Add option to replay in singlethreaded mode * Some traces fail to replay (hang) if glretrace does not have --singlethread on the command line, this change makes a UI option available
Peter Lohrmann
peterl at valvesoftware.com
Wed Jul 10 12:14:16 PDT 2013
Subject: [PATCH] qapitrace: Add option to replay in singlethreaded mode * Some
traces fail to replay (hang) if glretrace does not have --singelthread on the
command line, this change makes a UI option available
---
gui/mainwindow.cpp | 6 ++++++
gui/retracer.cpp | 15 +++++++++++++++
gui/retracer.h | 4 ++++
gui/ui/retracerdialog.ui | 45 ++++++++++++++++++++++++++++++++++++++++++++-
4 files changed, 69 insertions(+), 1 deletion(-)
diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp
index cd4e5fd..607cfb8 100644
--- a/gui/mainwindow.cpp
+++ b/gui/mainwindow.cpp
@@ -188,6 +188,9 @@ void MainWindow::replayStart()
dlgUi.errorCheckCB->setChecked(
!m_retracer->isBenchmarking());
+ dlgUi.singlethreadCB->setChecked(
+ m_retracer->isSinglethread());
+
if (dlg.exec() == QDialog::Accepted) {
m_retracer->setDoubleBuffered(
dlgUi.doubleBufferingCB->isChecked());
@@ -195,6 +198,9 @@ void MainWindow::replayStart()
m_retracer->setBenchmarking(
!dlgUi.errorCheckCB->isChecked());
+ m_retracer->setSinglethread(
+ dlgUi.singlethreadCB->isChecked());
+
m_retracer->setProfiling(false, false, false);
replayTrace(false, false);
diff --git a/gui/retracer.cpp b/gui/retracer.cpp
index 49c6182..48613f2 100644
--- a/gui/retracer.cpp
+++ b/gui/retracer.cpp
@@ -130,6 +130,7 @@ Retracer::Retracer(QObject *parent)
: QThread(parent),
m_benchmarking(false),
m_doubleBuffered(true),
+ m_singlethread(false),
m_captureState(false),
m_captureCall(0),
m_profileGpu(false),
@@ -174,6 +175,16 @@ void Retracer::setDoubleBuffered(bool db)
m_doubleBuffered = db;
}
+bool Retracer::isSinglethread() const
+{
+ return m_singlethread;
+}
+
+void Retracer::setSinglethread(bool singlethread)
+{
+ m_singlethread = singlethread;
+}
+
bool Retracer::isProfilingGpu() const
{
return m_profileGpu;
@@ -305,6 +316,10 @@ void Retracer::run()
return;
}
+ if (m_singlethread) {
+ arguments << QLatin1String("--singlethread");
+ }
+
if (m_captureState) {
arguments << QLatin1String("-D");
arguments << QString::number(m_captureCall);
diff --git a/gui/retracer.h b/gui/retracer.h
index 038a7d6..d363021 100644
--- a/gui/retracer.h
+++ b/gui/retracer.h
@@ -29,6 +29,9 @@ public:
bool isDoubleBuffered() const;
void setDoubleBuffered(bool db);
+ bool isSinglethread() const;
+ void setSinglethread(bool singlethread);
+
bool isProfilingGpu() const;
bool isProfilingCpu() const;
bool isProfilingPixels() const;
@@ -65,6 +68,7 @@ private:
trace::API m_api;
bool m_benchmarking;
bool m_doubleBuffered;
+ bool m_singlethread;
bool m_captureState;
bool m_captureThumbnails;
qlonglong m_captureCall;
diff --git a/gui/ui/retracerdialog.ui b/gui/ui/retracerdialog.ui
index 8df9960..33ae85d 100644
--- a/gui/ui/retracerdialog.ui
+++ b/gui/ui/retracerdialog.ui
@@ -10,7 +10,7 @@
<x>0</x>
<y>0</y>
<width>286</width>
- <height>94</height>
+ <height>125</height>
</rect>
</property>
<property name="windowTitle">
@@ -101,6 +101,49 @@
</layout>
</item>
<item>
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <item>
+ <spacer name="horizontalSpacer_5">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="singlethreadCB">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Singlethread</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_6">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
--
1.8.1.msysgit.1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/apitrace/attachments/20130710/f589c70f/attachment.html>
More information about the apitrace
mailing list