Added VPROF option & fixed vprof

This commit is contained in:
Kamay Xutax 2024-08-30 06:09:44 +02:00
parent dcf5536d93
commit c40f94a355
2 changed files with 7 additions and 2 deletions

View file

@ -490,7 +490,7 @@ ThreadId_t ThreadGetCurrentId()
sys_ppu_thread_get_id( &th ); sys_ppu_thread_get_id( &th );
return th; return th;
#elif defined(POSIX) #elif defined(POSIX)
return (ThreadId_t)pthread_self(); return (ThreadId_t)gettid();
#else #else
Assert(0); Assert(0);
DebuggerBreak(); DebuggerBreak();

View file

@ -281,11 +281,12 @@ def define_platform(conf):
]) ])
conf.define('GIT_COMMIT_HASH', conf.env.GIT_VERSION) conf.define('GIT_COMMIT_HASH', conf.env.GIT_VERSION)
conf.define('VPROF_LEVEL', 1)
def options(opt): def options(opt):
grp = opt.add_option_group('Common options') 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, 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]') help = 'allow targetting 32-bit engine(Linux/Windows/OSX x86 only) [default: %(default)r]')
@ -488,6 +489,10 @@ def configure(conf):
'-faligned-new', '-faligned-new',
] ]
if conf.options.PROFILING > 0:
conf.define('VPROF_LEVEL', conf.options.PROFILING)
conf.define('VPROF_ENABLED', 1)
c_compiler_optional_flags = [ c_compiler_optional_flags = [
'-fnonconst-initializers' # owcc '-fnonconst-initializers' # owcc
] ]