Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
17249 Discussions

How to analyse lock acquire and release using intel pin instrumentation

hErd
Beginner
880 Views
I am analyzing C++ codes to find data races in them using intel pin

Now I found some inbuilt functions in Intel Pin like INS_IsMemoryRead and INS_IsMemoryWrite to determine if a instruction is memory read or write respectively Now I want to achive the same for lock acquire and lock release (only for C++ pthread_mutex) but I didn't find any such function

So I disassembled the lock acquire statement and found a lock prefix and a cmpxchg statement

So I decided to use lockPrefix function of Intel Pin to determine if the instruction has lock prefix and INS_Opcode function to check if xed value is cmpxchg and then check if the adress being written to has value 1 then we can say lock acquire is successful

But I believe there is something simpler and also have doubts regarding correctness of my approach
Labels (1)
0 Kudos
1 Solution
KennyTan_Altera
Moderator
825 Views

Is this related to FPGA question?


View solution in original post

0 Kudos
7 Replies
KennyTan_Altera
Moderator
826 Views

Is this related to FPGA question?


0 Kudos
hErd
Beginner
794 Views
I am really sorry but I don't understand what you mean by "FPGA question"
0 Kudos
KennyTan_Altera
Moderator
790 Views

You may refer to here https://www.intel.com/content/www/us/en/products/overview.html


Is this related to FPGA product?


0 Kudos
KennyTan_Altera
Moderator
673 Views

Is there any update?


0 Kudos
KennyTan_Altera
Moderator
628 Views

upon checking, this is not a FPGA question.. Can you post your question to the right category in the below? https://community.intel.com/t5/Product-Support-Forums/ct-p/product-support-forums


Thanks


0 Kudos
KennyTan_Altera
Moderator
574 Views

closing the non fpga related question


0 Kudos
Reply