From 7b99314d846483167c665fabf8092e604554321c Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 20 Feb 2015 15:54:27 -0500 Subject: MAINT-4653, DRTVWR-397 WIP - more code for tracking attachment operations, smarter handling of multiple requests. --- indra/newview/llvoavatar.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index b54f341c31..f9a22690c2 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5730,10 +5730,21 @@ LLViewerJointAttachment* LLVOAvatar::getTargetAttachmentPoint(LLViewerObject* vi //----------------------------------------------------------------------------- const LLViewerJointAttachment *LLVOAvatar::attachObject(LLViewerObject *viewer_object) { + if (isSelf()) + { + const LLUUID& item_id = viewer_object->getAttachmentItemID(); + LLViewerInventoryItem *item = gInventory.getItem(item_id); + LL_DEBUGS("Avatar") << "ATT attaching object " + << (item ? item->getName() : "UNKNOWN") << " id " << item_id << LL_ENDL; + } LLViewerJointAttachment* attachment = getTargetAttachmentPoint(viewer_object); if (!attachment || !attachment->addObject(viewer_object)) { + const LLUUID& item_id = viewer_object->getAttachmentItemID(); + LLViewerInventoryItem *item = gInventory.getItem(item_id); + LL_DEBUGS("Avatar") << "ATT attach failed " + << (item ? item->getName() : "UNKNOWN") << " id " << item_id << LL_ENDL; return 0; } @@ -5793,6 +5804,13 @@ void LLVOAvatar::lazyAttach() LLPointer cur_attachment = mPendingAttachment[i]; if (cur_attachment->mDrawable) { + if (isSelf()) + { + const LLUUID& item_id = cur_attachment->getAttachmentItemID(); + LLViewerInventoryItem *item = gInventory.getItem(item_id); + LL_DEBUGS("Avatar") << "ATT attaching object " + << (item ? item->getName() : "UNKNOWN") << " id " << item_id << LL_ENDL; + } if (!attachObject(cur_attachment)) { // Drop it LL_WARNS() << "attachObject() failed for " -- cgit v1.3 From f1684cdea5e1086b1127993eac9a5a7b4e47321a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 2 Apr 2015 17:47:22 -0400 Subject: DRTVWR-397 WIP - more logging --- indra/newview/llattachmentsmgr.cpp | 25 +++++++++++++++++++------ indra/newview/llviewermessage.cpp | 2 +- indra/newview/llviewerobject.cpp | 5 +++++ indra/newview/llviewerobjectlist.cpp | 12 ++++++------ indra/newview/llvoavatar.cpp | 14 +++++++++++--- 5 files changed, 42 insertions(+), 16 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llattachmentsmgr.cpp b/indra/newview/llattachmentsmgr.cpp index ae9560211f..50f5efca25 100755 --- a/indra/newview/llattachmentsmgr.cpp +++ b/indra/newview/llattachmentsmgr.cpp @@ -258,9 +258,12 @@ void LLAttachmentsMgr::LLItemRequestTimes::addTime(const LLUUID& inv_item_id) void LLAttachmentsMgr::LLItemRequestTimes::removeTime(const LLUUID& inv_item_id) { LLInventoryItem *item = gInventory.getItem(inv_item_id); - LL_DEBUGS("Avatar") << "ATT " << mOpName << " removing request time " - << (item ? item->getName() : "UNKNOWN") << " " << inv_item_id << LL_ENDL; - (*this).erase(inv_item_id); + S32 remove_count = (*this).erase(inv_item_id); + if (remove_count) + { + LL_DEBUGS("Avatar") << "ATT " << mOpName << " removing request time " + << (item ? item->getName() : "UNKNOWN") << " " << inv_item_id << LL_ENDL; + } } BOOL LLAttachmentsMgr::LLItemRequestTimes::getTime(const LLUUID& inv_item_id, LLTimer& timer) const @@ -313,7 +316,7 @@ void LLAttachmentsMgr::expireOldAttachmentRequests() if (curr_it->second.getElapsedTimeF32() > MAX_ATTACHMENT_REQUEST_LIFETIME) { LLInventoryItem *item = gInventory.getItem(curr_it->first); - LL_DEBUGS("Avatar") << "ATT expiring request for attachment " + LL_WARNS("Avatar") << "ATT expiring request for attachment " << (item ? item->getName() : "UNKNOWN") << " item_id " << curr_it->first << " after " << MAX_ATTACHMENT_REQUEST_LIFETIME << " seconds" << LL_ENDL; mAttachmentRequests.erase(curr_it); @@ -331,7 +334,7 @@ void LLAttachmentsMgr::expireOldDetachRequests() if (curr_it->second.getElapsedTimeF32() > MAX_ATTACHMENT_REQUEST_LIFETIME) { LLInventoryItem *item = gInventory.getItem(curr_it->first); - LL_DEBUGS("Avatar") << "ATT expiring request for detach " + LL_WARNS("Avatar") << "ATT expiring request for detach " << (item ? item->getName() : "UNKNOWN") << " item_id " << curr_it->first << " after " << MAX_ATTACHMENT_REQUEST_LIFETIME << " seconds" << LL_ENDL; mDetachRequests.erase(curr_it); @@ -344,13 +347,19 @@ void LLAttachmentsMgr::expireOldDetachRequests() void LLAttachmentsMgr::onAttachmentArrived(const LLUUID& inv_item_id) { LLTimer timer; - if (!mAttachmentRequests.getTime(inv_item_id, timer)) + bool expected = mAttachmentRequests.getTime(inv_item_id, timer); + if (!expected) { LLInventoryItem *item = gInventory.getItem(inv_item_id); LL_WARNS() << "ATT Attachment was unexpected or arrived after " << MAX_ATTACHMENT_REQUEST_LIFETIME << " seconds: " << (item ? item->getName() : "UNKNOWN") << " id " << inv_item_id << LL_ENDL; } mAttachmentRequests.removeTime(inv_item_id); + if (expected && mAttachmentRequests.empty()) + { + // mAttachmentRequests just emptied out + LL_DEBUGS("Avatar") << "ATT all active attachment requests have completed" << LL_ENDL; + } if (mRecentlyArrivedAttachments.empty()) { // Start the timer for sending off a COF link batch. @@ -373,6 +382,10 @@ void LLAttachmentsMgr::onDetachCompleted(const LLUUID& inv_item_id) LL_DEBUGS("Avatar") << "ATT detach completed after " << timer.getElapsedTimeF32() << " seconds for " << (item ? item->getName() : "UNKNOWN") << " " << inv_item_id << LL_ENDL; mDetachRequests.removeTime(inv_item_id); + if (mDetachRequests.empty()) + { + LL_DEBUGS("Avatar") << "ATT all detach requests have completed" << LL_ENDL; + } } else { diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 44eb4361f1..5bc4ec699a 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -4656,7 +4656,7 @@ void process_kill_object(LLMessageSystem *mesgsys, void **user_data) LLViewerObjectList::getUUIDFromLocal(id, local_id, ip, port); if (id == LLUUID::null) { - LL_DEBUGS("Messaging") << "Unknown kill for local " << local_id << LL_ENDL; + LL_WARNS("Messaging") << "ATT? Unknown kill for local " << local_id << LL_ENDL; continue; } else diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 74b8e693c4..87063edec3 100755 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -1958,6 +1958,11 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, if (sent_parentp && (sent_parentp != this) && !sent_parentp->isDead()) { + if (((LLViewerObject*)sent_parentp)->isAvatar()) + { + //LL_DEBUGS("Avatar") << "ATT got object update for attachment " << LL_ENDL; + } + // // We have a viewer object for the parent, and it's not dead. // Do the actual reparenting here. diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 7c36b30dd1..7951503187 100755 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -474,13 +474,13 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, { U32 flags = 0; mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_UpdateFlags, flags, i); - + if(flags & FLAGS_TEMPORARY_ON_REZ) { - compressed_dp.unpackUUID(fullid, "ID"); - compressed_dp.unpackU32(local_id, "LocalID"); - compressed_dp.unpackU8(pcode, "PCode"); - } + compressed_dp.unpackUUID(fullid, "ID"); + compressed_dp.unpackU32(local_id, "LocalID"); + compressed_dp.unpackU8(pcode, "PCode"); + } else //send to object cache { regionp->cacheFullUpdate(compressed_dp, flags); @@ -497,7 +497,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, gMessageSystem->getSenderPort()); if (fullid.isNull()) { - // LL_WARNS() << "update for unknown localid " << local_id << " host " << gMessageSystem->getSender() << ":" << gMessageSystem->getSenderPort() << LL_ENDL; + LL_WARNS() << "ATT? update for unknown localid " << local_id << " host " << gMessageSystem->getSender() << ":" << gMessageSystem->getSenderPort() << LL_ENDL; mNumUnknownUpdates++; } } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index bc76dec587..67cb4af5c0 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5725,12 +5725,20 @@ BOOL LLVOAvatar::setParent(LLViewerObject* parent) void LLVOAvatar::addChild(LLViewerObject *childp) { childp->extractAttachmentItemID(); // find the inventory item this object is associated with. + if (isSelf()) + { + const LLUUID& item_id = childp->getAttachmentItemID(); + LLViewerInventoryItem *item = gInventory.getItem(item_id); + LL_DEBUGS("Avatar") << "ATT attachment child added " << (item ? item->getName() : "UNKNOWN") << " id " << item_id << LL_ENDL; + + } + LLViewerObject::addChild(childp); if (childp->mDrawable) { if (!attachObject(childp)) { - LL_WARNS() << "addChild() failed for " + LL_WARNS() << "ATT addChild() failed for " << childp->getID() << " item " << childp->getAttachmentItemID() << LL_ENDL; @@ -5813,8 +5821,8 @@ const LLViewerJointAttachment *LLVOAvatar::attachObject(LLViewerObject *viewer_o { const LLUUID& item_id = viewer_object->getAttachmentItemID(); LLViewerInventoryItem *item = gInventory.getItem(item_id); - LL_DEBUGS("Avatar") << "ATT attach failed " - << (item ? item->getName() : "UNKNOWN") << " id " << item_id << LL_ENDL; + LL_WARNS("Avatar") << "ATT attach failed " + << (item ? item->getName() : "UNKNOWN") << " id " << item_id << LL_ENDL; return 0; } -- cgit v1.3 From 4d689fc5155458f71912ff11c869d1b2e2e3076e Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 22 Apr 2015 16:09:02 -0400 Subject: MAINT-4653 WIP, DRTVWR-397 WIP - log output to file now includes tags. Request max 5 attachments per idle loop to reduce sim-side failures seen when requesting large numbers. --- indra/llcommon/llerror.cpp | 16 +++++++---- indra/newview/llattachmentsmgr.cpp | 56 +++++++++++++++++++------------------- indra/newview/llattachmentsmgr.h | 4 +-- indra/newview/llvoavatar.cpp | 2 +- 4 files changed, 42 insertions(+), 36 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 22cd861c72..bf57e47756 100755 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -119,6 +119,7 @@ namespace { LL_INFOS() << "Error setting log file to " << filename << LL_ENDL; } mWantsTime = true; + mWantsTags = true; } ~RecordToFile() @@ -558,7 +559,7 @@ namespace LLError mFunctionString += std::string(mFunction) + ":"; for (size_t i = 0; i < mTagCount; i++) { - mTagString += std::string("#") + mTags[i] + ((i == mTagCount - 1) ? "" : " "); + mTagString += std::string("#") + mTags[i] + ((i == mTagCount - 1) ? "" : ","); } } @@ -931,14 +932,19 @@ namespace } if (show_level && r->wantsLevel()) - { - message_stream << site.mLevelString << " "; - } + { + message_stream << site.mLevelString; + } if (show_tags && r->wantsTags()) { - message_stream << site.mTagString << " "; + message_stream << site.mTagString; } + if ((show_level && r->wantsLevel())|| + (show_tags && r->wantsTags())) + { + message_stream << " "; + } if (show_function && r->wantsFunctionName()) { diff --git a/indra/newview/llattachmentsmgr.cpp b/indra/newview/llattachmentsmgr.cpp index bbfcb6b955..39c21a195a 100755 --- a/indra/newview/llattachmentsmgr.cpp +++ b/indra/newview/llattachmentsmgr.cpp @@ -117,7 +117,6 @@ void LLAttachmentsMgr::requestPendingAttachments() if (mPendingAttachments.size()) { requestAttachments(mPendingAttachments); - mPendingAttachments.clear(); } } @@ -125,7 +124,7 @@ void LLAttachmentsMgr::requestPendingAttachments() // request at most 40 attachments and the rest will be // ignored. Currently the max attachments per avatar is 38, so the 40 // limit should not be hit in practice. -void LLAttachmentsMgr::requestAttachments(const attachments_vec_t& attachment_requests) +void LLAttachmentsMgr::requestAttachments(attachments_vec_t& attachment_requests) { // Make sure we got a region before trying anything else if( !gAgent.getRegion() ) @@ -133,7 +132,8 @@ void LLAttachmentsMgr::requestAttachments(const attachments_vec_t& attachment_re return; } - S32 obj_count = attachment_requests.size(); + const S32 max_objects_per_request = 5; + S32 obj_count = llmin((S32)attachment_requests.size(),max_objects_per_request); if (obj_count == 0) { return; @@ -145,7 +145,7 @@ void LLAttachmentsMgr::requestAttachments(const attachments_vec_t& attachment_re const S32 MAX_OBJECTS_TO_SEND = MAX_PACKETS_TO_SEND * OBJECTS_PER_PACKET; if( obj_count > MAX_OBJECTS_TO_SEND ) { - LL_WARNS() << "ATT Too many attachments requested: " << attachment_requests.size() + LL_WARNS() << "ATT Too many attachments requested: " << obj_count << " exceeds limit of " << MAX_OBJECTS_TO_SEND << LL_ENDL; LL_WARNS() << "ATT Excess requests will be ignored" << LL_ENDL; @@ -159,12 +159,10 @@ void LLAttachmentsMgr::requestAttachments(const attachments_vec_t& attachment_re compound_msg_id.generate(); LLMessageSystem* msg = gMessageSystem; - - S32 i = 0; - for (attachments_vec_t::const_iterator iter = attachment_requests.begin(); - iter != attachment_requests.end(); - ++iter) - { + // by construction, obj_count <= attachment_requests.size(), so no + // check against empty() is needed here. + for (S32 i=0; iaddBOOLFast(_PREHASH_FirstDetachAll, false ); } - const AttachmentsInfo &attachment = (*iter); + const AttachmentsInfo& attachment = attachment_requests.front(); LLViewerInventoryItem* item = gInventory.getItem(attachment.mItemID); - if (!item) + if (item) + { + LL_DEBUGS("Avatar") << "ATT requesting from attachment_requests " << item->getName() + << " " << item->getLinkedUUID() << LL_ENDL; + S32 attachment_pt = attachment.mAttachmentPt; + if (attachment.mAdd) + attachment_pt |= ATTACHMENT_ADD; + + msg->nextBlockFast(_PREHASH_ObjectData ); + msg->addUUIDFast(_PREHASH_ItemID, item->getLinkedUUID()); + msg->addUUIDFast(_PREHASH_OwnerID, item->getPermissions().getOwner()); + msg->addU8Fast(_PREHASH_AttachmentPt, attachment_pt); + pack_permissions_slam(msg, item->getFlags(), item->getPermissions()); + msg->addStringFast(_PREHASH_Name, item->getName()); + msg->addStringFast(_PREHASH_Description, item->getDescription()); + } + else { - LL_INFOS() << "Attempted to add non-existent item ID:" << attachment.mItemID << LL_ENDL; - continue; + LL_INFOS("Avatar") << "ATT Attempted to add non-existent item ID:" << attachment.mItemID << LL_ENDL; } - LL_DEBUGS("Avatar") << "ATT requesting from attachment_requests " << item->getName() - << " " << item->getLinkedUUID() << LL_ENDL; - S32 attachment_pt = attachment.mAttachmentPt; - if (attachment.mAdd) - attachment_pt |= ATTACHMENT_ADD; - - msg->nextBlockFast(_PREHASH_ObjectData ); - msg->addUUIDFast(_PREHASH_ItemID, item->getLinkedUUID()); - msg->addUUIDFast(_PREHASH_OwnerID, item->getPermissions().getOwner()); - msg->addU8Fast(_PREHASH_AttachmentPt, attachment_pt); - pack_permissions_slam(msg, item->getFlags(), item->getPermissions()); - msg->addStringFast(_PREHASH_Name, item->getName()); - msg->addStringFast(_PREHASH_Description, item->getDescription()); if( (i+1 == obj_count) || ((OBJECTS_PER_PACKET-1) == (i % OBJECTS_PER_PACKET)) ) { // End of message chunk msg->sendReliable( gAgent.getRegion()->getHost() ); } - i++; + attachment_requests.pop_front(); } } diff --git a/indra/newview/llattachmentsmgr.h b/indra/newview/llattachmentsmgr.h index f9d321398f..d56d6eb27b 100755 --- a/indra/newview/llattachmentsmgr.h +++ b/indra/newview/llattachmentsmgr.h @@ -70,7 +70,7 @@ public: U8 mAttachmentPt; BOOL mAdd; }; - typedef std::vector attachments_vec_t; + typedef std::deque attachments_vec_t; LLAttachmentsMgr(); virtual ~LLAttachmentsMgr(); @@ -79,7 +79,7 @@ public: const U8 attachment_pt, const BOOL add); void onAttachmentRequested(const LLUUID& item_id); - void requestAttachments(const attachments_vec_t& attachment_requests); + void requestAttachments(attachments_vec_t& attachment_requests); static void onIdle(void *); void onAttachmentArrived(const LLUUID& inv_item_id); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index ff9e021f8e..0a578fc0b3 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -732,7 +732,7 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, const BOOL needsSendToSim = false; // currently, this HUD effect doesn't need to pack and unpack data to do its job mVoiceVisualizer = ( LLVoiceVisualizer *)LLHUDManager::getInstance()->createViewerEffect( LLHUDObject::LL_HUD_EFFECT_VOICE_VISUALIZER, needsSendToSim ); - LL_DEBUGS("Avatar") << "LLVOAvatar Constructor (0x" << this << ") id:" << mID << LL_ENDL; + LL_DEBUGS("Avatar","Message") << "LLVOAvatar Constructor (0x" << this << ") id:" << mID << LL_ENDL; mPelvisp = NULL; -- cgit v1.3