Skip to content

Commit

Permalink
tool/trace: use linux.perf_event_open instead of posix one
Browse files Browse the repository at this point in the history
  • Loading branch information
tw4452852 committed Jan 8, 2025
1 parent aa5d9b8 commit 7960d3f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/tools/trace/trace.zig
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,9 @@ const LBR = struct {
.sample_type = perf_event.PERF_SAMPLE_BRANCH_STACK,
.branch_sample_type = perf_event.PERF_SAMPLE_BRANCH_USER | perf_event.PERF_SAMPLE_BRANCH_CALL,
};
fd.* = try std.posix.perf_event_open(&attr, -1, @intCast(cpu), -1, 0);
const ret = std.os.linux.perf_event_open(&attr, -1, @intCast(cpu), -1, 0);
if (@as(isize, @bitCast(ret)) < 0) return error.PERF_OPEN;
fd.* = @intCast(ret);
errdefer std.posix.close(fd.*);
}
return .{
Expand Down

0 comments on commit 7960d3f

Please sign in to comment.