Displaying 4 results from an estimated 4 matches for "__sanitizer_cov_trace_pc".
2016 Aug 13
2
A "hello world" coverage sanitizer
...houlai*
Zhoulai
On Fri, Aug 12, 2016 at 1:57 PM, Kostya Serebryany <kcc at google.com> wrote:
> Hi Zhoulai,
> The closest you can get is http://clang.llvm.org/docs/
> SanitizerCoverage.html#tracing-pcs
> With this flavor of instrumentation the compiler inserts calls to
> __sanitizer_cov_trace_pc into the control flow.
> The users (you) needs to define the function __sanitizer_cov_trace_pc and
> so you can call printf there.
>
> By default, not all edges in the control flow are instrumented
> This is an optimization, you can disable it by -mllvm
> -sanitizer-coverage-prune...
2016 Aug 12
2
A "hello world" coverage sanitizer
Hi, all
I want to instrument a program automatically so that it prints "hello"
before each conditional statement. For example, consider the function P
below.
int P(int x) {
if (x<3)
if (x>0)
return 1;
return 0;
}
Let P_instrum be the instrumented version of P. It is expected that:
-- P_instrum(1) prints two "hello"s
--
2016 Oct 28
2
Basic block execution over time
Hello All,
How can I keep track of the different basic blocks of a program executed over time?
Or in other words, how can I annotate the block name (block_a) and the time/cycle at which that blocs (block_a) was executed, and do this for all the blocks on a reasonable simple program?
Regards, Raul.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2016 Oct 29
0
Basic block execution over time
...to do this is using the new `trace_pc`
functionality from SanitizerCoverage. See
http://clang.llvm.org/docs/SanitizerCoverage.html#tracing-pcs for some
documentation about that.
In short:
- Compile your program with the `-fsanitize-coverage=trace-pc` flag.
- This adds a call to a function called `__sanitizer_cov_trace_pc` to every
edge in the control-flow graph.
- You can define this function in any way you want (just write C code, and
link it to the application)
- In particular, you can use `__builtin_return_address` to find where the
function was called from. You're then free to dump that address to a file
de...