Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add -Z instrument-mcount #57220

Merged
merged 1 commit into from
Dec 31, 2018
Merged

Add -Z instrument-mcount #57220

merged 1 commit into from
Dec 31, 2018

Commits on Dec 30, 2018

  1. 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
    quark-zju committed Dec 30, 2018
    Configuration menu
    Copy the full SHA
    31a5066 View commit details
    Browse the repository at this point in the history