On Thu, Jun 5, 2025 at 11:01 PM Kugan Vivekanandarajah
<kvivekana...@nvidia.com> wrote:
>
> Hi Andrew,
>
> > On 6 Jun 2025, at 8:18 am, Andrew Pinski <pins...@gmail.com> wrote:
> >
> > External email: Use caution opening links or attachments
> >
> >
> > On Wed, Jun 4, 2025 at 12:02 AM Kugan Vivekanandarajah
> > <kvivekana...@nvidia.com> wrote:
> >>
> >> This patch introduces a new testcase to verify the merging of profiles
> >> is performed for cloned functions.
> >>
> >> Since this is invoked very early, before the pass manager, we need to
> >> set up the dumping explicitly. This is similar to the handling in
> >> finish_optimization_passes.
> >>
> >> gcc/ChangeLog:
> >>
> >>        * auto-profile.cc (autofdo_source_profile::read): Dump message
> >>        while merging profile.
> >>        * pass_manager.h (get_pass_auto_profile): New.
> >>
> >> gcc/testsuite/ChangeLog:
> >>
> >>        * gcc.dg/tree-prof/clone-merge-1.c: New test.
> >
> > This new testcase fails if you don't have autofdo setup.
> > I think it needs:
> > /* { dg-require-profiling "-fauto-profile" } */
>
> Currently aarch64/gcc-auto-profile currently runs perf even when we do not 
> have BRBE (with a warning). This is what seems to be happening here.
> Tests currently rely on availability of create_gcov to decide if the tests 
> should be running. Without BRBE, we are not going to have
> good enough profile for the tests.
>
> I now get.
> ./gcc/testsuite/gcc/gcc.sum:UNSUPPORTED: gcc.dg/tree-prof/clone-merge-1.c 
> -fauto-profile: cannot run create_gcov
>
> Maybe we should fail when gcc-auto-profile warns? Let me try that.

I was getting the failure on x86_64:
FAIL: gcc.dg/tree-prof/clone-merge-1.c execution,    -fprofile-use
-D_PROFILE_USE

```
+ perf record -e cpu/event=0xC4,umask=0x20/pu -b -m8 -o
/bajas/pinskia/src/upstream-gcc-match/gcc/objdir/gcc/testsuite/gcc12/clone-merge-1.perf.data
/bajas/pinskia/src/upstream-gcc-match/gcc/objdir/gcc/testsuite/gcc12/clone-merge-1.x01
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.012 MB
/bajas/pinskia/src/upstream-gcc-match/gcc/objdir/gcc/testsuite/gcc12/clone-merge-1.perf.data
(15 samples) ]
/home/apinski/src/upstream-gcc-match/gcc/gcc/testsuite/../config/i386/gcc-auto-profile:
line 129: 2999953 Segmentation fault      (core dumped) perf record -e
$E -b "$@"
+ set +x
Retrying without /p.
sed: -e expression #1, char 1: unknown command: `''
+ exec perf record -e -b -m8 -o
/bajas/pinskia/src/upstream-gcc-match/gcc/objdir/gcc/testsuite/gcc12/clone-merge-1.perf.data
/bajas/pinskia/src/upstream-gcc-match/gcc/objdir/gcc/testsuite/gcc12/clone-merge-1.x01
event syntax error: '-b'
                     \___ parser error
Run 'perf list' for a list of valid events

 Usage: perf record [<options>] [<command>]
    or: perf record [<options>] -- <command> [<options>]

    -e, --event <event>   event selector. use 'perf list' to list
available events
FAIL: gcc.dg/tree-prof/clone-merge-1.c execution,    -g -DFOR_AUTOFDO_TESTING
UNRESOLVED: gcc.dg/tree-prof/clone-merge-1.c compilation,
-fauto-profile -DFOR_AUTOFDO_TESTING -fearly-inlining
UNRESOLVED: gcc.dg/tree-prof/clone-merge-1.c execution,
-fauto-profile -DFOR_AUTOFDO_TESTING -fearly-inlining
```

>
> Thanks,
> Kugan
>
> >
> > Thanks,
> > Andrew Pinski
> >
> >
> >>
> >> Is this OK?
> >>
> >> Thanks,
> >> Kugan
> >>
>

Reply via email to