// Static probes the DTrace way: leaves a nop and an ELF note // where each one is. `start` and `done` are always there; `tick` (in // kernel_usdt_tick.c) hides behind a semaphore until a tracer raises it. #include #include long work(long n); int main(int argc, char **argv) { long n = argc > 1 ? atol(argv[1]) : 5; DTRACE_PROBE1(ztrace, start, n); long sum = work(n); DTRACE_PROBE2(ztrace, done, n, sum); return 0; }