aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/swr/rasterizer/common
diff options
context:
space:
mode:
authorTim Rowley <[email protected]>2016-10-03 16:39:10 -0500
committerTim Rowley <[email protected]>2016-10-11 11:22:04 -0500
commit6b3691c8762320df5afc8a7e79b9da09e272695b (patch)
tree8d0b45ee1180eb1ff49719a90f92d432f57aa149 /src/gallium/drivers/swr/rasterizer/common
parent2550b04179614da4c71dbef195d06a7f53273438 (diff)
swr: [rasterizer common] remove threadviz code
Signed-off-by: Tim Rowley <[email protected]>
Diffstat (limited to 'src/gallium/drivers/swr/rasterizer/common')
-rw-r--r--src/gallium/drivers/swr/rasterizer/common/rdtsc_buckets.cpp49
-rw-r--r--src/gallium/drivers/swr/rasterizer/common/rdtsc_buckets.h38
2 files changed, 0 insertions, 87 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/common/rdtsc_buckets.cpp b/src/gallium/drivers/swr/rasterizer/common/rdtsc_buckets.cpp
index 288b0719a04..79e82c4e6b3 100644
--- a/src/gallium/drivers/swr/rasterizer/common/rdtsc_buckets.cpp
+++ b/src/gallium/drivers/swr/rasterizer/common/rdtsc_buckets.cpp
@@ -46,17 +46,6 @@ BucketManager::~BucketManager()
void BucketManager::RegisterThread(const std::string& name)
{
- // lazy evaluate threadviz knob
- if (!mThreadViz && KNOB_BUCKETS_ENABLE_THREADVIZ)
- {
- uint32_t pid = GetCurrentProcessId();
- std::stringstream str;
- str << "threadviz." << pid;
- mThreadVizDir = str.str();
- CreateDirectory(mThreadVizDir.c_str(), NULL);
-
- mThreadViz = KNOB_BUCKETS_ENABLE_THREADVIZ;
- }
BUCKET_THREAD newThread;
newThread.name = name;
@@ -72,15 +61,6 @@ void BucketManager::RegisterThread(const std::string& name)
newThread.id = (UINT)id;
tlsThreadId = (UINT)id;
- // open threadviz file if enabled
- if (mThreadViz)
- {
- std::stringstream ss;
- ss << mThreadVizDir << PATH_SEPARATOR;
- ss << "threadviz_thread." << newThread.id << ".dat";
- newThread.vizFile = fopen(ss.str().c_str(), "wb");
- }
-
// store new thread
mThreads.push_back(newThread);
@@ -171,37 +151,8 @@ void BucketManager::PrintThread(FILE* f, const BUCKET_THREAD& thread)
}
}
-void BucketManager::DumpThreadViz()
-{
- // ensure all thread data is flushed
- mThreadMutex.lock();
- for (auto& thread : mThreads)
- {
- fflush(thread.vizFile);
- fclose(thread.vizFile);
- thread.vizFile = nullptr;
- }
- mThreadMutex.unlock();
-
- // dump bucket descriptions
- std::stringstream ss;
- ss << mThreadVizDir << PATH_SEPARATOR << "threadviz_buckets.dat";
-
- FILE* f = fopen(ss.str().c_str(), "wb");
- for (auto& bucket : mBuckets)
- {
- Serialize(f, bucket);
- }
- fclose(f);
-}
-
void BucketManager::PrintReport(const std::string& filename)
{
- if (mThreadViz)
- {
- DumpThreadViz();
- }
- else
{
FILE* f = fopen(filename.c_str(), "w");
diff --git a/src/gallium/drivers/swr/rasterizer/common/rdtsc_buckets.h b/src/gallium/drivers/swr/rasterizer/common/rdtsc_buckets.h
index e50a8a546c4..48042ac2233 100644
--- a/src/gallium/drivers/swr/rasterizer/common/rdtsc_buckets.h
+++ b/src/gallium/drivers/swr/rasterizer/common/rdtsc_buckets.h
@@ -55,17 +55,6 @@ public:
void ClearThreads()
{
mThreadMutex.lock();
- // close out the threadviz files if threadviz is enabled
- if (KNOB_BUCKETS_ENABLE_THREADVIZ)
- {
- for (auto& thread : mThreads)
- {
- if (thread.vizFile != nullptr)
- {
- fclose(thread.vizFile);
- }
- }
- }
mThreads.clear();
mThreadMutex.unlock();
}
@@ -88,9 +77,6 @@ public:
/// @return unique id
UINT RegisterBucket(const BUCKET_DESC& desc);
- // dump threadviz data
- void DumpThreadViz();
-
// print report
void PrintReport(const std::string& filename);
@@ -134,17 +120,6 @@ public:
uint64_t tsc = __rdtsc();
- // if threadviz is enabled, only need to dump start info to threads viz file
- if (mThreadViz)
- {
- SWR_ASSERT(bt.vizFile != nullptr);
- if (mBuckets[id].enableThreadViz)
- {
- VIZ_START_DATA data{ VIZ_START, id, tsc };
- Serialize(bt.vizFile, data);
- }
- }
- else
{
if (bt.pCurrent->children.size() < mBuckets.size())
{
@@ -176,16 +151,6 @@ public:
uint64_t tsc = __rdtsc();
- if (mThreadViz)
- {
- SWR_ASSERT(bt.vizFile != nullptr);
- if (mBuckets[id].enableThreadViz)
- {
- VIZ_STOP_DATA data{ VIZ_STOP, tsc };
- Serialize(bt.vizFile, data);
- }
- }
- else
{
if (bt.pCurrent->start == 0) return;
SWR_ASSERT(bt.pCurrent->id == id, "Mismatched buckets detected");
@@ -209,7 +174,6 @@ public:
BUCKET_THREAD& bt = mThreads[tlsThreadId];
// don't record events for threadviz
- if (!mThreadViz)
{
if (bt.pCurrent->children.size() < mBuckets.size())
{
@@ -240,8 +204,6 @@ private:
std::mutex mThreadMutex;
- // enable threadviz
- bool mThreadViz{ false };
std::string mThreadVizDir;
};