Getting physical address in pin tool

拈花ヽ惹草 提交于 2020-01-12 10:49:31

问题


I'm using pin instrumentation tool to get memory traces. By my implementation result, I've found the traces indicate virtual address, not physical address. Is there any way to get physical address trace in Pin tool? Help!


回答1:


The pin tool runs in user space and therefore it works with virtual addresses only. There is no way to get the physical addresses directly from the pin tool's API.

An alternative approach to translate the virtual addresses to physical addresses would be to use the OS's page mapping API inside your pin tool. In Linux this might be possible by using /proc/<pid>/pagemap. There are many examples on internet that demonstrate how to translate virtual addresses to physical addresses and you can find some by searching in google for "linux virtual to physical memory map".



来源:https://stackoverflow.com/questions/26114260/getting-physical-address-in-pin-tool

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!