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

will support other platform such as ARM? #27

Open
ender233 opened this issue Jun 13, 2019 · 8 comments
Open

will support other platform such as ARM? #27

ender233 opened this issue Jun 13, 2019 · 8 comments
Labels
enhancement New feature or request help wanted Extra attention is needed research For possible research topic

Comments

@ender233
Copy link

hello
will support other platform such as ARM?

@svalat svalat added enhancement New feature or request help wanted Extra attention is needed research For possible research topic labels Jun 13, 2019
@svalat
Copy link
Member

svalat commented Jun 13, 2019

Hi,
as long as I'm based on Pintool no because it is x86 only.

I would like to make an additional port on top of DynamoRIO which provide mostly the same thing but free/open-source and available for both x86 and ARM. (see #5).

My problem, I currently do not have enougth continuous time to make this kind of work. But if ever you know someone or you are interested I will be more than happy to take time to assist/guide/help making it.

In principle DyanmoRIO offer a very similar API approach than Pin except less predefine functions to intercept Load/Stores, this just require a little bit more codes but there is exemples in there doc for what we need in theory, I already looked for that.

If we have DynamoRIO, there should be mostly nothing extra to change to support ARM for the rest of the code except really minor things I can for sure do by myself.

It will be also really nice as it removed the strong dependency on Pin which is not open.

Cheers.

@svalat
Copy link
Member

svalat commented Jun 13, 2019

I can make a course to help starting if it is interesting.

@ender233
Copy link
Author

hello, sounds good. where can someone start from?

@svalat
Copy link
Member

svalat commented Jun 24, 2019

Hi,
Thanks for your interest.

The main things to be done is to convert the Pin instrumentation glue to make the same into DynamoRIO. The only point is such there is a bit more automation for load/store interception in Pin which require a bit more code (not too much, and there is the required bases in examples).

So if ever you want to start or someone one, I would first:

Then look for equivalent in DyanmoRIO which also have pretty nice doc: http://dynamorio.org/. For the NUMAPROF case, the requirement is to:

From this you might get all the points to make the wrapper to replace the pin glue.

To make the work easier I would first run totaly outside of NUMAPROF just making an interception script writing events into a file as text to debug start making working, then we can look together to glue everything, there should not be too much work once the interception is done, this is the most hard part.

I can start a project board with tasks ordered in ways to make life easier if you want I track progress to help when needed, this will be with pleasure to share knowledge.

@ender233
Copy link
Author

nice, very useful info. i will read your numaprof document&code , try to get a whole picture.
as know little about techniques.
actually numaprof may give us lots help as we are optimizing apps running on numa arm know nothing about memory traffic.

@ismeFUFU
Copy link

hello,I am very interested in converting Pin instrument glue to DynamoRIO to enable NUMAPROF to support ARM. However, DynamoRIO's API is quite complex, and I would like to know if you can provide more detailed courses to replace pin glue.

@svalat
Copy link
Member

svalat commented Nov 16, 2023

Hi @ismeFUFU , sorry for the long delay to answer.

I would say that you can first me some tries as explain in the previous pose outside of numaprof.

For me the first point is :

  • to see how to capture all load/store instructions (this is probably the harder as DynamoRIO provide less wrapper than PIN for this, so maybe you will need to handle several issues, probably with vector instruction of I don't know what).
  • see how to extract the source line from the intercepted address. At least the address in the binary (not necessarily trivial because the actual address will be the rewritten instruction). But probably DynamoRIO provide functions for this, I didn't yet checked.
  • see how to intecept a function call (which will be malloc/free)
  • see if you can call some C++ function inside the instrumentation code to mimic the needs to call my numaprof internal lib.

Once you have this, the rest is makeing the glue with the numaprof internal lib which might not be blocking as the API is short.

@svalat
Copy link
Member

svalat commented Nov 16, 2023

Remark that the first steps you can do totaly out of numaprof, just making an instrumentation file standalone.

In code reading, as said in the older comment, the good start is to see if you understand this as it will be probably the most harder part to play put in place in the wrapper (intercepting the load/stores) : https://github.com/DynamoRIO/dynamorio/blob/master/api/samples/memtrace_x86.c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed research For possible research topic
Projects
None yet
Development

No branches or pull requests

3 participants