Commit 49ce143a authored by Yingchi Long's avatar Yingchi Long
Browse files

[BPF] report `Invalid usage of the XADD return value"` elegantly

Previously `report_fatal_error` is used for reporting something goes
wrong in the backend, but this is confusing because `report_fatal_error`
basically means there are something unexpected & crashed in the backend.

So, turn this "crash" into an elegant error reporting.
After this patch, clang can diagnose it:

    bpf-crash.c:4:30: error: Invalid usage of the XADD return value
        4 | u32 next_event_id() { return __sync_fetch_and_add(&GLOBAL_EVENT_ID, 1); }
        |                              ^
    1 error generated.
parent eab92cb7
Pipeline #2416 failed with stages
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment