summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/app_settings/settings.xml11
-rw-r--r--indra/newview/llappviewer.cpp46
2 files changed, 52 insertions, 5 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index d65a1ca583..75232da541 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -10362,6 +10362,17 @@
<key>Value</key>
<integer>0</integer>
</map>
+ <key>DumpVFSCaches</key>
+ <map>
+ <key>Comment</key>
+ <string>Dump VFS caches on startup.</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
<key>UseStartScreen</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 82b6f1286f..d7632e69e8 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -2979,6 +2979,42 @@ S32 LLAppViewer::getCacheVersion()
return cache_version ;
}
+void dumpVFSCaches()
+{
+ llinfos << "======= Dumping Static VFS ========" << llendl;
+ gStaticVFS->listFiles();
+#if LL_WINDOWS
+ WCHAR w_str[MAX_PATH];
+ GetCurrentDirectory(MAX_PATH, w_str);
+ S32 res = LLFile::mkdir("StaticVFSDump");
+ if (res == -1)
+ {
+ if (errno != EEXIST)
+ {
+ llwarns << "Couldn't create StaticVFSDump" << llendl;
+ }
+ }
+ SetCurrentDirectory(utf8str_to_utf16str("StaticVFSDump").c_str());
+ gStaticVFS->dumpFiles();
+ SetCurrentDirectory(w_str);
+#endif
+
+ llinfos << "========= Dumping regular VFS ====" << llendl;
+ gVFS->listFiles();
+#if LL_WINDOWS
+ res = LLFile::mkdir("VFSDump");
+ if (res == -1)
+ {
+ if (errno != EEXIST)
+ {
+ llwarns << "Couldn't create VFSDump" << llendl;
+ }
+ }
+ SetCurrentDirectory(utf8str_to_utf16str("VFSDump").c_str());
+ gVFS->dumpFiles();
+ SetCurrentDirectory(w_str);
+#endif
+}
bool LLAppViewer::initCache()
{
mPurgeCache = false;
@@ -3196,11 +3232,11 @@ bool LLAppViewer::initCache()
{
LLVFile::initClass();
- //llinfos << "======= Static VFS listing ========" << llendl;
- //gStaticVFS->listFiles();
-
- //llinfos << "========= regular VFS listing =====" << llendl;
- //gVFS->listFiles();
+ if (gSavedSettings.getBOOL("DumpVFSCaches"))
+ {
+ dumpVFSCaches();
+
+ }
return true;
}