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

Support for aarch64 #18

Open
anjuls opened this issue Jun 4, 2022 · 3 comments
Open

Support for aarch64 #18

anjuls opened this issue Jun 4, 2022 · 3 comments

Comments

@anjuls
Copy link

anjuls commented Jun 4, 2022

I am trying to run on Mac M1 processor and it doesn't seem to work.

@edeNFed
Copy link
Contributor

edeNFed commented Jun 4, 2022

We are familiar with this issue, only amd64 is supported right now.
Supporting arm is something we plan to implement very soon, will update here once it's ready.
Thanks for opening an issue.

@noBlubb
Copy link

noBlubb commented Sep 12, 2022

Hey @edeNFed, would you be able to share if there is progress being made or if there's any way to contribute towards the implementation of arm support?

@edeNFed
Copy link
Contributor

edeNFed commented Sep 13, 2022

Hi @noBlubb
Not yet, we are currently focused on implementing context propagation which should be finished in about 2-3 weeks.
The next item on the roadmap after that is supporting ARM.
If you would like to start working on it I'll be more than happy to assist.
Basically, the parts that I think will need to be changed for ARM support are:

  1. Registers order:
    https://github.com/keyval-dev/opentelemetry-go-instrumentation/blob/4755ac2402b24f75638eb5cd8978632ba11dea02/include/arguments.h#L8-L30
    The current order matches the x86 architecture ABI. There should be a similar method with the order of the registers that match ARM.
  2. Detection of return addresses:
    https://github.com/keyval-dev/opentelemetry-go-instrumentation/blob/eb6994ebf2f56fa8d504baee56388dc7a341a14c/pkg/process/analyze.go#L136-L143
    As you can see it uses x86asm package when parsing instructions, this should have a version that is suitable for ARM.
  3. We should probably detect the architecture in userspace (probably in injector.go by calling runtime.GOARCH) similar to what we do with is_registers_abi and inject it into the BPF program. After that, we will be able to call the ARM implementations of the previous sections by looking at the injected value, something like:
if (cpu_arch == ARM) {
   get_argument_by_reg_arm()
} else if (cpu_arch == X86) {
   get_argument_by_reg_x86()
}

Let me know if you have more questions 😄

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

No branches or pull requests

3 participants