History

Merge pull request #9225 from jherico/chrome_tracing

Additional work on tracing

Brad Davis committed 9 years ago

Commit ee3c8e62 parents 59f6c88 2d7358838 files · +188 −125Browse files

Showing the changes to interface/src/Application.cpp (1 of 38 files). Show all

Unified · Split

interface/src/Application.cpp+32−31
@@ -179,6 +179,8 @@ extern "C" { · 178 unmodified lines
179179 }
180180 #endif
181181
182+Q_LOGGING_CATEGORY(trace_app_input_mouse, "trace.app.input.mouse")
183+
182184 using namespace std;
183185
184186 static QTimer locationUpdateTimer;
@@ -1960,16 +1962,6 @@ void Application::initializeUi() { · 1775 unmodified lines
19601962 }
19611963
19621964 void Application::paintGL() {
1963− PROFILE_COUNTER(interfaceapp, "fps", { { "fps", _frameCounter.rate() } });
1964− PROFILE_COUNTER(interfaceapp, "downloads", {
1965− { "current", ResourceCache::getLoadingRequests().length() },
1966− { "pending", ResourceCache::getPendingRequestCount() }
1967− });
1968− PROFILE_COUNTER(interfaceapp, "processing", {
1969− { "current", DependencyManager::get<StatTracker>()->getStat("Processing") },
1970− { "pending", DependencyManager::get<StatTracker>()->getStat("PendingProcessing") }
1971− });
1972−
19731965 // Some plugins process message events, allowing paintGL to be called reentrantly.
19741966 if (_inPaint || _aboutToQuit) {
19751967 return;
@@ -1981,7 +1973,7 @@ void Application::paintGL() { · 5 unmodified lines
19811973 _frameCount++;
19821974
19831975 auto lastPaintBegin = usecTimestampNow();
1984− PROFILE_RANGE_EX(interfaceapp, __FUNCTION__, 0xff0000ff, (uint64_t)_frameCount);
1976+ PROFILE_RANGE_EX(render, __FUNCTION__, 0xff0000ff, (uint64_t)_frameCount);
19851977 PerformanceTimer perfTimer("paintGL");
19861978
19871979 if (nullptr == _displayPlugin) {
@@ -2158,7 +2150,7 @@ void Application::paintGL() { · 170 unmodified lines
21582150 auto finalFramebuffer = framebufferCache->getFramebuffer();
21592151
21602152 {
2161− PROFILE_RANGE(interfaceapp, "/mainRender");
2153+ PROFILE_RANGE(render, "/mainRender");
21622154 PerformanceTimer perfTimer("mainRender");
21632155 renderArgs._boomOffset = boomOffset;
21642156 // Viewport is assigned to the size of the framebuffer
@@ -2213,7 +2205,7 @@ void Application::paintGL() { · 48 unmodified lines
22132205 frame->overlay = _applicationOverlay.getOverlayTexture();
22142206 // deliver final scene rendering commands to the display plugin
22152207 {
2216− PROFILE_RANGE(interfaceapp, "/pluginOutput");
2208+ PROFILE_RANGE(render, "/pluginOutput");
22172209 PerformanceTimer perfTimer("pluginOutput");
22182210 _frameCounter.increment();
22192211 displayPlugin->submitFrame(frame);
@@ -2301,7 +2293,7 @@ void Application::resizeEvent(QResizeEvent* event) { · 81 unmodified lines
23012293 }
23022294
23032295 void Application::resizeGL() {
2304− PROFILE_RANGE(interfaceapp, __FUNCTION__);
2296+ PROFILE_RANGE(render, __FUNCTION__);
23052297 if (nullptr == _displayPlugin) {
23062298 return;
23072299 }
@@ -2946,7 +2938,7 @@ void Application::maybeToggleMenuVisible(QMouseEvent* event) const { · 638 unmodified lines
29462938 }
29472939
29482940 void Application::mouseMoveEvent(QMouseEvent* event) {
2949− PROFILE_RANGE(interfaceapp, __FUNCTION__);
2941+ PROFILE_RANGE(app_input_mouse, __FUNCTION__);
29502942
29512943 if (_aboutToQuit) {
29522944 return;
@@ -3240,7 +3232,6 @@ bool Application::shouldPaint(float nsecsElapsed) { · 287 unmodified lines
32403232 }
32413233
32423234 void Application::idle(float nsecsElapsed) {
3243− PROFILE_RANGE(interfaceapp, __FUNCTION__);
32443235 PerformanceTimer perfTimer("idle");
32453236
32463237 // Update the deadlock watchdog
@@ -3256,6 +3247,18 @@ void Application::idle(float nsecsElapsed) { · 9 unmodified lines
32563247 connect(offscreenUi.data(), &OffscreenUi::showDesktop, this, &Application::showDesktop);
32573248 }
32583249
3250+ PROFILE_COUNTER(app, "fps", { { "fps", _frameCounter.rate() } });
3251+ PROFILE_COUNTER(app, "downloads", {
3252+ { "current", ResourceCache::getLoadingRequests().length() },
3253+ { "pending", ResourceCache::getPendingRequestCount() }
3254+ });
3255+ PROFILE_COUNTER(app, "processing", {
3256+ { "current", DependencyManager::get<StatTracker>()->getStat("Processing") },
3257+ { "pending", DependencyManager::get<StatTracker>()->getStat("PendingProcessing") }
3258+ });
3259+
3260+ PROFILE_RANGE(app, __FUNCTION__);
3261+
32593262 if (auto steamClient = PluginManager::getInstance()->getSteamClientPlugin()) {
32603263 steamClient->runCallbacks();
32613264 }
@@ -3973,7 +3976,7 @@ static bool domainLoadingInProgress = false; · 711 unmodified lines
39733976
39743977 void Application::update(float deltaTime) {
39753978
3976− PROFILE_RANGE_EX(interfaceapp, __FUNCTION__, 0xffff0000, (uint64_t)_frameCount + 1);
3979+ PROFILE_RANGE_EX(app, __FUNCTION__, 0xffff0000, (uint64_t)_frameCount + 1);
39773980
39783981 bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);
39793982 PerformanceWarning warn(showWarnings, "Application::update()");
@@ -3982,7 +3985,7 @@ void Application::update(float deltaTime) { · 2 unmodified lines
39823985
39833986 if (!_physicsEnabled) {
39843987 if (!domainLoadingInProgress) {
3985− PROFILE_ASYNC_BEGIN(interfaceapp, "Scene Loading", "");
3988+ PROFILE_ASYNC_BEGIN(app, "Scene Loading", "");
39863989 domainLoadingInProgress = true;
39873990 }
39883991
@@ -4017,7 +4020,7 @@ void Application::update(float deltaTime) { · 28 unmodified lines
40174020 }
40184021 } else if (domainLoadingInProgress) {
40194022 domainLoadingInProgress = false;
4020− PROFILE_ASYNC_END(interfaceapp, "Scene Loading", "");
4023+ PROFILE_ASYNC_END(app, "Scene Loading", "");
40214024 }
40224025
40234026 {
@@ -4111,12 +4114,12 @@ void Application::update(float deltaTime) { · 87 unmodified lines
41114114 QSharedPointer<AvatarManager> avatarManager = DependencyManager::get<AvatarManager>();
41124115
41134116 if (_physicsEnabled) {
4114− PROFILE_RANGE_EX(interfaceapp, "Physics", 0xffff0000, (uint64_t)getActiveDisplayPlugin()->presentCount());
4117+ PROFILE_RANGE_EX(simulation_physics, "Physics", 0xffff0000, (uint64_t)getActiveDisplayPlugin()->presentCount());
41154118
41164119 PerformanceTimer perfTimer("physics");
41174120
41184121 {
4119− PROFILE_RANGE_EX(interfaceapp, "UpdateStats", 0xffffff00, (uint64_t)getActiveDisplayPlugin()->presentCount());
4122+ PROFILE_RANGE_EX(simulation_physics, "UpdateStats", 0xffffff00, (uint64_t)getActiveDisplayPlugin()->presentCount());
41204123
41214124 PerformanceTimer perfTimer("updateStates)");
41224125 static VectorOfMotionStates motionStates;
@@ -4150,14 +4153,14 @@ void Application::update(float deltaTime) { · 27 unmodified lines
41504153 });
41514154 }
41524155 {
4153− PROFILE_RANGE_EX(interfaceapp, "StepSimulation", 0xffff8000, (uint64_t)getActiveDisplayPlugin()->presentCount());
4156+ PROFILE_RANGE_EX(simulation_physics, "StepSimulation", 0xffff8000, (uint64_t)getActiveDisplayPlugin()->presentCount());
41544157 PerformanceTimer perfTimer("stepSimulation");
41554158 getEntities()->getTree()->withWriteLock([&] {
41564159 _physicsEngine->stepSimulation();
41574160 });
41584161 }
41594162 {
4160− PROFILE_RANGE_EX(interfaceapp, "HarvestChanges", 0xffffff00, (uint64_t)getActiveDisplayPlugin()->presentCount());
4163+ PROFILE_RANGE_EX(simulation_physics, "HarvestChanges", 0xffffff00, (uint64_t)getActiveDisplayPlugin()->presentCount());
41614164 PerformanceTimer perfTimer("harvestChanges");
41624165 if (_physicsEngine->hasOutgoingChanges()) {
41634166 getEntities()->getTree()->withWriteLock([&] {
@@ -4199,20 +4202,20 @@ void Application::update(float deltaTime) { · 35 unmodified lines
41994202 _avatarSimCounter.increment();
42004203
42014204 {
4202− PROFILE_RANGE_EX(interfaceapp, "OtherAvatars", 0xffff00ff, (uint64_t)getActiveDisplayPlugin()->presentCount());
4205+ PROFILE_RANGE_EX(simulation, "OtherAvatars", 0xffff00ff, (uint64_t)getActiveDisplayPlugin()->presentCount());
42034206 avatarManager->updateOtherAvatars(deltaTime);
42044207 }
42054208
42064209 qApp->updateMyAvatarLookAtPosition();
42074210
42084211 {
4209− PROFILE_RANGE_EX(interfaceapp, "MyAvatar", 0xffff00ff, (uint64_t)getActiveDisplayPlugin()->presentCount());
4212+ PROFILE_RANGE_EX(simulation, "MyAvatar", 0xffff00ff, (uint64_t)getActiveDisplayPlugin()->presentCount());
42104213 avatarManager->updateMyAvatar(deltaTime);
42114214 }
42124215 }
42134216
42144217 {
4215− PROFILE_RANGE_EX(interfaceapp, "Overlays", 0xffff0000, (uint64_t)getActiveDisplayPlugin()->presentCount());
4218+ PROFILE_RANGE_EX(app, "Overlays", 0xffff0000, (uint64_t)getActiveDisplayPlugin()->presentCount());
42164219 PerformanceTimer perfTimer("overlays");
42174220 _overlays.update(deltaTime);
42184221 }
@@ -4232,7 +4235,7 @@ void Application::update(float deltaTime) { · 13 unmodified lines
42324235
42334236 // Update my voxel servers with my current voxel query...
42344237 {
4235− PROFILE_RANGE_EX(interfaceapp, "QueryOctree", 0xffff0000, (uint64_t)getActiveDisplayPlugin()->presentCount());
4238+ PROFILE_RANGE_EX(app, "QueryOctree", 0xffff0000, (uint64_t)getActiveDisplayPlugin()->presentCount());
42364239 QMutexLocker viewLocker(&_viewMutex);
42374240 PerformanceTimer perfTimer("queryOctree");
42384241 quint64 sinceLastQuery = now - _lastQueriedTime;
@@ -4272,7 +4275,7 @@ void Application::update(float deltaTime) { · 33 unmodified lines
42724275 avatarManager->postUpdate(deltaTime);
42734276
42744277 {
4275− PROFILE_RANGE_EX(interfaceapp, "PreRenderLambdas", 0xffff0000, (uint64_t)0);
4278+ PROFILE_RANGE_EX(app, "PreRenderLambdas", 0xffff0000, (uint64_t)0);
42764279
42774280 std::unique_lock<std::mutex> guard(_postUpdateLambdasLock);
42784281 for (auto& iter : _postUpdateLambdas) {
@@ -4549,8 +4552,6 @@ QRect Application::getDesirableApplicationGeometry() const { · 270 unmodified lines
45494552 // or the "myCamera".
45504553 //
45514554 void Application::loadViewFrustum(Camera& camera, ViewFrustum& viewFrustum) {
4552− PROFILE_RANGE(interfaceapp, __FUNCTION__);
4553− PerformanceTimer perfTimer("loadViewFrustum");
45544555 // We will use these below, from either the camera or head vectors calculated above
45554556 viewFrustum.setProjection(camera.getProjection());
45564557
@@ -4726,7 +4727,7 @@ void Application::displaySide(RenderArgs* renderArgs, Camera& theCamera, bool se · 169 unmodified lines
47264727 myAvatar->preDisplaySide(renderArgs);
47274728
47284729 activeRenderingThread = QThread::currentThread();
4729− PROFILE_RANGE(interfaceapp, __FUNCTION__);
4730+ PROFILE_RANGE(render, __FUNCTION__);
47304731 PerformanceTimer perfTimer("display");
47314732 PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), "Application::displaySide()");
47324733

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t