diff options
| author | Alexei Starovoitov <[email protected]> | 2023-12-26 11:11:45 -0800 |
|---|---|---|
| committer | Andrii Nakryiko <[email protected]> | 2024-01-03 11:08:23 -0800 |
| commit | 624cd2a17672f4596fee97a5558bc990778bbcf9 (patch) | |
| tree | 8b24caf8e239bea1bbc4313d0f4a9aaed3c832e0 /tools/perf/scripts/python/failed-syscalls-by-pid.py | |
| parent | a8b242d77bd72556b7a9d8be779f7d27b95ba73c (diff) | |
selftests/bpf: Convert exceptions_assert.c to bpf_cmp
Convert exceptions_assert.c to bpf_cmp_unlikely() macro.
Since
bpf_assert(bpf_cmp_unlikely(var, ==, 100));
other code;
will generate assembly code:
if r1 == 100 goto L2;
r0 = 0
call bpf_throw
L1:
other code;
...
L2: goto L1;
LLVM generates redundant basic block with extra goto. LLVM will be fixed eventually.
Right now it's less efficient than __bpf_assert(var, ==, 100) macro that produces:
if r1 == 100 goto L1;
r0 = 0
call bpf_throw
L1:
other code;
But extra goto doesn't hurt the verification process.
Signed-off-by: Alexei Starovoitov <[email protected]>
Signed-off-by: Andrii Nakryiko <[email protected]>
Acked-by: Jiri Olsa <[email protected]>
Acked-by: Kumar Kartikeya Dwivedi <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/perf/scripts/python/failed-syscalls-by-pid.py')
0 files changed, 0 insertions, 0 deletions