diff options
author | Dan McCabe <zen3d.linux@gmail.com> | 2012-06-01 13:40:06 -0700 |
---|---|---|
committer | Jose Fonseca <jfonseca@vmware.com> | 2015-01-26 00:05:44 +0000 |
commit | b14bda21eb8335d4cf58130f6f6ccb1fb543b33d (patch) | |
tree | 12e20bab8523d13d7152d43d4acaf8da6576b3ad /gui/retracer.cpp | |
parent | c6f924e03f296a35256896eef66d320e486b7856 (diff) |
gui: Create a call set for thumbnails requested.
Retracer now knows what thumbnails are needed. This information needs
to be communicated to the glretrace command.
Construct a string that contains the call numbers for all missing thumbnails.
The constructed string is then passed to glretrace with the "-S" argument.
TODO: we want to be able to detect contiguous sequences of calls and emit
them as a range. However, I wasn't able to get this working correctly and
will defer this to a future patch.
Diffstat (limited to 'gui/retracer.cpp')
-rw-r--r-- | gui/retracer.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gui/retracer.cpp b/gui/retracer.cpp index bc6686be..4d117afb 100644 --- a/gui/retracer.cpp +++ b/gui/retracer.cpp @@ -275,6 +275,27 @@ void Retracer::resetThumbnailsToCapture() m_thumbnailsToCapture.clear(); } +QString Retracer::thumbnailCallSet() +{ + QString callSet; + + bool isFirst = true; + + foreach (qlonglong callIndex, m_thumbnailsToCapture) { + // TODO: detect contiguous ranges + if (!isFirst) { + callSet.append(QLatin1String(",")); + } else { + isFirst = false; + } + + //emit "callIndex" + callSet.append(QString::number(callIndex)); + } + + //qDebug() << QLatin1String("debug: call set to capture: ") << callSet; + return callSet; +} /** * Starting point for the retracing thread. @@ -328,6 +349,10 @@ void Retracer::run() arguments << QLatin1String("-D"); arguments << QString::number(m_captureCall); } else if (m_captureThumbnails) { + if (!m_thumbnailsToCapture.isEmpty()) { + arguments << QLatin1String("-S"); + arguments << thumbnailCallSet(); + } arguments << QLatin1String("-s"); // emit snapshots arguments << QLatin1String("-"); // emit to stdout } else if (isProfiling()) { |