Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1591272rwb; Fri, 28 Jul 2023 11:40:55 -0700 (PDT) X-Google-Smtp-Source: APBJJlHH6AlKba7+t71La4un0djeZfdH6Hm4REsqEew3hC4S0jflfe49pscz1P0XZY3QbEBx5ox5 X-Received: by 2002:a17:90a:5ae3:b0:262:e742:f419 with SMTP id n90-20020a17090a5ae300b00262e742f419mr2234173pji.47.1690569655018; Fri, 28 Jul 2023 11:40:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690569655; cv=none; d=google.com; s=arc-20160816; b=OVOS8oe8injGG87umFYtxcxcxoM/zQwRrxrxQrlvfBoWnIhnRQnt8Ep7YIxA5MEJoj RYT4JatL75f+UIJaIzVF7Eqqe3R6nYsl4bIwe3034Q3lmbxzIXxDxmQio2dO9Dz9tQBF P4LlzY1Rm2CTdrnGolsbFtc/9d3t8emc+B0Vqim6fOQVFGKnOIf2HF9A62SdJRyRtgRO c8UVrvl215R0RPcGe+SNeXDmCon1PLC0t9wuKfpq18VvwxTCZTMILHPo28+YR7PTVQnM up9Z81Mya0UabEWdCsxNQ29iRX/VhlSVWAWY1lZAsC0+utQR2hgu19QQzO7uFQ5J4R/E fhRQ== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=n4XRON1i9zHhOIUn4T/xMpyrayFBjA/6QpFCZxw/Z9Y=; fh=V+j/xPA+c/YjGkdaoP5odqooalUTPNCH+b8mmY+WocY=; b=05499f/3FpeHdX5nzFY8cBfJ6d1WMBQmoayANaMAitSM+YPr1rRFVwAz4vrgraoiIO 846RY0O1jW1094dSUPqwBvR1iLMAsH941Gdi9OZhJJaTKvqit4CgLRdVftY7qZ+p/Aja dpKVbemdZj57NpMbAAIDrc0XRj7OkFSqmfYiIV/71OITj3mW4kyR4aSXKGAirKIB/kn0 vcAffLL0FOVTvYf8T8cepDdrFi3BJLfrSftIYaHl+gWMS0xdLJjPE4otwX1of1Kl/MxX uiSwdr477NXt8CYgX1ePSI63bSy+kzYtwizTkAH+XY7zOBDQJ9VWG1ceI7NyUK1tbpb+ fZbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RzYn+nxk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o2-20020a17090ad24200b002683b77e224si3500595pjw.164.2023.07.28.11.40.41; Fri, 28 Jul 2023 11:40:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RzYn+nxk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S235717AbjG1SKd (ORCPT + 99 others); Fri, 28 Jul 2023 14:10:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235594AbjG1SK0 (ORCPT ); Fri, 28 Jul 2023 14:10:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 229D244B3; Fri, 28 Jul 2023 11:10:09 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9E83A621D9; Fri, 28 Jul 2023 18:10:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 98FD6C433C8; Fri, 28 Jul 2023 18:10:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690567808; bh=3LeMZELp4m+1YYGFtSrMAlQqThQJj6GMObRyyGm7lGs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RzYn+nxk5BM8Wz7vV7nTjftpnfIwmtyxP6J4GzJeLEQhZr2RLcF+z0Ds8EbGpPAHQ h2L2cjymJ524g3DzF/y8/NXSiwhm7AJ2zt6ITJwRY6i5O0O8DX5VOBB3SJa9cIuk4m 4tHzJX2ywbDPnRr4ZPoy/jHG39RxguJ1AdH4+ODNzIBeh0zXQQv79N3z8owiGz61Zh yNJB4uj0PS3/2i5/+BygJi3E6gvFAuUo/ZdhyCKzaRY82vXVf+4hLZTrrYzL1/cmBk 9YBIuVdMjoNIA+7q6HZ63s8+6iW6NAnaSVEUBGB9tueXB7k7kYAgqA5t7XDZ1kf4Df ZTClkQFSrd/cQ== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 08C7740096; Fri, 28 Jul 2023 15:10:05 -0300 (-03) Date: Fri, 28 Jul 2023 15:10:04 -0300 From: Arnaldo Carvalho de Melo To: Ian Rogers Cc: James Clark , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Adrian Hunter , Nathan Chancellor , Nick Desaulniers , Tom Rix , Kan Liang , Eduard Zingerman , Andrii Nakryiko , Gaosheng Cui , Rob Herring , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH v1 4/6] perf build: Disable fewer flex warnings Message-ID: References: <20230728064917.767761-1-irogers@google.com> <20230728064917.767761-5-irogers@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Url: http://acmel.wordpress.com X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Fri, Jul 28, 2023 at 08:26:54AM -0700, Ian Rogers escreveu: > On Fri, Jul 28, 2023 at 7:02 AM Arnaldo Carvalho de Melo > wrote: > > > > Em Fri, Jul 28, 2023 at 10:59:38AM -0300, Arnaldo Carvalho de Melo escreveu: > > > Em Fri, Jul 28, 2023 at 09:50:59AM +0100, James Clark escreveu: > > > > > > > > > > > > On 28/07/2023 07:49, Ian Rogers wrote: > > > > > If flex is version 2.6.4, reduce the number of flex C warnings > > > > > disabled. Earlier flex versions have all C warnings disabled. > > > > > > > > Hi Ian, > > > > > > > > I get a build error with either this one or the bison warning change: > > > > > > > > $ make LLVM=1 -C tools/perf NO_BPF_SKEL=1 DEBUG=1 > > > > > > > > util/pmu-bison.c:855:9: error: variable 'perf_pmu_nerrs' set but not > > > > used [-Werror,-Wunused-but-set-variable] > > > > int yynerrs = 0; > > > > > > > > I tried a clean build which normally fixes these kind of bison errors. > > > > Let me know if you need any version info. > > > > > > Trying to build it with the command line above I get: > > > > > > CC util/expr.o > > > CC util/parse-events.o > > > CC util/parse-events-flex.o > > > util/parse-events-flex.c:7503:13: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation] > > > if ( ! yyg->yy_state_buf ) > > > ^ > > > util/parse-events-flex.c:7501:9: note: previous statement is here > > > if ( ! yyg->yy_state_buf ) > > > ^ > > > > I added this to the patch to get it moving: > > > > make: Leaving directory '/var/home/acme/git/perf-tools-next/tools/perf' > > ⬢[acme@toolbox perf-tools-next]$ git diff > > diff --git a/tools/perf/util/Build b/tools/perf/util/Build > > index 32239c4b0393c319..afa93eff495811cf 100644 > > --- a/tools/perf/util/Build > > +++ b/tools/perf/util/Build > > @@ -281,7 +281,7 @@ $(OUTPUT)util/bpf-filter-bison.c $(OUTPUT)util/bpf-filter-bison.h: util/bpf-filt > > > > FLEX_GE_264 := $(shell expr $(shell $(FLEX) --version | sed -e 's/flex \([0-9]\+\).\([0-9]\+\).\([0-9]\+\)/\1\2\3/g') \>\= 264) > > ifeq ($(FLEX_GE_264),1) > > - flex_flags := -Wno-redundant-decls -Wno-switch-default -Wno-unused-function > > + flex_flags := -Wno-redundant-decls -Wno-switch-default -Wno-unused-function -Wno-misleading-indentation > > else > > flex_flags := -w > > endif > > ⬢[acme@toolbox perf-tools-next]$ > > > > > > > 1 error generated. > > > make[4]: *** [/var/home/acme/git/perf-tools-next/tools/build/Makefile.build:97: util/parse-events-flex.o] Error 1 > > > make[4]: *** Waiting for unfinished jobs.... > > > LD util/scripting-engines/perf-in.o > > > make[3]: *** [/var/home/acme/git/perf-tools-next/tools/build/Makefile.build:140: util] Error 2 > > > make[2]: *** [Makefile.perf:682: perf-in.o] Error 2 > > > make[2]: *** Waiting for unfinished jobs.... > > > CC pmu-events/pmu-events.o > > > LD pmu-events/pmu-events-in.o > > > make[1]: *** [Makefile.perf:242: sub-make] Error 2 > > > make: *** [Makefile:70: all] Error 2 > > > > > > ⬢[acme@toolbox perf-tools-next]$ clang --version > > > clang version 14.0.5 (Fedora 14.0.5-2.fc36) > > > Target: x86_64-redhat-linux-gnu > > > Thread model: posix > > > InstalledDir: /usr/bin > > > ⬢[acme@toolbox perf-tools-next]$ > > Thanks James/Arnaldo, I was trying to be aggressive in having more > flags, but it seems too aggressive. We should probably bring back the > logic to make this flag only added if it is supported: > CC_HASNT_MISLEADING_INDENTATION := $(shell echo "int main(void) { > return 0 }" | $(CC) -Werror -Wno-misleading-indentation -o /dev/null > -xc - 2>&1 | grep -q -- -Wno-misleading-indentation ; echo $$?) > ifeq ($(CC_HASNT_MISLEADING_INDENTATION), 1) > flex_flags += -Wno-misleading-indentation > endif > Arnaldo, is the misleading indentation in the bison generated code or > something copy-pasted from the parse-events.l ? If the latter we may > be able to fix the .l file to keep the warning. I haven't checked, lemme do it now. - Arnaldo