Questions tagged [intel-pin]

Pin is a dynamic binary instrumentation framework for the IA-32 and x86-64 instruction-set architectures that enables the creation of dynamic program analysis tools.

"Pin is a dynamic binary instrumentation framework for the IA-32 and x86-64 instruction-set architectures that enables the creation of dynamic program analysis tools."

Pin resources:

237 questions
1
vote
0 answers

Is there a way to retrieve the buffer of an instrumented system call in Intel Pin?

I am making a PIN tool that records all arguments and returns of a system call to a trace file, so that applications that are indeterministic can be re-run using the data collected during the recording for debugging purposes. The read syscall in…
1
vote
0 answers

Intel pin: How does RTN_InsertCall works?

The RTN_InsertCall in intel Pin has its definition as VOID LEVEL_PINCLIENT::RTN_InsertCall( RTN rtn, IPOINT action, AFUNPTR funptr, ... ) It can call the function funptr with the arguments provided in ... (before or…
Acesrc
  • 21
  • 3
1
vote
0 answers

Tracing CPU cycle with Pintool?

I am trying to run SPEC17 benchmark using Pintool. While doing so I need to log CPU cycle and memory address accessed. Pintool have pinatrace tool to log memory addresses but I can not find anything to log CPU cycles. Is there a way to do so?
Komal
  • 11
  • 1
1
vote
1 answer

How do I use (compile) zlib (gzip functions) compression library within Intel Pin tool?

I have libz-dev installed on ubuntu 20.04. I added the following lines in pin/source/tools/SimpleExamples/icount.cpp : #include and in main(): gzFile gp; gp = gzopen("compressed_log_file", "ab"); gzbuffer(gp, 100000); My makefile build…
wxz
  • 2,254
  • 1
  • 10
  • 31
1
vote
1 answer

Modifying registers with Intel PIN

I want to clobber all load instructions - essentially, I want to find all load instructions, and after the load is complete I want to modify the value in the register that stores the value that was read from memory. To do so, I instrument all…
Farhad
  • 516
  • 3
  • 14
1
vote
1 answer

How can I use Intel PIN to catch all loads to an array?

I'm profiling an application I have written using PIN. The source code of the application uses an array - I want PIN to catch every load instruction made to the array. Currently, I have annotated the source code of the application I am trying to…
Farhad
  • 516
  • 3
  • 14
1
vote
1 answer

Pin tool,the static ins address (INS_Address(ins)) is different from the address of the instrumented instruction(IARG_INST_PTR)

I want to print every rtn name, and instructions belong to this rtn. My code looks like this: ''' for (SEC sec = IMG_SecHead(img); SEC_Valid(sec); sec = SEC_Next(sec)) { //OutFile << "SEC name: " << SEC_Name(sec) << endl; for (RTN rtn =…
Jane F
  • 13
  • 2
1
vote
0 answers

Intel pin tool counting the number of instructions between dynamic and static linking

I tried to count the number of instructions for an application that only prints out "Hello, World!" with the given instruction counting tool. (which is located at ./pin/source/tools/ManualExamples/inscount) And I wondered if there is any difference…
Tae
  • 125
  • 5
1
vote
1 answer

How to get operands of 'lea' instruction using PIN?

I'm developing a taint analysis tool using PIN. And I have a question, How to get operands of lea instruction? About lea instruction like lea rdx, ptr [rip+0x2244aa], getting the first operand using INS_OperandReg(ins, 0) is possible. But I want to…
blbi
  • 11
  • 1
1
vote
0 answers

Prevent PIN_Backtrace() Unsuccessful Exit

I have a pintool that has calls to PIN_Backtrace(). It seems that libunwind does not support some registers in x86_64 and this leads to the following error message and an abnormal exit: libunwind: uint64_t…
TheAhmad
  • 810
  • 1
  • 9
  • 21
1
vote
1 answer

Calls to Addresses in the Middle of Routines

I am tracing wireshark-2.6.10 using Pin. At several points during the initialization, I can see some calls, such as this: 00000000004e9400 <__libc_csu_init@@Base>: ... 4e9449: 41 ff 14 dc callq *(%r12,%rbx,8) ... The target…
TheAhmad
  • 810
  • 1
  • 9
  • 21
1
vote
2 answers

How to characterize a workload by obtaining the instruction type breakdown?

I want to obtain the percentage of memory read-write instructions in a test program, preferably dynamically. Apart from counting instructions in the gdb asm dump, which is static anyway, is there an easier way to obtain it? Valgrind provides total…
1
vote
1 answer

Instrumenting R programs using intel-pin

I am instrumenting R programs using pinatrace.so tool to generate trace for read and write memory instructions. What I observe is that multiple #eof statements get printed in the trace file at different places(which should have been actually get…
1
vote
2 answers

Intel pin: how to detect realloc size

I have a following pin tool, say trace.cpp (exactly as is in a pin tool manual): #include "pin.H" #include #include /* ===================================================================== */ /* Names of malloc and free */ /*…
R4444
  • 2,016
  • 2
  • 19
  • 30
1
vote
1 answer

How do I instrument only the actual benchmark of SPEC CPU2006 with Intel's Pin?

I've been trying to instrument SPEC CPU2006 benchmarks using Intel's Pin on Ubuntu. I have a Pintool with a simple cache simulator that counts reads and writes. When running the Pintool on a 'runspec -nonreportable' command for a specific benchmark…