* 4.2-rc2 perf build error builtin-stat.c:346: error: declaration of ‘close’ shadows a global declaration
@ 2015-07-07 18:01 Vinson Lee
2015-07-08 11:17 ` [PATCH] perf stat: Fix shadow declaration of close Jiri Olsa
0 siblings, 1 reply; 3+ messages in thread
From: Vinson Lee @ 2015-07-07 18:01 UTC (permalink / raw)
To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo, Jiri Olsa
Cc: LKML, linux-perf-users
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
Cheers,
Vinson
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] perf stat: Fix shadow declaration of close
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
2015-07-10 8:13 ` [tip:perf/urgent] " tip-bot for Jiri Olsa
0 siblings, 1 reply; 3+ messages in thread
From: Jiri Olsa @ 2015-07-08 11:17 UTC (permalink / raw)
To: Vinson Lee
Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo, Jiri Olsa,
LKML, linux-perf-users
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* [tip:perf/urgent] perf stat: Fix shadow declaration of close
2015-07-08 11:17 ` [PATCH] perf stat: Fix shadow declaration of close Jiri Olsa
@ 2015-07-10 8:13 ` tip-bot for Jiri Olsa
0 siblings, 0 replies; 3+ messages in thread
From: tip-bot for Jiri Olsa @ 2015-07-10 8:13 UTC (permalink / raw)
To: linux-tip-commits
Cc: tglx, a.p.zijlstra, jolsa, linux-kernel, jolsa, hpa, mingo, vlee, acme
Commit-ID: 5fc472a628edb8ad83016a063329e8b589a04060
Gitweb: http://git.kernel.org/tip/5fc472a628edb8ad83016a063329e8b589a04060
Author: Jiri Olsa <jolsa@redhat.com>
AuthorDate: Wed, 8 Jul 2015 13:17:31 +0200
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 8 Jul 2015 10:04:58 -0300
perf stat: Fix shadow declaration of close
Vinson reported shadow declaration of close introduced
by the following commit:
106a94a0f8c2 perf stat: Introduce read_counters function
Using close_counters name instead.
Reported-by: Vinson Lee <vlee@twopensource.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Fixes: 106a94a0f8c2 ("perf stat: Introduce read_counters function")
Link: http://lkml.kernel.org/r/20150708111731.GA3512@krava.redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
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 37e301a..d99d850 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -343,7 +343,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;
@@ -354,7 +354,7 @@ static void read_counters(bool close)
if (process_counter(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));
}
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-07-10 8:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH] perf stat: Fix shadow declaration of close Jiri Olsa
2015-07-10 8:13 ` [tip:perf/urgent] " tip-bot for Jiri Olsa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®