summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llappviewer.cpp5
-rw-r--r--indra/newview/llscenemonitor.cpp143
-rw-r--r--indra/newview/llscenemonitor.h9
-rw-r--r--indra/newview/lltextureview.cpp12
-rw-r--r--indra/newview/llviewerassetstats.cpp2
-rw-r--r--indra/newview/llviewerstats.cpp10
-rw-r--r--indra/newview/llviewerstats.h4
-rw-r--r--indra/newview/llviewertexture.cpp8
-rw-r--r--indra/newview/llviewertexture.h8
-rwxr-xr-xindra/newview/llviewerwindow.cpp2
10 files changed, 81 insertions, 122 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index ff481d6278..451ea76a02 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -1578,10 +1578,7 @@ bool LLAppViewer::cleanup()
LLEventPumps::instance().reset();
//dump scene loading monitor results
- if(LLSceneMonitor::instance().hasResults())
- {
- LLSceneMonitor::instance().dumpToFile(gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "scene_monitor_results.csv"));
- }
+ LLSceneMonitor::instance().dumpToFile(gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "scene_monitor_results.csv"));
if (LLFastTimerView::sAnalyzePerformance)
{
diff --git a/indra/newview/llscenemonitor.cpp b/indra/newview/llscenemonitor.cpp
index a28c2eac20..dccf8a2a17 100644
--- a/indra/newview/llscenemonitor.cpp
+++ b/indra/newview/llscenemonitor.cpp
@@ -67,22 +67,13 @@ LLSceneMonitor::LLSceneMonitor() :
{
mFrames[0] = NULL;
mFrames[1] = NULL;
-
- mRecording = new LLTrace::ExtendablePeriodicRecording();
}
LLSceneMonitor::~LLSceneMonitor()
{
mDiffState = VIEWER_QUITTING;
- destroyClass();
-}
-
-void LLSceneMonitor::destroyClass()
-{
reset();
- delete mRecording;
- mRecording = NULL;
mDitheringTexture = NULL;
}
@@ -96,7 +87,8 @@ void LLSceneMonitor::reset()
mFrames[1] = NULL;
mDiff = NULL;
- mRecording->reset();
+ mMonitorRecording.reset();
+ mSceneLoadRecording.reset();
unfreezeScene();
@@ -248,7 +240,7 @@ void LLSceneMonitor::unfreezeScene()
if(mDiffState == VIEWER_QUITTING)
{
- return; //we are quitting viewer.
+ return;
}
// thaw everything else
@@ -269,10 +261,9 @@ void LLSceneMonitor::capture()
static LLCachedControl<F32> scene_load_sample_time(gSavedSettings, "SceneLoadingMonitorSampleTime");
static LLFrameTimer timer;
- LLTrace::Recording& last_frame_recording = LLTrace::get_frame_recording().getLastRecording();
if (mEnabled
- && (last_frame_recording.getSum(*LLViewerCamera::getVelocityStat()) > 0.001f
- || last_frame_recording.getSum(*LLViewerCamera::getAngularVelocityStat()) > 0.01f))
+ && (mMonitorRecording.getSum(*LLViewerCamera::getVelocityStat()) > 0.1f
+ || mMonitorRecording.getSum(*LLViewerCamera::getAngularVelocityStat()) > 0.05f))
{
reset();
freezeScene();
@@ -299,7 +290,8 @@ void LLSceneMonitor::capture()
&& LLGLSLShader::sNoFixedFunction
&& last_capture_time != gFrameCount)
{
- mRecording->resume();
+ mSceneLoadRecording.resume();
+ mMonitorRecording.resume();
timer.reset();
@@ -486,13 +478,13 @@ void LLSceneMonitor::fetchQueryResult()
static LLCachedControl<F32> diff_threshold(gSavedSettings,"SceneLoadingPixelDiffThreshold");
if(mDiffResult > diff_threshold())
{
- mRecording->extend();
- llassert(mRecording->getAcceptedRecording().getLastRecording().getSum(LLStatViewer::FPS));
+ mSceneLoadRecording.extend();
+ llassert(mSceneLoadRecording.getAcceptedRecording().getLastRecording().getSum(LLStatViewer::FPS));
}
else
{
- mRecording->getPotentialRecording().nextPeriod();
- llassert(mRecording->getPotentialRecording().getLastRecording().getSum(LLStatViewer::FPS));
+ mSceneLoadRecording.getPotentialRecording().nextPeriod();
+ llassert(mSceneLoadRecording.getPotentialRecording().getLastRecording().getSum(LLStatViewer::FPS));
}
}
}
@@ -500,15 +492,18 @@ void LLSceneMonitor::fetchQueryResult()
//dump results to a file _scene_xmonitor_results.csv
void LLSceneMonitor::dumpToFile(std::string file_name)
-{
+{ using namespace LLTrace;
+
+ if (!hasResults()) return;
+
LL_INFOS("SceneMonitor") << "Saving scene load stats to " << file_name << LL_ENDL;
std::ofstream os(file_name.c_str());
- os << std::setprecision(4);
+ os << std::setprecision(3);
- LLTrace::PeriodicRecording& scene_load_recording = mRecording->getAcceptedRecording();
- U32 frame_count = scene_load_recording.getNumPeriods();
+ PeriodicRecording& scene_load_recording = mSceneLoadRecording.getAcceptedRecording();
+ const U32 frame_count = scene_load_recording.getNumPeriods();
LLUnit<LLUnits::Seconds, F64> frame_time;
@@ -520,42 +515,26 @@ void LLSceneMonitor::dumpToFile(std::string file_name)
}
os << std::endl;
- for (LLTrace::CountStatHandle<F64>::instance_iter it = LLTrace::CountStatHandle<F64>::beginInstances(), end_it = LLTrace::CountStatHandle<F64>::endInstances();
+ typedef TraceType<CountAccumulator> trace_count;
+ for (trace_count::instance_iter it = trace_count::beginInstances(), end_it = trace_count::endInstances();
it != end_it;
++it)
{
std::ostringstream row;
row << it->getName();
- S32 samples = 0;
-
- for (S32 i = frame_count - 1; i >= 0; --i)
- {
- samples += scene_load_recording.getPrevRecording(i).getSampleCount(*it);
- row << ", " << scene_load_recording.getPrevRecording(i).getSum(*it);
- }
-
- row << std::endl;
-
- if (samples > 0)
+ const char* unit_label = it->getUnitLabel();
+ if(unit_label[0])
{
- os << row.str();
+ row << "(" << unit_label << ")";
}
- }
-
- for (LLTrace::CountStatHandle<S64>::instance_iter it = LLTrace::CountStatHandle<S64>::beginInstances(), end_it = LLTrace::CountStatHandle<S64>::endInstances();
- it != end_it;
- ++it)
- {
- std::ostringstream row;
- row << it->getName();
S32 samples = 0;
- for (S32 i = frame_count - 1; i >= 0; --i)
+ for (S32 frame = 0; frame < frame_count; frame++)
{
- samples += scene_load_recording.getPrevRecording(i).getSampleCount(*it);
- row << ", " << scene_load_recording.getPrevRecording(i).getSum(*it);
+ samples += scene_load_recording.getPrevRecording(frame_count - frame).getSampleCount(*it);
+ row << ", " << scene_load_recording.getPrevRecording(frame_count - frame).getSum(*it);
}
row << std::endl;
@@ -566,42 +545,27 @@ void LLSceneMonitor::dumpToFile(std::string file_name)
}
}
- for (LLTrace::EventStatHandle<F64>::instance_iter it = LLTrace::EventStatHandle<F64>::beginInstances(), end_it = LLTrace::EventStatHandle<F64>::endInstances();
+ typedef TraceType<EventAccumulator> trace_event;
+
+ for (trace_event::instance_iter it = trace_event::beginInstances(), end_it = trace_event::endInstances();
it != end_it;
++it)
{
std::ostringstream row;
row << it->getName();
- S32 samples = 0;
-
- for (S32 i = frame_count - 1; i >= 0; --i)
- {
- samples += scene_load_recording.getPrevRecording(i).getSampleCount(*it);
- row << ", " << scene_load_recording.getPrevRecording(i).getMean(*it);
- }
-
- row << std::endl;
-
- if (samples > 0)
+ const char* unit_label = it->getUnitLabel();
+ if(unit_label[0])
{
- os << row.str();
+ row << "(" << unit_label << ")";
}
- }
-
- for (LLTrace::EventStatHandle<S64>::instance_iter it = LLTrace::EventStatHandle<S64>::beginInstances(), end_it = LLTrace::EventStatHandle<S64>::endInstances();
- it != end_it;
- ++it)
- {
- std::ostringstream row;
- row << it->getName();
S32 samples = 0;
- for (S32 i = frame_count - 1; i >= 0; --i)
+ for (S32 frame = 0; frame < frame_count; frame++)
{
- samples += scene_load_recording.getPrevRecording(i).getSampleCount(*it);
- row << ", " << scene_load_recording.getPrevRecording(i).getMean(*it);
+ samples += scene_load_recording.getPrevRecording(frame_count - frame).getSampleCount(*it);
+ row << ", " << scene_load_recording.getPrevRecording(frame_count - frame).getMean(*it);
}
row << std::endl;
@@ -612,19 +576,27 @@ void LLSceneMonitor::dumpToFile(std::string file_name)
}
}
- for (LLTrace::SampleStatHandle<F64>::instance_iter it = LLTrace::SampleStatHandle<F64>::beginInstances(), end_it = LLTrace::SampleStatHandle<F64>::endInstances();
+ typedef TraceType<SampleAccumulator> trace_sample;
+
+ for (trace_sample::instance_iter it = trace_sample::beginInstances(), end_it = trace_sample::endInstances();
it != end_it;
++it)
{
std::ostringstream row;
row << it->getName();
+ const char* unit_label = it->getUnitLabel();
+ if(unit_label[0])
+ {
+ row << "(" << unit_label << ")";
+ }
+
S32 samples = 0;
- for (S32 i = frame_count - 1; i >= 0; --i)
+ for (S32 frame = 0; frame < frame_count; frame++)
{
- samples += scene_load_recording.getPrevRecording(i).getSampleCount(*it);
- row << ", " << scene_load_recording.getPrevRecording(i).getMean(*it);
+ samples += scene_load_recording.getPrevRecording(frame_count - frame).getSampleCount(*it);
+ row << ", " << scene_load_recording.getPrevRecording(frame_count - frame).getMean(*it);
}
row << std::endl;
@@ -635,32 +607,23 @@ void LLSceneMonitor::dumpToFile(std::string file_name)
}
}
- for (LLTrace::SampleStatHandle<S64>::instance_iter it = LLTrace::SampleStatHandle<S64>::beginInstances(), end_it = LLTrace::SampleStatHandle<S64>::endInstances();
+ typedef TraceType<MemStatAccumulator> trace_mem;
+ for (trace_mem::instance_iter it = trace_mem::beginInstances(), end_it = trace_mem::endInstances();
it != end_it;
++it)
{
- std::ostringstream row;
- row << it->getName();
-
- S32 samples = 0;
+ os << it->getName() << "(KiB)";
- for (S32 i = frame_count - 1; i >= 0; --i)
+ for (S32 frame = 0; frame < frame_count; frame++)
{
- samples += scene_load_recording.getPrevRecording(i).getSampleCount(*it);
- row << ", " << scene_load_recording.getPrevRecording(i).getMean(*it);
+ os << ", " << scene_load_recording.getPrevRecording(frame_count - frame).getMax(*it).as<LLUnits::Kibibytes>().value();
}
- row << std::endl;
-
- if (samples > 0)
- {
- os << row.str();
- }
+ os << std::endl;
}
os.flush();
os.close();
-
}
//-------------------------------------------------------------------------------------------------------------
diff --git a/indra/newview/llscenemonitor.h b/indra/newview/llscenemonitor.h
index 3351ed0579..6af58b707a 100644
--- a/indra/newview/llscenemonitor.h
+++ b/indra/newview/llscenemonitor.h
@@ -44,8 +44,6 @@ public:
LLSceneMonitor();
~LLSceneMonitor();
- void destroyClass();
-
void freezeAvatar(LLCharacter* avatarp);
void setDebugViewerVisible(bool visible);
@@ -62,9 +60,9 @@ public:
bool isEnabled()const {return mEnabled;}
bool needsUpdate() const;
- LLTrace::ExtendablePeriodicRecording* getRecording() const {return mRecording;}
+ const LLTrace::ExtendablePeriodicRecording* getRecording() const {return &mSceneLoadRecording;}
void dumpToFile(std::string file_name);
- bool hasResults() const { return mRecording->getAcceptedRecording().getDuration() != 0;}
+ bool hasResults() const { return mSceneLoadRecording.getAcceptedRecording().getDuration() != 0;}
private:
void freezeScene();
@@ -103,7 +101,8 @@ private:
std::vector<LLAnimPauseRequest> mAvatarPauseHandles;
- LLTrace::ExtendablePeriodicRecording* mRecording;
+ LLTrace::ExtendablePeriodicRecording mSceneLoadRecording;
+ LLTrace::Recording mMonitorRecording;
};
class LLSceneMonitorView : public LLFloater
diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp
index 7a6351c880..0df7b46b52 100644
--- a/indra/newview/lltextureview.cpp
+++ b/indra/newview/lltextureview.cpp
@@ -507,13 +507,13 @@ private:
void LLGLTexMemBar::draw()
{
- LLUnit<LLUnits::Megabytes, S32> bound_mem = LLViewerTexture::sBoundTextureMemory;
- LLUnit<LLUnits::Megabytes, S32> max_bound_mem = LLViewerTexture::sMaxBoundTextureMem;
- LLUnit<LLUnits::Megabytes, S32> total_mem = LLViewerTexture::sTotalTextureMemory;
- LLUnit<LLUnits::Megabytes, S32> max_total_mem = LLViewerTexture::sMaxTotalTextureMem;
+ LLUnit<LLUnits::Mibibytes, S32> bound_mem = LLViewerTexture::sBoundTextureMemory;
+ LLUnit<LLUnits::Mibibytes, S32> max_bound_mem = LLViewerTexture::sMaxBoundTextureMem;
+ LLUnit<LLUnits::Mibibytes, S32> total_mem = LLViewerTexture::sTotalTextureMemory;
+ LLUnit<LLUnits::Mibibytes, S32> max_total_mem = LLViewerTexture::sMaxTotalTextureMem;
F32 discard_bias = LLViewerTexture::sDesiredDiscardBias;
- F32 cache_usage = (F32)LLTrace::Megabytes(LLAppViewer::getTextureCache()->getUsage()).value() ;
- F32 cache_max_usage = (F32)LLTrace::Megabytes(LLAppViewer::getTextureCache()->getMaxUsage()).value() ;
+ F32 cache_usage = (F32)LLTrace::Mibibytes(LLAppViewer::getTextureCache()->getUsage()).value() ;
+ F32 cache_max_usage = (F32)LLTrace::Mibibytes(LLAppViewer::getTextureCache()->getMaxUsage()).value() ;
S32 line_height = LLFontGL::getFontMonospace()->getLineHeight();
S32 v_offset = 0;//(S32)((texture_bar_height + 2.2f) * mTextureView->mNumTextureBars + 2.0f);
LLUnit<LLUnits::Bytes, F32> total_texture_downloaded = gTotalTextureData;
diff --git a/indra/newview/llviewerassetstats.cpp b/indra/newview/llviewerassetstats.cpp
index 0bbf2cbbea..062dabdd13 100644
--- a/indra/newview/llviewerassetstats.cpp
+++ b/indra/newview/llviewerassetstats.cpp
@@ -286,13 +286,13 @@ LLViewerAssetStats::LLViewerAssetStats(const LLViewerAssetStats & src)
mRegionRecordings = src.mRegionRecordings;
mCurRecording = &mRegionRecordings[mRegionHandle];
- mCurRecording->stop();
// assume this is being passed to another thread, so make sure we have unique copies of recording data
for (PerRegionRecordingContainer::iterator it = mRegionRecordings.begin(), end_it = mRegionRecordings.end();
it != end_it;
++it)
{
+ it->second.stop();
it->second.makeUnique();
}
diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp
index 635611c02e..d29d1ebe5f 100644
--- a/indra/newview/llviewerstats.cpp
+++ b/indra/newview/llviewerstats.cpp
@@ -89,7 +89,7 @@ LLTrace::CountStatHandle<> FPS("framesrendered"),
TEX_BAKES("texbakes"),
TEX_REBAKES("texrebakes"),
NUM_NEW_OBJECTS("numnewobjectsstat");
-LLTrace::CountStatHandle<LLTrace::Kilobits> KBIT("kbitstat"),
+LLTrace::CountStatHandle<LLTrace::Kibibits> KBIT("kbitstat"),
LAYERS_KBIT("layerskbitstat"),
OBJECT_KBIT("objectkbitstat"),
ASSET_KBIT("assetkbitstat"),
@@ -263,7 +263,7 @@ void LLViewerStats::updateFrameStats(const F64 time_diff)
mLastTimeDiff = time_diff;
}
-void LLViewerStats::addToMessage(LLSD &body) const
+void LLViewerStats::addToMessage(LLSD &body)
{
LLSD &misc = body["misc"];
@@ -552,9 +552,9 @@ void send_stats()
LLSD &download = body["downloads"];
- download["world_kbytes"] = LLTrace::Kilobytes(gTotalWorldData).value();
- download["object_kbytes"] = LLTrace::Kilobytes(gTotalObjectData).value();
- download["texture_kbytes"] = LLTrace::Kilobytes(gTotalTextureData).value();
+ download["world_kbytes"] = LLTrace::Kibibytes(gTotalWorldData).value();
+ download["object_kbytes"] = LLTrace::Kibibytes(gTotalObjectData).value();
+ download["texture_kbytes"] = LLTrace::Kibibytes(gTotalTextureData).value();
download["mesh_kbytes"] = LLMeshRepository::sBytesReceived/1024.0;
LLSD &in = body["stats"]["net"]["in"];
diff --git a/indra/newview/llviewerstats.h b/indra/newview/llviewerstats.h
index c0ac6d220f..7ad1e5d053 100644
--- a/indra/newview/llviewerstats.h
+++ b/indra/newview/llviewerstats.h
@@ -94,7 +94,7 @@ extern LLTrace::CountStatHandle<> FPS,
NUM_NEW_OBJECTS;
-extern LLTrace::CountStatHandle<LLTrace::Kilobits> KBIT,
+extern LLTrace::CountStatHandle<LLTrace::Kibibits> KBIT,
LAYERS_KBIT,
OBJECT_KBIT,
ASSET_KBIT,
@@ -207,7 +207,7 @@ public:
void updateFrameStats(const F64 time_diff);
- void addToMessage(LLSD &body) const;
+ void addToMessage(LLSD &body);
struct StatsAccumulator
{
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index 12835002d3..a3cd2efd66 100644
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -65,8 +65,8 @@
///////////////////////////////////////////////////////////////////////////////
// extern
-const LLUnit<LLUnits::Megabytes, S32> gMinVideoRam = 32;
-const LLUnit<LLUnits::Megabytes, S32> gMaxVideoRam = 512;
+const LLUnit<LLUnits::Mibibytes, S32> gMinVideoRam = 32;
+const LLUnit<LLUnits::Mibibytes, S32> gMaxVideoRam = 512;
// statics
@@ -89,8 +89,8 @@ F32 LLViewerTexture::sDesiredDiscardBias = 0.f;
F32 LLViewerTexture::sDesiredDiscardScale = 1.1f;
LLUnit<LLUnits::Bytes, S32> LLViewerTexture::sBoundTextureMemory = 0;
LLUnit<LLUnits::Bytes, S32> LLViewerTexture::sTotalTextureMemory = 0;
-LLUnit<LLUnits::Megabytes, S32> LLViewerTexture::sMaxBoundTextureMem = 0;
-LLUnit<LLUnits::Megabytes, S32> LLViewerTexture::sMaxTotalTextureMem = 0;
+LLUnit<LLUnits::Mibibytes, S32> LLViewerTexture::sMaxBoundTextureMem = 0;
+LLUnit<LLUnits::Mibibytes, S32> LLViewerTexture::sMaxTotalTextureMem = 0;
LLUnit<LLUnits::Bytes, S32> LLViewerTexture::sMaxDesiredTextureMem = 0 ;
S8 LLViewerTexture::sCameraMovingDiscardBias = 0 ;
F32 LLViewerTexture::sCameraMovingBias = 0.0f ;
diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h
index d69a0ffb72..ff1aef181b 100644
--- a/indra/newview/llviewertexture.h
+++ b/indra/newview/llviewertexture.h
@@ -39,8 +39,8 @@
#include <map>
#include <list>
-extern const LLUnit<LLUnits::Megabytes, S32> gMinVideoRam;
-extern const LLUnit<LLUnits::Megabytes, S32> gMaxVideoRam;
+extern const LLUnit<LLUnits::Mibibytes, S32> gMinVideoRam;
+extern const LLUnit<LLUnits::Mibibytes, S32> gMaxVideoRam;
class LLFace;
class LLImageGL ;
@@ -329,8 +329,8 @@ public:
static F32 sDesiredDiscardScale;
static LLUnit<LLUnits::Bytes, S32> sBoundTextureMemory;
static LLUnit<LLUnits::Bytes, S32> sTotalTextureMemory;
- static LLUnit<LLUnits::Megabytes, S32> sMaxBoundTextureMem;
- static LLUnit<LLUnits::Megabytes, S32> sMaxTotalTextureMem;
+ static LLUnit<LLUnits::Mibibytes, S32> sMaxBoundTextureMem;
+ static LLUnit<LLUnits::Mibibytes, S32> sMaxTotalTextureMem;
static LLUnit<LLUnits::Bytes, S32> sMaxDesiredTextureMem ;
static S8 sCameraMovingDiscardBias;
static F32 sCameraMovingBias;
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index ed85667469..9523037b36 100755
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -734,7 +734,7 @@ public:
{
if(gTotalTextureBytesPerBoostLevel[i] > 0)
{
- addText(xpos, ypos, llformat("Boost_Level %d: %.3f MB", i, LLUnit<LLUnits::Megabytes, F32>(gTotalTextureBytesPerBoostLevel[i]).value()));
+ addText(xpos, ypos, llformat("Boost_Level %d: %.3f MB", i, LLUnit<LLUnits::Mibibytes, F32>(gTotalTextureBytesPerBoostLevel[i]).value()));
ypos += y_inc;
}
}