Lines Matching refs:CLG_
62 ThreadId CLG_(current_tid);
66 thread_info** CLG_(get_threads)() in CLG_() function
71 thread_info* CLG_(get_current_thread)() in CLG_() function
73 return thread[CLG_(current_tid)]; in CLG_()
76 void CLG_(init_threads)() in CLG_() function
84 CLG_(current_tid) = VG_INVALID_THREADID; in CLG_()
88 void CLG_(forall_threads)(void (*func)(thread_info*)) in CLG_() function
90 Int t, orig_tid = CLG_(current_tid); in CLG_()
94 CLG_(switch_thread)(t); in CLG_()
97 CLG_(switch_thread)(orig_tid); in CLG_()
110 CLG_(init_exec_stack)( &(t->states) ); in new_thread()
111 CLG_(init_call_stack)( &(t->calls) ); in new_thread()
112 CLG_(init_fn_stack) ( &(t->fns) ); in new_thread()
116 t->lastdump_cost = CLG_(get_eventset_cost)( CLG_(sets).full ); in new_thread()
117 t->sighandler_cost = CLG_(get_eventset_cost)( CLG_(sets).full ); in new_thread()
118 CLG_(init_cost)( CLG_(sets).full, t->lastdump_cost ); in new_thread()
119 CLG_(init_cost)( CLG_(sets).full, t->sighandler_cost ); in new_thread()
122 CLG_(init_fn_array)( &(t->fn_active) ); in new_thread()
123 CLG_(init_bbcc_hash)( &(t->bbccs) ); in new_thread()
124 CLG_(init_jcc_hash)( &(t->jccs) ); in new_thread()
130 void CLG_(switch_thread)(ThreadId tid) in CLG_() function
132 if (tid == CLG_(current_tid)) return; in CLG_()
134 CLG_DEBUG(0, ">> thread %u (was %u)\n", tid, CLG_(current_tid)); in CLG_()
136 if (CLG_(current_tid) != VG_INVALID_THREADID) { in CLG_()
138 thread_info* t = thread[CLG_(current_tid)]; in CLG_()
144 CLG_(copy_current_exec_stack)( &(t->states) ); in CLG_()
145 CLG_(copy_current_call_stack)( &(t->calls) ); in CLG_()
146 CLG_(copy_current_fn_stack) ( &(t->fns) ); in CLG_()
148 CLG_(copy_current_fn_array) ( &(t->fn_active) ); in CLG_()
150 if (!CLG_(clo).separate_threads) t = thread[1]; in CLG_()
151 CLG_(copy_current_bbcc_hash)( &(t->bbccs) ); in CLG_()
152 CLG_(copy_current_jcc_hash) ( &(t->jccs) ); in CLG_()
155 CLG_(current_tid) = tid; in CLG_()
167 CLG_(set_current_exec_stack)( &(t->states) ); in CLG_()
169 CLG_(set_current_call_stack)( &(t->calls) ); in CLG_()
170 CLG_(set_current_fn_stack) ( &(t->fns) ); in CLG_()
172 CLG_(set_current_fn_array) ( &(t->fn_active) ); in CLG_()
174 if (!CLG_(clo).separate_threads) t = thread[1]; in CLG_()
175 CLG_(set_current_bbcc_hash) ( &(t->bbccs) ); in CLG_()
176 CLG_(set_current_jcc_hash) ( &(t->jccs) ); in CLG_()
181 void CLG_(run_thread)(ThreadId tid) in CLG_() function
187 if (CLG_(clo).dump_every_bb >0) { in CLG_()
188 if (CLG_(stat).bb_executions - bbs_done > CLG_(clo).dump_every_bb) { in CLG_()
189 VG_(sprintf)(buf, "--dump-every-bb=%llu", CLG_(clo).dump_every_bb); in CLG_()
190 CLG_(dump_profile)(buf, False); in CLG_()
191 bbs_done = CLG_(stat).bb_executions; in CLG_()
196 CLG_(switch_thread)(tid); in CLG_()
199 void CLG_(pre_signal)(ThreadId tid, Int sigNum, Bool alt_stack) in CLG_() function
207 CLG_(switch_thread)(tid); in CLG_()
214 CLG_(zero_cost)( CLG_(sets).full, es->cost ); in CLG_()
215 CLG_(current_state).cost = es->cost; in CLG_()
216 es->call_stack_bottom = CLG_(current_call_stack).sp; in CLG_()
219 CLG_(init_exec_state)( &CLG_(current_state) ); in CLG_()
220 CLG_(current_state).sig = sigNum; in CLG_()
221 CLG_(push_cxt)(0); in CLG_()
229 void CLG_(run_post_signal_on_call_stack_bottom)() in CLG_() function
233 CLG_ASSERT(CLG_(current_state).sig >0); in CLG_()
235 if (CLG_(current_call_stack).sp == es->call_stack_bottom) in CLG_()
236 CLG_(post_signal)( CLG_(current_tid), CLG_(current_state).sig ); in CLG_()
239 void CLG_(post_signal)(ThreadId tid, Int sigNum) in CLG_() function
248 CLG_(switch_thread)(tid); in CLG_()
249 CLG_ASSERT(sigNum == CLG_(current_state).sig); in CLG_()
256 while(CLG_(current_call_stack).sp > es->call_stack_bottom) in CLG_()
257 CLG_(pop_call_stack)(); in CLG_()
259 if (CLG_(current_state).cxt) { in CLG_()
261 fn_number = CLG_(current_state).cxt->fn[0]->number; in CLG_()
262 pactive = CLG_(get_fn_entry)(fn_number); in CLG_()
265 CLG_(current_state).cxt->fn[0]->name, *pactive); in CLG_()
268 if (CLG_(current_fn_stack).top > CLG_(current_fn_stack).bottom) { in CLG_()
273 if (*(CLG_(current_fn_stack).top) != 0) { in CLG_()
274 CLG_(current_fn_stack).top--; in CLG_()
275 CLG_ASSERT(*(CLG_(current_fn_stack).top) == 0); in CLG_()
277 if (CLG_(current_fn_stack).top > CLG_(current_fn_stack).bottom) in CLG_()
278 CLG_(current_fn_stack).top--; in CLG_()
282 CLG_ASSERT(CLG_(current_state).cost == es->cost); in CLG_()
283 CLG_(add_and_zero_cost)( CLG_(sets).full, in CLG_()
284 thread[CLG_(current_tid)]->sighandler_cost, in CLG_()
285 CLG_(current_state).cost ); in CLG_()
291 CLG_(current_state).sig = es->sig; in CLG_()
315 void CLG_(init_exec_state)(exec_state* es) in CLG_() function
317 es->collect = CLG_(clo).collect_atstart; in CLG_()
333 es->cost = CLG_(get_eventset_cost)(CLG_(sets).full); in new_exec_state()
334 CLG_(zero_cost)( CLG_(sets).full, es->cost ); in new_exec_state()
335 CLG_(init_exec_state)(es); in new_exec_state()
342 void CLG_(init_exec_stack)(exec_stack* es) in CLG_() function
353 void CLG_(copy_current_exec_stack)(exec_stack* dst) in CLG_() function
362 void CLG_(set_current_exec_stack)(exec_stack* dst) in CLG_() function
416 es->cxt = CLG_(current_state).cxt; in exec_state_save()
417 es->collect = CLG_(current_state).collect; in exec_state_save()
418 es->jmps_passed = CLG_(current_state).jmps_passed; in exec_state_save()
419 es->bbcc = CLG_(current_state).bbcc; in exec_state_save()
420 es->nonskipped = CLG_(current_state).nonskipped; in exec_state_save()
421 CLG_ASSERT(es->cost == CLG_(current_state).cost); in exec_state_save()
426 CLG_(print_bbcc)(-9, es->bbcc); in exec_state_save()
427 CLG_(print_cost)(-9, CLG_(sets).full, es->cost); in exec_state_save()
431 CLG_ASSERT(CLG_(current_state).sig == es->sig); in exec_state_save()
441 CLG_(current_state).cxt = es->cxt; in exec_state_restore()
442 CLG_(current_state).collect = es->collect; in exec_state_restore()
443 CLG_(current_state).jmps_passed = es->jmps_passed; in exec_state_restore()
444 CLG_(current_state).bbcc = es->bbcc; in exec_state_restore()
445 CLG_(current_state).nonskipped = es->nonskipped; in exec_state_restore()
446 CLG_(current_state).cost = es->cost; in exec_state_restore()
447 CLG_(current_state).sig = es->sig; in exec_state_restore()
452 CLG_(print_bbcc)(-9, es->bbcc); in exec_state_restore()
453 CLG_(print_cxt)(-9, es->cxt, 0); in exec_state_restore()
454 CLG_(print_cost)(-9, CLG_(sets).full, es->cost); in exec_state_restore()