Re: [PATCH V7 6/8] perf/tools: Extend branch type classification

From: Arnaldo Carvalho de Melo
Date: Fri Sep 02 2022 - 13:47:01 EST


Em Fri, Sep 02, 2022 at 02:31:34PM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Thu, Sep 01, 2022 at 10:37:24AM +0530, Anshuman Khandual escreveu:
> > On 8/31/22 02:41, Arnaldo Carvalho de Melo wrote:
> > > Strange:
> > >
> > > 75 8.89 ubuntu:20.04-x-powerpc64el : FAIL gcc version 10.3.0 (Ubuntu 10.3.0-1ubuntu1~20.04)
> > > inlined from 'branch_type_stat_display' at util/branch.c:152:4:
> > > /usr/powerpc64le-linux-gnu/include/bits/stdio2.h:100:10: error: '%8s' directive argument is null [-Werror=format-overflow=]
> > > 100 | return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt,
> > > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > 101 | __va_arg_pack ());
> > > | ~~~~~~~~~~~~~~~~~
> > >
> >
> > Indeed. But this new code block here looks exact same like the previous and existing one
> > i.e with branch_new_name() and PERF_BR_NEW_MAX. The complain is that - '%8s' directive
> > argument is NULL. This warning might just be a false positive [1], because of a compiler
> > problem on powerpc64el ? But please do let me know if something needs to be changed here
> > to avoid this warning.
> >
> > [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90036
> >
>
> So, I tried not returning NULL in the functions that are ultimately
> called, but that didn't help, so I'll try just disabling that specific
> warning for this specific file.

Got it building:

23.68 ubuntu:20.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0
BUILD_TARBALL_HEAD=b0f700972d9d0c9b8e73f69ccf0e56d74c580d71

With: