Software Archive
Read-only legacy content
17061 Discussions

pin tools forum

Olaf_Krzikalla
Beginner
2,746 Views
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
0 Kudos
21 Replies
Aubrey_W_
New Contributor I
2,550 Views
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

0 Kudos
Olaf_Krzikalla
Beginner
2,550 Views
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




0 Kudos
MarkC_Intel
Moderator
2,550 Views
Please join the pinheads Yahoo group and ask this question there.
0 Kudos
Olaf_Krzikalla
Beginner
2,550 Views
Sorry to say so, but no way (for reasons just look at their ads).
0 Kudos
Sukriti_B_
Beginner
2,550 Views

Hi 

I am facing problem regarding Pin installation in windows 7.

Do you have any good tutorials?

0 Kudos
Harold_G_Intel
Employee
2,550 Views

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.

 

 

 

 

 

 

 

 

 

 

0 Kudos
srijoni_m_
Beginner
2,550 Views

Hi,

 

I would like to use Pin compatible on ARM architecture. I am not able to find any download link for the same. Kindly can you let me knwo the download path for the same. Will the pintools for linux OS present in path https://software.intel.com/en-us/articles/pintool-downloads  be compatible for ARM.

Thanking in Advance

0 Kudos
Harold_G_Intel
Employee
2,550 Views

Hello,

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

Regards, Hal

Intel(R) Developer Zone Support

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

0 Kudos
KAUSHIK_S_
Beginner
2,550 Views

Please tell me how to generate the PIN PLUG-IN for ECLIPSE, I use windows Xp and MinGW compiler. please help me. Thank You

0 Kudos
KAUSHIK_S_
Beginner
2,550 Views

I had run the pintool8 manual program inscount0.cpp in visual studio & mingw and got the errors please help me to solve it

the errors are attached

 

0 Kudos
KAUSHIK_S_
Beginner
2,550 Views

Subject: Error while compiling the manual examples using the PIN tool with the command "make all"
Dear all
I am new to the pintools. I am using PIN for my M.tech project.
Details of software I am using are as follows

1. OS- Microsoft Windows XP [Version 5.1.2600]
2. Compiler MinGW Version 2, June 1991& Microsoft visual studio 2010 express
3.Pin tool package "pin-2.13-62141-msvc8-windows" Rev-62141,Date
Nov,22,2013,Compiler Kit- VC8
4. Cygwin.

I am trying to build the manual examples of PIN and getting following
messages while building the tools using "make all" command: in dos
command prompt
 ------------------------------------message---------------------------

C:\pin-2.12-58423-msvc8-windows\source\tools\ManualExamples>make all
link /DLL /EXPORT:main /NODEFAULTLIB /NOLOGO /INCREMENTAL:NO /MACHINE:x86 /ENTRY
:Ptrace_DllMainCRTStartup@12 /BASE:0x55000000 /OPT:REF  /out:obj-ia32/inscount0.
dll obj-ia32/inscount0.obj  /LIBPATH:../../../ia32/lib /LIBPATH:../../../ia32/li
b-ext /LIBPATH:../../../extras/xed2-ia32/lib pin.lib libxed.lib libcpmt.lib libc
mt.lib pinvm.lib kernel32.lib ntdll-32.lib
link: extra operand '/NODEFAULTLIB'
Try 'link --help' for more information.
../../../source/tools/Config/makefile.default.rules:156: recipe for target 'obj-
ia32/inscount0.dll' failed
make: *** [obj-ia32/inscount0.dll] Error 1
------------------------------message end------------------------------

Please help me to solve the problem

you can directly email me the solution email add= abirsarkar1987@gmail.com
thanks
Kaushik Sarkar
M.Tech (cse) cu

0 Kudos
Harold_G_Intel
Employee
2,550 Views

Hello,

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

Regards, Hal

Intel(R) Developer Zone Support

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

0 Kudos
Manish_G_1
Beginner
2,550 Views

Hi All, I am facing issue using pin on linux 4.0. Has anyone else face the same issue. 

Terminal Output

pin/source/tools/ManualExamples$ ../../../pin -t obj-intel64/inscount0.so -- /bin/ls
E: 4.0 is not a supported linux release

Does pin not support latest linux kernel?

http://stackoverflow.com/questions/35511380/intel-pin-tool-on-linux-4-0

Any suggestions would be really helpful. Thanks! Manish

0 Kudos
Hao_L_1
Beginner
2,550 Views

Hi Everyone. I want to write a pintool to record the frame pointer of each function call at runtime. Is there any API function that can be used to retrieve the current frame pointer.  I tried to instrument the binary by adding a function call  _builtin_frame_address() at the end of each function call. It seems that the stack addresses was messed up. I think maybe it is because pin does dynamic instrumentation. Any idea of how to solve the problem?

 

0 Kudos
Nadeen_G_Intel
Employee
2,550 Views

Hi,

Is it normal that using INS_MemoryOperandCount(ins) from within the trace subroutine of pinatrace and then calling it from RecordMemWrite predicated call routine display different results.

if (INS_MemoryOperandIsWritten(ins, memOp))
                {
            INS_InsertPredicatedCall(
                ins, IPOINT_BEFORE, (AFUNPTR)RecordMemWrite,
                IARG_INST_PTR,
                IARG_MEMORYOP_EA, memOp,IARG_PTR,ins,
                IARG_END);
                }} }

 

VOID RecordMemWrite(ADDRINT * ip, ADDRINT * addr,INS ins)
{

cout<<INS_MemoryOperandCount(ins); 

}

 

Thanks

 

 

0 Kudos
SergeyKostrov
Valued Contributor II
2,550 Views
Yes. But I would use a CRT printf function inside of RecordMemWrite instead of cout C++ stream. Also, I hope that you know about https://software.intel.com/sites/landingpage/pintool/docs/53271/Pin/html/group__INS__BASIC__API__GEN__IA32.html
0 Kudos
Rohit_P_1
Beginner
2,550 Views

Hi I am trying to use the Intel Pin tool to emulate some new instructions. I am using the x86_64/ intel64 architecture. I am trying to use opcodes which are undefined in the original architecture, as new instructions. So I am using a c program which calls these instructions using the asm functions. 

For example I am using the opcode 0x17, which is undefined in x86 to emulate a new instruction. However when I run an instruction trace from the Pin tool, I see that 0x17 is used by some other instruction which is "add" and my when I run the Pin tool with my  c program executable, I keep getting the Illegal instruction program. I am not able to figure out the actual instruction trace, and I feel that it is probably not the x86 instruction trace I am expecting.

Can anyone suggest what I am doing wrong?

0 Kudos
Singla__Priyanka
Beginner
2,550 Views

Hi,

I am trying to use PIN tool with a trace driven simulator. I want to feed the traces (generated by the PIN tool) to the simulator by using shared memory.  For this, I wrote a tool in which I create a shared memory region by using "ftok() and shmget()" from "ipc.h and shm.h", respectively.

When I make (and link) the tool, the linker command fails with the following error for ftok and shmget:

Undefined symbols for architecture x86_64:
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I am using the following libraries -lpin -lxed -lpin3dwarf -nostdlib -lstlport-dynamic -lm-dynamic -lc-dynamic -lunwind-dynamic while linking. However, if I add the  libc library using "-lc", then I am able to successfully compile my code, but when i run it, then pin is unable to load the compiled library.

I am using Pin 3.7 (kit:97619 for OS X) on macOS High Sierra, with LLVM version 9.1.0 (clang-902.0.39.2). Any suggestions woud really be helpful. 

Thanks

 
0 Kudos
luis__leo
Beginner
2,550 Views

KAUSHIK S. wrote:

Subject: Error while compiling the manual examples using the PIN tool with the command "make all"
Dear all
I am new to the pintools. I am using PIN for my M.tech project.
Details of software I am using are as follows

1. OS- Microsoft Windows XP [Version 5.1.2600]
2. Compiler MinGW Version 2, June 1991& Microsoft visual studio 2010 express
3.Pin tool package "pin-2.13-62141-msvc8-windows" Rev-62141,Date
Nov,22,2013,Compiler Kit- VC8
4. Cygwin.

I am trying to build the manual examples of PIN and getting following
messages while building the tools using "make all" command: in dos
command prompt
 ------------------------------------message---------------------------

C:\pin-2.12-58423-msvc8-windows\source\tools\ManualExamples>make all
link /DLL /EXPORT:main /NODEFAULTLIB /NOLOGO /INCREMENTAL:NO /MACHINE:x86 /ENTRY
:Ptrace_DllMainCRTStartup@12 /BASE:0x55000000 /OPT:REF  /out:obj-ia32/inscount0.
dll obj-ia32/inscount0.obj  /LIBPATH:../../../ia32/lib /LIBPATH:../../../ia32/li
b-ext /LIBPATH:../../../extras/xed2-ia32/lib pin.lib libxed.lib libcpmt.lib libc
mt.lib pinvm.lib kernel32.lib ntdll-32.lib
link: extra operand '/NODEFAULTLIB'
Try 'link --help' for more information.
../../../source/tools/Config/makefile.default.rules:156: recipe for target 'obj-
ia32/inscount0.dll' failed
make: *** [obj-ia32/inscount0.dll] Error 1
------------------------------message end------------------------------

Please help me to solve the problem

you can directly email me the solution email add= abirsarkar1987@gmail.com
thanks
Kaushik Sarkar
M.Tech (cse) cu

 

 

hi,sarkar

i have the same problem as you met.May you give me advice? thank you in advance. 

------------msg start--------------

link /DLL /EXPORT:main /NODEFAULTLIB /NOLOGO /INCREMENTAL:NO /MACHINE:x86 /ENTRY
:Ptrace_DllMainCRTStartup@12 /BASE:0x55000000 /OPT:REF  /out:obj-ia32/inscount0.
dll obj-ia32/inscount0.obj  /LIBPATH:../../../ia32/lib /LIBPATH:../../../ia32/li
b-ext /LIBPATH:../../../extras/xed-ia32/lib pin.lib libxed.lib libcpmt.lib libcm
t.lib pinvm.lib kernel32.lib ntdll-32.lib
link: extra operand '/NODEFAULTLIB'
Try 'link --help' for more information.
make: *** [../../../source/tools/Config/makefile.default.rules:178: obj-ia32/ins
count0.dll] Error 1

-----------msg end--------------

0 Kudos
Shilpa_B_
Beginner
2,068 Views

Hi,

What is the right way to instrument R programs using PIN. I tried running pin tool "pinatrace.so" to trace memory addresses for reads and writes using the following commands:

../../../pin -follow_execv -t obj-intel64/pinatrace.so -- /home/shlpa/R-3.5.3/bin/R -f hello.R    and

../../../pin -follow_execv -t obj-intel64/pinatrace.so -- /home/shilpa/R-3.5.3/bin/Rscript hello.R

I am wondering whether -follow_execv option should be used? I notice in my trace file output (pinatrace.out) that after #eof line gets printed, then the trace for next line is not printed correctly. Also, whether trace output file should be opened in "w" or "a" mode?

I have also posted in pinheads yahoo group but did not get any reply.

Any help is appreciated.

Thanks,
Shilpa

0 Kudos
Reply