1

I'm trying to trace .NET application with the latest Intel PIN Tool (3.19), but it doesn't work as expected. It seems pin tool doesn't even load the profiling library (checked loaded modules). I was looking for strings "INTEL_JIT_PROFILER32" inside pin and other binaries, but didn't find them. Also there is no help regarding "support_jit_api" option. However, the documentation directly says that it has "Managed platforms support".

What I missing?

This is my starting config:

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

This is my code:

#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;
}
DBenson
  • 377
  • 3
  • 12

0 Answers0