Stop getting blindsided by application-level syscall latency
By Saket Jain Published Linux/Unix
Stop getting blindsided by application-level syscall latency
Technical Briefing | 8/31/2026
You have likely spent hours tailing journald logs when an application goes sideways, only to see complete silence. The service is hung, CPU usage is flat, and the logs are pristine because the process hasn’t even reached the point where it logs the error. It’s stuck in a syscall, usually waiting for a lock or a slow I/O device that isn’t throwing a hardware error. This bit me last month when a legacy database connector started stalling on a kernel-level mutex.
The kernel isn’t lying, you’re just not looking at the right layer
When your application enters a blocked state, the usual monitoring tools like top or htop just show the process as D state. They don’t tell you why. You could attach strace, but attaching a tracer to a production process under load often adds enough overhead to mask the race condition you’re trying to hunt down. That’s where eBPF shines. It’s essentially an invisible probe that hooks into the kernel’s scheduler and function calls without stalling the process.
bpftrace -e 'tracepoint:syscalls:sys_enter_read { @start[tid] = nsecs; } tracepoint:syscalls:sys_exit_read /@start[tid]/ { @latency[comm] = hist(nsecs - @start[tid]); delete(@start[tid]); }'
- The bpftrace one-liner hooks specifically into read syscalls for all processes
- It builds a latency histogram directly in the kernel memory buffer
- You get a clear view of how long your syscalls take without killing performance
Most of the time, the bottleneck isn’t the code you wrote, but the interface between your code and the kernel. If you find your latency histograms spiking, stop blaming your application logic. Start looking at the disk scheduler or the specific mount point configuration. Once you see the histogram skewing toward the right, you have the proof needed to tell the storage team exactly which IOps tier is failing you.
