summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerobjectlist.cpp
diff options
context:
space:
mode:
authorRichard Linden <none@none>2013-08-12 20:07:41 -0700
committerRichard Linden <none@none>2013-08-12 20:07:41 -0700
commitb8d49dab9afddf196618d66b1a409cdf7d2d53ba (patch)
tree535eb32ba4f17c87c0853cda9223c37a4940fea1 /indra/newview/llviewerobjectlist.cpp
parentc2601ec9c574ac3bd7a7f4001bc08572483028a6 (diff)
parent1a093beb7f69e6911f34cb12d71502aa7a05982e (diff)
merge
Diffstat (limited to 'indra/newview/llviewerobjectlist.cpp')
-rwxr-xr-xindra/newview/llviewerobjectlist.cpp119
1 files changed, 59 insertions, 60 deletions
diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp
index 0b75d44096..214d4f2bf6 100755
--- a/indra/newview/llviewerobjectlist.cpp
+++ b/indra/newview/llviewerobjectlist.cpp
@@ -94,7 +94,6 @@ extern LLPipeline gPipeline;
U32 LLViewerObjectList::sSimulatorMachineIndex = 1; // Not zero deliberately, to speed up index check.
std::map<U64, U32> LLViewerObjectList::sIPAndPortToIndex;
std::map<U64, LLUUID> LLViewerObjectList::sIndexAndLocalIDToUUID;
-LLTrace::SampleStatHandle<LLUnit<F32, LLUnits::Percent> > LLViewerObjectList::sCacheHitRate("object_cache_hits");
LLViewerObjectList::LLViewerObjectList()
{
@@ -171,7 +170,7 @@ BOOL LLViewerObjectList::removeFromLocalIDTable(const LLViewerObject* objectp)
U64 ipport = (((U64)ip) << 32) | (U64)port;
U32 index = sIPAndPortToIndex[ipport];
- // llinfos << "Removing object from table, local ID " << local_id << ", ip " << ip << ":" << port << llendl;
+ // LL_INFOS() << "Removing object from table, local ID " << local_id << ", ip " << ip << ":" << port << LL_ENDL;
U64 indexid = (((U64)index) << 32) | (U64)local_id;
@@ -188,8 +187,8 @@ BOOL LLViewerObjectList::removeFromLocalIDTable(const LLViewerObject* objectp)
return TRUE;
}
// UUIDs did not match - this would zap a valid entry, so don't erase it
- //llinfos << "Tried to erase entry where id in table ("
- // << iter->second << ") did not match object " << object.getID() << llendl;
+ //LL_INFOS() << "Tried to erase entry where id in table ("
+ // << iter->second << ") did not match object " << object.getID() << LL_ENDL;
}
return FALSE ;
@@ -214,8 +213,8 @@ void LLViewerObjectList::setUUIDAndLocal(const LLUUID &id,
sIndexAndLocalIDToUUID[indexid] = id;
- //llinfos << "Adding object to table, full ID " << id
- // << ", local ID " << local_id << ", ip " << ip << ":" << port << llendl;
+ //LL_INFOS() << "Adding object to table, full ID " << id
+ // << ", local ID " << local_id << ", ip " << ip << ":" << port << LL_ENDL;
}
S32 gFullObjectUpdates = 0;
@@ -278,8 +277,8 @@ void LLViewerObjectList::processUpdateCore(LLViewerObject* objectp,
{
if ( LLToolMgr::getInstance()->getCurrentTool() != LLToolPie::getInstance() )
{
- // llinfos << "DEBUG selecting " << objectp->mID << " "
- // << objectp->mLocalID << llendl;
+ // LL_INFOS() << "DEBUG selecting " << objectp->mID << " "
+ // << objectp->mLocalID << LL_ENDL;
LLSelectMgr::getInstance()->selectObjectAndFamily(objectp);
dialog_refresh_all();
}
@@ -308,6 +307,8 @@ LLViewerObject* LLViewerObjectList::processObjectUpdateFromCache(LLVOCacheEntry*
LLViewerStatsRecorder& recorder = LLViewerStatsRecorder::instance();
// Cache Hit.
+ record(LLStatViewer::OBJECT_CACHE_HIT_RATE, LLUnits::Ratio::fromValue(1));
+
cached_dpp->reset();
cached_dpp->unpackUUID(fullid, "ID");
cached_dpp->unpackU32(local_id, "LocalID");
@@ -349,18 +350,17 @@ LLViewerObject* LLViewerObjectList::processObjectUpdateFromCache(LLVOCacheEntry*
if (!objectp)
{
- llinfos << "createObject failure for object: " << fullid << llendl;
+ LL_INFOS() << "createObject failure for object: " << fullid << LL_ENDL;
recorder.objectUpdateFailure(entry->getLocalID(), OUT_FULL_CACHED, 0);
return NULL;
}
justCreated = true;
mNumNewObjects++;
- sample(sCacheHitRate, LLUnits::Percent::fromValue(100.f));
}
if (objectp->isDead())
{
- llwarns << "Dead object " << objectp->mID << " in UUID map 1!" << llendl;
+ LL_WARNS() << "Dead object " << objectp->mID << " in UUID map 1!" << LL_ENDL;
}
processUpdateCore(objectp, NULL, 0, OUT_FULL_CACHED, cached_dpp, justCreated, true);
@@ -395,7 +395,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
// I don't think this case is ever hit. TODO* Test this.
if (!compressed && update_type != OUT_FULL)
{
- //llinfos << "TEST: !cached && !compressed && update_type != OUT_FULL" << llendl;
+ //LL_INFOS() << "TEST: !cached && !compressed && update_type != OUT_FULL" << LL_ENDL;
gTerseObjectUpdates += num_objects;
/*
S32 size;
@@ -407,7 +407,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
{
size = mesgsys->getReceiveSize();
}
- llinfos << "Received terse " << num_objects << " in " << size << " byte (" << size/num_objects << ")" << llendl;
+ LL_INFOS() << "Received terse " << num_objects << " in " << size << " byte (" << size/num_objects << ")" << LL_ENDL;
*/
}
else
@@ -423,7 +423,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
size = mesgsys->getReceiveSize();
}
- llinfos << "Received " << num_objects << " in " << size << " byte (" << size/num_objects << ")" << llendl;
+ LL_INFOS() << "Received " << num_objects << " in " << size << " byte (" << size/num_objects << ")" << LL_ENDL;
*/
gFullObjectUpdates += num_objects;
}
@@ -435,7 +435,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
if (!regionp)
{
- llwarns << "Object update from unknown region! " << region_handle << llendl;
+ LL_WARNS() << "Object update from unknown region! " << region_handle << LL_ENDL;
return;
}
@@ -487,7 +487,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
gMessageSystem->getSenderPort());
if (fullid.isNull())
{
- // llwarns << "update for unknown localid " << local_id << " host " << gMessageSystem->getSender() << ":" << gMessageSystem->getSenderPort() << llendl;
+ // LL_WARNS() << "update for unknown localid " << local_id << " host " << gMessageSystem->getSender() << ":" << gMessageSystem->getSenderPort() << LL_ENDL;
mNumUnknownUpdates++;
}
}
@@ -503,7 +503,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
gMessageSystem->getSenderPort());
if (fullid.isNull())
{
- // llwarns << "update for unknown localid " << local_id << " host " << gMessageSystem->getSender() << llendl;
+ // LL_WARNS() << "update for unknown localid " << local_id << " host " << gMessageSystem->getSender() << LL_ENDL;
mNumUnknownUpdates++;
}
}
@@ -514,7 +514,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_ID, local_id, i);
msg_size += sizeof(LLUUID);
msg_size += sizeof(U32);
- // llinfos << "Full Update, obj " << local_id << ", global ID" << fullid << "from " << mesgsys->getSender() << llendl;
+ // LL_INFOS() << "Full Update, obj " << local_id << ", global ID" << fullid << "from " << mesgsys->getSender() << LL_ENDL;
}
objectp = findObject(fullid);
@@ -532,13 +532,13 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
{
//if (objectp->getRegion())
//{
- // llinfos << "Local ID change: Removing object from table, local ID " << objectp->mLocalID
+ // LL_INFOS() << "Local ID change: Removing object from table, local ID " << objectp->mLocalID
// << ", id from message " << local_id << ", from "
// << LLHost(objectp->getRegion()->getHost().getAddress(), objectp->getRegion()->getHost().getPort())
// << ", full id " << fullid
// << ", objects id " << objectp->getID()
// << ", regionp " << (U32) regionp << ", object region " << (U32) objectp->getRegion()
- // << llendl;
+ // << LL_ENDL;
//}
removeFromLocalIDTable(objectp);
setUUIDAndLocal(fullid,
@@ -563,7 +563,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
{
if (update_type == OUT_TERSE_IMPROVED)
{
- // llinfos << "terse update for an unknown object (compressed):" << fullid << llendl;
+ // LL_INFOS() << "terse update for an unknown object (compressed):" << fullid << LL_ENDL;
recorder.objectUpdateFailure(local_id, update_type, msg_size);
continue;
}
@@ -572,7 +572,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
{
if (update_type != OUT_FULL)
{
- //llinfos << "terse update for an unknown object:" << fullid << llendl;
+ //LL_INFOS() << "terse update for an unknown object:" << fullid << LL_ENDL;
recorder.objectUpdateFailure(local_id, update_type, msg_size);
continue;
}
@@ -585,7 +585,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
if (mDeadObjects.find(fullid) != mDeadObjects.end())
{
mNumDeadObjectUpdates++;
- //llinfos << "update for a dead object:" << fullid << llendl;
+ //LL_INFOS() << "update for a dead object:" << fullid << LL_ENDL;
recorder.objectUpdateFailure(local_id, update_type, msg_size);
continue;
}
@@ -594,7 +594,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
objectp = createObject(pcode, regionp, fullid, local_id, gMessageSystem->getSender());
if (!objectp)
{
- llinfos << "createObject failure for object: " << fullid << llendl;
+ LL_INFOS() << "createObject failure for object: " << fullid << LL_ENDL;
recorder.objectUpdateFailure(local_id, update_type, msg_size);
continue;
}
@@ -605,7 +605,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
if (objectp->isDead())
{
- llwarns << "Dead object " << objectp->mID << " in UUID map 1!" << llendl;
+ LL_WARNS() << "Dead object " << objectp->mID << " in UUID map 1!" << LL_ENDL;
}
bool bCached = false;
@@ -671,7 +671,7 @@ void LLViewerObjectList::processCachedObjectUpdate(LLMessageSystem *mesgsys,
LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(region_handle);
if (!regionp)
{
- llwarns << "Object update from unknown region! " << region_handle << llendl;
+ LL_WARNS() << "Object update from unknown region! " << region_handle << LL_ENDL;
return;
}
@@ -697,7 +697,6 @@ void LLViewerObjectList::processCachedObjectUpdate(LLMessageSystem *mesgsys,
continue; // no data packer, skip this object
}
- sample(sCacheHitRate, 100.f);
}
return;
@@ -811,10 +810,10 @@ public:
void errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content)
{
- llwarns
+ LL_WARNS()
<< "Transport error requesting object cost "
<< "[status: " << statusNum << "]: "
- << content << llendl;
+ << content << LL_ENDL;
// TODO*: Error message to user
// For now just clear the request from the pending list
@@ -827,11 +826,11 @@ public:
{
// Improper response or the request had an error,
// show an error to the user?
- llwarns
+ LL_WARNS()
<< "Application level error when fetching object "
<< "cost. Message: " << content["error"]["message"].asString()
<< ", identifier: " << content["error"]["identifier"].asString()
- << llendl;
+ << LL_ENDL;
// TODO*: Adaptively adjust request size if the
// service says we've requested too many and retry
@@ -900,10 +899,10 @@ public:
void errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content)
{
- llwarns
+ LL_WARNS()
<< "Transport error requesting object physics flags "
<< "[status: " << statusNum << "]: "
- << content << llendl;
+ << content << LL_ENDL;
// TODO*: Error message to user
// For now just clear the request from the pending list
@@ -916,11 +915,11 @@ public:
{
// Improper response or the request had an error,
// show an error to the user?
- llwarns
+ LL_WARNS()
<< "Application level error when fetching object "
<< "physics flags. Message: " << content["error"]["message"].asString()
<< ", identifier: " << content["error"]["identifier"].asString()
- << llendl;
+ << LL_ENDL;
// TODO*: Adaptively adjust request size if the
// service says we've requested too many and retry
@@ -985,7 +984,7 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world)
phase_out_time < 0.0 ||
phase_out_time > interp_time)
{
- llwarns << "Invalid values for InterpolationTime or InterpolationPhaseOut, resetting to defaults" << llendl;
+ LL_WARNS() << "Invalid values for InterpolationTime or InterpolationPhaseOut, resetting to defaults" << LL_ENDL;
interp_time = 3.0f;
phase_out_time = 1.0f;
}
@@ -1046,7 +1045,7 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world)
else
{ // There shouldn't be any NULL pointers in the list, but they have caused
// crashes before. This may be idleUpdate() messing with the list.
- llwarns << "LLViewerObjectList::update has a NULL objectp" << llendl;
+ LL_WARNS() << "LLViewerObjectList::update has a NULL objectp" << LL_ENDL;
}
}
}
@@ -1282,7 +1281,7 @@ void LLViewerObjectList::cleanupReferences(LLViewerObject *objectp)
{
if (mDeadObjects.find(objectp->mID) != mDeadObjects.end())
{
- llinfos << "Object " << objectp->mID << " already on dead list!" << llendl;
+ LL_INFOS() << "Object " << objectp->mID << " already on dead list!" << LL_ENDL;
}
else
{
@@ -1296,16 +1295,16 @@ void LLViewerObjectList::cleanupReferences(LLViewerObject *objectp)
//if (objectp->getRegion())
//{
- // llinfos << "cleanupReferences removing object from table, local ID " << objectp->mLocalID << ", ip "
+ // LL_INFOS() << "cleanupReferences removing object from table, local ID " << objectp->mLocalID << ", ip "
// << objectp->getRegion()->getHost().getAddress() << ":"
- // << objectp->getRegion()->getHost().getPort() << llendl;
+ // << objectp->getRegion()->getHost().getPort() << LL_ENDL;
//}
removeFromLocalIDTable(objectp);
if (objectp->onActiveList())
{
- //llinfos << "Removing " << objectp->mID << " " << objectp->getPCodeString() << " from active list in cleanupReferences." << llendl;
+ //LL_INFOS() << "Removing " << objectp->mID << " " << objectp->getPCodeString() << " from active list in cleanupReferences." << LL_ENDL;
objectp->setOnActiveList(FALSE);
removeFromActiveList(objectp);
}
@@ -1405,19 +1404,19 @@ void LLViewerObjectList::killAllObjects()
if(!mObjects.empty())
{
- llwarns << "LLViewerObjectList::killAllObjects still has entries in mObjects: " << mObjects.size() << llendl;
+ LL_WARNS() << "LLViewerObjectList::killAllObjects still has entries in mObjects: " << mObjects.size() << LL_ENDL;
mObjects.clear();
}
if (!mActiveObjects.empty())
{
- llwarns << "Some objects still on active object list!" << llendl;
+ LL_WARNS() << "Some objects still on active object list!" << LL_ENDL;
mActiveObjects.clear();
}
if (!mMapObjects.empty())
{
- llwarns << "Some objects still on map object list!" << llendl;
+ LL_WARNS() << "Some objects still on map object list!" << LL_ENDL;
mMapObjects.clear();
}
}
@@ -1508,7 +1507,7 @@ void LLViewerObjectList::updateActive(LLViewerObject *objectp)
{
if (active)
{
- //llinfos << "Adding " << objectp->mID << " " << objectp->getPCodeString() << " to active list." << llendl;
+ //LL_INFOS() << "Adding " << objectp->mID << " " << objectp->getPCodeString() << " to active list." << LL_ENDL;
S32 idx = objectp->getListIndex();
if (idx <= -1)
{
@@ -1524,13 +1523,13 @@ void LLViewerObjectList::updateActive(LLViewerObject *objectp)
if (idx >= mActiveObjects.size() ||
mActiveObjects[idx] != objectp)
{
- llwarns << "Invalid object list index detected!" << llendl;
+ LL_WARNS() << "Invalid object list index detected!" << LL_ENDL;
}
}
}
else
{
- //llinfos << "Removing " << objectp->mID << " " << objectp->getPCodeString() << " from active list." << llendl;
+ //LL_INFOS() << "Removing " << objectp->mID << " " << objectp->getPCodeString() << " from active list." << LL_ENDL;
removeFromActiveList(objectp);
objectp->setOnActiveList(FALSE);
}
@@ -1568,7 +1567,7 @@ void LLViewerObjectList::updateObjectCost(const LLUUID& object_id, F32 object_co
void LLViewerObjectList::onObjectCostFetchFailure(const LLUUID& object_id)
{
- //llwarns << "Failed to fetch object cost for object: " << object_id << llendl;
+ //LL_WARNS() << "Failed to fetch object cost for object: " << object_id << LL_ENDL;
mPendingObjectCost.erase(object_id);
}
@@ -1607,7 +1606,7 @@ void LLViewerObjectList::updatePhysicsProperties(const LLUUID& object_id,
void LLViewerObjectList::onPhysicsFlagsFetchFailure(const LLUUID& object_id)
{
- //llwarns << "Failed to fetch physics flags for object: " << object_id << llendl;
+ //LL_WARNS() << "Failed to fetch physics flags for object: " << object_id << LL_ENDL;
mPendingPhysicsFlags.erase(object_id);
}
@@ -1710,7 +1709,7 @@ void LLViewerObjectList::clearAllMapObjectsInRegion(LLViewerRegion* regionp)
if(dead_object_list.size() > 0)
{
- llwarns << "There are " << dead_object_list.size() << " dead objects on the map!" << llendl ;
+ LL_WARNS() << "There are " << dead_object_list.size() << " dead objects on the map!" << LL_ENDL ;
for(std::set<LLViewerObject*>::iterator iter = dead_object_list.begin(); iter != dead_object_list.end(); ++iter)
{
@@ -1719,7 +1718,7 @@ void LLViewerObjectList::clearAllMapObjectsInRegion(LLViewerRegion* regionp)
}
if(region_object_list.size() > 0)
{
- llwarns << "There are " << region_object_list.size() << " objects not removed from the deleted region!" << llendl ;
+ LL_WARNS() << "There are " << region_object_list.size() << " objects not removed from the deleted region!" << LL_ENDL ;
for(std::set<LLViewerObject*>::iterator iter = region_object_list.begin(); iter != region_object_list.end(); ++iter)
{
@@ -1985,7 +1984,7 @@ LLViewerObject *LLViewerObjectList::createObjectViewer(const LLPCode pcode, LLVi
LLViewerObject *objectp = LLViewerObject::createObject(fullid, pcode, regionp);
if (!objectp)
{
-// llwarns << "Couldn't create object of type " << LLPrimitive::pCodeToString(pcode) << llendl;
+// LL_WARNS() << "Couldn't create object of type " << LLPrimitive::pCodeToString(pcode) << LL_ENDL;
return NULL;
}
@@ -2005,7 +2004,7 @@ LLViewerObject *LLViewerObjectList::createObjectFromCache(const LLPCode pcode, L
LLViewerObject *objectp = LLViewerObject::createObject(uuid, pcode, regionp);
if (!objectp)
{
-// llwarns << "Couldn't create object of type " << LLPrimitive::pCodeToString(pcode) << " id:" << fullid << llendl;
+// LL_WARNS() << "Couldn't create object of type " << LLPrimitive::pCodeToString(pcode) << " id:" << fullid << LL_ENDL;
return NULL;
}
@@ -2039,7 +2038,7 @@ LLViewerObject *LLViewerObjectList::createObject(const LLPCode pcode, LLViewerRe
LLViewerObject *objectp = LLViewerObject::createObject(fullid, pcode, regionp);
if (!objectp)
{
-// llwarns << "Couldn't create object of type " << LLPrimitive::pCodeToString(pcode) << " id:" << fullid << llendl;
+// LL_WARNS() << "Couldn't create object of type " << LLPrimitive::pCodeToString(pcode) << " id:" << fullid << LL_ENDL;
return NULL;
}
if(regionp)
@@ -2108,7 +2107,7 @@ void LLViewerObjectList::orphanize(LLViewerObject *childp, U32 parent_id, U32 ip
// object probably ISN'T being reparented, but just got an object
// update out of order (child update before parent).
make_invisible = false;
- //llinfos << "Don't make object handoffs invisible!" << llendl;
+ //LL_INFOS() << "Don't make object handoffs invisible!" << LL_ENDL;
}
}
@@ -2140,8 +2139,8 @@ void LLViewerObjectList::findOrphans(LLViewerObject* objectp, U32 ip, U32 port)
{
if (objectp->isDead())
{
- llwarns << "Trying to find orphans for dead obj " << objectp->mID
- << ":" << objectp->getPCodeString() << llendl;
+ LL_WARNS() << "Trying to find orphans for dead obj " << objectp->mID
+ << ":" << objectp->getPCodeString() << LL_ENDL;
return;
}
@@ -2181,8 +2180,8 @@ void LLViewerObjectList::findOrphans(LLViewerObject* objectp, U32 ip, U32 port)
{
if (childp == objectp)
{
- llwarns << objectp->mID << " has self as parent, skipping!"
- << llendl;
+ LL_WARNS() << objectp->mID << " has self as parent, skipping!"
+ << LL_ENDL;
continue;
}
@@ -2215,7 +2214,7 @@ void LLViewerObjectList::findOrphans(LLViewerObject* objectp, U32 ip, U32 port)
}
else
{
- llinfos << "Missing orphan child, removing from list" << llendl;
+ LL_INFOS() << "Missing orphan child, removing from list" << LL_ENDL;
iter = mOrphanChildren.erase(iter);
}