https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124075

            Bug ID: 124075
           Summary: gcc-auto-profile does not use PERF_DATA for perf file
                    output
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: gcov-profile
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dhruvc at gcc dot gnu.org
  Target Milestone: ---

The PERF_DATA make variable is set in Makefile.def for the perf file that
create_gcov ingests (in {c,cp,lto}/Make-lang.in), but the gcc-auto-profile
script that generates the perf file does not make use of it (in top-level
Makefile.in, invoked via $(AUTO_PROFILE)). Thus, its value can never be
anything other than the current "perf.data".

There's two options here:
1. Hardcode perf.data everywhere and get rid of this variable.
2. Use PERF_DATA in gcc-auto-profile.

I like 2. more, but it will require some plumbing around the build system. I
wanted to open this PR to track fixing this, also because specifying the output
filename to perf will fix a bug where it seems to randomly dump profiles to
stdout, which I observed when testing autoprofiledbootstrap on both x86 and
aarch64.

Reply via email to