about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorJun Wu <quark@fb.com>2018-12-30 11:59:03 -0800
committerJun Wu <quark@fb.com>2018-12-30 11:59:03 -0800
commit31a5066e0b5f0e7e79b6cc04ae09166de0352c63 (patch)
tree734d3c518bbaa8a07aaf49bc8aec9aad20a5e956 /src/rustllvm/RustWrapper.cpp
parenta35cf79fcb961d43828aa9f010e7109b60633f52 (diff)
downloadrust-31a5066e0b5f0e7e79b6cc04ae09166de0352c63.tar.gz
rust-31a5066e0b5f0e7e79b6cc04ae09166de0352c63.zip
Add `-Z instrument-mcount`
This flag inserts `mcount` function call to the beginning of every function
after inline processing. So tracing tools like uftrace [1] (or ftrace for
Linux kernel modules) have a chance to examine function calls.

It is similar to the `-pg` flag provided by gcc or clang, but without
generating a `__gmon_start__` function for executables. If a program
runs without being traced, no `gmon.out` will be written to disk.

Under the hood, it simply adds `"instrument-function-entry-inlined"="mcount"`
attribute to every function. The `post-inline-ee-instrument` LLVM pass does
the actual job.

[1]: https://github.com/namhyung/uftrace
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions