[LLVMdev] How to measure the overhead of instrumented code

Lu Mitnick king19880326 at gmail.com
Sun Feb 24 08:07:15 PST 2013


Hello all,

I have developed a instrumented pass which insert some variables between
the original variables,
as well as insert some code into the original source code. just like:

============= original source code =============

int a[10];

void fun1 () {
    // some  source code here
}

=========================================

============= instrumented source code =============

int dummy1[20];
int a[10];
int dummy2[30];

void fun1 () {
    // instrumented source code 1
    // some  source code here
    // instrumented source code 2
}

============= instrumented source code =============

Apparently, dummy1 and dummy2 may cause pressure of data cache, and
instrumented source code 1
and instrumented source code 2 may lead not only execution overhead but
also extra instruction cache
pressure. Now I want to measure these separated overhead precisely. To
measure the pressure of
instruction cache, I want to replace the instrumented source code as nop
(with length equals the length of
instrumented source code). Is there anyway to instrument nop explicitly in
LLVM?

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130225/187a4e85/attachment.html>


More information about the llvm-dev mailing list