In this project I wrote quite some eBPF. I was constantly hitting verifier limits, and like everyone initially just reordering variables and sprinkling "inline" or "noinline" everywhere. Of course that wasn't sustainable.
And it turns out - there is now some reasonable tooling to understand verifier!
For stack problems, clang accepts `-s` which prints stack requirement per function, like so:
And for instruction count, I was able to feed the logs from verbose verifier (during loading) into code-coverage tooling, and count stuff up. Anyway, the reuseorg prog takes 100k verifier instruction count/paths:
And it turns out - there is now some reasonable tooling to understand verifier!
For stack problems, clang accepts `-s` which prints stack requirement per function, like so:
And for instruction count, I was able to feed the logs from verbose verifier (during loading) into code-coverage tooling, and count stuff up. Anyway, the reuseorg prog takes 100k verifier instruction count/paths: While 100k is lower than 1m instr count limit, it's still a lot. And reordering some loop or introducing some "if" often makes that count baloon.Anyway - with stack and instr statistics it's way easier to make sense of verifier problems.