mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-21 22:24:35 +00:00
Drop support for Cygwin.
This commit is contained in:
parent
12f693372a
commit
07bc665d8c
4
NEWS
4
NEWS
@ -6,7 +6,9 @@ here.
|
||||
v0.x.x (xxxx-xx-xx)
|
||||
-------------------
|
||||
|
||||
- Cygwin and Mingw are deprecated due to lack of interest.
|
||||
- Support for Cygwin has been dropped. It was not working for a very long
|
||||
time and nobody had complained about it.
|
||||
- Mingw is deprecated due to lack of interest.
|
||||
- Added TRACY_NO_CALLSTACK_INLINES macro to disable inline functions
|
||||
resolution in call stacks on Windows.
|
||||
- Limited client query response rate.
|
||||
|
@ -69,7 +69,7 @@ public:
|
||||
VkTimeDomainEXT data[4];
|
||||
_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT( physdev, &num, data );
|
||||
VkTimeDomainEXT supportedDomain = VK_TIME_DOMAIN_MAX_ENUM_EXT;
|
||||
#if defined _WIN32 || defined __CYGWIN__
|
||||
#if defined _WIN32
|
||||
supportedDomain = VK_TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_EXT;
|
||||
#elif defined __linux__ && defined CLOCK_MONOTONIC_RAW
|
||||
supportedDomain = VK_TIME_DOMAIN_CLOCK_MONOTONIC_RAW_EXT;
|
||||
@ -155,7 +155,7 @@ public:
|
||||
}
|
||||
m_deviation = minDeviation * 3 / 2;
|
||||
|
||||
#if defined _WIN32 || defined __CYGWIN__
|
||||
#if defined _WIN32
|
||||
m_qpcToNs = int64_t( 1000000000. / GetFrequencyQpc() );
|
||||
#endif
|
||||
|
||||
@ -304,7 +304,7 @@ private:
|
||||
}
|
||||
while( deviation > m_deviation );
|
||||
|
||||
#if defined _WIN32 || defined __CYGWIN__
|
||||
#if defined _WIN32
|
||||
tGpu = ts[0];
|
||||
tCpu = ts[1] * m_qpcToNs;
|
||||
#elif defined __linux__ && defined CLOCK_MONOTONIC_RAW
|
||||
|
@ -115,7 +115,7 @@ extern "C"
|
||||
t_SymGetLineFromInlineContext _SymGetLineFromInlineContext = 0;
|
||||
}
|
||||
|
||||
#ifndef __CYGWIN__
|
||||
|
||||
struct ModuleCache
|
||||
{
|
||||
uint64_t start;
|
||||
@ -134,7 +134,7 @@ struct KernelDriver
|
||||
|
||||
KernelDriver* s_krnlCache = nullptr;
|
||||
size_t s_krnlCacheCnt;
|
||||
#endif
|
||||
|
||||
|
||||
void InitCallstack()
|
||||
{
|
||||
@ -152,7 +152,6 @@ void InitCallstack()
|
||||
SymInitialize( GetCurrentProcess(), nullptr, true );
|
||||
SymSetOptions( SYMOPT_LOAD_LINES );
|
||||
|
||||
#ifndef __CYGWIN__
|
||||
DWORD needed;
|
||||
LPVOID dev[4096];
|
||||
if( EnumDeviceDrivers( dev, sizeof(dev), &needed ) != 0 )
|
||||
@ -231,7 +230,6 @@ void InitCallstack()
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef TRACY_DBGHELP_LOCK
|
||||
DBGHELP_UNLOCK;
|
||||
@ -278,7 +276,6 @@ static const char* GetModuleName( uint64_t addr )
|
||||
{
|
||||
if( ( addr >> 63 ) != 0 )
|
||||
{
|
||||
#ifndef __CYGWIN__
|
||||
if( s_krnlCache )
|
||||
{
|
||||
auto it = std::lower_bound( s_krnlCache, s_krnlCache + s_krnlCacheCnt, addr, []( const KernelDriver& lhs, const uint64_t& rhs ) { return lhs.addr > rhs; } );
|
||||
@ -287,11 +284,9 @@ static const char* GetModuleName( uint64_t addr )
|
||||
return it->mod;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return "<kernel>";
|
||||
}
|
||||
|
||||
#ifndef __CYGWIN__
|
||||
for( auto& v : *s_modCache )
|
||||
{
|
||||
if( addr >= v.start && addr < v.end )
|
||||
@ -338,8 +333,6 @@ static const char* GetModuleName( uint64_t addr )
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return "[unknown]";
|
||||
}
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
#ifndef __TRACYCALLSTACK_H__
|
||||
#define __TRACYCALLSTACK_H__
|
||||
|
||||
#if !defined _WIN32 && !defined __CYGWIN__
|
||||
#if !defined _WIN32
|
||||
# include <sys/param.h>
|
||||
#endif
|
||||
|
||||
#if defined _WIN32 || defined __CYGWIN__
|
||||
#if defined _WIN32
|
||||
# define TRACY_HAS_CALLSTACK 1
|
||||
#elif defined __ANDROID__
|
||||
# if !defined __arm__ || __ANDROID_API__ >= 21
|
||||
|
@ -14,12 +14,6 @@
|
||||
# include <sys/param.h>
|
||||
#endif
|
||||
|
||||
#ifdef __CYGWIN__
|
||||
# include <windows.h>
|
||||
# include <unistd.h>
|
||||
# include <tlhelp32.h>
|
||||
#endif
|
||||
|
||||
#ifdef _GNU_SOURCE
|
||||
# include <errno.h>
|
||||
#endif
|
||||
@ -95,7 +89,7 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined _WIN32 || defined __CYGWIN__
|
||||
#if defined _WIN32
|
||||
# include <lmcons.h>
|
||||
extern "C" typedef LONG (WINAPI *t_RtlGetVersion)( PRTL_OSVERSIONINFOW );
|
||||
extern "C" typedef BOOL (WINAPI *t_GetLogicalProcessorInformationEx)( LOGICAL_PROCESSOR_RELATIONSHIP, PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX, PDWORD );
|
||||
@ -108,11 +102,11 @@ extern "C" typedef BOOL (WINAPI *t_GetLogicalProcessorInformationEx)( LOGICAL_PR
|
||||
# include <sys/utsname.h>
|
||||
#endif
|
||||
|
||||
#if !defined _WIN32 && !defined __CYGWIN__ && ( defined __i386 || defined _M_IX86 || defined __x86_64__ || defined _M_X64 )
|
||||
#if !defined _WIN32 && ( defined __i386 || defined _M_IX86 || defined __x86_64__ || defined _M_X64 )
|
||||
# include <cpuid.h>
|
||||
#endif
|
||||
|
||||
#if !( ( ( defined _WIN32 || defined __CYGWIN__ ) && _WIN32_WINNT >= _WIN32_WINNT_VISTA ) || defined __linux__ )
|
||||
#if !( ( defined _WIN32 && _WIN32_WINNT >= _WIN32_WINNT_VISTA ) || defined __linux__ )
|
||||
# include <mutex>
|
||||
#endif
|
||||
|
||||
@ -142,7 +136,7 @@ struct ThreadHandleWrapper
|
||||
static inline void CpuId( uint32_t* regs, uint32_t leaf )
|
||||
{
|
||||
memset(regs, 0, sizeof(uint32_t) * 4);
|
||||
#if defined _WIN32 || defined __CYGWIN__
|
||||
#if defined _WIN32
|
||||
__cpuidex( (int*)regs, leaf, 0 );
|
||||
#else
|
||||
__get_cpuid( leaf, regs, regs+1, regs+2, regs+3 );
|
||||
@ -151,7 +145,7 @@ static inline void CpuId( uint32_t* regs, uint32_t leaf )
|
||||
|
||||
static void InitFailure( const char* msg )
|
||||
{
|
||||
#if defined _WIN32 || defined __CYGWIN__
|
||||
#if defined _WIN32
|
||||
bool hasConsole = false;
|
||||
bool reopen = false;
|
||||
const auto attached = AttachConsole( ATTACH_PARENT_PROCESS );
|
||||
@ -199,7 +193,7 @@ static int64_t SetupHwTimer()
|
||||
const char* noCheck = GetEnvVar( "TRACY_NO_INVARIANT_CHECK" );
|
||||
if( !noCheck || noCheck[0] != '1' )
|
||||
{
|
||||
#if defined _WIN32 || defined __CYGWIN__
|
||||
#if defined _WIN32
|
||||
InitFailure( "CPU doesn't support invariant TSC.\nDefine TRACY_NO_INVARIANT_CHECK=1 to ignore this error, *if you know what you are doing*.\nAlternatively you may rebuild the application with the TRACY_TIMER_QPC or TRACY_TIMER_FALLBACK define to use lower resolution timer." );
|
||||
#else
|
||||
InitFailure( "CPU doesn't support invariant TSC.\nDefine TRACY_NO_INVARIANT_CHECK=1 to ignore this error, *if you know what you are doing*.\nAlternatively you may rebuild the application with the TRACY_TIMER_FALLBACK define to use lower resolution timer." );
|
||||
@ -233,7 +227,7 @@ static const char* GetProcessName()
|
||||
auto buf = getprogname();
|
||||
if( buf ) processName = buf;
|
||||
# endif
|
||||
#elif defined _GNU_SOURCE || defined __CYGWIN__
|
||||
#elif defined _GNU_SOURCE
|
||||
if( program_invocation_short_name ) processName = program_invocation_short_name;
|
||||
#elif defined __APPLE__ || defined BSD
|
||||
auto buf = getprogname();
|
||||
@ -250,7 +244,7 @@ static const char* GetProcessExecutablePath()
|
||||
return buf;
|
||||
#elif defined __ANDROID__
|
||||
return nullptr;
|
||||
#elif defined _GNU_SOURCE || defined __CYGWIN__
|
||||
#elif defined _GNU_SOURCE
|
||||
return program_invocation_name;
|
||||
#elif defined __APPLE__
|
||||
static char buf[1024];
|
||||
@ -304,13 +298,11 @@ static const char* GetHostInfo()
|
||||
{
|
||||
static char buf[1024];
|
||||
auto ptr = buf;
|
||||
#if defined _WIN32 || defined __CYGWIN__
|
||||
#if defined _WIN32
|
||||
t_RtlGetVersion RtlGetVersion = (t_RtlGetVersion)GetProcAddress( GetModuleHandleA( "ntdll.dll" ), "RtlGetVersion" );
|
||||
if( !RtlGetVersion )
|
||||
{
|
||||
# ifdef __CYGWIN__
|
||||
ptr += sprintf( ptr, "OS: Windows (Cygwin)\n" );
|
||||
# elif defined __MINGW32__
|
||||
# ifdef __MINGW32__
|
||||
ptr += sprintf( ptr, "OS: Windows (MingW)\n" );
|
||||
# else
|
||||
ptr += sprintf( ptr, "OS: Windows\n" );
|
||||
@ -321,9 +313,7 @@ static const char* GetHostInfo()
|
||||
RTL_OSVERSIONINFOW ver = { sizeof( RTL_OSVERSIONINFOW ) };
|
||||
RtlGetVersion( &ver );
|
||||
|
||||
# ifdef __CYGWIN__
|
||||
ptr += sprintf( ptr, "OS: Windows %i.%i.%i (Cygwin)\n", ver.dwMajorVersion, ver.dwMinorVersion, ver.dwBuildNumber );
|
||||
# elif defined __MINGW32__
|
||||
# ifdef __MINGW32__
|
||||
ptr += sprintf( ptr, "OS: Windows %i.%i.%i (MingW)\n", (int)ver.dwMajorVersion, (int)ver.dwMinorVersion, (int)ver.dwBuildNumber );
|
||||
# else
|
||||
ptr += sprintf( ptr, "OS: Windows %i.%i.%i\n", ver.dwMajorVersion, ver.dwMinorVersion, ver.dwBuildNumber );
|
||||
@ -371,10 +361,9 @@ static const char* GetHostInfo()
|
||||
ptr += sprintf( ptr, "Compiler: unknown\n" );
|
||||
#endif
|
||||
|
||||
#if defined _WIN32 || defined __CYGWIN__
|
||||
# ifndef __CYGWIN__
|
||||
#if defined _WIN32
|
||||
InitWinSock();
|
||||
# endif
|
||||
|
||||
char hostname[512];
|
||||
gethostname( hostname, 512 );
|
||||
|
||||
@ -492,7 +481,7 @@ static const char* GetHostInfo()
|
||||
|
||||
ptr += sprintf( ptr, "CPU cores: %i\n", std::thread::hardware_concurrency() );
|
||||
|
||||
#if defined _WIN32 || defined __CYGWIN__
|
||||
#if defined _WIN32
|
||||
MEMORYSTATUSEX statex;
|
||||
statex.dwLength = sizeof( statex );
|
||||
GlobalMemoryStatusEx( &statex );
|
||||
@ -524,7 +513,7 @@ static const char* GetHostInfo()
|
||||
|
||||
static uint64_t GetPid()
|
||||
{
|
||||
#if defined _WIN32 || defined __CYGWIN__
|
||||
#if defined _WIN32
|
||||
return uint64_t( GetCurrentProcessId() );
|
||||
#else
|
||||
return uint64_t( getpid() );
|
||||
@ -562,7 +551,7 @@ static BroadcastMessage& GetBroadcastMessage( const char* procname, size_t pnsz,
|
||||
return msg;
|
||||
}
|
||||
|
||||
#if defined _WIN32 || defined __CYGWIN__
|
||||
#if defined _WIN32
|
||||
static DWORD s_profilerThreadId = 0;
|
||||
static char s_crashText[1024];
|
||||
|
||||
@ -914,7 +903,7 @@ TRACY_API bool ProfilerAvailable() { return s_instance != nullptr; }
|
||||
|
||||
TRACY_API int64_t GetFrequencyQpc()
|
||||
{
|
||||
#if defined _WIN32 || defined __CYGWIN__
|
||||
#if defined _WIN32
|
||||
LARGE_INTEGER t;
|
||||
QueryPerformanceFrequency( &t );
|
||||
return t.QuadPart;
|
||||
@ -1127,12 +1116,7 @@ TRACY_API int64_t GetInitTime() { return s_initTime.val; }
|
||||
TRACY_API std::atomic<uint32_t>& GetLockCounter() { return s_lockCounter; }
|
||||
TRACY_API std::atomic<uint8_t>& GetGpuCtxCounter() { return s_gpuCtxCounter; }
|
||||
TRACY_API GpuCtxWrapper& GetGpuCtx() { return s_gpuCtx; }
|
||||
# ifdef __CYGWIN__
|
||||
// Hackfix for cygwin reporting memory frees without matching allocations. WTF?
|
||||
TRACY_API uint64_t GetThreadHandle() { return detail::GetThreadHandleImpl(); }
|
||||
# else
|
||||
TRACY_API uint64_t GetThreadHandle() { return s_threadHandle.val; }
|
||||
# endif
|
||||
|
||||
std::atomic<ThreadNameData*>& GetThreadNameData() { return s_threadNameData; }
|
||||
|
||||
@ -1229,7 +1213,7 @@ void Profiler::SpawnWorkerThreads()
|
||||
new(s_compressThread) Thread( LaunchCompressWorker, this );
|
||||
#endif
|
||||
|
||||
#if defined _WIN32 || defined __CYGWIN__
|
||||
#if defined _WIN32
|
||||
s_profilerThreadId = GetThreadId( s_thread->Handle() );
|
||||
m_exceptionHandler = AddVectoredExceptionHandler( 1, CrashFilter );
|
||||
#endif
|
||||
@ -1263,7 +1247,7 @@ Profiler::~Profiler()
|
||||
{
|
||||
m_shutdown.store( true, std::memory_order_relaxed );
|
||||
|
||||
#if defined _WIN32 || defined __CYGWIN__
|
||||
#if defined _WIN32
|
||||
if( m_crashHandlerInstalled ) RemoveVectoredExceptionHandler( m_exceptionHandler );
|
||||
#endif
|
||||
|
||||
@ -2899,7 +2883,7 @@ void Profiler::ReportTopology()
|
||||
uint32_t thread;
|
||||
};
|
||||
|
||||
#if defined _WIN32 || defined __CYGWIN__
|
||||
#if defined _WIN32
|
||||
t_GetLogicalProcessorInformationEx _GetLogicalProcessorInformationEx = (t_GetLogicalProcessorInformationEx)GetProcAddress( GetModuleHandleA( "kernel32.dll" ), "GetLogicalProcessorInformationEx" );
|
||||
if( !_GetLogicalProcessorInformationEx ) return;
|
||||
|
||||
@ -3344,7 +3328,7 @@ void Profiler::SendCodeLocation( uint64_t ptr )
|
||||
#endif
|
||||
}
|
||||
|
||||
#if ( defined _WIN32 || defined __CYGWIN__ ) && defined TRACY_TIMER_QPC
|
||||
#if defined _WIN32 && defined TRACY_TIMER_QPC
|
||||
int64_t Profiler::GetTimeQpc()
|
||||
{
|
||||
LARGE_INTEGER t;
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include "../common/TracyMutex.hpp"
|
||||
#include "../common/TracyProtocol.hpp"
|
||||
|
||||
#if defined _WIN32 || defined __CYGWIN__
|
||||
#if defined _WIN32
|
||||
# include <intrin.h>
|
||||
#endif
|
||||
#ifdef __APPLE__
|
||||
@ -25,7 +25,7 @@
|
||||
# include <mach/mach_time.h>
|
||||
#endif
|
||||
|
||||
#if !defined TRACY_TIMER_FALLBACK && ( defined _WIN32 || defined __CYGWIN__ || ( defined __i386 || defined _M_IX86 || defined __x86_64__ || defined _M_X64 ) || ( defined TARGET_OS_IOS && TARGET_OS_IOS == 1 ) )
|
||||
#if !defined TRACY_TIMER_FALLBACK && ( defined _WIN32 || ( defined __i386 || defined _M_IX86 || defined __x86_64__ || defined _M_X64 ) || ( defined TARGET_OS_IOS && TARGET_OS_IOS == 1 ) )
|
||||
# define TRACY_HW_TIMER
|
||||
#endif
|
||||
|
||||
@ -130,7 +130,7 @@ public:
|
||||
#ifdef TRACY_HW_TIMER
|
||||
# if defined TARGET_OS_IOS && TARGET_OS_IOS == 1
|
||||
return mach_absolute_time();
|
||||
# elif defined _WIN32 || defined __CYGWIN__
|
||||
# elif defined _WIN32
|
||||
# ifdef TRACY_TIMER_QPC
|
||||
return GetTimeQpc();
|
||||
# else
|
||||
@ -748,7 +748,7 @@ private:
|
||||
GetProfiler().m_serialQueue.commit_next();
|
||||
}
|
||||
|
||||
#if ( defined _WIN32 || defined __CYGWIN__ ) && defined TRACY_TIMER_QPC
|
||||
#if defined _WIN32 && defined TRACY_TIMER_QPC
|
||||
static int64_t GetTimeQpc();
|
||||
#endif
|
||||
|
||||
@ -812,7 +812,7 @@ private:
|
||||
char* m_queryData;
|
||||
char* m_queryDataPtr;
|
||||
|
||||
#if defined _WIN32 || defined __CYGWIN__
|
||||
#if defined _WIN32
|
||||
void* m_exceptionHandler;
|
||||
#endif
|
||||
#ifdef __linux__
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#ifdef TRACY_HAS_SYSTIME
|
||||
|
||||
# if defined _WIN32 || defined __CYGWIN__
|
||||
# if defined _WIN32
|
||||
# include <windows.h>
|
||||
# elif defined __linux__
|
||||
# include <stdio.h>
|
||||
@ -18,7 +18,7 @@
|
||||
namespace tracy
|
||||
{
|
||||
|
||||
# if defined _WIN32 || defined __CYGWIN__
|
||||
# if defined _WIN32
|
||||
|
||||
static inline uint64_t ConvertTime( const FILETIME& t )
|
||||
{
|
||||
@ -95,7 +95,7 @@ float SysTime::Get()
|
||||
const auto diffIdle = idle - oldIdle;
|
||||
const auto diffUsed = used - oldUsed;
|
||||
|
||||
#if defined _WIN32 || defined __CYGWIN__
|
||||
#if defined _WIN32
|
||||
return diffUsed == 0 ? -1 : ( diffUsed - diffIdle ) * 100.f / diffUsed;
|
||||
#elif defined __linux__ || defined __APPLE__ || defined BSD
|
||||
const auto total = diffUsed + diffIdle;
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef __TRACYSYSTIME_HPP__
|
||||
#define __TRACYSYSTIME_HPP__
|
||||
|
||||
#if defined _WIN32 || defined __CYGWIN__ || defined __linux__ || defined __APPLE__
|
||||
#if defined _WIN32 || defined __linux__ || defined __APPLE__
|
||||
# define TRACY_HAS_SYSTIME
|
||||
#else
|
||||
# include <sys/param.h>
|
||||
|
@ -5,7 +5,7 @@
|
||||
#ifdef TRACY_HAS_SYSTEM_TRACING
|
||||
|
||||
#ifndef TRACY_SAMPLING_HZ
|
||||
# if defined _WIN32 || defined __CYGWIN__
|
||||
# if defined _WIN32
|
||||
# define TRACY_SAMPLING_HZ 8000
|
||||
# elif defined __linux__
|
||||
# define TRACY_SAMPLING_HZ 10000
|
||||
@ -17,7 +17,7 @@ namespace tracy
|
||||
|
||||
static constexpr int GetSamplingFrequency()
|
||||
{
|
||||
#if defined _WIN32 || defined __CYGWIN__
|
||||
#if defined _WIN32
|
||||
return TRACY_SAMPLING_HZ > 8000 ? 8000 : ( TRACY_SAMPLING_HZ < 1 ? 1 : TRACY_SAMPLING_HZ );
|
||||
#else
|
||||
return TRACY_SAMPLING_HZ > 1000000 ? 1000000 : ( TRACY_SAMPLING_HZ < 1 ? 1 : TRACY_SAMPLING_HZ );
|
||||
@ -31,7 +31,7 @@ static constexpr int GetSamplingPeriod()
|
||||
|
||||
}
|
||||
|
||||
# if defined _WIN32 || defined __CYGWIN__
|
||||
# if defined _WIN32
|
||||
|
||||
# ifndef NOMINMAX
|
||||
# define NOMINMAX
|
||||
@ -129,14 +129,6 @@ struct VSyncInfo
|
||||
uint64_t flipFenceId;
|
||||
};
|
||||
|
||||
#ifdef __CYGWIN__
|
||||
extern "C" typedef DWORD (WINAPI *t_GetProcessIdOfThread)( HANDLE );
|
||||
extern "C" typedef DWORD (WINAPI *t_GetProcessImageFileNameA)( HANDLE, LPSTR, DWORD );
|
||||
extern "C" ULONG WMIAPI TraceSetInformation(TRACEHANDLE SessionHandle, TRACE_INFO_CLASS InformationClass, PVOID TraceInformation, ULONG InformationLength);
|
||||
t_GetProcessIdOfThread GetProcessIdOfThread = (t_GetProcessIdOfThread)GetProcAddress( GetModuleHandleA( "kernel32.dll" ), "GetProcessIdOfThread" );
|
||||
t_GetProcessImageFileNameA GetProcessImageFileNameA = (t_GetProcessImageFileNameA)GetProcAddress( GetModuleHandleA( "kernel32.dll" ), "K32GetProcessImageFileNameA" );
|
||||
#endif
|
||||
|
||||
extern "C" typedef NTSTATUS (WINAPI *t_NtQueryInformationThread)( HANDLE, THREADINFOCLASS, PVOID, ULONG, PULONG );
|
||||
extern "C" typedef BOOL (WINAPI *t_EnumProcessModules)( HANDLE, HMODULE*, DWORD, LPDWORD );
|
||||
extern "C" typedef BOOL (WINAPI *t_GetModuleInformation)( HANDLE, HMODULE, LPMODULEINFO, DWORD );
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef __TRACYSYSTRACE_HPP__
|
||||
#define __TRACYSYSTRACE_HPP__
|
||||
|
||||
#if !defined TRACY_NO_SYSTEM_TRACING && ( defined _WIN32 || defined __CYGWIN__ || defined __linux__ )
|
||||
#if !defined TRACY_NO_SYSTEM_TRACING && ( defined _WIN32 || defined __linux__ )
|
||||
# define TRACY_HAS_SYSTEM_TRACING
|
||||
#endif
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef __TRACYTHREAD_HPP__
|
||||
#define __TRACYTHREAD_HPP__
|
||||
|
||||
#if defined _WIN32 || defined __CYGWIN__
|
||||
#if defined _WIN32
|
||||
# include <windows.h>
|
||||
#else
|
||||
# include <pthread.h>
|
||||
@ -25,7 +25,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
#if defined _WIN32 || defined __CYGWIN__
|
||||
#if defined _WIN32
|
||||
|
||||
class Thread
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef __TRACYAPI_H__
|
||||
#define __TRACYAPI_H__
|
||||
|
||||
#if defined _WIN32 || defined __CYGWIN__
|
||||
#if defined _WIN32
|
||||
# if defined TRACY_EXPORTS
|
||||
# define TRACY_API __declspec(dllexport)
|
||||
# elif defined TRACY_IMPORTS
|
||||
|
@ -489,7 +489,7 @@ bool ListenSocket::Listen( uint16_t port, int backlog )
|
||||
m_sock = addrinfo_and_socket_for_family( port, AF_INET, &res );
|
||||
if( m_sock == -1 ) return false;
|
||||
}
|
||||
#if defined _WIN32 || defined __CYGWIN__
|
||||
#if defined _WIN32
|
||||
unsigned long val = 0;
|
||||
setsockopt( m_sock, IPPROTO_IPV6, IPV6_V6ONLY, (const char*)&val, sizeof( val ) );
|
||||
#elif defined BSD
|
||||
|
@ -1,15 +1,13 @@
|
||||
#if defined _MSC_VER || defined __CYGWIN__ || defined _WIN32
|
||||
# ifndef WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# endif
|
||||
# ifndef NOMINMAX
|
||||
# define NOMINMAX
|
||||
# endif
|
||||
#endif
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning(disable:4996)
|
||||
#endif
|
||||
#if defined _WIN32 || defined __CYGWIN__
|
||||
#if defined _WIN32
|
||||
# ifndef WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# endif
|
||||
# ifndef NOMINMAX
|
||||
# define NOMINMAX
|
||||
# endif
|
||||
# include <windows.h>
|
||||
# include <malloc.h>
|
||||
#else
|
||||
@ -40,7 +38,7 @@
|
||||
|
||||
#include "TracySystem.hpp"
|
||||
|
||||
#if defined _WIN32 || defined __CYGWIN__
|
||||
#if defined _WIN32
|
||||
extern "C" typedef HRESULT (WINAPI *t_SetThreadDescription)( HANDLE, PCWSTR );
|
||||
extern "C" typedef HRESULT (WINAPI *t_GetThreadDescription)( HANDLE, PWSTR* );
|
||||
#endif
|
||||
@ -58,7 +56,7 @@ namespace detail
|
||||
|
||||
TRACY_API uint64_t GetThreadHandleImpl()
|
||||
{
|
||||
#if defined _WIN32 || defined __CYGWIN__
|
||||
#if defined _WIN32
|
||||
static_assert( sizeof( decltype( GetCurrentThreadId() ) ) <= sizeof( uint64_t ), "Thread handle too big to fit in protocol" );
|
||||
return uint64_t( GetCurrentThreadId() );
|
||||
#elif defined __APPLE__
|
||||
@ -123,7 +121,7 @@ void ThreadNameMsvcMagic( const THREADNAME_INFO& info )
|
||||
|
||||
TRACY_API void SetThreadName( const char* name )
|
||||
{
|
||||
#if defined _WIN32 || defined __CYGWIN__
|
||||
#if defined _WIN32
|
||||
static auto _SetThreadDescription = (t_SetThreadDescription)GetProcAddress( GetModuleHandleA( "kernel32.dll" ), "SetThreadDescription" );
|
||||
if( _SetThreadDescription )
|
||||
{
|
||||
@ -142,7 +140,7 @@ TRACY_API void SetThreadName( const char* name )
|
||||
ThreadNameMsvcMagic( info );
|
||||
# endif
|
||||
}
|
||||
#elif defined _GNU_SOURCE && !defined __EMSCRIPTEN__ && !defined __CYGWIN__
|
||||
#elif defined _GNU_SOURCE && !defined __EMSCRIPTEN__
|
||||
{
|
||||
const auto sz = strlen( name );
|
||||
if( sz <= 15 )
|
||||
@ -187,7 +185,7 @@ TRACY_API const char* GetThreadName( uint64_t id )
|
||||
ptr = ptr->next;
|
||||
}
|
||||
#else
|
||||
# if defined _WIN32 || defined __CYGWIN__
|
||||
# if defined _WIN32
|
||||
static auto _GetThreadDescription = (t_GetThreadDescription)GetProcAddress( GetModuleHandleA( "kernel32.dll" ), "GetThreadDescription" );
|
||||
if( _GetThreadDescription )
|
||||
{
|
||||
|
@ -14,7 +14,7 @@
|
||||
#ifdef _MSC_VER
|
||||
# define stat64 _stat64
|
||||
#endif
|
||||
#if defined __CYGWIN__ || defined __APPLE__
|
||||
#if defined __APPLE__
|
||||
# define stat64 stat
|
||||
#endif
|
||||
|
||||
|
@ -384,7 +384,7 @@ Moreover, the following platforms are not supported due to how secretive their o
|
||||
\item Google Stadia
|
||||
\end{itemize}
|
||||
|
||||
You may also try your luck with Cygwin or Mingw, but don't get your hopes too high. These platforms were usable some time ago, but nobody is actively working on resolving any issues you might encounter with them.
|
||||
You may also try your luck with Mingw, but don't get your hopes too high. This platform was usable some time ago, but nobody is actively working on resolving any issues you might encounter with it.
|
||||
|
||||
\subsection{Initial client setup}
|
||||
\label{initialsetup}
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include "../server/TracyVersion.hpp"
|
||||
#include "HttpRequest.hpp"
|
||||
|
||||
#if defined _WIN32 || defined __CYGWIN__
|
||||
#if defined _WIN32
|
||||
# include <windows.h>
|
||||
extern "C" typedef LONG (WINAPI *t_RtlGetVersion)( PRTL_OSVERSIONINFOW );
|
||||
#elif defined __linux__
|
||||
@ -21,13 +21,11 @@ static constexpr char CRLF[2] = { '\r', '\n' };
|
||||
static const char* GetOsInfo()
|
||||
{
|
||||
static char buf[1024];
|
||||
#if defined _WIN32 || defined __CYGWIN__
|
||||
#if defined _WIN32
|
||||
t_RtlGetVersion RtlGetVersion = (t_RtlGetVersion)GetProcAddress( GetModuleHandleA( "ntdll.dll" ), "RtlGetVersion" );
|
||||
if( !RtlGetVersion )
|
||||
{
|
||||
# ifdef __CYGWIN__
|
||||
sprintf( buf, "Windows (Cygwin)" );
|
||||
# elif defined __MINGW32__
|
||||
# ifdef __MINGW32__
|
||||
sprintf( buf, "Windows (MingW)" );
|
||||
# else
|
||||
sprintf( buf, "Windows" );
|
||||
@ -38,9 +36,7 @@ static const char* GetOsInfo()
|
||||
RTL_OSVERSIONINFOW ver = { sizeof( RTL_OSVERSIONINFOW ) };
|
||||
RtlGetVersion( &ver );
|
||||
|
||||
# ifdef __CYGWIN__
|
||||
sprintf( buf, "Windows %i.%i.%i (Cygwin)", ver.dwMajorVersion, ver.dwMinorVersion, ver.dwBuildNumber );
|
||||
# elif defined __MINGW32__
|
||||
# ifdef __MINGW32__
|
||||
sprintf( buf, "Windows %i.%i.%i (MingW)", (int)ver.dwMajorVersion, (int)ver.dwMinorVersion, (int)ver.dwBuildNumber );
|
||||
# else
|
||||
sprintf( buf, "Windows %i.%i.%i", ver.dwMajorVersion, ver.dwMinorVersion, ver.dwBuildNumber );
|
||||
|
@ -16,7 +16,7 @@
|
||||
#ifdef _MSC_VER
|
||||
# define stat64 _stat64
|
||||
#endif
|
||||
#if defined __CYGWIN__ || defined __APPLE__
|
||||
#if defined __APPLE__
|
||||
# define stat64 stat
|
||||
#endif
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "TracyMmap.hpp"
|
||||
|
||||
#if defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__
|
||||
#if defined _WIN32
|
||||
# include <io.h>
|
||||
# include <windows.h>
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef __TRACYMMAP_HPP__
|
||||
#define __TRACYMMAP_HPP__
|
||||
|
||||
#if !defined _MSC_VER && !defined __MINGW32__ && !defined __CYGWIN__
|
||||
#if !defined _WIN32
|
||||
# include <sys/mman.h>
|
||||
#else
|
||||
# include <string.h>
|
||||
|
@ -13,9 +13,6 @@ SRC := \
|
||||
|
||||
OBJ := $(SRC:%.cpp=%.o)
|
||||
|
||||
ifeq ($(shell uname -o),Cygwin)
|
||||
LIBS += -ldbghelp
|
||||
endif
|
||||
ifeq ($(shell uname -o),FreeBSD)
|
||||
LIBS += -lexecinfo
|
||||
endif
|
||||
|
@ -15,9 +15,7 @@
|
||||
#include "../../zstd/zstd.h"
|
||||
#include "../../getopt/getopt.h"
|
||||
|
||||
#ifdef __CYGWIN__
|
||||
# define ftello64(x) ftello(x)
|
||||
#elif defined __APPLE__
|
||||
#ifdef __APPLE__
|
||||
# define ftello64(x) ftello(x)
|
||||
#elif defined _WIN32
|
||||
# define ftello64(x) _ftelli64(x)
|
||||
|
Loading…
Reference in New Issue
Block a user