summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerdisplay.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2024-09-16 17:25:48 -0400
committerNat Goodspeed <nat@lindenlab.com>2024-09-18 14:09:34 -0400
commite6d0138a6a1ce6dd285fbfedbcf8532bc6aaa29b (patch)
tree6857c248f73e808abe3cd33e72b3dd30c73de806 /indra/newview/llviewerdisplay.cpp
parentee1b0061c36c36ab019438c2a722696801de04f9 (diff)
Add LLFloaterAbout info (esp. GPU info) to Frame Profile stats dump
With the About info added, `getProfileStatsContext()` need not redundantly add `"channel"`, `"version"` or `"region"`. Slightly improve the efficiency of `LlsdToJson()` and `LlsdFromJson()` by preallocating the known size of the source array or map. (Unfortunately the C++ `LLSD` class offers us no way to preallocate a map.) In `LLAppViewer::getViewerInfo()`, avoid immediate successive calls to `gAgent.getRegion()`. (cherry picked from commit f4b65638879c10c832b3bb8448f82001106ffd11)
Diffstat (limited to 'indra/newview/llviewerdisplay.cpp')
-rw-r--r--indra/newview/llviewerdisplay.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index fdfe477a6c..ae0579f5f7 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -58,6 +58,7 @@
#include "llpostprocess.h"
#include "llrender.h"
#include "llscenemonitor.h"
+#include "llsdjson.h"
#include "llselectmgr.h"
#include "llsky.h"
#include "llspatialpartition.h"
@@ -1044,6 +1045,31 @@ void display(bool rebuild, F32 zoom_factor, int subfield, bool for_snapshot)
}
}
+void getProfileStatsContext(boost::json::object& stats)
+{
+ // populate the context with info from LLFloaterAbout
+ auto contextit = stats.emplace("context",
+ LlsdToJson(LLAppViewer::instance()->getViewerInfo())).first;
+ auto& context = contextit->value().as_object();
+
+ // then add a few more things
+ unsigned char unique_id[MAC_ADDRESS_BYTES]{};
+ LLMachineID::getUniqueID(unique_id, sizeof(unique_id));
+ context.emplace("machine", stringize(LL::hexdump(unique_id, sizeof(unique_id))));
+ context.emplace("grid", LLGridManager::instance().getGrid());
+ LLViewerRegion* region = gAgent.getRegion();
+ if (region)
+ {
+ context.emplace("regionid", stringize(region->getRegionID()));
+ }
+ LLParcel* parcel = LLViewerParcelMgr::instance().getAgentParcel();
+ if (parcel)
+ {
+ context.emplace("parcel", parcel->getName());
+ context.emplace("parcelid", parcel->getLocalID());
+ }
+}
+
std::string getProfileStatsFilename()
{
std::ostringstream basebuff;