英特尔 PIN 是否支持仅跟踪 .NET 可执行文件中的 JIT 代码?

问题描述

我正在尝试使用最新的英特尔 PIN 工具 (3.19) 跟踪 .NET 应用程序,但它没有按预期工作。似乎 pin 工具甚至没有加载分析库(检查加载的模块)。我在 pin 和其他二进制文件中寻找字符串“INTEL_JIT_PROFILER32”,但没有找到它们。也没有关于“support_jit_api”选项的帮助。但是,文档直接说它有“托管平台支持”。

我错过了什么?

这是我的起始配置:

set CL_CONfig_USE_VTUNE=True
set INTEL_JIT_PROFILER32="c:\Tools\PIN\ia32\bin\pinjitprofiling.dll"
"c:\Tools\PIN\ia32\bin\pin.exe" -t Release\Dottracer.dll -support_jit_api -- examples\HelloWorldConsole\bin\Release\HelloWorldConsole.exe

这是我的代码

#include "pin.H"
#include <iostream>

UINT64 insDynamicExecutedCount = 0;

//Print out help message.
INT32 Usage()
{    
    return -1;
}

VOID InsDynamicCount()
{
    ++insDynamicExecutedCount;
}

VOID Instruction(INS ins,VOID* v)
{
    RTN rtn = INS_Rtn(ins);
    if (RTN_IsDynamic(rtn))
    {
        //have to insert this call to calculate the same
        //encountered instruction several time
        INS_InsertCall(ins,IPOINT_BEFORE,(AFUNPTR)InsDynamicCount,IARG_END);
    }
}

VOID Fini(INT32 code,VOID* v)
{
    std::cerr << "Total ins: " << insDynamicExecutedCount << std::endl;
}

int main(int argc,char* argv[])
{
    // Initialize PIN library. Print help message if -h(elp) is specified
    // in the command line or the command line is invalid 

    PIN_InitSymbols();
    if (PIN_Init(argc,argv))
    {
        return Usage();
    }

    INS_AddInstrumentFunction(Instruction,NULL);
    PIN_AddFiniFunction(Fini,NULL);

    PIN_StartProgram();

    return 0;
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)