• Home
  • Raw
  • Download

Lines Matching refs:CLG_

48 CommandLineOptions CLG_(clo);
49 Statistics CLG_(stat);
50 Bool CLG_(instrument_state) = True; /* Instrumentation on ? */
53 exec_state CLG_(current_state);
57 Int CLG_(min_line_size) = 0;
64 static void CLG_(init_statistics)(Statistics* s) in CLG_() function
114 CLG_(bb_base) + ii->instr_offset, ii->instr_size); in log_global_event()
116 if (!CLG_(current_state).collect) return; in log_global_event()
120 CLG_(current_state).cost[ fullOffset(EG_BUS) ]++; in log_global_event()
122 if (CLG_(current_state).nonskipped) in log_global_event()
123 cost_Bus = CLG_(current_state).nonskipped->skipped + fullOffset(EG_BUS); in log_global_event()
125 cost_Bus = CLG_(cost_base) + ii->cost_offset + ii->eventset->offset[EG_BUS]; in log_global_event()
143 CLG_(bb_base) + ii->instr_offset, taken); in log_cond_branch()
145 miss = 1 & do_cond_branch_predict(CLG_(bb_base) + ii->instr_offset, taken); in log_cond_branch()
147 if (!CLG_(current_state).collect) return; in log_cond_branch()
151 if (CLG_(current_state).nonskipped) in log_cond_branch()
152 cost_Bc = CLG_(current_state).nonskipped->skipped + fullOffset(EG_BC); in log_cond_branch()
154 cost_Bc = CLG_(cost_base) + ii->cost_offset + ii->eventset->offset[EG_BC]; in log_cond_branch()
157 CLG_(current_state).cost[ fullOffset_Bc ]++; in log_cond_branch()
160 CLG_(current_state).cost[ fullOffset_Bc+1 ]++; in log_cond_branch()
173 CLG_(bb_base) + ii->instr_offset, actual_dst); in log_ind_branch()
175 miss = 1 & do_ind_branch_predict(CLG_(bb_base) + ii->instr_offset, actual_dst); in log_ind_branch()
177 if (!CLG_(current_state).collect) return; in log_ind_branch()
181 if (CLG_(current_state).nonskipped) in log_ind_branch()
182 cost_Bi = CLG_(current_state).nonskipped->skipped + fullOffset(EG_BI); in log_ind_branch()
184 cost_Bi = CLG_(cost_base) + ii->cost_offset + ii->eventset->offset[EG_BI]; in log_ind_branch()
187 CLG_(current_state).cost[ fullOffset_Bi ]++; in log_ind_branch()
190 CLG_(current_state).cost[ fullOffset_Bi+1 ]++; in log_ind_branch()
398 ev->inode->eventset = CLG_(sets).base; in flushEvents()
402 ev->inode->eventset = CLG_(add_event_group)(ev->inode->eventset, in flushEvents()
408 ev->inode->eventset = CLG_(add_event_group)(ev->inode->eventset, in flushEvents()
413 ev->inode->eventset = CLG_(add_event_group)(ev->inode->eventset, in flushEvents()
418 ev->inode->eventset = CLG_(add_event_group)(ev->inode->eventset, in flushEvents()
423 ev->inode->eventset = CLG_(add_event_group)(ev->inode->eventset, in flushEvents()
470 helperName = CLG_(cachesim).log_1I1Dr_name; in flushEvents()
471 helperAddr = CLG_(cachesim).log_1I1Dr; in flushEvents()
482 helperName = CLG_(cachesim).log_1I1Dw_name; in flushEvents()
483 helperAddr = CLG_(cachesim).log_1I1Dw; in flushEvents()
493 helperName = CLG_(cachesim).log_3I0D_name; in flushEvents()
494 helperAddr = CLG_(cachesim).log_3I0D; in flushEvents()
504 helperName = CLG_(cachesim).log_2I0D_name; in flushEvents()
505 helperAddr = CLG_(cachesim).log_2I0D; in flushEvents()
513 helperName = CLG_(cachesim).log_1I0D_name; in flushEvents()
514 helperAddr = CLG_(cachesim).log_1I0D; in flushEvents()
522 helperName = CLG_(cachesim).log_0I1Dr_name; in flushEvents()
523 helperAddr = CLG_(cachesim).log_0I1Dr; in flushEvents()
533 helperName = CLG_(cachesim).log_0I1Dw_name; in flushEvents()
534 helperAddr = CLG_(cachesim).log_0I1Dw; in flushEvents()
603 if (!CLG_(clo).simulate_cache) return; in addEvent_Ir()
621 if (!CLG_(clo).simulate_cache) return; in addEvent_Dr()
622 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()
678 if (!CLG_(clo).simulate_branch) return; in addEvent_Bc()
698 if (!CLG_(clo).simulate_branch) return; in addEvent_Bi()
715 if (!CLG_(clo).collect_bus) return; in addEvent_G()
754 CLG_(stat).distinct_instrs++; in next_InstrInfo()
816 void CLG_(collectBlockInfo)(IRSB* sbIn, in CLG_() function
901 VG_(fnptr_to_fnentry)( & CLG_(setup_bbcc) ), in addBBSetupCall()
908 IRSB* CLG_(instrument)( VgCallbackClosure* closure, in CLG_() function
928 if (! CLG_(instrument_state)) { in CLG_()
961 clgs.bb = CLG_(get_bb)(origAddr, sbIn, &(clgs.seen_before)); in CLG_()
1036 if (CLG_(clo).simulate_cache && dataSize > CLG_(min_line_size)) in CLG_()
1037 dataSize = CLG_(min_line_size); in CLG_()
1175 (UWord) &CLG_(current_state).jmps_passed, in CLG_()
1227 (UWord) &CLG_(current_state).jmps_passed, in CLG_()
1309 CLG_(delete_bb)(orig_addr); in clg_discard_superblock_info()
1323 for(i = 0; i < CLG_(current_call_stack).sp; i++) { in zero_thread_cost()
1324 if (!CLG_(current_call_stack).entry[i].jcc) continue; in zero_thread_cost()
1327 CLG_(copy_cost)( CLG_(sets).full, in zero_thread_cost()
1328 CLG_(current_call_stack).entry[i].enter_cost, in zero_thread_cost()
1329 CLG_(current_state).cost ); in zero_thread_cost()
1330 CLG_(current_call_stack).entry[i].jcc->call_counter = 0; in zero_thread_cost()
1333 CLG_(forall_bbccs)(CLG_(zero_bbcc)); in zero_thread_cost()
1336 CLG_(copy_cost)( CLG_(sets).full, in zero_thread_cost()
1337 t->lastdump_cost, CLG_(current_state).cost ); in zero_thread_cost()
1340 void CLG_(zero_all_cost)(Bool only_current_thread) in CLG_() function
1346 zero_thread_cost(CLG_(get_current_thread)()); in CLG_()
1348 CLG_(forall_threads)(zero_thread_cost); in CLG_()
1358 while(CLG_(current_state).sig !=0) in unwind_thread()
1359 CLG_(post_signal)(CLG_(current_tid),CLG_(current_state).sig); in unwind_thread()
1362 while(CLG_(current_call_stack).sp>0) in unwind_thread()
1363 CLG_(pop_call_stack)(); in unwind_thread()
1366 CLG_(init_exec_state)( &CLG_(current_state) ); in unwind_thread()
1367 CLG_(current_fn_stack).top = CLG_(current_fn_stack).bottom; in unwind_thread()
1373 CLG_(zero_cost)( CLG_(sets).full, CLG_(current_state).cost ); in zero_state_cost()
1379 void CLG_(set_instrument_state)(Char* reason, Bool state) in CLG_() function
1381 if (CLG_(instrument_state) == state) { in CLG_()
1386 CLG_(instrument_state) = state; in CLG_()
1393 CLG_(forall_threads)(unwind_thread); in CLG_()
1394 CLG_(forall_threads)(zero_state_cost); in CLG_()
1395 (*CLG_(cachesim).clear)(); in CLG_()
1411 t = CLG_(current_tid); in dump_state_of_thread_togdb()
1412 CLG_(init_cost_lz)( CLG_(sets).full, &sum ); in dump_state_of_thread_togdb()
1413 CLG_(copy_cost_lz)( CLG_(sets).full, &tmp, ti->lastdump_cost ); in dump_state_of_thread_togdb()
1414 CLG_(add_diff_cost)( CLG_(sets).full, sum, ti->lastdump_cost, in dump_state_of_thread_togdb()
1416 CLG_(copy_cost)( CLG_(sets).full, ti->lastdump_cost, tmp ); in dump_state_of_thread_togdb()
1417 CLG_(sprint_mappingcost)(buf, CLG_(dumpmap), sum); in dump_state_of_thread_togdb()
1419 VG_(gdb_printf)("frames-%d: %d\n", t, CLG_(current_call_stack).sp); in dump_state_of_thread_togdb()
1422 for(i = 0; i < CLG_(current_call_stack).sp; i++) { in dump_state_of_thread_togdb()
1423 ce = CLG_(get_call_entry)(i); in dump_state_of_thread_togdb()
1432 CLG_(copy_cost)( CLG_(sets).full, sum, ce->jcc->cost ); in dump_state_of_thread_togdb()
1433 CLG_(copy_cost)( CLG_(sets).full, tmp, ce->enter_cost ); in dump_state_of_thread_togdb()
1434 CLG_(add_diff_cost)( CLG_(sets).full, sum, in dump_state_of_thread_togdb()
1435 ce->enter_cost, CLG_(current_state).cost ); in dump_state_of_thread_togdb()
1436 CLG_(copy_cost)( CLG_(sets).full, ce->enter_cost, tmp ); in dump_state_of_thread_togdb()
1439 CLG_(sprint_mappingcost)(buf + p, CLG_(dumpmap), sum ); in dump_state_of_thread_togdb()
1454 Int orig_tid = CLG_(current_tid); in dump_state_togdb()
1457 CLG_(instrument_state) ? "on":"off"); in dump_state_togdb()
1458 if (!CLG_(instrument_state)) return; in dump_state_togdb()
1460 VG_(gdb_printf)("executed-bbs: %llu\n", CLG_(stat).bb_executions); in dump_state_togdb()
1461 VG_(gdb_printf)("executed-calls: %llu\n", CLG_(stat).call_counter); in dump_state_togdb()
1462 VG_(gdb_printf)("distinct-bbs: %d\n", CLG_(stat).distinct_bbs); in dump_state_togdb()
1463 VG_(gdb_printf)("distinct-calls: %d\n", CLG_(stat).distinct_jccs); in dump_state_togdb()
1464 VG_(gdb_printf)("distinct-functions: %d\n", CLG_(stat).distinct_fns); in dump_state_togdb()
1465 VG_(gdb_printf)("distinct-contexts: %d\n", CLG_(stat).distinct_contexts); in dump_state_togdb()
1469 CLG_(sprint_eventmapping)(buf+p, CLG_(dumpmap)); in dump_state_togdb()
1472 VG_(gdb_printf)("part: %d\n", CLG_(get_dump_counter)()); in dump_state_togdb()
1475 th = CLG_(get_threads)(); in dump_state_togdb()
1483 CLG_(forall_threads)(dump_state_of_thread_togdb); in dump_state_togdb()
1522 CLG_(dump_profile)(req, False); in handle_gdb_monitor_command()
1526 CLG_(zero_all_cost)(False); in handle_gdb_monitor_command()
1538 if (!CLG_(instrument_state)) { in handle_gdb_monitor_command()
1542 thread_info** th = CLG_(get_threads)(); in handle_gdb_monitor_command()
1555 CLG_(instrument_state) ? "on":"off"); in handle_gdb_monitor_command()
1558 CLG_(set_instrument_state)("Command", VG_(strcmp)(arg,"off")!=0); in handle_gdb_monitor_command()
1569 Bool CLG_(handle_client_request)(ThreadId tid, UWord *args, UWord *ret) in CLG_() function
1577 CLG_(dump_profile)("Client Request", True); in CLG_()
1585 CLG_(dump_profile)(buf, True); in CLG_()
1591 CLG_(zero_all_cost)(True); in CLG_()
1596 CLG_(current_state).collect = !CLG_(current_state).collect; in CLG_()
1598 CLG_(current_state).collect ? "ON" : "OFF"); in CLG_()
1603 CLG_(set_instrument_state)("Client Request", True); in CLG_()
1608 CLG_(set_instrument_state)("Client Request", False); in CLG_()
1642 void CLG_(pre_syscalltime)(ThreadId tid, UInt syscallno, in CLG_() function
1645 if (CLG_(clo).collect_systime) { in CLG_()
1657 void CLG_(post_syscalltime)(ThreadId tid, UInt syscallno, in CLG_() function
1660 if (CLG_(clo).collect_systime && in CLG_()
1661 CLG_(current_state).bbcc) { in CLG_()
1678 CLG_(current_state).cost[o] ++; in CLG_()
1679 CLG_(current_state).cost[o+1] += diff; in CLG_()
1680 if (!CLG_(current_state).bbcc->skipped) in CLG_()
1681 CLG_(init_cost_lz)(CLG_(sets).full, in CLG_()
1682 &(CLG_(current_state).bbcc->skipped)); in CLG_()
1683 CLG_(current_state).bbcc->skipped[o] ++; in CLG_()
1684 CLG_(current_state).bbcc->skipped[o+1] += diff; in CLG_()
1707 total = CLG_(total_cost); in branchsim_printstat()
1746 (*CLG_(cachesim).finish)(); in finish()
1750 CLG_(forall_threads)(unwind_thread); in finish()
1752 CLG_(dump_profile)(0, False); in finish()
1759 CLG_(stat).full_debug_BBs + in finish()
1760 CLG_(stat).fn_name_debug_BBs + in finish()
1761 CLG_(stat).file_line_debug_BBs + in finish()
1762 CLG_(stat).no_debug_BBs; in finish()
1766 CLG_(stat).distinct_objs); in finish()
1768 CLG_(stat).distinct_files); in finish()
1770 CLG_(stat).distinct_fns); in finish()
1772 CLG_(stat).distinct_contexts); in finish()
1774 CLG_(stat).distinct_bbs); in finish()
1776 CLG_(costarray_entries), CLG_(costarray_chunks)); in finish()
1778 CLG_(stat).distinct_bbccs); in finish()
1780 CLG_(stat).distinct_jccs); in finish()
1782 CLG_(stat).distinct_skips); in finish()
1787 CLG_(stat).full_debug_BBs * 100 / BB_lookups, in finish()
1788 CLG_(stat).full_debug_BBs); in finish()
1790 CLG_(stat).file_line_debug_BBs * 100 / BB_lookups, in finish()
1791 CLG_(stat).file_line_debug_BBs); in finish()
1793 CLG_(stat).fn_name_debug_BBs * 100 / BB_lookups, in finish()
1794 CLG_(stat).fn_name_debug_BBs); in finish()
1796 CLG_(stat).no_debug_BBs * 100 / BB_lookups, in finish()
1797 CLG_(stat).no_debug_BBs); in finish()
1800 CLG_(stat).bbcc_clones); in finish()
1802 CLG_(stat).bb_retranslations); in finish()
1804 CLG_(stat).distinct_instrs); in finish()
1808 CLG_(stat).cxt_lru_misses); in finish()
1810 CLG_(stat).bbcc_lru_misses); in finish()
1812 CLG_(stat).jcc_lru_misses); in finish()
1814 CLG_(stat).bb_executions); in finish()
1816 CLG_(stat).call_counter); in finish()
1818 CLG_(stat).jcnd_counter); in finish()
1820 CLG_(stat).jump_counter); in finish()
1822 CLG_(stat).rec_call_counter); in finish()
1824 CLG_(stat).ret_counter); in finish()
1829 CLG_(sprint_eventmapping)(buf, CLG_(dumpmap)); in finish()
1831 CLG_(sprint_mappingcost)(buf, CLG_(dumpmap), CLG_(total_cost)); in finish()
1836 total = CLG_(total_cost); in finish()
1839 if (CLG_(clo).simulate_cache) { in finish()
1843 if (CLG_(clo).simulate_branch) { in finish()
1856 if (CLG_(clo).simulate_cache) in finish()
1857 (*CLG_(cachesim).printstat)(l1, l2, l3); in finish()
1859 if (CLG_(clo).simulate_branch) in finish()
1865 void CLG_(fini)(Int exitcode) in CLG_() function
1886 CLG_(run_thread)( tid ); in clg_start_client_code_callback()
1890 void CLG_(post_clo_init)(void) in CLG_() function
1895 CLG_DEBUG(1, " dump threads: %s\n", CLG_(clo).separate_threads ? "Yes":"No"); in CLG_()
1896 CLG_DEBUG(1, " call sep. : %d\n", CLG_(clo).separate_callers); in CLG_()
1897 CLG_DEBUG(1, " rec. sep. : %d\n", CLG_(clo).separate_recursions); in CLG_()
1899 if (!CLG_(clo).dump_line && !CLG_(clo).dump_instr && !CLG_(clo).dump_bb) { in CLG_()
1901 CLG_(clo).dump_line = True; in CLG_()
1904 CLG_(init_dumps)(); in CLG_()
1906 (*CLG_(cachesim).post_clo_init)(); in CLG_()
1908 CLG_(init_eventsets)(); in CLG_()
1909 CLG_(init_statistics)(& CLG_(stat)); in CLG_()
1910 CLG_(init_cost_lz)( CLG_(sets).full, &CLG_(total_cost) ); in CLG_()
1913 CLG_(init_obj_table)(); in CLG_()
1914 CLG_(init_cxt_table)(); in CLG_()
1915 CLG_(init_bb_hash)(); in CLG_()
1917 CLG_(init_threads)(); in CLG_()
1918 CLG_(run_thread)(1); in CLG_()
1920 CLG_(instrument_state) = CLG_(clo).instrument_atstart; in CLG_()
1929 void CLG_(pre_clo_init)(void) in CLG_() function
1939 VG_(basic_tool_funcs) (CLG_(post_clo_init), in CLG_()
1940 CLG_(instrument), in CLG_()
1941 CLG_(fini)); in CLG_()
1946 VG_(needs_command_line_options)(CLG_(process_cmd_line_option), in CLG_()
1947 CLG_(print_usage), in CLG_()
1948 CLG_(print_debug_usage)); in CLG_()
1950 VG_(needs_client_requests)(CLG_(handle_client_request)); in CLG_()
1951 VG_(needs_syscall_wrapper)(CLG_(pre_syscalltime), in CLG_()
1952 CLG_(post_syscalltime)); in CLG_()
1955 VG_(track_pre_deliver_signal) ( & CLG_(pre_signal) ); in CLG_()
1956 VG_(track_post_deliver_signal)( & CLG_(post_signal) ); in CLG_()
1958 CLG_(set_clo_defaults)(); in CLG_()
1961 VG_DETERMINE_INTERFACE_VERSION(CLG_(pre_clo_init))