Sample Header Ad - 728x90

DPROBES (DTRACE_PROBE) for measuring high latency stuff under 1µsec

1 vote
1 answer
161 views
Currently, I'm analyzing the performance of a high latency application but I'm not confident in my measurements at all. So far, I have used DPROBES for instrumentation and BCC/funclatency for measuring. Would someone be able to verify those numbers? Also, if someone knows of a better method, please let me know. measuring usleep(1) : avg = 53962 nsecs #include #include int main() { int i; for(i=0; i int main() { int i; for(i=0; i #include #include #include int main() { struct timespec tim, tim2; tim.tv_sec = 0; tim.tv_nsec = 200L; int i; for (i=0; i<100000; i++){ DTRACE_PROBE("hello-usdt", probe-main-start); if(nanosleep(&tim , &tim2) < 0 ){ printf("Nano sleep system call failed \n"); return -1; } DTRACE_PROBE("hello-usdt", probe-main-end); } printf("Nano sleep successfull \n"); return 0; } A little modification was made to the funclatency code: # attach probes usdt = USDT(path = "path to application") usdt.enable_probe(probe = "probe-main-start", fn_name = "trace_func_entry") usdt.enable_probe(probe = "probe-main-end", fn_name = "trace_func_return") b = BPF(text = bpf_text, usdt_contexts = [usdt]) Am I unable to measure anything below 0.8usec with this method? Furthermore I cannot believe that nanosleep(200) "oversleep" by 50 usec.
Asked by Bahamas (113 rep)
Jan 28, 2023, 02:31 PM
Last activity: Jan 31, 2023, 09:30 PM