Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does this only support x86_64 #39

Closed
Zentrik opened this issue May 8, 2024 · 1 comment · Fixed by #41
Closed

Does this only support x86_64 #39

Zentrik opened this issue May 8, 2024 · 1 comment · Fixed by #41

Comments

@Zentrik
Copy link
Collaborator

Zentrik commented May 8, 2024

It looks to me that syscall numbers differ on different platforms, so this code is only going to work on x86_64 as https://github.com/torvalds/linux/blob/v4.17/arch/x86/entry/syscalls/syscall_32.tbl#L17 says perf_event_open is 336 on i686

const SYS_perf_event_open = 298
"""
perf_event_open(attr::perf_event_attr, pid, cpu, fd, flags)
"""
function perf_event_open(attr::perf_event_attr, pid, cpu, leader_fd, flags)
r_attr = Ref(attr)
GC.@preserve r_attr begin
# Have to do a manual conversion, since the ABI is a vararg call
ptr = Base.unsafe_convert(Ptr{Cvoid}, Base.cconvert(Ptr{Cvoid}, r_attr))
fd = ccall(:syscall, Cint, (Clong, Clong...), SYS_perf_event_open,

If this package only supports x86_64 I think it makes sense to add to the readme.

@vchuravy
Copy link
Member

vchuravy commented May 8, 2024

It should be easy enough to add the branches, but yes I think only x86_64 has ever been tested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants