https://gcc.gnu.org/g:f164ed904503c9eff5c15977526f7f036d247963
commit r16-7955-gf164ed904503c9eff5c15977526f7f036d247963 Author: Dhruv Chawla <[email protected]> Date: Thu Feb 12 03:57:51 2026 +0000 gcc-auto-profile: Force --inherit flag for perf record [PR123923] This works around a bug I was seeing while testing autoprofiledbootstrap where it appeared that perf record was only recording the make invocation and not any of the child processes. I did not find any configuration that would make it do so, so forcing the flag in gcc-auto-profile will make sure that it doesn't happen regardless of perf's settings. Bootstrapped and regtested on aarch64-linux-gnu. Signed-off-by: Dhruv Chawla <[email protected]> gcc/ChangeLog: PR gcov-profile/123923 * config/aarch64/gcc-auto-profile: Add --inherit to perf record flags. * config/i386/gcc-auto-profile: Likewise. Diff: --- gcc/config/aarch64/gcc-auto-profile | 4 ++-- gcc/config/i386/gcc-auto-profile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gcc/config/aarch64/gcc-auto-profile b/gcc/config/aarch64/gcc-auto-profile index 4d5c2e34855f..fdf06dfeed03 100755 --- a/gcc/config/aarch64/gcc-auto-profile +++ b/gcc/config/aarch64/gcc-auto-profile @@ -43,11 +43,11 @@ if [ "$use_brbe" = true ] ; then echo >&2 "Warning: branch profiling may not be functional in VMs" fi set -x - perf record -j any,$FLAGS "$@" + perf record --inherit -j any,$FLAGS "$@" set +x else echo >&2 "Warning: branch profiling may not be functional without BRBE" set -x - perf record "$@" + perf record --inherit "$@" set +x fi diff --git a/gcc/config/i386/gcc-auto-profile b/gcc/config/i386/gcc-auto-profile index 0e9e5fec2fe2..5cd4077826ba 100755 --- a/gcc/config/i386/gcc-auto-profile +++ b/gcc/config/i386/gcc-auto-profile @@ -117,13 +117,13 @@ echo >&2 "AMD CPU without support for ex_ret_brn_tkn event" fi ;; esac set -x -if ! perf record -e $E -b "$@" ; then +if ! perf record --inherit -e $E -b "$@" ; then # PEBS may not actually be working even if the processor supports it # (e.g., in a virtual machine). Trying to run without /p. set +x echo >&2 "Retrying without /p." E="$(echo "${E}" | sed -e \'s/\/p/\//\ -e s/:p//)" set -x - exec perf record -e $E -b "$@" + exec perf record --inherit -e $E -b "$@" set +x fi
