<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Veterans could tell you more, what I say may be wrong, it is just based on my still enough poor understanding of clang and LLVM nonetheless poor understanding of the paper.</div><div><br></div><div>What I mean with AST is that you can static-analyze your AST to find the "to dynamically analyze" points and inject code (also in form of AST) in form of "report now that there is a read from array (memory)" or "now there is a save to memory". This would give though tons of false positives as the compiler will optimize out lot of stuff, so I think it would be a false positives. To understand this in details you should read how the clang compiler works.<br><br>But I think nobody could give you a precise answer without reading the paper in question you marked with [1] especially that you did not provide a link to it.</div><div><br></div><div>tools/libraries like vallgrind, dynamorio, intel.pin are in my opinion more specialized for what you probably want to do. Anyway I think mainly there are two approaches. You either inject analysis code near the instructions to be observed or you run your code through an interpreter (vallgrind or llvm) and try to "catch" what you are interested in. With "AST" hacking you could inject code I think more precisely than any of the other tools... but all depends on what exactly you want to measure. </div><div><br></div><div>Think also about performance. Running such an analyzis through an interpreter often is impossible (valgrind, llvm). Myself I had to do some profiling with valgrind, but given that starting the server in real situation took half an hour. Running it through valgrind (thus intepreter) took one day (if it was not crashing) ;) which made it impossible to use at the end...</div><div><br></div><div><br></div></div>
</div></div>