pin tools forum

pin tools forum

Hi,

since Pin Tools belongs to Intel I wonder if there is a forum about it (the Yahoo group is no alternative)?
I encountered some strange behavior in Pin and need to ask someone whether it's a bug or something else.

Best regards

7 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.

Hi Olaf,

Sorry for the delayed response. Please feel free to post your concerns here, and I'll see if we can get some answers for you.

Best regards,

==
Aubrey W.
Intel Software Network Support

Hi Aubrey,

nevertheless thank you for the response and the invitation. I'll just use this thread to describe my problem.

I have two versions of a pintool tracing memory refernces of a particular function given by name.

V1:
// -------------------------------------------- start
static int InFunctionOfInterest = 0;

VOID EnterFunction()
{
++InFunctionOfInterest;
}

VOID LeaveFunction()
{
--InFunctionOfInterest;
}

VOID Instruction(INS ins, VOID *v)
{
if (InFunctionOfInterest == 0)
{
return;
}
// tracing done as in ManualExamples/pinatrace.cpp
}

VOID Routine(RTN rtn, VOID *v)
{
if (RTN_Name(rtn) == function_name)
{
RTN_Open(rtn);
RTN_InsertCall(rtn, IPOINT_BEFORE, (AFUNPTR)EnterFunction, IARG_END);
RTN_InsertCall(rtn, IPOINT_AFTER, (AFUNPTR)LeaveFunction, IARG_END);
RTN_Close(rtn);
}
}

int main(int argc, char *argv[])
{
// init
RTN_AddInstrumentFunction(Routine, 0);
INS_AddInstrumentFunction(Instruction, 0);
// aso.
}
// -------------------------------------------- stop

and V2:

// -------------------------------------------- start
VOID Instruction(INS ins, VOID *v)
{
// tracing done as in ManualExamples/pinatrace.cpp
}

VOID Routine(RTN rtn, VOID *v)
{
if (RTN_Name(rtn) == functionName)
{
RTN_Open(rtn);
for (INS ins = RTN_InsHead(rtn); INS_Valid(ins); ins = INS_Next(ins))
{
Instruction(ins, 0);
}
RTN_Close(rtn);
}
}

int main(int argc, char *argv[])
{
// init
RTN_AddInstrumentFunction(Routine, 0);
// not needed: INS_AddInstrumentFunction(Instruction, 0);
// aso.
}
// -------------------------------------------- stop

Now V1 has the clear advantage over V2 that it traces the function recursively. For V2 I haven't found a way to recursively instrument the instructions by hand (something like a function "RTN INS_GetCallee(INS)" could be handy).
However V1 shows strange behavior when a function is traced. In particular the first traces are somehow left out. That is, either "EnterFunction" gets called too late or the first couple of instructions of a function aren't instrumented properly.
For the moment I can live with V2 but eventually I'd like to get V1 working properly. And I'm not sure if it's my fault or if it's due to some quirks in Pintools.

Thanks in advance
Olaf

Please join the pinheads Yahoo group and ask this question there. http://tech.groups.yahoo.com/group/pinheads

Sorry to say so, but no way (for reasons just look at their ads).

Hi 

I am facing problem regarding Pin installation in windows 7.

Do you have any good tutorials?

Hello,

You might try posting your question here: https://groups.yahoo.com/neo/groups/pinheads/info

Regards, Hal

Intel(R) Developer Zone Support

http://software.intel.com
*Other names and brands may be claimed as the property of others.

 

 

 

 

 

 

 

 

 

 

Kommentar hinterlassen

Bitte anmelden, um einen Kommentar hinzuzufügen. Sie sind noch nicht Mitglied? Jetzt teilnehmen