summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Rowley <[email protected]>2016-05-04 09:24:55 -0600
committerTim Rowley <[email protected]>2016-05-19 16:25:30 -0500
commit4a58b21ef777e2e47d0ac9ead3d8dccae395df03 (patch)
treed95dda91ac4d4c27cf925957a34d26b3764e6d52
parent2031baffb592cb06e844d76cdaef9aab5c43b259 (diff)
swr: [rasterizer common] portable threadviz buckets
Output with slashes instead of backslashes for unix/linux. Reviewed-by: Bruce Cherniak <[email protected]>
-rw-r--r--src/gallium/drivers/swr/rasterizer/common/rdtsc_buckets.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/common/rdtsc_buckets.cpp b/src/gallium/drivers/swr/rasterizer/common/rdtsc_buckets.cpp
index 7163f9d3837..df09f6caadc 100644
--- a/src/gallium/drivers/swr/rasterizer/common/rdtsc_buckets.cpp
+++ b/src/gallium/drivers/swr/rasterizer/common/rdtsc_buckets.cpp
@@ -30,6 +30,14 @@
#include "rdtsc_buckets.h"
#include <inttypes.h>
+#if defined(_WIN32)
+#define PATH_SEPARATOR "\\"
+#elif defined(__unix__)
+#define PATH_SEPARATOR "/"
+#else
+#error "Unsupported platform"
+#endif
+
THREAD UINT tlsThreadId = 0;
void BucketManager::RegisterThread(const std::string& name)
@@ -64,7 +72,8 @@ void BucketManager::RegisterThread(const std::string& name)
if (mThreadViz)
{
std::stringstream ss;
- ss << mThreadVizDir << "\\threadviz_thread." << newThread.id << ".dat";
+ ss << mThreadVizDir << PATH_SEPARATOR;
+ ss << "threadviz_thread." << newThread.id << ".dat";
newThread.vizFile = fopen(ss.str().c_str(), "wb");
}
@@ -171,7 +180,7 @@ void BucketManager::DumpThreadViz()
// dump bucket descriptions
std::stringstream ss;
- ss << mThreadVizDir << "\\threadviz_buckets.dat";
+ ss << mThreadVizDir << PATH_SEPARATOR << "threadviz_buckets.dat";
FILE* f = fopen(ss.str().c_str(), "wb");
for (auto& bucket : mBuckets)