20 #include "instrument.h" 22 #define USE_LITE_RECORD 1 25 void __cyg_profile_func_enter(
void *func_address,
void *call_site)
33 #ifdef INSTRUMENTATION 34 static volatile int g_WrittenFirst = 0;
37 void __cyg_profile_func_enter(
void *func_address,
void *call_site)
39 #ifdef INSTRUMENTATION 45 if (__sync_bool_compare_and_swap(&g_WrittenFirst, 0, 1))
49 flag |= INSTRUMENT_GLOBAL_LITE;
51 asm volatile(
"outb %%al, %%dx" ::
"d"(COM2),
"a"(flag));
59 record.data.flags = INSTRUMENT_RECORD_ENTRY;
60 record.data.caller =
reinterpret_cast<uintptr_t
>(call_site);
61 record.data.magic = INSTRUMENT_MAGIC;
63 record.data.function =
reinterpret_cast<uintptr_t
>(func_address);
68 asm volatile(
"pushf; cli;" 82 :
"d"(COM2),
"0"(record.buffer),
"1"(
sizeof record.buffer)