<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 2/24/13 10:07 AM, Lu Mitnick wrote:<br>
</div>
<blockquote
cite="mid:CAH1oQ8pwO5stXOH=Y1DnGH46Jp4zCnRo3eRcY690CUSpU_9_AQ@mail.gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
Hello all,<br>
<br>
I have developed a instrumented pass which insert some variables
between the original variables, <br>
as well as insert some code into the original source code. just
like:<br>
<br>
============= original source code =============<br>
<br>
int a[10];<br>
<br>
void fun1 () {<br>
// some source code here<br>
}<br>
<br>
=========================================<br>
<br>
============= instrumented source code =============<br>
<br>
int dummy1[20];<br>
int a[10];<br>
int dummy2[30];<br>
<br>
void fun1 () {<br>
// instrumented source code 1<br>
// some source code here<br>
// instrumented source code 2<br>
}<br>
<br>
============= instrumented source code =============<br>
<br>
Apparently, dummy1 and dummy2 may cause pressure of data cache,
and instrumented source code 1<br>
and instrumented source code 2 may lead not only execution
overhead but also extra instruction cache<br>
pressure. Now I want to measure these separated overhead
precisely. To measure the pressure of<br>
instruction cache, I want to replace the instrumented source code
as nop (with length equals the length of<br>
instrumented source code). Is there anyway to instrument nop
explicitly in LLVM?<br>
</blockquote>
<br>
If you know the length of your instrumentation in bytes, you could
generate inline assembly code that inserts the correct number of NOP
instructions.<br>
<br>
Alternatively, if your processor has the necessary performance
counter registers, you could simply measure the change in cache
performance between the instrumented and uninstrumented code. For
x86_64 processors, you can use VTune (which will sample the
performance counter registers) or you can use the perfctr Linux
kernel patch and tools to get a precise measurement.<br>
<br>
-- John T.<br>
<br>
<blockquote
cite="mid:CAH1oQ8pwO5stXOH=Y1DnGH46Jp4zCnRo3eRcY690CUSpU_9_AQ@mail.gmail.com"
type="cite"><br>
Thanks<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a class="moz-txt-link-freetext" href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
</pre>
</blockquote>
<br>
</body>
</html>