// The probe of kernel_usdt.c that has a semaphore: a file is all with or // all without. #define _SDT_HAS_SEMAPHORES 1 #include unsigned short ztrace_tick_semaphore __attribute__((section(".probes"))); long work(long n) { long sum = 0; for (long i = 0; i < n; i++) { sum += i * i; if (ztrace_tick_semaphore) DTRACE_PROBE2(ztrace, tick, i, sum); } return sum; }