From c40f94a355588365489438f4862c05e96bfe3f34 Mon Sep 17 00:00:00 2001 From: Kamay Xutax Date: Fri, 30 Aug 2024 06:09:44 +0200 Subject: [PATCH] Added VPROF option & fixed vprof --- tier0/threadtools.cpp | 2 +- wscript | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tier0/threadtools.cpp b/tier0/threadtools.cpp index d51949272c..a887aa40e3 100644 --- a/tier0/threadtools.cpp +++ b/tier0/threadtools.cpp @@ -490,7 +490,7 @@ ThreadId_t ThreadGetCurrentId() sys_ppu_thread_get_id( &th ); return th; #elif defined(POSIX) - return (ThreadId_t)pthread_self(); + return (ThreadId_t)gettid(); #else Assert(0); DebuggerBreak(); diff --git a/wscript b/wscript index 491f9c7906..baf1c31fd3 100644 --- a/wscript +++ b/wscript @@ -281,11 +281,12 @@ def define_platform(conf): ]) conf.define('GIT_COMMIT_HASH', conf.env.GIT_VERSION) - conf.define('VPROF_LEVEL', 1) def options(opt): grp = opt.add_option_group('Common options') + grp.add_option('-P', '--profiling', dest='PROFILING', type = int, default = 0, action='store', help='Add profiling support (0 to 4)') + grp.add_option('-4', '--32bits', action = 'store_true', dest = 'TARGET32', default = False, help = 'allow targetting 32-bit engine(Linux/Windows/OSX x86 only) [default: %(default)r]') @@ -488,6 +489,10 @@ def configure(conf): '-faligned-new', ] + if conf.options.PROFILING > 0: + conf.define('VPROF_LEVEL', conf.options.PROFILING) + conf.define('VPROF_ENABLED', 1) + c_compiler_optional_flags = [ '-fnonconst-initializers' # owcc ]