Fix JIT profiler compilation on linux

This commit is contained in:
thelemonman 2014-05-03 15:52:20 +00:00
parent 23955ff791
commit fc6930c2e1
1 changed files with 8 additions and 10 deletions

View File

@ -298,7 +298,7 @@ struct PROFILER_COUNTER_INFO
struct JIT_PROFILER struct JIT_PROFILER
{ {
JIT_PROFILER::JIT_PROFILER() JIT_PROFILER()
{ {
memset(&arm_count[0], 0, sizeof(arm_count)); memset(&arm_count[0], 0, sizeof(arm_count));
memset(&thumb_count[0], 0, sizeof(thumb_count)); memset(&thumb_count[0], 0, sizeof(thumb_count));
@ -310,8 +310,8 @@ struct JIT_PROFILER
static GpVar bb_profiler; static GpVar bb_profiler;
#define profiler_counter_arm(opcode) qword_ptr(bb_profiler, offsetof(JIT_PROFILER, arm_count[INSTRUCTION_INDEX(opcode)])) #define profiler_counter_arm(opcode) qword_ptr(bb_profiler, offsetof(JIT_PROFILER, arm_count) + (INSTRUCTION_INDEX(opcode)*sizeof(u64)))
#define profiler_counter_thumb(opcode) qword_ptr(bb_profiler, offsetof(JIT_PROFILER, thumb_count[opcode>>6])) #define profiler_counter_thumb(opcode) qword_ptr(bb_profiler, offsetof(JIT_PROFILER, thumb_count) + ((opcode>>6)*sizeof(u64)))
#if (PROFILER_JIT_LEVEL > 1) #if (PROFILER_JIT_LEVEL > 1)
struct PROFILER_ENTRY struct PROFILER_ENTRY
@ -4246,9 +4246,7 @@ void arm_jit_reset(bool enable, bool suppress_msg)
{ {
#if LOG_JIT #if LOG_JIT
c.setLogger(&logger); c.setLogger(&logger);
#ifdef _WINDOWS freopen("desmume_jit.log", "w", stderr);
freopen("\\desmume_jit.log", "w", stderr);
#endif
#endif #endif
#ifdef HAVE_STATIC_CODE_BUFFER #ifdef HAVE_STATIC_CODE_BUFFER
scratchptr = scratchpad; scratchptr = scratchpad;
@ -4382,11 +4380,11 @@ void arm_jit_close()
std::qsort(thumb_info, last[1], sizeof(PROFILER_COUNTER_INFO), (int (*)(const void *, const void *))pcmp); std::qsort(thumb_info, last[1], sizeof(PROFILER_COUNTER_INFO), (int (*)(const void *, const void *))pcmp);
char buf[MAX_PATH] = {0}; char buf[MAX_PATH] = {0};
sprintf(buf, "\\desmume_jit%c_counter.profiler", proc==0?'9':'7'); sprintf(buf, "desmume_jit%c_counter.profiler", proc==0?'9':'7');
FILE *fp = fopen(buf, "w"); FILE *fp = fopen(buf, "w");
if (fp) if (fp)
{ {
if (!gameInfo.isHomebrew) if (!gameInfo.isHomebrew())
{ {
fprintf(fp, "Name: %s\n", gameInfo.ROMname); fprintf(fp, "Name: %s\n", gameInfo.ROMname);
fprintf(fp, "Serial: %s\n", gameInfo.ROMserial); fprintf(fp, "Serial: %s\n", gameInfo.ROMserial);
@ -4418,7 +4416,7 @@ void arm_jit_close()
delete [] thumb_info; thumb_info = NULL; delete [] thumb_info; thumb_info = NULL;
#if (PROFILER_JIT_LEVEL > 1) #if (PROFILER_JIT_LEVEL > 1)
sprintf(buf, "\\desmume_jit%c_entry.profiler", proc==0?'9':'7'); sprintf(buf, "desmume_jit%c_entry.profiler", proc==0?'9':'7');
fp = fopen(buf, "w"); fp = fopen(buf, "w");
if (fp) if (fp)
{ {
@ -4434,7 +4432,7 @@ void arm_jit_close()
memcpy(&tmp[count++], &profiler_entry[proc][i], sizeof(PROFILER_ENTRY)); memcpy(&tmp[count++], &profiler_entry[proc][i], sizeof(PROFILER_ENTRY));
} }
std::qsort(tmp, count, sizeof(PROFILER_ENTRY), (int (*)(const void *, const void *))pcmp_entry); std::qsort(tmp, count, sizeof(PROFILER_ENTRY), (int (*)(const void *, const void *))pcmp_entry);
if (!gameInfo.isHomebrew) if (!gameInfo.isHomebrew())
{ {
fprintf(fp, "Name: %s\n", gameInfo.ROMname); fprintf(fp, "Name: %s\n", gameInfo.ROMname);
fprintf(fp, "Serial: %s\n", gameInfo.ROMserial); fprintf(fp, "Serial: %s\n", gameInfo.ROMserial);