All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Anshuman Khandual <anshuman.khandual@arm.com>,
	Stephen Rothwell <sfr@canb.auug.org.au>
Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	peterz@infradead.org, alexander.shishkin@linux.intel.com,
	jolsa@redhat.com, mark.rutland@arm.com,
	Robin Murphy <robin.murphy@arm.com>,
	Suzuki Poulose <suzuki.poulose@arm.com>,
	James Clark <james.clark@arm.com>, Ingo Molnar <mingo@redhat.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Will Deacon <will@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH V7 6/8] perf/tools: Extend branch type classification
Date: Fri, 2 Sep 2022 14:46:47 -0300	[thread overview]
Message-ID: <YxJBh3wvAGol+Ekq@kernel.org> (raw)
In-Reply-To: <YxI99uLvpgAZjm2r@kernel.org>

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:

From b0f700972d9d0c9b8e73f69ccf0e56d74c580d71 Mon Sep 17 00:00:00 2001
From: Arnaldo Carvalho de Melo <acme@redhat.com>
Date: Fri, 2 Sep 2022 14:35:26 -0300
Subject: [PATCH 1/1] perf build: Avoid false positive with
 -Werror=format-overflow= with gcc 10.3.0 on powerpc

When building with gcc 10.3.0 on powerpc this is happening:

   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 ());
           |    ~~~~~~~~~~~~~~~~~

Looks related to:

  [10/11/12/13 Regression] false positive: directive argument is null [-Werror=format-overflow=]
  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90036

So lets disable this just for the util/branch.o file.

Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@arm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will@kernel.org>
Link: http://lore.kernel.org/lkml/YxI99uLvpgAZjm2r@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/Build | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/perf/util/Build b/tools/perf/util/Build
index 8fd6dc8de5210336..20a5524e88a04d44 100644
--- a/tools/perf/util/Build
+++ b/tools/perf/util/Build
@@ -223,6 +223,10 @@ CFLAGS_llvm-utils.o += -DPERF_INCLUDE_DIR="BUILD_STR($(perf_include_dir_SQ))"
 # avoid compiler warnings in 32-bit mode
 CFLAGS_genelf_debug.o  += -Wno-packed
 
+# avoid false positive when building with gcc 10.3.0 on powerpc
+# See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90036
+CFLAGS_branch.o += -Wno-format-overflow
+
 $(OUTPUT)util/parse-events-flex.c $(OUTPUT)util/parse-events-flex.h: util/parse-events.l $(OUTPUT)util/parse-events-bison.c
 	$(call rule_mkdir)
 	$(Q)$(call echo-cmd,flex)$(FLEX) -o $(OUTPUT)util/parse-events-flex.c \
-- 
2.37.2


WARNING: multiple messages have this Message-ID (diff)
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Anshuman Khandual <anshuman.khandual@arm.com>,
	Stephen Rothwell <sfr@canb.auug.org.au>
Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	peterz@infradead.org, alexander.shishkin@linux.intel.com,
	jolsa@redhat.com, mark.rutland@arm.com,
	Robin Murphy <robin.murphy@arm.com>,
	Suzuki Poulose <suzuki.poulose@arm.com>,
	James Clark <james.clark@arm.com>, Ingo Molnar <mingo@redhat.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Will Deacon <will@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH V7 6/8] perf/tools: Extend branch type classification
Date: Fri, 2 Sep 2022 14:46:47 -0300	[thread overview]
Message-ID: <YxJBh3wvAGol+Ekq@kernel.org> (raw)
In-Reply-To: <YxI99uLvpgAZjm2r@kernel.org>

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:

From b0f700972d9d0c9b8e73f69ccf0e56d74c580d71 Mon Sep 17 00:00:00 2001
From: Arnaldo Carvalho de Melo <acme@redhat.com>
Date: Fri, 2 Sep 2022 14:35:26 -0300
Subject: [PATCH 1/1] perf build: Avoid false positive with
 -Werror=format-overflow= with gcc 10.3.0 on powerpc

When building with gcc 10.3.0 on powerpc this is happening:

   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 ());
           |    ~~~~~~~~~~~~~~~~~

Looks related to:

  [10/11/12/13 Regression] false positive: directive argument is null [-Werror=format-overflow=]
  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90036

So lets disable this just for the util/branch.o file.

Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@arm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will@kernel.org>
Link: http://lore.kernel.org/lkml/YxI99uLvpgAZjm2r@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/Build | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/perf/util/Build b/tools/perf/util/Build
index 8fd6dc8de5210336..20a5524e88a04d44 100644
--- a/tools/perf/util/Build
+++ b/tools/perf/util/Build
@@ -223,6 +223,10 @@ CFLAGS_llvm-utils.o += -DPERF_INCLUDE_DIR="BUILD_STR($(perf_include_dir_SQ))"
 # avoid compiler warnings in 32-bit mode
 CFLAGS_genelf_debug.o  += -Wno-packed
 
+# avoid false positive when building with gcc 10.3.0 on powerpc
+# See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90036
+CFLAGS_branch.o += -Wno-format-overflow
+
 $(OUTPUT)util/parse-events-flex.c $(OUTPUT)util/parse-events-flex.h: util/parse-events.l $(OUTPUT)util/parse-events-bison.c
 	$(call rule_mkdir)
 	$(Q)$(call echo-cmd,flex)$(FLEX) -o $(OUTPUT)util/parse-events-flex.c \
-- 
2.37.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-09-02 17:47 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-24  4:48 [PATCH V7 0/8] perf: Expand perf_branch_entry Anshuman Khandual
2022-08-24  4:48 ` Anshuman Khandual
2022-08-24  4:48 ` [PATCH V7 1/8] perf: Add system error and not in transaction branch types Anshuman Khandual
2022-08-24  4:48   ` Anshuman Khandual
2022-08-26 22:15   ` [tip: perf/core] " tip-bot2 for Anshuman Khandual
2022-08-29  7:50   ` tip-bot2 for Anshuman Khandual
2022-08-24  4:48 ` [PATCH V7 2/8] perf: Extend branch type classification Anshuman Khandual
2022-08-24  4:48   ` Anshuman Khandual
2022-08-26 22:15   ` [tip: perf/core] " tip-bot2 for Anshuman Khandual
2022-08-29  7:50   ` tip-bot2 for Anshuman Khandual
2022-08-24  4:48 ` [PATCH V7 3/8] perf: Capture branch privilege information Anshuman Khandual
2022-08-24  4:48   ` Anshuman Khandual
2022-08-26 22:15   ` [tip: perf/core] " tip-bot2 for Anshuman Khandual
2022-08-29  7:50   ` tip-bot2 for Anshuman Khandual
2022-08-24  4:48 ` [PATCH V7 4/8] perf: Add PERF_BR_NEW_ARCH_[N] map for BRBE on arm64 platform Anshuman Khandual
2022-08-24  4:48   ` Anshuman Khandual
2022-08-26 22:15   ` [tip: perf/core] " tip-bot2 for Anshuman Khandual
2022-08-29  7:49   ` tip-bot2 for Anshuman Khandual
2022-08-24  4:48 ` [PATCH V7 5/8] perf/tools: Add system error and not in transaction branch types Anshuman Khandual
2022-08-24  4:48   ` Anshuman Khandual
2022-08-24  4:48 ` [PATCH V7 6/8] perf/tools: Extend branch type classification Anshuman Khandual
2022-08-24  4:48   ` Anshuman Khandual
2022-08-30 21:11   ` Arnaldo Carvalho de Melo
2022-08-30 21:11     ` Arnaldo Carvalho de Melo
2022-09-01  5:07     ` Anshuman Khandual
2022-09-01  5:07       ` Anshuman Khandual
2022-09-02 17:31       ` Arnaldo Carvalho de Melo
2022-09-02 17:31         ` Arnaldo Carvalho de Melo
2022-09-02 17:46         ` Arnaldo Carvalho de Melo [this message]
2022-09-02 17:46           ` Arnaldo Carvalho de Melo
2022-09-05  8:00           ` Anshuman Khandual
2022-09-05  8:00             ` Anshuman Khandual
2022-08-24  4:48 ` [PATCH V7 7/8] perf/tools: Add branch privilege information request flag Anshuman Khandual
2022-08-24  4:48   ` Anshuman Khandual
2022-08-24  4:48 ` [PATCH V7 8/8] perf/tools: Add PERF_BR_NEW_ARCH_[N] map for BRBE on arm64 platform Anshuman Khandual
2022-08-24  4:48   ` Anshuman Khandual
2022-08-25 10:22 ` [PATCH V7 0/8] perf: Expand perf_branch_entry Peter Zijlstra
2022-08-25 10:22   ` Peter Zijlstra
2022-08-29  4:12   ` Anshuman Khandual
2022-08-29  4:12     ` Anshuman Khandual

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YxJBh3wvAGol+Ekq@kernel.org \
    --to=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=anshuman.khandual@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=james.clark@arm.com \
    --cc=jolsa@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=robin.murphy@arm.com \
    --cc=sfr@canb.auug.org.au \
    --cc=suzuki.poulose@arm.com \
    --cc=tglx@linutronix.de \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.