Changeset 2119
- Timestamp:
- 29/03/2008 01:56:39 (9 months ago)
- Location:
- box/trunk
- Files:
-
- 21 modified
-
bin/bbackupd/BackupClientDirectoryRecord.cpp (modified) (2 diffs)
-
bin/bbstored/BBStoreDHousekeeping.cpp (modified) (1 diff)
-
bin/bbstored/BackupContext.cpp (modified) (1 diff)
-
lib/backupclient/BackupStoreFileDiff.cpp (modified) (8 diffs)
-
lib/backupclient/BackupStoreFilenameClear.cpp (modified) (2 diffs)
-
lib/backupclient/BackupStoreObjectDump.cpp (modified) (2 diffs)
-
lib/backupstore/BackupStoreCheck.cpp (modified) (1 diff)
-
lib/backupstore/BackupStoreCheck2.cpp (modified) (9 diffs)
-
lib/backupstore/BackupStoreCheckData.cpp (modified) (1 diff)
-
lib/common/Box.h (modified) (2 diffs)
-
lib/common/Configuration.cpp (modified) (1 diff)
-
lib/common/DebugMemLeakFinder.cpp (modified) (3 diffs)
-
lib/common/Logging.h (modified) (2 diffs)
-
lib/common/PartialReadStream.cpp (modified) (1 diff)
-
lib/common/Utils.cpp (modified) (1 diff)
-
lib/compress/Compress.h (modified) (2 diffs)
-
lib/compress/CompressStream.cpp (modified) (1 diff)
-
lib/crypto/CipherContext.cpp (modified) (4 diffs)
-
lib/intercept/intercept.cpp (modified) (2 diffs)
-
lib/raidfile/RaidFileWrite.cpp (modified) (3 diffs)
-
lib/server/ProtocolUncertainStream.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
box/trunk/bin/bbackupd/BackupClientDirectoryRecord.cpp
r2041 r2119 1015 1015 if(mpPendingEntries != 0 && mpPendingEntries->size() == 0) 1016 1016 { 1017 TRACE1("Deleting mpPendingEntries from dir ID %lld\n", mObjectID); 1017 BOX_TRACE("Deleting mpPendingEntries from dir ID " << 1018 BOX_FORMAT_OBJECTID(mObjectID)); 1018 1019 delete mpPendingEntries; 1019 1020 mpPendingEntries = 0; … … 1250 1251 dirname.GetClearFilename()); 1251 1252 1252 TRACE1("Deleted directory record for"1253 " %s\n", name.c_str());1253 BOX_TRACE("Deleted directory record " 1254 "for " << name); 1254 1255 } 1255 1256 } -
box/trunk/bin/bbstored/BBStoreDHousekeeping.cpp
r1783 r2119 194 194 if(mInterProcessComms.GetLine(line, false /* no pre-processing */, MaximumWaitTime)) 195 195 { 196 TRACE1("Housekeeping received command '%s' over interprocess comms\n", line.c_str()); 196 BOX_TRACE("Housekeeping received command '" << line << 197 "' over interprocess comms"); 197 198 198 199 int account = 0; -
box/trunk/bin/bbstored/BackupContext.cpp
r2079 r2119 383 383 mSaveStoreInfoDelay = 0; 384 384 385 TRACE1("When allocating object ID, found that %lld is already in use\n", id); 385 BOX_WARNING("When allocating object ID, found that " << 386 BOX_FORMAT_OBJECTID(id) << " is already in use"); 386 387 } 387 388 -
box/trunk/lib/backupclient/BackupStoreFileDiff.cpp
r1940 r2119 150 150 bool canDiffFromThis = false; 151 151 LoadIndex(rDiffFromBlockIndex, DiffFromObjectID, &pindex, blocksInIndex, Timeout, canDiffFromThis); 152 // TRACE1("Diff: Blocks in index: %lld\n",blocksInIndex);152 // BOX_TRACE("Diff: Blocks in index: " << blocksInIndex); 153 153 154 154 if(!canDiffFromThis) … … 440 440 for(int t = 0; t < BACKUP_FILE_DIFF_MAX_BLOCK_SIZES; ++t) 441 441 { 442 TRACE3("Diff block size %d: %d (count = %lld)\n", t, Sizes[t], sizeCounts[t]); 442 BOX_TRACE("Diff block size " << t << ": " << 443 Sizes[t] << " (count = " << 444 sizeCounts[t] << ")"); 443 445 } 444 446 } … … 775 777 if(pHashTable[hash] != 0) 776 778 { 777 // TRACE1("Another hash entry for %d found\n", hash);779 //BOX_TRACE("Another hash entry for " << hash << " found"); 778 780 // Yes -- need to set the pointer in this entry to the current entry to build the linked list 779 781 pIndex[b].mpNextInHashList = pHashTable[hash]; … … 841 843 // Then go through the entries in the hash list, comparing with the strong digest calculated 842 844 scan = pFirstInHashList; 843 // TRACE0("second stage match\n");845 //BOX_TRACE("second stage match"); 844 846 while(scan != 0) 845 847 { 846 //TRACE3("scan size %d, block size %d, hash %d\n", scan->mSize, BlockSize, Hash); 848 //BOX_TRACE("scan size " << scan->mSize << 849 // ", block size " << BlockSize << 850 // ", hash " << Hash); 847 851 ASSERT(scan->mSize == BlockSize); 848 852 ASSERT(RollingChecksum::ExtractHashingComponent(scan->mWeakChecksum) == DEBUG_Hash); … … 851 855 if(strong.DigestMatches(scan->mStrongChecksum)) 852 856 { 853 // TRACE0("Match!\n");857 //BOX_TRACE("Match!\n"); 854 858 // Found! Add to list of found blocks... 855 859 int64_t fileOffset = (FileBlockNumber * BlockSize) + Offset; … … 913 917 if(BackupStoreFile::TraceDetailsOfDiffProcess) 914 918 { 915 TRACE1("Diff: Default recipe generated, %lld bytes of file\n", SizeOfInputFile); 919 BOX_TRACE("Diff: Default recipe generated, " << 920 SizeOfInputFile << " bytes of file"); 916 921 } 917 922 #endif … … 1006 1011 // dump out the recipe 1007 1012 #ifndef NDEBUG 1008 TRACE2("Diff: %lld new bytes found, %lld old blocks used\n", debug_NewBytesFound, debug_OldBlocksUsed); 1013 BOX_TRACE("Diff: " << 1014 debug_NewBytesFound << " new bytes found, " << 1015 debug_OldBlocksUsed << " old blocks used"); 1009 1016 if(BackupStoreFile::TraceDetailsOfDiffProcess) 1010 1017 { 1011 TRACE1("Diff: Recipe generated (size %d)\n======== ========= ========\nSpace b4 FirstBlk NumBlks\n", rRecipe.size()); 1018 BOX_TRACE("Diff: Recipe generated (size " << rRecipe.size()); 1019 BOX_TRACE("======== ========= ========"); 1020 BOX_TRACE("Space b4 FirstBlk NumBlks"); 1012 1021 { 1013 1022 for(unsigned int e = 0; e < rRecipe.size(); ++e) … … 1019 1028 sprintf(b, "%8lld", (int64_t)(rRecipe[e].mpStartBlock - pIndex)); 1020 1029 #endif 1021 TRACE3("%8lld %s %8lld\n", rRecipe[e].mSpaceBefore, (rRecipe[e].mpStartBlock == 0)?" -":b, (int64_t)rRecipe[e].mBlocks); 1022 } 1023 } 1024 TRACE0("======== ========= ========\n"); 1030 BOX_TRACE(std::setw(8) << 1031 rRecipe[e].mSpaceBefore << 1032 " " << 1033 ((rRecipe[e].mpStartBlock == 0)?" -":b) << 1034 " " << std::setw(8) << 1035 rRecipe[e].mBlocks); 1036 } 1037 } 1038 BOX_TRACE("======== ========= ========"); 1025 1039 } 1026 1040 #endif -
box/trunk/lib/backupclient/BackupStoreFilenameClear.cpp
r1471 r2119 168 168 { 169 169 case Encoding_Clear: 170 TRACE0("**** BackupStoreFilename encoded with Clear encoding ****\n"); 170 BOX_TRACE("**** BackupStoreFilename encoded with " 171 "Clear encoding ****"); 171 172 mClearFilename.assign(c_str() + 2, size - 2); 172 173 break; … … 194 195 { 195 196 #ifndef WIN32 196 TRACE1("Allocating filename encoding/decoding buffer with size %d\n", BufSize); 197 BOX_TRACE("Allocating filename encoding/decoding buffer " 198 "with size " << BufSize); 197 199 #endif 198 200 spEncDecBuffer = new MemoryBlockGuard<uint8_t *>(BufSize); -
box/trunk/lib/backupclient/BackupStoreObjectDump.cpp
r879 r2119 48 48 if(ToTrace) 49 49 { 50 TRACE1("%s",text);50 BOX_TRACE(text); 51 51 } 52 52 } … … 212 212 { 213 213 nnew++; 214 TRACE2("%8lld this s=%8lld\n", b, s); 214 BOX_TRACE(std::setw(8) << b << " this s=" << 215 std::setw(8) << s); 215 216 } 216 217 else 217 218 { 218 219 nold++; 219 TRACE2("%8lld other i=%8lld\n", b, 0 - s); 220 } 221 } 222 TRACE0("======== ===== ==========\n"); 220 BOX_TRACE(std::setw(8) << b << " other i=" << 221 std::setw(8) << 0 - s); 222 } 223 } 224 BOX_TRACE("======== ===== =========="); 223 225 } 224 226 -
box/trunk/lib/backupstore/BackupStoreCheck.cpp
r1789 r2119 269 269 270 270 maxDir = CheckObjectsScanDir(0, 1, mStoreRoot); 271 TRACE1("Max dir starting ID is %llx\n", maxDir); 271 BOX_TRACE("Max dir starting ID is " << 272 BOX_FORMAT_OBJECTID(maxDir)); 272 273 } 273 274 -
box/trunk/lib/backupstore/BackupStoreCheck2.cpp
r1789 r2119 595 595 } 596 596 597 #define FMT_OID(x) BOX_FORMAT_OBJECTID(x) 598 #define FMT_i BOX_FORMAT_OBJECTID((*i)->GetObjectID()) 597 599 598 600 // -------------------------------------------------------------------------- … … 621 623 { 622 624 // Depends on something, but it isn't there. 623 TRACE2("Entry id %llx removed because depends on newer version %llx which doesn't exist\n", (*i)->GetObjectID(), dependsNewer); 625 BOX_TRACE("Entry id " << FMT_i << 626 " removed because depends " 627 "on newer version " << 628 FMT_OID(dependsNewer) << 629 " which doesn't exist"); 624 630 625 631 // Remove … … 639 645 { 640 646 // Wrong entry 641 TRACE3("Entry id %llx, correcting DependsOlder to %llx, was %llx\n", dependsNewer, (*i)->GetObjectID(), newerEn->GetDependsOlder()); 647 BOX_TRACE("Entry id " << 648 FMT_OID(dependsNewer) << 649 ", correcting DependsOlder to " << 650 FMT_i << 651 ", was " << 652 FMT_OID(newerEn->GetDependsOlder())); 642 653 newerEn->SetDependsOlder((*i)->GetObjectID()); 643 654 // Mark as changed … … 658 669 { 659 670 // Has an older version marked, but this doesn't exist. Remove this mark 660 TRACE2("Entry id %llx was marked that %llx depended on it, which doesn't exist, dependency info cleared\n", (*i)->GetObjectID(), dependsOlder); 671 BOX_TRACE("Entry id " << FMT_i << 672 " was marked as depended on by " << 673 FMT_OID(dependsOlder) << ", " 674 "which doesn't exist, dependency " 675 "info cleared"); 661 676 662 677 (*i)->SetDependsOlder(0); … … 694 709 if((*i) == 0) 695 710 { 696 TRACE0("Remove because null pointer found\n");711 BOX_TRACE("Remove because null pointer found"); 697 712 removeEntry = true; 698 713 } … … 705 720 { 706 721 // Bad! Unset the file flag 707 TRACE1("Entry %llx: File flag set when dir flag set\n", (*i)->GetObjectID()); 722 BOX_TRACE("Entry " << FMT_i << 723 ": File flag and dir flag both set"); 708 724 (*i)->RemoveFlags(Entry::Flags_File); 709 725 changed = true; … … 714 730 { 715 731 // ID already seen, or type doesn't match 716 TRACE1("Entry %llx: Remove because ID already seen\n", (*i)->GetObjectID()); 732 BOX_TRACE("Entry " << FMT_i << 733 ": Remove because ID already seen"); 717 734 removeEntry = true; 718 735 } … … 731 748 { 732 749 // Not set, set it 733 TRACE1("Entry %llx: Set old flag\n", (*i)->GetObjectID()); 750 BOX_TRACE("Entry " << FMT_i << 751 ": Set old flag"); 734 752 (*i)->AddFlags(Entry::Flags_OldVersion); 735 753 changed = true; … … 742 760 { 743 761 // Set, unset it 744 TRACE1("Entry %llx: Old flag unset\n", (*i)->GetObjectID()); 762 BOX_TRACE("Entry " << FMT_i << 763 ": Old flag unset"); 745 764 (*i)->RemoveFlags(Entry::Flags_OldVersion); 746 765 changed = true; -
box/trunk/lib/backupstore/BackupStoreCheckData.cpp
r217 r2119 190 190 IDBlock *pblock = i->second; 191 191 int32_t bentries = (pblock == mpInfoLastBlock)?mInfoLastBlockEntries:BACKUPSTORECHECK_BLOCK_SIZE; 192 TRACE2("BLOCK @ 0x%08x, %d entries\n", pblock, bentries); 192 BOX_TRACE("BLOCK @ " << BOX_FORMAT_HEX32(pblock) << 193 ", " << bentries << " entries"); 193 194 194 195 for(int e = 0; e < bentries; ++e) 195 196 { 196 197 uint8_t flags = GetFlags(pblock, e); 197 TRACE4("id %llx, c %llx, %s, %s\n", 198 pblock->mID[e], pblock->mContainer[e], 199 (flags & Flags_IsDir)?"dir":"file", 200 (flags & Flags_IsContained)?"contained":"unattached"); 198 BOX_TRACE(std::hex << 199 "id " << pblock->mID[e] << 200 ", c " << pblock->mContainer[e] << 201 ", " << ((flags & Flags_IsDir)?"dir":"file") << 202 ", " << ((flags & Flags_IsContained) ? 203 "contained":"unattached")); 201 204 } 202 205 } -
box/trunk/lib/common/Box.h
r2050 r2119 53 53 int BoxDebug_printf(const char *format, ...); 54 54 int BoxDebugTrace(const char *format, ...); 55 #define TRACE0(msg) {BoxDebugTrace("%s", msg);}56 #define TRACE1(msg, a0) {BoxDebugTrace(msg, a0);}57 #define TRACE2(msg, a0, a1) {BoxDebugTrace(msg, a0, a1);}58 #define TRACE3(msg, a0, a1, a2) {BoxDebugTrace(msg, a0, a1, a2);}59 #define TRACE4(msg, a0, a1, a2, a3) {BoxDebugTrace(msg, a0, a1, a2, a3);}60 #define TRACE5(msg, a0, a1, a2, a3, a4) {BoxDebugTrace(msg, a0, a1, a2, a3, a4);}61 #define TRACE6(msg, a0, a1, a2, a3, a4, a5) {BoxDebugTrace(msg, a0, a1, a2, a3, a4, a5);}62 #define TRACE7(msg, a0, a1, a2, a3, a4, a5, a6) {BoxDebugTrace(msg, a0, a1, a2, a3, a4, a5, a6);}63 #define TRACE8(msg, a0, a1, a2, a3, a4, a5, a6, a7) {BoxDebugTrace(msg, a0, a1, a2, a3, a4, a5, a6, a7);}64 55 65 56 #ifndef PLATFORM_DISABLE_MEM_LEAK_TESTING … … 77 68 #define TRACE_TO_STDOUT(x) {} 78 69 79 #define TRACE0(msg)80 #define TRACE1(msg, a0)81 #define TRACE2(msg, a0, a1)82 #define TRACE3(msg, a0, a1, a2)83 #define TRACE4(msg, a0, a1, a2, a3)84 #define TRACE5(msg, a0, a1, a2, a3, a4)85 #define TRACE6(msg, a0, a1, a2, a3, a4, a5)86 #define TRACE7(msg, a0, a1, a2, a3, a4, a5, a6)87 #define TRACE8(msg, a0, a1, a2, a3, a4, a5, a6, a7)88 89 70 // Box Backup builds release get extra information for exception logging 90 71 #define EXCEPTION_CODENAMES_EXTENDED -
box/trunk/lib/common/Configuration.cpp
r2116 r2119 209 209 { 210 210 // An error occured, return now 211 //TRACE1("Error message from LoadInto: %s", rErrorMsg.c_str());212 TRACE0("Error at Configuration::LoadInfo\n");211 BOX_ERROR("Error in Configuration::LoadInfo: " << 212 rErrorMsg); 213 213 delete pconfig; 214 214 pconfig = 0; -
box/trunk/lib/common/DebugMemLeakFinder.cpp
r2053 r2119 147 147 if(ptr && i == sMallocBlocks.end()) 148 148 { 149 TRACE1("Block %x realloc(), but not in list. Error? Or allocated in startup static objects?\n", ptr); 149 BOX_WARNING("Block " << ptr << " realloc()ated, but not " 150 "in list. Error? Or allocated in startup static " 151 "objects?"); 150 152 } 151 153 … … 194 196 else 195 197 { 196 TRACE1("Block %p freed, but not known. Error? Or allocated in startup static allocation?\n", ptr); 198 BOX_WARNING("Block " << ptr << " freed, but not " 199 "known. Error? Or allocated in startup " 200 "static allocation?"); 197 201 } 198 202 … … 294 298 if(i == sMallocBlocks.end()) 295 299 { 296 TRACE0("Logical error in section block finding\n");300 BOX_WARNING("Logical error in section block finding"); 297 301 } 298 302 else 299 303 { 300 TRACE4("Block %p size %d allocated at %s:%d\n", i->first, i->second.size, i->second.file, i->second.line); 304 BOX_TRACE("Block " << i->first << " size " << 305 i->second.size << " allocated at " << 306 i->second.file << ":" << i->second.line); 301 307 } 302 308 } 303 309 for(std::map<void *, ObjectInfo>::const_iterator i(sSectionObjectBlocks.begin()); i != sSectionObjectBlocks.end(); ++i) 304 310 { 305 TRACE5("Object%s %p size %d allocated at %s:%d\n", i->second.array?" []":"", i->first, i->second.size, i->second.file, i->second.line); 311 BOX_TRACE("Object" << (i->second.array?" []":"") << " " << 312 i->first << " size " << i->second.size << 313 " allocated at " << i->second.file << 314 ":" << i->second.line); 306 315 } 307 316 } -
box/trunk/lib/common/Logging.h
r2115 r2119 63 63 #endif 64 64 65 #define BOX_FORMAT_ ACCOUNT(accno) \65 #define BOX_FORMAT_HEX32(number) \ 66 66 std::hex << \ 67 67 std::showbase << \ … … 69 69 std::setw(10) << \ 70 70 std::setfill('0') << \ 71 ( accno) << \71 (number) << \ 72 72 std::dec 73 74 #define BOX_FORMAT_ACCOUNT(accno) \ 75 BOX_FORMAT_HEX32(accno) 73 76 74 77 #define BOX_FORMAT_OBJECTID(objectid) \ -
box/trunk/lib/common/PartialReadStream.cpp
r1586 r2119 45 45 if(mBytesLeft != 0) 46 46 { 47 TRACE1("PartialReadStream::~PartialReadStream when mBytesLeft = %d\n", mBytesLeft); 47 BOX_TRACE("PartialReadStream destroyed with " << mBytesLeft << 48 " bytes remaining"); 48 49 } 49 50 } -
box/trunk/lib/common/Utils.cpp
r1923 r2119 54 54 } 55 55 /*#ifndef NDEBUG 56 TRACE2("Splitting string '%s' on %c\n", String.c_str(),SplitOn);56 BOX_TRACE("Splitting string '" << String << " on " << (char)SplitOn); 57 57 for(unsigned int l = 0; l < rOutput.size(); ++l) 58 58 { 59 TRACE2("%d = '%s'\n", l, rOutput[l].c_str());59 BOX_TRACE(l << " = '" << rOutput[l] << "'"); 60 60 } 61 61 #endif*/ -
box/trunk/lib/compress/Compress.h
r1868 r2119 53 53 :(inflateEnd(&mStream)))) != Z_OK) 54 54 { 55 TRACE1("zlib error code = %d\n",r);55 BOX_WARNING("zlib error code = " << r); 56 56 if(r == Z_DATA_ERROR) 57 57 { 58 TRACE0("WARNING: End of compress/decompress without all input being consumed -- possible corruption?\n"); 58 BOX_WARNING("End of compress/decompress "
