ServerBench.cpp fails to compile when SYS_perf_event_open is not transitively visible #41

Closed
opened 2026-06-19 00:09:42 +00:00 by weaselbot · 3 comments
Member

ServerBench.cpp calls syscall(SYS_perf_event_open, ...) at line 356, but it only includes <unistd.h> and not <sys/syscall.h>. On systems/glibc versions where unistd.h does not pull in the SYS_* constants, the build fails with:

ServerBench.cpp:356:19: error: ‘SYS_perf_event_open’ was not declared in this scope

Location: ServerBench.cpp:356 (and the surrounding #includes at lines 1–24).

Expected behavior: server_bench compiles on any platform that provides perf_event_open.
Actual behavior: server_bench fails to compile because the SYS_perf_event_open macro is missing.

Impact: The server_bench executable cannot be built in environments where <unistd.h> does not transitively define SYS_perf_event_open (e.g. the current CI/container toolchain).

Suggested fix: Add #include <sys/syscall.h> near the other system headers at the top of ServerBench.cpp.

`ServerBench.cpp` calls `syscall(SYS_perf_event_open, ...)` at line 356, but it only includes `<unistd.h>` and not `<sys/syscall.h>`. On systems/glibc versions where `unistd.h` does not pull in the `SYS_*` constants, the build fails with: ``` ServerBench.cpp:356:19: error: ‘SYS_perf_event_open’ was not declared in this scope ``` **Location:** `ServerBench.cpp:356` (and the surrounding `#include`s at lines 1–24). **Expected behavior:** `server_bench` compiles on any platform that provides `perf_event_open`. **Actual behavior:** `server_bench` fails to compile because the `SYS_perf_event_open` macro is missing. **Impact:** The `server_bench` executable cannot be built in environments where `<unistd.h>` does not transitively define `SYS_perf_event_open` (e.g. the current CI/container toolchain). **Suggested fix:** Add `#include <sys/syscall.h>` near the other system headers at the top of `ServerBench.cpp`.
weaselbot was assigned by andrew 2026-06-19 01:20:57 +00:00
Author
Member

Fix pushed to weaselbot/conflict-set@weaselbot/issue-41 and opened as PR weaselbot/conflict-set#2.

ServerBench.cpp now includes <sys/syscall.h>, which provides SYS_perf_event_open on toolchains where <unistd.h> does not transitively define it. I verified the server_bench target builds successfully with this change.

Note: upstream weaselab/conflict-set appears to have pull requests disabled (the API and web UI return 404 on the pulls endpoint), so the PR was created against the fork instead.

Fix pushed to `weaselbot/conflict-set@weaselbot/issue-41` and opened as PR weaselbot/conflict-set#2. `ServerBench.cpp` now includes `<sys/syscall.h>`, which provides `SYS_perf_event_open` on toolchains where `<unistd.h>` does not transitively define it. I verified the `server_bench` target builds successfully with this change. Note: upstream `weaselab/conflict-set` appears to have pull requests disabled (the API and web UI return 404 on the pulls endpoint), so the PR was created against the fork instead.
Owner

Pull requests should be enabled now

Pull requests should be enabled now
Author
Member

Opened upstream PR #44 with the fix.

  • Added #include <sys/syscall.h> to ServerBench.cpp so SYS_perf_event_open is available on toolchains where unistd.h does not define it transitively.
  • Verified that the server_bench target builds successfully.
Opened upstream PR #44 with the fix. - Added `#include <sys/syscall.h>` to `ServerBench.cpp` so `SYS_perf_event_open` is available on toolchains where `unistd.h` does not define it transitively. - Verified that the `server_bench` target builds successfully.
weaselbot was unassigned by andrew 2026-06-19 17:11:02 +00:00
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: weaselab/conflict-set#41