mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 19:55:07 +02:00
Add thread names to traces
This commit is contained in:
parent
a5e61184bf
commit
f2638637f7
3 changed files with 7 additions and 0 deletions
|
@ -436,6 +436,7 @@ bool setupEssentials(int& argc, char** argv) {
|
|||
}
|
||||
|
||||
DependencyManager::set<tracing::Tracer>();
|
||||
PROFILE_SET_THREAD_NAME("Main Thread");
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
// Select appropriate audio DLL
|
||||
|
|
|
@ -118,6 +118,8 @@ public:
|
|||
|
||||
|
||||
virtual void run() override {
|
||||
PROFILE_SET_THREAD_NAME("Present Thread");
|
||||
|
||||
// FIXME determine the best priority balance between this and the main thread...
|
||||
// It may be dependent on the display plugin being used, since VR plugins should
|
||||
// have higher priority on rendering (although we could say that the Oculus plugin
|
||||
|
|
|
@ -863,6 +863,10 @@ QScriptValue ScriptEngine::evaluate(const QString& sourceCode, const QString& fi
|
|||
}
|
||||
|
||||
void ScriptEngine::run() {
|
||||
auto filenameParts = _fileNameString.split("/");
|
||||
auto name = filenameParts.size() > 0 ? filenameParts[filenameParts.size() - 1] : "unknown";
|
||||
PROFILE_SET_THREAD_NAME("Script: " + name);
|
||||
|
||||
if (DependencyManager::get<ScriptEngines>()->isStopped()) {
|
||||
return; // bail early - avoid setting state in init(), as evaluate() will bail too
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue