ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/SheepShaver/src/kpx_cpu/sheepshaver_glue.cpp
(Generate patch)

Comparing SheepShaver/src/kpx_cpu/sheepshaver_glue.cpp (file contents):
Revision 1.43 by gbeauche, 2004-05-31T10:08:31Z vs.
Revision 1.44 by gbeauche, 2004-06-05T07:09:38Z

# Line 52 | Line 52
52   #include "debug.h"
53  
54   // Emulation time statistics
55 < #define EMUL_TIME_STATS 1
55 > #ifndef EMUL_TIME_STATS
56 > #define EMUL_TIME_STATS 0
57 > #endif
58  
59   #if EMUL_TIME_STATS
60   static clock_t emul_start_time;
61 < static uint32 interrupt_count = 0;
61 > static uint32 interrupt_count = 0, ppc_interrupt_count = 0;
62   static clock_t interrupt_time = 0;
63   static uint32 exec68k_count = 0;
64   static clock_t exec68k_time = 0;
# Line 596 | Line 598 | sheepshaver_cpu::interrupt_context::~int
598   void sheepshaver_cpu::interrupt(uint32 entry)
599   {
600   #if EMUL_TIME_STATS
601 <        interrupt_count++;
601 >        ppc_interrupt_count++;
602          const clock_t interrupt_start = clock();
603   #endif
604  
# Line 988 | Line 990 | void exit_emul_ppc(void)
990          printf("Total emulation time : %.1f sec\n", double(emul_time) / double(CLOCKS_PER_SEC));
991          printf("Total interrupt count: %d (%2.1f Hz)\n", interrupt_count,
992                     (double(interrupt_count) * CLOCKS_PER_SEC) / double(emul_time));
993 +        printf("Total ppc interrupt count: %d (%2.1f %%)\n", ppc_interrupt_count,
994 +                   (double(ppc_interrupt_count) * 100.0) / double(interrupt_count));
995  
996   #define PRINT_STATS(LABEL, VAR_PREFIX) do {                                                             \
997                  printf("Total " LABEL " count : %d\n", VAR_PREFIX##_count);             \
# Line 1074 | Line 1078 | void sheepshaver_cpu::handle_interrupt(v
1078          // Current interrupt nest level
1079          static int interrupt_depth = 0;
1080          ++interrupt_depth;
1081 + #if EMUL_TIME_STATS
1082 +        interrupt_count++;
1083 + #endif
1084  
1085          // Disable MacOS stack sniffer
1086          WriteMacInt32(0x110, 0);
# Line 1113 | Line 1120 | void sheepshaver_cpu::handle_interrupt(v
1120                  // 68k emulator active, within EMUL_OP routine, execute 68k interrupt routine directly when interrupt level is 0
1121                  if ((ReadMacInt32(XLM_68K_R25) & 7) == 0) {
1122                          interrupt_context ctx(this, "68k mode");
1123 + #if EMUL_TIME_STATS
1124 +                        const clock_t interrupt_start = clock();
1125 + #endif
1126   #if 1
1127                          // Execute full 68k interrupt routine
1128                          M68kRegisters r;
# Line 1138 | Line 1148 | void sheepshaver_cpu::handle_interrupt(v
1148                                  }
1149                          }
1150   #endif
1151 + #if EMUL_TIME_STATS
1152 +                        interrupt_time += (clock() - interrupt_start);
1153 + #endif
1154                  }
1155                  break;
1156   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines