From 819adb5eb4d7f982121f3dbd82750e05d26864d9 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 1 Nov 2012 00:26:44 -0700 Subject: SH-3405 FIX convert existing stats to lltrace system final removal of remaining LLStat code --- indra/llvfs/llvfile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llvfs/llvfile.cpp') diff --git a/indra/llvfs/llvfile.cpp b/indra/llvfs/llvfile.cpp index ca749c5eaf..7f631ef0bb 100644 --- a/indra/llvfs/llvfile.cpp +++ b/indra/llvfs/llvfile.cpp @@ -30,8 +30,8 @@ #include "llerror.h" #include "llthread.h" -#include "llstat.h" #include "llvfs.h" +#include "lltimer.h" const S32 LLVFile::READ = 0x00000001; const S32 LLVFile::WRITE = 0x00000002; -- cgit v1.2.3 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/llvfs/llvfile.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llvfs/llvfile.cpp') diff --git a/indra/llvfs/llvfile.cpp b/indra/llvfs/llvfile.cpp index 7f631ef0bb..d3f5673485 100644 --- a/indra/llvfs/llvfile.cpp +++ b/indra/llvfs/llvfile.cpp @@ -32,6 +32,7 @@ #include "llthread.h" #include "llvfs.h" #include "lltimer.h" +#include "llfasttimer.h" const S32 LLVFile::READ = 0x00000001; const S32 LLVFile::WRITE = 0x00000002; -- 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/llvfs/llvfile.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'indra/llvfs/llvfile.cpp') diff --git a/indra/llvfs/llvfile.cpp b/indra/llvfs/llvfile.cpp index ea67b8027b..2120812f91 100755 --- a/indra/llvfs/llvfile.cpp +++ b/indra/llvfs/llvfile.cpp @@ -73,7 +73,7 @@ LLVFile::~LLVFile() { if (!(mMode & LLVFile::WRITE)) { - //llwarns << "Destroying LLVFile with pending async read/write, aborting..." << llendl; + //LL_WARNS() << "Destroying LLVFile with pending async read/write, aborting..." << LL_ENDL; sVFSThread->setFlags(mHandle, LLVFSThread::FLAG_AUTO_COMPLETE | LLVFSThread::FLAG_ABORT); } else // WRITE @@ -89,13 +89,13 @@ BOOL LLVFile::read(U8 *buffer, S32 bytes, BOOL async, F32 priority) { if (! (mMode & READ)) { - llwarns << "Attempt to read from file " << mFileID << " opened with mode " << std::hex << mMode << std::dec << llendl; + LL_WARNS() << "Attempt to read from file " << mFileID << " opened with mode " << std::hex << mMode << std::dec << LL_ENDL; return FALSE; } if (mHandle != LLVFSThread::nullHandle()) { - llwarns << "Attempt to read from vfile object " << mFileID << " with pending async operation" << llendl; + LL_WARNS() << "Attempt to read from vfile object " << mFileID << " with pending async operation" << LL_ENDL; return FALSE; } mPriority = priority; @@ -199,11 +199,11 @@ BOOL LLVFile::write(const U8 *buffer, S32 bytes) { if (! (mMode & WRITE)) { - llwarns << "Attempt to write to file " << mFileID << " opened with mode " << std::hex << mMode << std::dec << llendl; + LL_WARNS() << "Attempt to write to file " << mFileID << " opened with mode " << std::hex << mMode << std::dec << LL_ENDL; } if (mHandle != LLVFSThread::nullHandle()) { - llerrs << "Attempt to write to vfile object " << mFileID << " with pending async operation" << llendl; + LL_ERRS() << "Attempt to write to vfile object " << mFileID << " with pending async operation" << LL_ENDL; return FALSE; } BOOL success = TRUE; @@ -233,7 +233,7 @@ BOOL LLVFile::write(const U8 *buffer, S32 bytes) if (wrote < bytes) { - llwarns << "Tried to write " << bytes << " bytes, actually wrote " << wrote << llendl; + LL_WARNS() << "Tried to write " << bytes << " bytes, actually wrote " << wrote << LL_ENDL; success = FALSE; } @@ -253,7 +253,7 @@ BOOL LLVFile::seek(S32 offset, S32 origin) { if (mMode == APPEND) { - llwarns << "Attempt to seek on append-only file" << llendl; + LL_WARNS() << "Attempt to seek on append-only file" << LL_ENDL; return FALSE; } @@ -268,14 +268,14 @@ BOOL LLVFile::seek(S32 offset, S32 origin) if (new_pos > size) { - llwarns << "Attempt to seek past end of file" << llendl; + LL_WARNS() << "Attempt to seek past end of file" << LL_ENDL; mPosition = size; return FALSE; } else if (new_pos < 0) { - llwarns << "Attempt to seek past beginning of file" << llendl; + LL_WARNS() << "Attempt to seek past beginning of file" << LL_ENDL; mPosition = 0; return FALSE; @@ -309,7 +309,7 @@ BOOL LLVFile::setMaxSize(S32 size) { if (! (mMode & WRITE)) { - llwarns << "Attempt to change size of file " << mFileID << " opened with mode " << std::hex << mMode << std::dec << llendl; + LL_WARNS() << "Attempt to change size of file " << mFileID << " opened with mode " << std::hex << mMode << std::dec << LL_ENDL; return FALSE; } @@ -322,7 +322,7 @@ BOOL LLVFile::setMaxSize(S32 size) { if (count % 100 == 0) { - llinfos << "VFS catching up... Pending: " << sVFSThread->getPending() << llendl; + LL_INFOS() << "VFS catching up... Pending: " << sVFSThread->getPending() << LL_ENDL; } if (sVFSThread->isPaused()) { @@ -338,14 +338,14 @@ BOOL LLVFile::rename(const LLUUID &new_id, const LLAssetType::EType new_type) { if (! (mMode & WRITE)) { - llwarns << "Attempt to rename file " << mFileID << " opened with mode " << std::hex << mMode << std::dec << llendl; + LL_WARNS() << "Attempt to rename file " << mFileID << " opened with mode " << std::hex << mMode << std::dec << LL_ENDL; return FALSE; } if (mHandle != LLVFSThread::nullHandle()) { - llwarns << "Renaming file with pending async read" << llendl; + LL_WARNS() << "Renaming file with pending async read" << LL_ENDL; } waitForLock(VFSLOCK_READ); @@ -365,18 +365,18 @@ BOOL LLVFile::rename(const LLUUID &new_id, const LLAssetType::EType new_type) BOOL LLVFile::remove() { -// llinfos << "Removing file " << mFileID << llendl; +// LL_INFOS() << "Removing file " << mFileID << LL_ENDL; if (! (mMode & WRITE)) { // Leaving paranoia warning just because this should be a very infrequent // operation. - llwarns << "Remove file " << mFileID << " opened with mode " << std::hex << mMode << std::dec << llendl; + LL_WARNS() << "Remove file " << mFileID << " opened with mode " << std::hex << mMode << std::dec << LL_ENDL; } if (mHandle != LLVFSThread::nullHandle()) { - llwarns << "Removing file with pending async read" << llendl; + LL_WARNS() << "Removing file with pending async read" << LL_ENDL; } // why not seek back to the beginning of the file too? -- 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/llvfs/llvfile.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/llvfs/llvfile.cpp') diff --git a/indra/llvfs/llvfile.cpp b/indra/llvfs/llvfile.cpp index 2120812f91..2af7a7d35d 100755 --- a/indra/llvfs/llvfile.cpp +++ b/indra/llvfs/llvfile.cpp @@ -40,7 +40,7 @@ const S32 LLVFile::WRITE = 0x00000002; const S32 LLVFile::READ_WRITE = 0x00000003; // LLVFile::READ & LLVFile::WRITE const S32 LLVFile::APPEND = 0x00000006; // 0x00000004 & LLVFile::WRITE -static LLFastTimer::DeclareTimer FTM_VFILE_WAIT("VFile Wait"); +static LLTrace::TimeBlock FTM_VFILE_WAIT("VFile Wait"); //---------------------------------------------------------------------------- LLVFSThread* LLVFile::sVFSThread = NULL; @@ -316,7 +316,7 @@ BOOL LLVFile::setMaxSize(S32 size) if (!mVFS->checkAvailable(size)) { - //LLFastTimer t(FTM_VFILE_WAIT); + //LL_RECORD_BLOCK_TIME(FTM_VFILE_WAIT); S32 count = 0; while (sVFSThread->getPending() > 1000) { @@ -424,7 +424,7 @@ bool LLVFile::isLocked(EVFSLock lock) void LLVFile::waitForLock(EVFSLock lock) { - //LLFastTimer t(FTM_VFILE_WAIT); + //LL_RECORD_BLOCK_TIME(FTM_VFILE_WAIT); // spin until the lock clears while (isLocked(lock)) { -- cgit v1.2.3 From 6115125dd2b065d7083357b02665d93d47468285 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 26 Sep 2013 11:20:11 -0700 Subject: BUILDFIX: ll_aligned_free call --- indra/llvfs/llvfile.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llvfs/llvfile.cpp') diff --git a/indra/llvfs/llvfile.cpp b/indra/llvfs/llvfile.cpp index 2af7a7d35d..9b57246ea1 100755 --- a/indra/llvfs/llvfile.cpp +++ b/indra/llvfs/llvfile.cpp @@ -137,12 +137,12 @@ U8* LLVFile::readFile(LLVFS *vfs, const LLUUID &uuid, LLAssetType::EType type, S } else { - data = (U8*) ll_aligned_malloc_16(file_size); + data = (U8*) ll_aligned_malloc(16, file_size); file.read(data, file_size); /* Flawfinder: ignore */ if (file.getLastBytesRead() != (S32)file_size) { - ll_aligned_free(data); + ll_aligned_free(16, data); data = NULL; file_size = 0; } -- cgit v1.2.3 From 1acceb3633c0f0c4fdf29b17d77d67c8a9b71986 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 14 Oct 2013 10:18:41 -0700 Subject: changed ll_aligned_(malloc|free) to take alignment size as a template argument --- indra/llvfs/llvfile.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llvfs/llvfile.cpp') diff --git a/indra/llvfs/llvfile.cpp b/indra/llvfs/llvfile.cpp index 9b57246ea1..add88fe0a3 100755 --- a/indra/llvfs/llvfile.cpp +++ b/indra/llvfs/llvfile.cpp @@ -137,12 +137,12 @@ U8* LLVFile::readFile(LLVFS *vfs, const LLUUID &uuid, LLAssetType::EType type, S } else { - data = (U8*) ll_aligned_malloc(16, file_size); + data = (U8*) ll_aligned_malloc<16>(file_size); file.read(data, file_size); /* Flawfinder: ignore */ if (file.getLastBytesRead() != (S32)file_size) { - ll_aligned_free(16, data); + ll_aligned_free<16>(data); data = NULL; file_size = 0; } -- 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/llvfs/llvfile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llvfs/llvfile.cpp') diff --git a/indra/llvfs/llvfile.cpp b/indra/llvfs/llvfile.cpp index add88fe0a3..34b61ee0a0 100755 --- a/indra/llvfs/llvfile.cpp +++ b/indra/llvfs/llvfile.cpp @@ -40,7 +40,7 @@ const S32 LLVFile::WRITE = 0x00000002; const S32 LLVFile::READ_WRITE = 0x00000003; // LLVFile::READ & LLVFile::WRITE const S32 LLVFile::APPEND = 0x00000006; // 0x00000004 & LLVFile::WRITE -static LLTrace::TimeBlock FTM_VFILE_WAIT("VFile Wait"); +static LLTrace::BlockTimerStatHandle FTM_VFILE_WAIT("VFile Wait"); //---------------------------------------------------------------------------- LLVFSThread* LLVFile::sVFSThread = NULL; -- cgit v1.2.3