• Home
  • Raw
  • Download

Lines Matching refs:CLG_

49 CommandLineOptions CLG_(clo);
50 Statistics CLG_(stat);
51 Bool CLG_(instrument_state) = True; /* Instrumentation on ? */
54 exec_state CLG_(current_state);
58 Int CLG_(min_line_size) = 0;
65 static void CLG_(init_statistics)(Statistics* s) in CLG_() function
115 CLG_(bb_base) + ii->instr_offset, ii->instr_size); in log_global_event()
117 if (!CLG_(current_state).collect) return; in log_global_event()
121 CLG_(current_state).cost[ fullOffset(EG_BUS) ]++; in log_global_event()
123 if (CLG_(current_state).nonskipped) in log_global_event()
124 cost_Bus = CLG_(current_state).nonskipped->skipped + fullOffset(EG_BUS); in log_global_event()
126 cost_Bus = CLG_(cost_base) + ii->cost_offset + ii->eventset->offset[EG_BUS]; in log_global_event()
144 CLG_(bb_base) + ii->instr_offset, taken); in log_cond_branch()
146 miss = 1 & do_cond_branch_predict(CLG_(bb_base) + ii->instr_offset, taken); in log_cond_branch()
148 if (!CLG_(current_state).collect) return; in log_cond_branch()
152 if (CLG_(current_state).nonskipped) in log_cond_branch()
153 cost_Bc = CLG_(current_state).nonskipped->skipped + fullOffset(EG_BC); in log_cond_branch()
155 cost_Bc = CLG_(cost_base) + ii->cost_offset + ii->eventset->offset[EG_BC]; in log_cond_branch()
158 CLG_(current_state).cost[ fullOffset_Bc ]++; in log_cond_branch()
161 CLG_(current_state).cost[ fullOffset_Bc+1 ]++; in log_cond_branch()
174 CLG_(bb_base) + ii->instr_offset, actual_dst); in log_ind_branch()
176 miss = 1 & do_ind_branch_predict(CLG_(bb_base) + ii->instr_offset, actual_dst); in log_ind_branch()
178 if (!CLG_(current_state).collect) return; in log_ind_branch()
182 if (CLG_(current_state).nonskipped) in log_ind_branch()
183 cost_Bi = CLG_(current_state).nonskipped->skipped + fullOffset(EG_BI); in log_ind_branch()
185 cost_Bi = CLG_(cost_base) + ii->cost_offset + ii->eventset->offset[EG_BI]; in log_ind_branch()
188 CLG_(current_state).cost[ fullOffset_Bi ]++; in log_ind_branch()
191 CLG_(current_state).cost[ fullOffset_Bi+1 ]++; in log_ind_branch()
399 ev->inode->eventset = CLG_(sets).base; in flushEvents()
403 ev->inode->eventset = CLG_(add_event_group)(ev->inode->eventset, in flushEvents()
409 ev->inode->eventset = CLG_(add_event_group)(ev->inode->eventset, in flushEvents()
414 ev->inode->eventset = CLG_(add_event_group)(ev->inode->eventset, in flushEvents()
419 ev->inode->eventset = CLG_(add_event_group)(ev->inode->eventset, in flushEvents()
424 ev->inode->eventset = CLG_(add_event_group)(ev->inode->eventset, in flushEvents()
471 helperName = CLG_(cachesim).log_1I1Dr_name; in flushEvents()
472 helperAddr = CLG_(cachesim).log_1I1Dr; in flushEvents()
483 helperName = CLG_(cachesim).log_1I1Dw_name; in flushEvents()
484 helperAddr = CLG_(cachesim).log_1I1Dw; in flushEvents()
494 helperName = CLG_(cachesim).log_3I0D_name; in flushEvents()
495 helperAddr = CLG_(cachesim).log_3I0D; in flushEvents()
505 helperName = CLG_(cachesim).log_2I0D_name; in flushEvents()
506 helperAddr = CLG_(cachesim).log_2I0D; in flushEvents()
514 helperName = CLG_(cachesim).log_1I0D_name; in flushEvents()
515 helperAddr = CLG_(cachesim).log_1I0D; in flushEvents()
523 helperName = CLG_(cachesim).log_0I1Dr_name; in flushEvents()
524 helperAddr = CLG_(cachesim).log_0I1Dr; in flushEvents()
534 helperName = CLG_(cachesim).log_0I1Dw_name; in flushEvents()
535 helperAddr = CLG_(cachesim).log_0I1Dw; in flushEvents()
604 if (!CLG_(clo).simulate_cache) return; in addEvent_Ir()
622 if (!CLG_(clo).simulate_cache) return; in addEvent_Dr()
623 tl_assert(datasize <= CLG_(min_line_size)); in addEvent_Dr()
643 if (!CLG_(clo).simulate_cache) return; in addEvent_Dw()
644 tl_assert(datasize <= CLG_(min_line_size)); in addEvent_Dw()
681 if (!CLG_(clo).simulate_cache) return; in addEvent_D_guarded()
682 tl_assert(datasize <= CLG_(min_line_size)); in addEvent_D_guarded()
701 helperName = isWrite ? CLG_(cachesim).log_0I1Dw_name in addEvent_D_guarded()
702 : CLG_(cachesim).log_0I1Dr_name; in addEvent_D_guarded()
703 helperAddr = isWrite ? CLG_(cachesim).log_0I1Dw in addEvent_D_guarded()
704 : CLG_(cachesim).log_0I1Dr; in addEvent_D_guarded()
723 if (!CLG_(clo).simulate_branch) return; in addEvent_Bc()
743 if (!CLG_(clo).simulate_branch) return; in addEvent_Bi()
760 if (!CLG_(clo).collect_bus) return; in addEvent_G()
799 CLG_(stat).distinct_instrs++; in next_InstrInfo()
861 void CLG_(collectBlockInfo)(IRSB* sbIn, in CLG_() function
946 VG_(fnptr_to_fnentry)( & CLG_(setup_bbcc) ), in addBBSetupCall()
953 IRSB* CLG_(instrument)( VgCallbackClosure* closure, in CLG_() function
974 if (! CLG_(instrument_state)) { in CLG_()
1007 clgs.bb = CLG_(get_bb)(origAddr, sbIn, &(clgs.seen_before)); in CLG_()
1107 if (CLG_(clo).simulate_cache && dataSize > CLG_(min_line_size)) in CLG_()
1108 dataSize = CLG_(min_line_size); in CLG_()
1249 (UWord) &CLG_(current_state).jmps_passed, in CLG_()
1303 (UWord) &CLG_(current_state).jmps_passed, in CLG_()
1385 CLG_(delete_bb)(vge.base[0]); in clg_discard_superblock_info()
1399 for(i = 0; i < CLG_(current_call_stack).sp; i++) { in zero_thread_cost()
1400 if (!CLG_(current_call_stack).entry[i].jcc) continue; in zero_thread_cost()
1403 CLG_(copy_cost)( CLG_(sets).full, in zero_thread_cost()
1404 CLG_(current_call_stack).entry[i].enter_cost, in zero_thread_cost()
1405 CLG_(current_state).cost ); in zero_thread_cost()
1406 CLG_(current_call_stack).entry[i].jcc->call_counter = 0; in zero_thread_cost()
1409 CLG_(forall_bbccs)(CLG_(zero_bbcc)); in zero_thread_cost()
1412 CLG_(copy_cost)( CLG_(sets).full, in zero_thread_cost()
1413 t->lastdump_cost, CLG_(current_state).cost ); in zero_thread_cost()
1416 void CLG_(zero_all_cost)(Bool only_current_thread) in CLG_() function
1422 zero_thread_cost(CLG_(get_current_thread)()); in CLG_()
1424 CLG_(forall_threads)(zero_thread_cost); in CLG_()
1434 while(CLG_(current_state).sig !=0) in unwind_thread()
1435 CLG_(post_signal)(CLG_(current_tid),CLG_(current_state).sig); in unwind_thread()
1438 while(CLG_(current_call_stack).sp>0) in unwind_thread()
1439 CLG_(pop_call_stack)(); in unwind_thread()
1442 CLG_(init_exec_state)( &CLG_(current_state) ); in unwind_thread()
1443 CLG_(current_fn_stack).top = CLG_(current_fn_stack).bottom; in unwind_thread()
1449 CLG_(zero_cost)( CLG_(sets).full, CLG_(current_state).cost ); in zero_state_cost()
1452 void CLG_(set_instrument_state)(const HChar* reason, Bool state) in CLG_() function
1454 if (CLG_(instrument_state) == state) { in CLG_()
1459 CLG_(instrument_state) = state; in CLG_()
1466 CLG_(forall_threads)(unwind_thread); in CLG_()
1467 CLG_(forall_threads)(zero_state_cost); in CLG_()
1468 (*CLG_(cachesim).clear)(); in CLG_()
1484 t = CLG_(current_tid); in dump_state_of_thread_togdb()
1485 CLG_(init_cost_lz)( CLG_(sets).full, &sum ); in dump_state_of_thread_togdb()
1486 CLG_(copy_cost_lz)( CLG_(sets).full, &tmp, ti->lastdump_cost ); in dump_state_of_thread_togdb()
1487 CLG_(add_diff_cost)( CLG_(sets).full, sum, ti->lastdump_cost, in dump_state_of_thread_togdb()
1489 CLG_(copy_cost)( CLG_(sets).full, ti->lastdump_cost, tmp ); in dump_state_of_thread_togdb()
1490 mcost = CLG_(mappingcost_as_string)(CLG_(dumpmap), sum); in dump_state_of_thread_togdb()
1493 VG_(gdb_printf)("frames-%d: %d\n", t, CLG_(current_call_stack).sp); in dump_state_of_thread_togdb()
1496 for(i = 0; i < CLG_(current_call_stack).sp; i++) { in dump_state_of_thread_togdb()
1497 ce = CLG_(get_call_entry)(i); in dump_state_of_thread_togdb()
1506 CLG_(copy_cost)( CLG_(sets).full, sum, ce->jcc->cost ); in dump_state_of_thread_togdb()
1507 CLG_(copy_cost)( CLG_(sets).full, tmp, ce->enter_cost ); in dump_state_of_thread_togdb()
1508 CLG_(add_diff_cost)( CLG_(sets).full, sum, in dump_state_of_thread_togdb()
1509 ce->enter_cost, CLG_(current_state).cost ); in dump_state_of_thread_togdb()
1510 CLG_(copy_cost)( CLG_(sets).full, ce->enter_cost, tmp ); in dump_state_of_thread_togdb()
1512 mcost = CLG_(mappingcost_as_string)(CLG_(dumpmap), sum); in dump_state_of_thread_togdb()
1527 Int orig_tid = CLG_(current_tid); in dump_state_togdb()
1530 CLG_(instrument_state) ? "on":"off"); in dump_state_togdb()
1531 if (!CLG_(instrument_state)) return; in dump_state_togdb()
1533 VG_(gdb_printf)("executed-bbs: %llu\n", CLG_(stat).bb_executions); in dump_state_togdb()
1534 VG_(gdb_printf)("executed-calls: %llu\n", CLG_(stat).call_counter); in dump_state_togdb()
1535 VG_(gdb_printf)("distinct-bbs: %d\n", CLG_(stat).distinct_bbs); in dump_state_togdb()
1536 VG_(gdb_printf)("distinct-calls: %d\n", CLG_(stat).distinct_jccs); in dump_state_togdb()
1537 VG_(gdb_printf)("distinct-functions: %d\n", CLG_(stat).distinct_fns); in dump_state_togdb()
1538 VG_(gdb_printf)("distinct-contexts: %d\n", CLG_(stat).distinct_contexts); in dump_state_togdb()
1541 HChar *evmap = CLG_(eventmapping_as_string)(CLG_(dumpmap)); in dump_state_togdb()
1545 VG_(gdb_printf)("part: %d\n", CLG_(get_dump_counter)()); in dump_state_togdb()
1548 th = CLG_(get_threads)(); in dump_state_togdb()
1556 CLG_(forall_threads)(dump_state_of_thread_togdb); in dump_state_togdb()
1595 CLG_(dump_profile)(req, False); in handle_gdb_monitor_command()
1599 CLG_(zero_all_cost)(False); in handle_gdb_monitor_command()
1611 if (!CLG_(instrument_state)) { in handle_gdb_monitor_command()
1615 thread_info** th = CLG_(get_threads)(); in handle_gdb_monitor_command()
1628 CLG_(instrument_state) ? "on":"off"); in handle_gdb_monitor_command()
1631 CLG_(set_instrument_state)("Command", VG_(strcmp)(arg,"off")!=0); in handle_gdb_monitor_command()
1642 Bool CLG_(handle_client_request)(ThreadId tid, UWord *args, UWord *ret) in CLG_() function
1650 CLG_(dump_profile)("Client Request", True); in CLG_()
1659 CLG_(dump_profile)(buf, True); in CLG_()
1665 CLG_(zero_all_cost)(True); in CLG_()
1670 CLG_(current_state).collect = !CLG_(current_state).collect; in CLG_()
1672 CLG_(current_state).collect ? "ON" : "OFF"); in CLG_()
1677 CLG_(set_instrument_state)("Client Request", True); in CLG_()
1682 CLG_(set_instrument_state)("Client Request", False); in CLG_()
1712 void CLG_(pre_syscalltime)(ThreadId tid, UInt syscallno, in CLG_() function
1715 if (CLG_(clo).collect_systime) { in CLG_()
1727 void CLG_(post_syscalltime)(ThreadId tid, UInt syscallno, in CLG_() function
1730 if (CLG_(clo).collect_systime && in CLG_()
1731 CLG_(current_state).bbcc) { in CLG_()
1749 CLG_(current_state).cost[o] ++; in CLG_()
1750 CLG_(current_state).cost[o+1] += diff; in CLG_()
1751 if (!CLG_(current_state).bbcc->skipped) in CLG_()
1752 CLG_(init_cost_lz)(CLG_(sets).full, in CLG_()
1753 &(CLG_(current_state).bbcc->skipped)); in CLG_()
1754 CLG_(current_state).bbcc->skipped[o] ++; in CLG_()
1755 CLG_(current_state).bbcc->skipped[o+1] += diff; in CLG_()
1778 total = CLG_(total_cost); in branchsim_printstat()
1810 CLG_(stat).full_debug_BBs + in clg_print_stats()
1811 CLG_(stat).fn_name_debug_BBs + in clg_print_stats()
1812 CLG_(stat).file_line_debug_BBs + in clg_print_stats()
1813 CLG_(stat).no_debug_BBs; in clg_print_stats()
1817 CLG_(stat).distinct_objs); in clg_print_stats()
1819 CLG_(stat).distinct_files); in clg_print_stats()
1821 CLG_(stat).distinct_fns); in clg_print_stats()
1823 CLG_(stat).distinct_contexts); in clg_print_stats()
1825 CLG_(stat).distinct_bbs); in clg_print_stats()
1827 CLG_(costarray_entries), CLG_(costarray_chunks)); in clg_print_stats()
1829 CLG_(stat).distinct_bbccs); in clg_print_stats()
1831 CLG_(stat).distinct_jccs); in clg_print_stats()
1833 CLG_(stat).distinct_skips); in clg_print_stats()
1838 CLG_(stat).full_debug_BBs * 100 / BB_lookups, in clg_print_stats()
1839 CLG_(stat).full_debug_BBs); in clg_print_stats()
1841 CLG_(stat).file_line_debug_BBs * 100 / BB_lookups, in clg_print_stats()
1842 CLG_(stat).file_line_debug_BBs); in clg_print_stats()
1844 CLG_(stat).fn_name_debug_BBs * 100 / BB_lookups, in clg_print_stats()
1845 CLG_(stat).fn_name_debug_BBs); in clg_print_stats()
1847 CLG_(stat).no_debug_BBs * 100 / BB_lookups, in clg_print_stats()
1848 CLG_(stat).no_debug_BBs); in clg_print_stats()
1851 CLG_(stat).bbcc_clones); in clg_print_stats()
1853 CLG_(stat).bb_retranslations); in clg_print_stats()
1855 CLG_(stat).distinct_instrs); in clg_print_stats()
1858 CLG_(stat).cxt_lru_misses); in clg_print_stats()
1860 CLG_(stat).bbcc_lru_misses); in clg_print_stats()
1862 CLG_(stat).jcc_lru_misses); in clg_print_stats()
1864 CLG_(stat).bb_executions); in clg_print_stats()
1866 CLG_(stat).call_counter); in clg_print_stats()
1868 CLG_(stat).jcnd_counter); in clg_print_stats()
1870 CLG_(stat).jump_counter); in clg_print_stats()
1872 CLG_(stat).rec_call_counter); in clg_print_stats()
1874 CLG_(stat).ret_counter); in clg_print_stats()
1887 (*CLG_(cachesim).finish)(); in finish()
1891 CLG_(forall_threads)(unwind_thread); in finish()
1893 CLG_(dump_profile)(0, False); in finish()
1903 HChar *evmap = CLG_(eventmapping_as_string)(CLG_(dumpmap)); in finish()
1906 HChar *mcost = CLG_(mappingcost_as_string)(CLG_(dumpmap), CLG_(total_cost)); in finish()
1912 total = CLG_(total_cost); in finish()
1915 if (CLG_(clo).simulate_cache) { in finish()
1919 if (CLG_(clo).simulate_branch) { in finish()
1932 if (CLG_(clo).simulate_cache) in finish()
1933 (*CLG_(cachesim).printstat)(l1, l2, l3); in finish()
1935 if (CLG_(clo).simulate_branch) in finish()
1941 void CLG_(fini)(Int exitcode) in CLG_() function
1962 CLG_(run_thread)( tid ); in clg_start_client_code_callback()
1966 void CLG_(post_clo_init)(void) in CLG_() function
1978 if (CLG_(clo).collect_systime) { in CLG_()
1979 VG_(needs_syscall_wrapper)(CLG_(pre_syscalltime), in CLG_()
1980 CLG_(post_syscalltime)); in CLG_()
2010 CLG_DEBUG(1, " dump threads: %s\n", CLG_(clo).separate_threads ? "Yes":"No"); in CLG_()
2011 CLG_DEBUG(1, " call sep. : %d\n", CLG_(clo).separate_callers); in CLG_()
2012 CLG_DEBUG(1, " rec. sep. : %d\n", CLG_(clo).separate_recursions); in CLG_()
2014 if (!CLG_(clo).dump_line && !CLG_(clo).dump_instr && !CLG_(clo).dump_bb) { in CLG_()
2016 CLG_(clo).dump_line = True; in CLG_()
2019 CLG_(init_dumps)(); in CLG_()
2021 (*CLG_(cachesim).post_clo_init)(); in CLG_()
2023 CLG_(init_eventsets)(); in CLG_()
2024 CLG_(init_statistics)(& CLG_(stat)); in CLG_()
2025 CLG_(init_cost_lz)( CLG_(sets).full, &CLG_(total_cost) ); in CLG_()
2028 CLG_(init_obj_table)(); in CLG_()
2029 CLG_(init_cxt_table)(); in CLG_()
2030 CLG_(init_bb_hash)(); in CLG_()
2032 CLG_(init_threads)(); in CLG_()
2033 CLG_(run_thread)(1); in CLG_()
2035 CLG_(instrument_state) = CLG_(clo).instrument_atstart; in CLG_()
2046 void CLG_(pre_clo_init)(void) in CLG_() function
2063 VG_(basic_tool_funcs) (CLG_(post_clo_init), in CLG_()
2064 CLG_(instrument), in CLG_()
2065 CLG_(fini)); in CLG_()
2070 VG_(needs_command_line_options)(CLG_(process_cmd_line_option), in CLG_()
2071 CLG_(print_usage), in CLG_()
2072 CLG_(print_debug_usage)); in CLG_()
2074 VG_(needs_client_requests)(CLG_(handle_client_request)); in CLG_()
2078 VG_(track_pre_deliver_signal) ( & CLG_(pre_signal) ); in CLG_()
2079 VG_(track_post_deliver_signal)( & CLG_(post_signal) ); in CLG_()
2081 CLG_(set_clo_defaults)(); in CLG_()
2085 VG_DETERMINE_INTERFACE_VERSION(CLG_(pre_clo_init))