From 9d77e030d9a0d23cebce616631677459eec1612c Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 14 Nov 2012 23:52:27 -0800 Subject: SH-3406 WIP convert fast timers to lltrace system cleaning up build moved most includes of windows.h to llwin32headers.h to disable min/max macros, etc streamlined Time class and consolidated functionality in BlockTimer class llfasttimer is no longer included via llstring.h, so had to add it manually in several places --- indra/llinventory/llinventory.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llinventory/llinventory.cpp') diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp index fbf23bc3f0..43aa2ab799 100644 --- a/indra/llinventory/llinventory.cpp +++ b/indra/llinventory/llinventory.cpp @@ -28,6 +28,7 @@ #include "llinventory.h" #include "lldbstrings.h" +#include "llfasttimer.h" #include "llinventorydefines.h" #include "llxorcipher.h" #include "llsd.h" -- cgit v1.2.3 From e340009fc59d59e59b2e8d903a884acb76b178eb Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 9 Aug 2013 17:11:19 -0700 Subject: second phase summer cleaning replace llinfos, lldebugs, etc with new LL_INFOS(), LL_DEBUGS(), etc. --- indra/llinventory/llinventory.cpp | 74 +++++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 37 deletions(-) (limited to 'indra/llinventory/llinventory.cpp') diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp index 2a319c635f..38e01593ca 100755 --- a/indra/llinventory/llinventory.cpp +++ b/indra/llinventory/llinventory.cpp @@ -213,8 +213,8 @@ BOOL LLInventoryObject::importLegacyStream(std::istream& input_stream) } else { - llwarns << "unknown keyword '" << keyword - << "' in LLInventoryObject::importLegacyStream() for object " << mUUID << llendl; + LL_WARNS() << "unknown keyword '" << keyword + << "' in LLInventoryObject::importLegacyStream() for object " << mUUID << LL_ENDL; } } return TRUE; @@ -254,19 +254,19 @@ BOOL LLInventoryObject::exportLegacyStream(std::ostream& output_stream, BOOL) co void LLInventoryObject::removeFromServer() { // don't do nothin' - llwarns << "LLInventoryObject::removeFromServer() called. Doesn't do anything." << llendl; + LL_WARNS() << "LLInventoryObject::removeFromServer() called. Doesn't do anything." << LL_ENDL; } void LLInventoryObject::updateParentOnServer(BOOL) const { // don't do nothin' - llwarns << "LLInventoryObject::updateParentOnServer() called. Doesn't do anything." << llendl; + LL_WARNS() << "LLInventoryObject::updateParentOnServer() called. Doesn't do anything." << LL_ENDL; } void LLInventoryObject::updateServer(BOOL) const { // don't do nothin' - llwarns << "LLInventoryObject::updateServer() called. Doesn't do anything." << llendl; + LL_WARNS() << "LLInventoryObject::updateServer() called. Doesn't do anything." << LL_ENDL; } inline @@ -404,23 +404,23 @@ U32 LLInventoryItem::getCRC32() const // *NOTE: We currently do not validate the name or description, // but if they change in transit, it's no big deal. U32 crc = mUUID.getCRC32(); - //lldebugs << "1 crc: " << std::hex << crc << std::dec << llendl; + //LL_DEBUGS() << "1 crc: " << std::hex << crc << std::dec << LL_ENDL; crc += mParentUUID.getCRC32(); - //lldebugs << "2 crc: " << std::hex << crc << std::dec << llendl; + //LL_DEBUGS() << "2 crc: " << std::hex << crc << std::dec << LL_ENDL; crc += mPermissions.getCRC32(); - //lldebugs << "3 crc: " << std::hex << crc << std::dec << llendl; + //LL_DEBUGS() << "3 crc: " << std::hex << crc << std::dec << LL_ENDL; crc += mAssetUUID.getCRC32(); - //lldebugs << "4 crc: " << std::hex << crc << std::dec << llendl; + //LL_DEBUGS() << "4 crc: " << std::hex << crc << std::dec << LL_ENDL; crc += mType; - //lldebugs << "5 crc: " << std::hex << crc << std::dec << llendl; + //LL_DEBUGS() << "5 crc: " << std::hex << crc << std::dec << LL_ENDL; crc += mInventoryType; - //lldebugs << "6 crc: " << std::hex << crc << std::dec << llendl; + //LL_DEBUGS() << "6 crc: " << std::hex << crc << std::dec << LL_ENDL; crc += mFlags; - //lldebugs << "7 crc: " << std::hex << crc << std::dec << llendl; + //LL_DEBUGS() << "7 crc: " << std::hex << crc << std::dec << LL_ENDL; crc += mSaleInfo.getCRC32(); - //lldebugs << "8 crc: " << std::hex << crc << std::dec << llendl; + //LL_DEBUGS() << "8 crc: " << std::hex << crc << std::dec << LL_ENDL; crc += (U32)mCreationDate; - //lldebugs << "9 crc: " << std::hex << crc << std::dec << llendl; + //LL_DEBUGS() << "9 crc: " << std::hex << crc << std::dec << LL_ENDL; return crc; } @@ -577,13 +577,13 @@ BOOL LLInventoryItem::unpackMessage(LLMessageSystem* msg, const char* block, S32 #ifdef CRC_CHECK if(local_crc == remote_crc) { - lldebugs << "crc matches" << llendl; + LL_DEBUGS() << "crc matches" << LL_ENDL; return TRUE; } else { - llwarns << "inventory crc mismatch: local=" << std::hex << local_crc - << " remote=" << remote_crc << std::dec << llendl; + LL_WARNS() << "inventory crc mismatch: local=" << std::hex << local_crc + << " remote=" << remote_crc << std::dec << LL_ENDL; return FALSE; } #else @@ -719,7 +719,7 @@ BOOL LLInventoryItem::importFile(LLFILE* fp) const char *donkey = mDescription.c_str(); if (donkey[0] == '|') { - llerrs << "Donkey" << llendl; + LL_ERRS() << "Donkey" << LL_ENDL; } */ } @@ -731,8 +731,8 @@ BOOL LLInventoryItem::importFile(LLFILE* fp) } else { - llwarns << "unknown keyword '" << keyword - << "' in inventory import of item " << mUUID << llendl; + LL_WARNS() << "unknown keyword '" << keyword + << "' in inventory import of item " << mUUID << LL_ENDL; } } @@ -742,7 +742,7 @@ BOOL LLInventoryItem::importFile(LLFILE* fp) if((LLInventoryType::IT_NONE == mInventoryType) || !inventory_and_asset_types_match(mInventoryType, mType)) { - lldebugs << "Resetting inventory type for " << mUUID << llendl; + LL_DEBUGS() << "Resetting inventory type for " << mUUID << LL_ENDL; mInventoryType = LLInventoryType::defaultForAssetType(mType); } @@ -925,7 +925,7 @@ BOOL LLInventoryItem::importLegacyStream(std::istream& input_stream) const char *donkey = mDescription.c_str(); if (donkey[0] == '|') { - llerrs << "Donkey" << llendl; + LL_ERRS() << "Donkey" << LL_ENDL; } */ } @@ -937,8 +937,8 @@ BOOL LLInventoryItem::importLegacyStream(std::istream& input_stream) } else { - llwarns << "unknown keyword '" << keyword - << "' in inventory import of item " << mUUID << llendl; + LL_WARNS() << "unknown keyword '" << keyword + << "' in inventory import of item " << mUUID << LL_ENDL; } } @@ -948,7 +948,7 @@ BOOL LLInventoryItem::importLegacyStream(std::istream& input_stream) if((LLInventoryType::IT_NONE == mInventoryType) || !inventory_and_asset_types_match(mInventoryType, mType)) { - lldebugs << "Resetting inventory type for " << mUUID << llendl; + LL_DEBUGS() << "Resetting inventory type for " << mUUID << LL_ENDL; mInventoryType = LLInventoryType::defaultForAssetType(mType); } @@ -1175,7 +1175,7 @@ bool LLInventoryItem::fromLLSD(const LLSD& sd) if((LLInventoryType::IT_NONE == mInventoryType) || !inventory_and_asset_types_match(mInventoryType, mType)) { - lldebugs << "Resetting inventory type for " << mUUID << llendl; + LL_DEBUGS() << "Resetting inventory type for " << mUUID << LL_ENDL; mInventoryType = LLInventoryType::defaultForAssetType(mType); } @@ -1248,7 +1248,7 @@ void LLInventoryItem::unpackBinaryBucket(U8* bin_bucket, S32 bin_bucket_size) if (NULL == bin_bucket) { - llerrs << "unpackBinaryBucket failed. bin_bucket is NULL." << llendl; + LL_ERRS() << "unpackBinaryBucket failed. bin_bucket is NULL." << LL_ENDL; return; } @@ -1258,7 +1258,7 @@ void LLInventoryItem::unpackBinaryBucket(U8* bin_bucket, S32 bin_bucket_size) item_buffer[bin_bucket_size] = '\0'; std::string str(&item_buffer[0]); - lldebugs << "item buffer: " << str << llendl; + LL_DEBUGS() << "item buffer: " << str << LL_ENDL; // Tokenize the string. typedef boost::tokenizer > tokenizer; @@ -1295,7 +1295,7 @@ void LLInventoryItem::unpackBinaryBucket(U8* bin_bucket, S32 bin_bucket_size) perm.init(creator_id, owner_id, last_owner_id, group_id); perm.initMasks(mask_base, mask_owner, mask_group, mask_every, mask_next); setPermissions(perm); - //lldebugs << "perm: " << perm << llendl; + //LL_DEBUGS() << "perm: " << perm << LL_ENDL; LLUUID asset_id((*(iter++)).c_str()); setAssetUUID(asset_id); @@ -1496,8 +1496,8 @@ BOOL LLInventoryCategory::importFile(LLFILE* fp) } else { - llwarns << "unknown keyword '" << keyword - << "' in inventory import category " << mUUID << llendl; + LL_WARNS() << "unknown keyword '" << keyword + << "' in inventory import category " << mUUID << LL_ENDL; } } return TRUE; @@ -1575,8 +1575,8 @@ BOOL LLInventoryCategory::importLegacyStream(std::istream& input_stream) } else { - llwarns << "unknown keyword '" << keyword - << "' in inventory import category " << mUUID << llendl; + LL_WARNS() << "unknown keyword '" << keyword + << "' in inventory import category " << mUUID << LL_ENDL; } } return TRUE; @@ -1607,8 +1607,8 @@ LLSD ll_create_sd_from_inventory_item(LLPointer item) if(item.isNull()) return rv; if (item->getType() == LLAssetType::AT_NONE) { - llwarns << "ll_create_sd_from_inventory_item() for item with AT_NONE" - << llendl; + LL_WARNS() << "ll_create_sd_from_inventory_item() for item with AT_NONE" + << LL_ENDL; return rv; } rv[INV_ITEM_ID_LABEL] = item->getUUID(); @@ -1633,8 +1633,8 @@ LLSD ll_create_sd_from_inventory_category(LLPointer cat) if(cat.isNull()) return rv; if (cat->getType() == LLAssetType::AT_NONE) { - llwarns << "ll_create_sd_from_inventory_category() for cat with AT_NONE" - << llendl; + LL_WARNS() << "ll_create_sd_from_inventory_category() for cat with AT_NONE" + << LL_ENDL; return rv; } rv[INV_FOLDER_ID_LABEL] = cat->getUUID(); -- cgit v1.2.3 From cbe397ad13665c7bc993e10d8fe1e4a876253378 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 5 Sep 2013 14:04:13 -0700 Subject: changed fast timer over to using macro another attempt to move mem stat into base class --- indra/llinventory/llinventory.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llinventory/llinventory.cpp') diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp index 38e01593ca..d2efda8612 100755 --- a/indra/llinventory/llinventory.cpp +++ b/indra/llinventory/llinventory.cpp @@ -1049,11 +1049,11 @@ void LLInventoryItem::asLLSD( LLSD& sd ) const sd[INV_CREATION_DATE_LABEL] = (S32) mCreationDate; } -LLFastTimer::DeclareTimer FTM_INVENTORY_SD_DESERIALIZE("Inventory SD Deserialize"); +LLTrace::TimeBlock FTM_INVENTORY_SD_DESERIALIZE("Inventory SD Deserialize"); bool LLInventoryItem::fromLLSD(const LLSD& sd) { - LLFastTimer _(FTM_INVENTORY_SD_DESERIALIZE); + LL_RECORD_BLOCK_TIME(FTM_INVENTORY_SD_DESERIALIZE); mInventoryType = LLInventoryType::IT_NONE; mAssetUUID.setNull(); std::string w; -- cgit v1.2.3 From 12f0f8cb72f789e21b01b45063dcc5f1f5292087 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 1 Oct 2013 13:46:43 -0700 Subject: changed over to manual naming of MemTrackable stats changed claimMem and disclaimMem behavior to not pass through argument added more mem tracking stats to floater_stats --- indra/llinventory/llinventory.cpp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'indra/llinventory/llinventory.cpp') diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp index d2efda8612..61ba0939bf 100755 --- a/indra/llinventory/llinventory.cpp +++ b/indra/llinventory/llinventory.cpp @@ -72,17 +72,20 @@ const LLUUID MAGIC_ID("3c115e51-04f4-523c-9fa6-98aff1034730"); LLInventoryObject::LLInventoryObject(const LLUUID& uuid, const LLUUID& parent_uuid, LLAssetType::EType type, - const std::string& name) : + const std::string& name) +: LLTrace::MemTrackable("LLInventoryObject"), mUUID(uuid), mParentUUID(parent_uuid), mType(type), mName(name), mCreationDate(0) { + claimMem(mName); correctInventoryName(mName); } -LLInventoryObject::LLInventoryObject() : +LLInventoryObject::LLInventoryObject() +: LLTrace::MemTrackable("LLInventoryObject"), mType(LLAssetType::AT_NONE), mCreationDate(0) { @@ -97,7 +100,9 @@ void LLInventoryObject::copyObject(const LLInventoryObject* other) mUUID = other->mUUID; mParentUUID = other->mParentUUID; mType = other->mType; + disclaimMem(mName); mName = other->mName; + claimMem(mName); } const LLUUID& LLInventoryObject::getUUID() const @@ -150,7 +155,9 @@ void LLInventoryObject::rename(const std::string& n) correctInventoryName(new_name); if( !new_name.empty() && new_name != mName ) { + disclaimMem(mName); mName = new_name; + claimMem(mName); } } @@ -326,6 +333,8 @@ LLInventoryItem::LLInventoryItem(const LLUUID& uuid, LLStringUtil::replaceNonstandardASCII(mDescription, ' '); LLStringUtil::replaceChar(mDescription, '|', ' '); + claimMem(mDescription); + mPermissions.initMasks(inv_type); } @@ -357,7 +366,9 @@ void LLInventoryItem::copyItem(const LLInventoryItem* other) copyObject(other); mPermissions = other->mPermissions; mAssetUUID = other->mAssetUUID; + disclaimMem(mDescription); mDescription = other->mDescription; + claimMem(mDescription); mSaleInfo = other->mSaleInfo; mInventoryType = other->mInventoryType; mFlags = other->mFlags; @@ -432,7 +443,9 @@ void LLInventoryItem::setDescription(const std::string& d) LLStringUtil::replaceChar(new_desc, '|', ' '); if( new_desc != mDescription ) { + disclaimMem(mDescription); mDescription = new_desc; + claimMem(mDescription); } } @@ -713,7 +726,9 @@ BOOL LLInventoryItem::importFile(LLFILE* fp) valuestr[0] = '\000'; } + disclaimMem(mDescription); mDescription.assign(valuestr); + claimMem(mDescription); LLStringUtil::replaceNonstandardASCII(mDescription, ' '); /* TODO -- ask Ian about this code const char *donkey = mDescription.c_str(); @@ -919,8 +934,10 @@ BOOL LLInventoryItem::importLegacyStream(std::istream& input_stream) valuestr[0] = '\000'; } + disclaimMem(mDescription); mDescription.assign(valuestr); LLStringUtil::replaceNonstandardASCII(mDescription, ' '); + claimMem(mDescription); /* TODO -- ask Ian about this code const char *donkey = mDescription.c_str(); if (donkey[0] == '|') @@ -1160,8 +1177,10 @@ bool LLInventoryItem::fromLLSD(const LLSD& sd) w = INV_DESC_LABEL; if (sd.has(w)) { + disclaimMem(mDescription); mDescription = sd[w].asString(); LLStringUtil::replaceNonstandardASCII(mDescription, ' '); + claimMem(mDescription); } w = INV_CREATION_DATE_LABEL; if (sd.has(w)) -- cgit v1.2.3 From 697d2e720ba75e142a4d56ae8794bab8d7698dad Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 15 Oct 2013 20:24:42 -0700 Subject: renamed TimeBlock to BlockTimerStatHandle --- indra/llinventory/llinventory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llinventory/llinventory.cpp') diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp index 61ba0939bf..7fb2a801b2 100755 --- a/indra/llinventory/llinventory.cpp +++ b/indra/llinventory/llinventory.cpp @@ -1066,7 +1066,7 @@ void LLInventoryItem::asLLSD( LLSD& sd ) const sd[INV_CREATION_DATE_LABEL] = (S32) mCreationDate; } -LLTrace::TimeBlock FTM_INVENTORY_SD_DESERIALIZE("Inventory SD Deserialize"); +LLTrace::BlockTimerStatHandle FTM_INVENTORY_SD_DESERIALIZE("Inventory SD Deserialize"); bool LLInventoryItem::fromLLSD(const LLSD& sd) { -- cgit v1.2.3