mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-24 02:50:39 +02:00
swr: [rasterizer common] portable threadviz buckets
Output with slashes instead of backslashes for unix/linux. Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
This commit is contained in:
parent
2031baffb5
commit
4a58b21ef7
1 changed files with 11 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue