From: Jiri Olsa <jolsa@redhat.com>
To: Vinson Lee <vlee@twopensource.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Jiri Olsa <jolsa@kernel.org>, LKML <linux-kernel@vger.kernel.org>,
linux-perf-users@vger.kernel.org
Subject: [PATCH] perf stat: Fix shadow declaration of close
Date: Wed, 8 Jul 2015 13:17:31 +0200 [thread overview]
Message-ID: <20150708111731.GA3512@krava.redhat.com> (raw)
In-Reply-To: <CAHTgTXWecD6LoDRt4a5gJ385GULuhyB6YaK6iMNh=YW9cCkiZg@mail.gmail.com>
On Tue, Jul 07, 2015 at 11:01:25AM -0700, Vinson Lee wrote:
> Hi.
>
> 4.2-rc1 commit 106a94a0f8c207ef4113ce7e32f34a00b3b174e7 "perf stat:
> Introduce read_counters function" introduced a build error with older
> toolchains.
>
> This is the build error on CentOS 6.
>
> CC builtin-stat.o
> cc1: warnings being treated as errors
> builtin-stat.c: In function ‘read_counters’:
> builtin-stat.c:346: error: declaration of ‘close’ shadows a global declaration
> /usr/include/unistd.h:350: error: shadowed declaration is here
hi,
oops, sry.. patch attached
thanks,
jirka
---
Vinson reported shadow declaration of close introduced
by following commit:
106a94a0f8c2 perf stat: Introduce read_counters function
Using close_counters name instead.
Reported-by: Vinson Lee <vlee@twopensource.com>
Link: http://lkml.kernel.org/n/tip-x4029j7ktlsxr0tnoontt4l8@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/perf/builtin-stat.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index de9577503ea6..2c9edd22e6e8 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -297,7 +297,7 @@ static int read_counter(struct perf_evsel *counter)
return 0;
}
-static void read_counters(bool close)
+static void read_counters(bool close_counters)
{
struct perf_evsel *counter;
@@ -308,7 +308,7 @@ static void read_counters(bool close)
if (perf_stat_process_counter(&stat_config, counter))
pr_warning("failed to process counter %s\n", counter->name);
- if (close) {
+ if (close_counters) {
perf_evsel__close_fd(counter, perf_evsel__nr_cpus(counter),
thread_map__nr(evsel_list->threads));
}
--
2.4.3
prev parent reply other threads:[~2015-07-08 11:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-07 18:01 4.2-rc2 perf build error builtin-stat.c:346: error: declaration of ‘close’ shadows a global declaration Vinson Lee
2015-07-08 11:17 ` Jiri Olsa [this message]
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=20150708111731.GA3512@krava.redhat.com \
--to=jolsa@redhat.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@kernel.org \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=vlee@twopensource.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).