? diff ? vg_intercept.my Index: vg_from_ucode.c =================================================================== RCS file: /cvsroot/valgrind/valgrind/coregrind/vg_from_ucode.c,v retrieving revision 1.18 diff -C2 -r1.18 vg_from_ucode.c *** vg_from_ucode.c 13 Nov 2002 22:42:12 -0000 1.18 --- vg_from_ucode.c 19 Nov 2002 10:54:02 -0000 *************** *** 79,82 **** --- 79,86 ---- static UInt ccall_retval_movs = 0; + #define N_OPS 66 + + static UInt UInstr_pairs[N_OPS][N_OPS]; + /* Statistics about frequency of each UInstr */ typedef *************** *** 89,92 **** --- 93,115 ---- static Histogram histogram[100]; + void print_UInstr_pairs(void) + { + Int i, j; + + VG_(printf)("-- UInstr pair frequencies ------\n"); + + for (i = 0; i < N_OPS; i++) { + for (j = 0; j < N_OPS; j++) { + Int n = UInstr_pairs[i][j]; + if (n > 0) { + VG_(printf)("%8d: %-7s, %-7s\n", + n, + VG_(name_UOpcode)(True, i), + VG_(name_UOpcode)(True, j)); + } + } + } + } + void VG_(print_ccall_stats)(void) { *************** *** 114,117 **** --- 137,142 ---- (double)ccall_retvals*100)), (ccall_retvals-ccall_retval_movs)*2); + + print_UInstr_pairs(); } *************** *** 2456,2459 **** --- 2481,2488 ---- } regs_live_before = u->regs_live_after; + + if (i > 0) { + UInstr_pairs [ cb->instrs[i-1].opcode ] [ cb->instrs[i].opcode ]++; + } } if (dis) VG_(printf)("\n");