Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2552408pxb; Thu, 11 Feb 2021 15:55:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJz2UORLjmZV8N2bRlDGlw8qVVVYWyb8dIiCv31K5hYSYSubMgtEACcAOQ/Cc2qVV00erkHu X-Received: by 2002:a17:907:724a:: with SMTP id ds10mr228084ejc.28.1613087736374; Thu, 11 Feb 2021 15:55:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613087736; cv=none; d=google.com; s=arc-20160816; b=TAu+OQWEhxzhq0t10JnmAzPUCaDe73NqvMbDLSUC8ty5GnpyNPif4Hxghnv3x7se1S UzvYl8oAcr/VjFOcoN2GQk22SunCzBnZewNPJt8QjYkLIlFsihyJBTVSVrSh5GLN1hUU H5iZcsSI1H7jcePV9yJZm1njUse4RqQe4j5JUcyQAsftz+o9XCoHnRE7g/kbAy7A4L2w 2mBjbP0AQ01MEZXACFdV/p/9YDWyhhIr0aHujk3+LcN/J4Qd3xUIcYT07kYlbl+uqs90 0OUD7dY8fCohk92I/Kbtjc/NlOqJj4ZfBZt+yCcG5sKgHXpJ9axeWIVTejXINdTgPHCk EZhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ZCyovxY1MgH9wjqvUt0IpL/JoxuADw8+opJJbHNaivc=; b=zatA+Ae8LS7JC5RQxuNpGySLJOcT+LQflOF5tKmtb7TOvyQukk0eNHMSjB5WdRVdyy x1fuo/JHFhC4hV5M5ihws27MEqvZZkVBpapZeX4USaCvnMJN0PYBbfuC2Gz54CuQ9rf1 lT4TvZ+V0fhP9rBhIidWGvK3VXOqV8KOHAcT/iW6bYxAGWR3gGW8PaOrTEmt5IV6bymN PSckOVUbpb5Fu1C4tW9fFQrPp7IJ+l/eeyVjSnu0xKJaTgqI677qDRJy+GVMfgnnvPVR 61d78gSlbycMxgnE7PZ1iZLe9/wjXCPq+P8rDDpWAl6tbS2gFYG/Hww6l0Zj/ywdGG/h fWPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=D72F1mhg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id de28si4516315edb.466.2021.02.11.15.55.13; Thu, 11 Feb 2021 15:55:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=D72F1mhg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230352AbhBKXyc (ORCPT + 99 others); Thu, 11 Feb 2021 18:54:32 -0500 Received: from mail.kernel.org ([198.145.29.99]:53126 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230187AbhBKXxR (ORCPT ); Thu, 11 Feb 2021 18:53:17 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id E462164E4A; Thu, 11 Feb 2021 23:52:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1613087556; bh=xtzmI2dR4hRaYr3yDSbATKA7Pt6c4sw8xv9I6JldghY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=D72F1mhgSuhPSrhUH8Jo74/w0Z3fradjOWXTcGkZYfblNkMiHFEaevmvMuCEcmQ5h rk2RfBLEYzVlHpDBF65cLyIxgSaJzgdJo57tdY9oedM/gNClU/G97wtG37Tq0pRek3 XeMkxW2gCIHQIHklktBKTWKz9cx/GJTPjxa3swyEcQrViNM6VyOjh5+GAGhwF1YdjQ 34K/hEsWZyE5PKpvhFpuZLF6KbIzTjmVaVEV7SDVlO1h8Zqd8cUstZLsqHwM7N6B3V /amyA+8WFFyZ6vYFaSAvFVdw6R7G7F4RNMroZoMH60GC0/yzr6uS6eZnqUKh0PuwWQ qeWJ8+CqQlolw== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id DA69F40513; Thu, 11 Feb 2021 20:52:30 -0300 (-03) Date: Thu, 11 Feb 2021 20:52:30 -0300 From: Arnaldo Carvalho de Melo To: Namhyung Kim Cc: Dmitry Safonov , linux-kernel , Dmitry Safonov <0x7f454c46@gmail.com>, Alexander Shishkin , Ingo Molnar , Jacek Caban , Jiri Olsa , Mark Rutland , Peter Zijlstra , Remi Bernon Subject: Re: [PATCH] perf: Use (long) for iterator for bfd symbols Message-ID: <20210211235230.GA1370062@kernel.org> References: <20210209145148.178702-1-dima@arista.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Thu, Feb 11, 2021 at 06:14:03PM +0900, Namhyung Kim escreveu: > Hello, > > On Tue, Feb 9, 2021 at 11:51 PM Dmitry Safonov wrote: > > > > GCC (GCC) 8.4.0 20200304 fails to build perf with: > > : util/symbol.c: In function 'dso__load_bfd_symbols': > > : util/symbol.c:1626:16: error: comparison of integer expressions of different signednes > > : for (i = 0; i < symbols_count; ++i) { > > : ^ > > : util/symbol.c:1632:16: error: comparison of integer expressions of different signednes > > : while (i + 1 < symbols_count && > > : ^ > > : util/symbol.c:1637:13: error: comparison of integer expressions of different signednes > > : if (i + 1 < symbols_count && > > : ^ > > : cc1: all warnings being treated as errors > > > > It's unlikely that the symtable will be that big, but the fix is > > oneliner and as perf has CORE_CFLAGS += -Wextra, which makes build to > > fail together with CORE_CFLAGS += -Werror > > > > Fixes: eac9a4342e54 ("perf symbols: Try reading the symbol table with libbfd") > > Cc: Alexander Shishkin > > Cc: Arnaldo Carvalho de Melo > > Cc: Ingo Molnar > > Cc: Jacek Caban > > Cc: Jiri Olsa > > Cc: Mark Rutland > > Cc: Namhyung Kim > > Cc: Peter Zijlstra > > Cc: Remi Bernon > > Signed-off-by: Dmitry Safonov > > Acked-by: Namhyung Kim Thanks, applied. - Arnaldo > Thanks, > Namhyung > > > > --- > > tools/perf/util/symbol.c | 3 +-- > > 1 file changed, 1 insertion(+), 2 deletions(-) > > > > diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c > > index 64a039cbba1b..1645fb4ec9ed 100644 > > --- a/tools/perf/util/symbol.c > > +++ b/tools/perf/util/symbol.c > > @@ -1561,12 +1561,11 @@ static int bfd2elf_binding(asymbol *symbol) > > int dso__load_bfd_symbols(struct dso *dso, const char *debugfile) > > { > > int err = -1; > > - long symbols_size, symbols_count; > > + long symbols_size, symbols_count, i; > > asection *section; > > asymbol **symbols, *sym; > > struct symbol *symbol; > > bfd *abfd; > > - u_int i; > > u64 start, len; > > > > abfd = bfd_openr(dso->long_name, NULL); > > -- > > 2.30.0 > > -- - Arnaldo