mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-27 08:15:33 +01:00
Some code cleanup + added scons flavor=prof
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1763 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
7c37718089
commit
952dfcd610
28
SConstruct
28
SConstruct
@ -101,7 +101,7 @@ vars.AddVariables(
|
|||||||
BoolVariable('gltest', 'temp don\'t use (WIP)', False),
|
BoolVariable('gltest', 'temp don\'t use (WIP)', False),
|
||||||
BoolVariable('jittest', 'temp don\'t use (WIP)', False),
|
BoolVariable('jittest', 'temp don\'t use (WIP)', False),
|
||||||
EnumVariable('flavor', 'Choose a build flavor', 'release',
|
EnumVariable('flavor', 'Choose a build flavor', 'release',
|
||||||
allowed_values = ('release', 'devel', 'debug', 'fastlog'),
|
allowed_values = ('release', 'devel', 'debug', 'fastlog', 'prof'),
|
||||||
ignorecase = 2
|
ignorecase = 2
|
||||||
),
|
),
|
||||||
EnumVariable('osx', 'Choose a backend (WIP)', '32cocoa',
|
EnumVariable('osx', 'Choose a backend (WIP)', '32cocoa',
|
||||||
@ -117,6 +117,7 @@ vars.AddVariables(
|
|||||||
env = Environment(
|
env = Environment(
|
||||||
CPPPATH = include_paths,
|
CPPPATH = include_paths,
|
||||||
LIBPATH = lib_paths,
|
LIBPATH = lib_paths,
|
||||||
|
RPATH = [],
|
||||||
variables = vars,
|
variables = vars,
|
||||||
ENV = {
|
ENV = {
|
||||||
'PATH' : os.environ['PATH'],
|
'PATH' : os.environ['PATH'],
|
||||||
@ -147,6 +148,7 @@ if not env['verbose']:
|
|||||||
env['RANLIBCOMSTR'] = "Indexing $TARGET"
|
env['RANLIBCOMSTR'] = "Indexing $TARGET"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# build falvuor
|
# build falvuor
|
||||||
flavour = ARGUMENTS.get('flavor')
|
flavour = ARGUMENTS.get('flavor')
|
||||||
if (flavour == 'debug'):
|
if (flavour == 'debug'):
|
||||||
@ -155,14 +157,16 @@ if (flavour == 'debug'):
|
|||||||
cppDefines.append('_DEBUG')
|
cppDefines.append('_DEBUG')
|
||||||
# FIXME: this disable wx debugging how do we make it work?
|
# FIXME: this disable wx debugging how do we make it work?
|
||||||
cppDefines.append('NDEBUG')
|
cppDefines.append('NDEBUG')
|
||||||
|
|
||||||
elif (flavour == 'devel'):
|
elif (flavour == 'devel'):
|
||||||
compileFlags.append('-g')
|
compileFlags.append('-g')
|
||||||
cppDefines.append('DEBUGFAST')
|
cppDefines.append('DEBUGFAST')
|
||||||
elif (flavour == 'fastlog'):
|
elif (flavour == 'fastlog'):
|
||||||
compileFlags.append('-O3')
|
compileFlags.append('-O3')
|
||||||
cppDefines.append('LOGGING')
|
cppDefines.append('LOGGING')
|
||||||
else:
|
elif (flavour == 'prof'):
|
||||||
|
compileFlags.append('-O3')
|
||||||
|
compileFlags.append('-g')
|
||||||
|
elif (flavour == 'release'):
|
||||||
compileFlags.append('-O3')
|
compileFlags.append('-O3')
|
||||||
|
|
||||||
# more warnings
|
# more warnings
|
||||||
@ -261,6 +265,18 @@ conf.Define('USE_WX', env['USE_WX'])
|
|||||||
conf.Define('HAVE_X11', env['HAVE_X11'])
|
conf.Define('HAVE_X11', env['HAVE_X11'])
|
||||||
conf.Define('HAVE_COCOA', env['HAVE_COCOA'])
|
conf.Define('HAVE_COCOA', env['HAVE_COCOA'])
|
||||||
|
|
||||||
|
|
||||||
|
# profile
|
||||||
|
env['USE_OPROFILE'] = 0
|
||||||
|
if (flavour == 'prof'):
|
||||||
|
env['LIBPATH'] += [ '/usr/lib/oprofile' ]
|
||||||
|
env['RPATH'] += [ '/usr/lib/oprofile' ]
|
||||||
|
if conf.CheckPKG('opagent'):
|
||||||
|
env['USE_OPROFILE'] = 1
|
||||||
|
else:
|
||||||
|
print "Can't build prof without oprofile, disabling"
|
||||||
|
|
||||||
|
conf.Define('USE_OPROFILE', env['USE_OPROFILE'])
|
||||||
# After all configuration tests are done
|
# After all configuration tests are done
|
||||||
conf.Finish()
|
conf.Finish()
|
||||||
|
|
||||||
@ -278,8 +294,10 @@ env['base_dir'] = os.getcwd()+ '/';
|
|||||||
|
|
||||||
# install paths
|
# install paths
|
||||||
extra=''
|
extra=''
|
||||||
if env['flavor'] == 'debug':
|
if flavour == 'debug':
|
||||||
extra = '-debug'
|
extra = '-debug'
|
||||||
|
elif flavour == 'prof':
|
||||||
|
extra = '-prof'
|
||||||
|
|
||||||
# TODO: support global install
|
# TODO: support global install
|
||||||
env['prefix'] = os.path.join(env['base_dir'] + 'Binary', platform.system() + '-' + platform.machine() + extra +os.sep)
|
env['prefix'] = os.path.join(env['base_dir'] + 'Binary', platform.system() + '-' + platform.machine() + extra +os.sep)
|
||||||
@ -292,7 +310,7 @@ env['libs_dir'] = env['prefix'] + 'Libs/'
|
|||||||
#TODO where should this go?
|
#TODO where should this go?
|
||||||
env['data_dir'] = env['prefix']
|
env['data_dir'] = env['prefix']
|
||||||
|
|
||||||
env['RPATH'] = env['libs_dir']
|
env['RPATH'] += env['libs_dir']
|
||||||
|
|
||||||
env['LIBPATH'] += [ env['libs_dir'] ]
|
env['LIBPATH'] += [ env['libs_dir'] ]
|
||||||
|
|
||||||
|
@ -22,8 +22,6 @@
|
|||||||
// performance hit, it's not enabled by default, but it's useful for
|
// performance hit, it's not enabled by default, but it's useful for
|
||||||
// locating performance issues.
|
// locating performance issues.
|
||||||
|
|
||||||
//#define OPROFILE_REPORT
|
|
||||||
|
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
#include "../../Core.h"
|
#include "../../Core.h"
|
||||||
#include "MemoryUtil.h"
|
#include "MemoryUtil.h"
|
||||||
@ -44,11 +42,11 @@
|
|||||||
|
|
||||||
#include "disasm.h"
|
#include "disasm.h"
|
||||||
|
|
||||||
#ifdef OPROFILE_REPORT
|
#if defined USE_OPROFILE && USE_OPROFILE
|
||||||
#include <opagent.h>
|
#include <opagent.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef OPROFILE_REPORT
|
#if defined USE_OPROFILE && USE_OPROFILE
|
||||||
op_agent_t agent;
|
op_agent_t agent;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -76,7 +74,7 @@ bool JitBlock::ContainsAddress(u32 em_address)
|
|||||||
MAX_NUM_BLOCKS = 65536*8;
|
MAX_NUM_BLOCKS = 65536*8;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef OPROFILE_REPORT
|
#if defined USE_OPROFILE && USE_OPROFILE
|
||||||
agent = op_open_agent();
|
agent = op_open_agent();
|
||||||
#endif
|
#endif
|
||||||
blocks = new JitBlock[MAX_NUM_BLOCKS];
|
blocks = new JitBlock[MAX_NUM_BLOCKS];
|
||||||
@ -92,7 +90,7 @@ bool JitBlock::ContainsAddress(u32 em_address)
|
|||||||
blocks = 0;
|
blocks = 0;
|
||||||
blockCodePointers = 0;
|
blockCodePointers = 0;
|
||||||
num_blocks = 0;
|
num_blocks = 0;
|
||||||
#ifdef OPROFILE_REPORT
|
#if defined USE_OPROFILE && USE_OPROFILE
|
||||||
op_close_agent(agent);
|
op_close_agent(agent);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -184,7 +182,7 @@ bool JitBlock::ContainsAddress(u32 em_address)
|
|||||||
LinkBlockExits(block_num);
|
LinkBlockExits(block_num);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef OPROFILE_REPORT
|
#if defined USE_OPROFILE && USE_OPROFILE
|
||||||
char buf[100];
|
char buf[100];
|
||||||
sprintf(buf, "EmuCode%x", b.originalAddress);
|
sprintf(buf, "EmuCode%x", b.originalAddress);
|
||||||
const u8* blockStart = blockCodePointers[block_num];
|
const u8* blockStart = blockCodePointers[block_num];
|
||||||
|
@ -22,8 +22,6 @@
|
|||||||
// performance hit, it's not enabled by default, but it's useful for
|
// performance hit, it's not enabled by default, but it's useful for
|
||||||
// locating performance issues.
|
// locating performance issues.
|
||||||
|
|
||||||
//#define OPROFILE_REPORT
|
|
||||||
|
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
#include "../../Core.h"
|
#include "../../Core.h"
|
||||||
#include "MemoryUtil.h"
|
#include "MemoryUtil.h"
|
||||||
@ -44,11 +42,11 @@
|
|||||||
|
|
||||||
#include "disasm.h"
|
#include "disasm.h"
|
||||||
|
|
||||||
#ifdef OPROFILE_REPORT
|
#if defined USE_OPROFILE && USE_OPROFILE
|
||||||
#include <opagent.h>
|
#include <opagent.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef OPROFILE_REPORT
|
#if defined USE_OPROFILE && USE_OPROFILE
|
||||||
op_agent_t agent;
|
op_agent_t agent;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -76,7 +74,7 @@ bool JitBlock::ContainsAddress(u32 em_address)
|
|||||||
MAX_NUM_BLOCKS = 65536*8;
|
MAX_NUM_BLOCKS = 65536*8;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef OPROFILE_REPORT
|
#if defined USE_OPROFILE && USE_OPROFILE
|
||||||
agent = op_open_agent();
|
agent = op_open_agent();
|
||||||
#endif
|
#endif
|
||||||
blocks = new JitBlock[MAX_NUM_BLOCKS];
|
blocks = new JitBlock[MAX_NUM_BLOCKS];
|
||||||
@ -92,7 +90,7 @@ bool JitBlock::ContainsAddress(u32 em_address)
|
|||||||
blocks = 0;
|
blocks = 0;
|
||||||
blockCodePointers = 0;
|
blockCodePointers = 0;
|
||||||
num_blocks = 0;
|
num_blocks = 0;
|
||||||
#ifdef OPROFILE_REPORT
|
#if defined USE_OPROFILE && USE_OPROFILE
|
||||||
op_close_agent(agent);
|
op_close_agent(agent);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -184,7 +182,7 @@ bool JitBlock::ContainsAddress(u32 em_address)
|
|||||||
LinkBlockExits(block_num);
|
LinkBlockExits(block_num);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef OPROFILE_REPORT
|
#if defined USE_OPROFILE && USE_OPROFILE
|
||||||
char buf[100];
|
char buf[100];
|
||||||
sprintf(buf, "EmuCode%x", b.originalAddress);
|
sprintf(buf, "EmuCode%x", b.originalAddress);
|
||||||
const u8* blockStart = blockCodePointers[block_num];
|
const u8* blockStart = blockCodePointers[block_num];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user