Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964981AbbGHLRp (ORCPT ); Wed, 8 Jul 2015 07:17:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35805 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934465AbbGHLRi (ORCPT ); Wed, 8 Jul 2015 07:17:38 -0400 Date: Wed, 8 Jul 2015 13:17:31 +0200 From: Jiri Olsa To: Vinson Lee Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Jiri Olsa , LKML , linux-perf-users@vger.kernel.org Subject: [PATCH] perf stat: Fix shadow declaration of close Message-ID: <20150708111731.GA3512@krava.redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1997 Lines: 65 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 Link: http://lkml.kernel.org/n/tip-x4029j7ktlsxr0tnoontt4l8@git.kernel.org Signed-off-by: Jiri Olsa --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/