summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorsimon <none@none>2013-04-03 16:26:11 -0700
committersimon <none@none>2013-04-03 16:26:11 -0700
commit15e2f76615581341a861ed0e37da96170e2aee61 (patch)
treeaf93ffdea60f28cf9fb8848fe777d3c3fb92eb9c /indra
parentbdf8cacc4cd216d7df8212177587a21979d2a883 (diff)
MAINT-2558 - Add viewer debug setting for more logging on avatar render info.
Reviewed by Kelly
Diffstat (limited to 'indra')
-rwxr-xr-xindra/newview/app_settings/settings.xml11
-rw-r--r--indra/newview/llavatarrenderinfoaccountant.cpp77
-rw-r--r--indra/newview/llavatarrenderinfoaccountant.h2
3 files changed, 57 insertions, 33 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 384e83a2a0..4c6940500e 100755
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -9400,6 +9400,17 @@
<key>Value</key>
<integer>0</integer>
</map>
+ <key>RenderAutoMuteLogging</key>
+ <map>
+ <key>Comment</key>
+ <string>Show extra information in viewer logs about avatar rendering costs</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
<key>RenderAutoMuteVisibilityRank</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp
index 04a79f7d4c..54144677f4 100644
--- a/indra/newview/llavatarrenderinfoaccountant.cpp
+++ b/indra/newview/llavatarrenderinfoaccountant.cpp
@@ -37,15 +37,13 @@
#include "llcharacter.h"
#include "llhttpclient.h"
#include "lltimer.h"
+#include "llviewercontrol.h"
#include "llviewerobjectlist.h"
#include "llviewerregion.h"
#include "llvoavatar.h"
#include "llworld.h"
-// Use this for debugging
-//#define LL_AVATAR_RENDER_INFO_LOG_SPAM
-
static const std::string KEY_AGENTS = "agents"; // map
static const std::string KEY_WEIGHT = "weight"; // integer
static const std::string KEY_GEOMETRY = "geometry"; // integer
@@ -94,9 +92,10 @@ public:
LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle);
if (regionp)
{
- #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM
- llinfos << "Result for avatar weights request for region " << regionp->getName() << ":" << llendl;
- #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM
+ if (LLAvatarRenderInfoAccountant::logRenderInfo())
+ {
+ llinfos << "Result for avatar weights request for region " << regionp->getName() << ":" << llendl;
+ }
if (content.isMap())
{
@@ -116,10 +115,11 @@ public:
agent_info_map.isMap())
{ // Extract the data for this avatar
- #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM
- llinfos << " Agent " << target_agent_id
- << ": " << agent_info_map << llendl;
- #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM
+ if (LLAvatarRenderInfoAccountant::logRenderInfo())
+ {
+ llinfos << " Agent " << target_agent_id
+ << ": " << agent_info_map << llendl;
+ }
if (agent_info_map.has(KEY_WEIGHT))
{
@@ -194,10 +194,11 @@ public:
LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle);
if (regionp)
{
- #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM
- llinfos << "Result for avatar weights POST for region " << regionp->getName()
- << ": " << content << llendl;
- #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM
+ if (LLAvatarRenderInfoAccountant::logRenderInfo())
+ {
+ llinfos << "Result for avatar weights POST for region " << regionp->getName()
+ << ": " << content << llendl;
+ }
if (content.isMap())
{
@@ -231,12 +232,13 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio
std::string url = regionp->getCapability("AvatarRenderInfo");
if (!url.empty())
{
- #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM
- llinfos << "Sending avatar render info to region "
- << regionp->getName()
- << " from " << url
- << llendl;
- #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM
+ if (logRenderInfo())
+ {
+ llinfos << "Sending avatar render info to region "
+ << regionp->getName()
+ << " from " << url
+ << llendl;
+ }
// Build the render info to POST to the region
LLSD report = LLSD::emptyMap();
@@ -271,10 +273,11 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio
agents[avatar->getID().asString()] = info;
}
- #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM
- llinfos << "Sending avatar render info for " << avatar->getID()
- << ": " << info << llendl;
- #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM
+ if (logRenderInfo())
+ {
+ llinfos << "Sending avatar render info for " << avatar->getID()
+ << ": " << info << llendl;
+ }
}
iter++;
}
@@ -297,12 +300,13 @@ void LLAvatarRenderInfoAccountant::getRenderInfoFromRegion(LLViewerRegion * regi
std::string url = regionp->getCapability("AvatarRenderInfo");
if (!url.empty())
{
- #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM
- llinfos << "Requesting avatar render info for region "
- << regionp->getName()
- << " from " << url
- << llendl;
- #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM
+ if (logRenderInfo())
+ {
+ llinfos << "Requesting avatar render info for region "
+ << regionp->getName()
+ << " from " << url
+ << llendl;
+ }
// First send a request to get the latest data
LLHTTPClient::get(url, new LLAvatarRenderInfoGetResponder(regionp->getHandle()));
@@ -351,10 +355,17 @@ void LLAvatarRenderInfoAccountant::idle()
// are returned for a new LLViewerRegion, and is the earliest time to get render info
void LLAvatarRenderInfoAccountant::expireRenderInfoReportTimer()
{
- #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM
- llinfos << "Viewer has new region capabilities" << llendl;
- #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM
+ if (logRenderInfo())
+ {
+ llinfos << "Viewer has new region capabilities" << llendl;
+ }
sRenderInfoReportTimer.resetWithExpiry(0.f);
}
+// static
+bool LLAvatarRenderInfoAccountant::logRenderInfo()
+{
+ static LLCachedControl<bool> render_mute_logging_enabled(gSavedSettings, "RenderAutoMuteLogging");
+ return render_mute_logging_enabled;
+}
diff --git a/indra/newview/llavatarrenderinfoaccountant.h b/indra/newview/llavatarrenderinfoaccountant.h
index 5b4a4d3db2..97dd9f0ad3 100644
--- a/indra/newview/llavatarrenderinfoaccountant.h
+++ b/indra/newview/llavatarrenderinfoaccountant.h
@@ -46,6 +46,8 @@ public:
static void idle();
+ static bool logRenderInfo();
+
private:
// Send data updates about once per minute, only need per-frame resolution
static LLFrameTimer sRenderInfoReportTimer;