Intel Pin Tools以及PinPoints

Pin(Intel)的文章中介绍了Pin的工作原理,Pin是一个dynamic instrumentation tool。Pin使用just-in-time(JIT) compiler来进行实时的insert,optimize code,以实现profiling、performance evalution 和bug detection的目的。

其架构如下图所示:
在这里插入图片描述
JIT compiler负责编译并instrument 应用代码,code cache负责暂存修改的代码。从code cache进入或离开VM就需要保存或恢复应用寄存器的状态。因为Pin工作在用户模式,所以需要由emulation uint来和系统进行交互。

使用动态二进制编译的可以与lib,license-check解耦,便于执行。

与其他工具的运行时间对比:
在这里插入图片描述
PinPoint用于自动寻找要仿真的程序片段,选择其中有代表性的,并产生trace。对于大的商业程序主要有两个挑战:
1) 程序运行时间长,如果在simulator进行完整的运行需要的时间会很久
2)这些程序通常有较大的资源需求,对操作系统和驱动有依赖,并且有license-checking机制,使得在simulator上很难运行
第一个问题我们通过SimPoint来克服(一个可以自动的进行phase analysis来找到有代表性区域的程序的方法)
第二个问题则使用Pin来收集SimPoint程序的profiles(称为PinPoint)和instruction trace,减少了在simulator上执行程序时对资源的需求。通过使用PinPoints产生的trace,极大的减少了simulation time。

如果对Pin的内部机制感兴趣,可以看以下的资料
1.Pin:Intel’s Dynamic Binary Instrumentation Engine
2.Ispike: A Post-link Optimizer for the Intel Itanium Architectue
3.推荐Dynamic Binary Translation & Instrumentation
4.动态二进制修改(Dynamic Binary Instrumentation)入门:Pin、DynamoRIO、Frida
5. Dynamic Binary Analysis and Instrumentation
参考:
DrPin: A dynamic binary instumentator for multiple processor architectures

欢迎关注我的公众号《处理器与AI芯片》

************* Path validation summary ************** Response Time (ms) Location Deferred srv* Symbol search path is: srv* Executable search path is: Windows 7 Kernel Version 7601 (Service Pack 1) MP (4 procs) Free x86 compatible Product: WinNt, suite: TerminalServer SingleUserTS Edition build lab: 7601.24059.x86fre.win7sp1_ldr_escrow.180308-1637 Kernel base = 0x84e1c000 PsLoadedModuleList = 0x84f6f750 Debug session time: Sat Apr 12 13:33:43.435 2025 (UTC 8:00) System Uptime: 0 days 10:04:47.299 Loading Kernel Symbols ............................................................... ................................................................ ..................................... Loading User Symbols Loading unloaded module list ............... For analysis of this file, run !analyze -v eax=ffffffff ebx=00000000 ecx=fe5a8310 edx=0229b342 esi=fe5a8310 edi=00000000 eip=837acd7c esp=9e01bb40 ebp=9e01bb50 iopl=0 nv up ei ng nz na pe nc cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00010286 win32k!zzzUpdateCursorImage 0x33: 837acd7c f7403400010000 test dword ptr [eax 34h],100h ds:0023:00000033=???????? 0: kd> !analyze -v ******************************************************************************* * * * Bugcheck Analysis * * * ******************************************************************************* KERNEL_MODE_EXCEPTION_NOT_HANDLED (8e) This is a very common BugCheck. Usually the exception address pinpoints the driver/function that caused the problem. Always note this address as well as the link date of the driver/image that contains this address. Some common problems are exception code 0x80000003. This means a hard coded breakpoint or assertion wa
最新发布
04-14
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值