[LLVMdev] Help on LLVM Instrumentation

Sandra Johnson sandra_johnk at yahoo.com
Sun Oct 16 11:24:57 PDT 2005


Hi ,

I am using LLVM for my Post Graduate course project on Optimization. I am trying to do some insrtumentation to the bytecode.I 've been going through your Instrumentation code for the past few days in /llvm/lib/Transforms/Instrumentation folder and finally found two ways of instrumentation :

1) injecting LLVM bytecode instructions

2) calling an external C function.

I am trying both and I am comfortable with the 2).
My goal is to insert a global variable , which will count the total number of functions executed.At each method entry the global variable should be incremented and at the last method exit , it should print the count. The code compiled successfully, but when I used in the opt tool, I get an error in the getElementPtr(..) statement and finally a segmentation fault error. Please help me regarding this.

I am sending the code as an attachment.

I 've written a pass which will do instrumentation using the opt tool and then execute with lli JIT enabled.

Thank you ,

Sandra Johnson , M.E. (C.S.E.)

Anna University,

Chennai , India.



		
---------------------------------
 Yahoo! Music Unlimited - Access over 1 million songs. Try it free.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20051016/02dd0a86/attachment.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Sample.cpp
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20051016/02dd0a86/attachment.ksh>


More information about the llvm-dev mailing list