Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1398790rwb; Fri, 28 Jul 2023 08:53:32 -0700 (PDT) X-Google-Smtp-Source: APBJJlFUPPb7kVudK7eETXh6vC5WS2io0i5rF47fdMvbuJnTi7JEYNIyNASTuKHHlDG71w2/PFR7 X-Received: by 2002:a17:902:da81:b0:1b8:36a8:faf9 with SMTP id j1-20020a170902da8100b001b836a8faf9mr2269044plx.38.1690559612094; Fri, 28 Jul 2023 08:53:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690559612; cv=none; d=google.com; s=arc-20160816; b=HrOfameJ6EBvPAZpt8Hx5KxXY/jTWovf8Sao5zGZ2ZKMLus4S1N4Sn2ktS2obZPrsF 0BQ9YaGy68+w2iWVbe+yXuOmz+d/G2fPUblYTahh+THvJfJlozgePdzlkz/JpXuLXY53 q129DOahqrefEjYrcjz1aOZYUijEb6PH9hX3wpdi5j1Syu+vQY5LN/A3YHfev5damX9L jYO2olbMubvDUK2Hg/0/uZzpFdtSZnA+tnjhWWeJBFmH5SgxuTPOl2Xu/JALCthTwXMo 8DI0Aa/DpFFv3z+4r4wQUh7ZdLM1A2wugNtyI25GKlOORJaBpw+fibJWS1gw4kvKOVCY duFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=w2cHEglOBw7vOs0ctBUQxyK7WvVIZxui8AGCj214fFw=; fh=qv98fuFWgzz80niya018dEMHM11aNaivanB6Sf0MlwA=; b=zdcGpPJJNGMivP//83/AHg261wPJeM4MLVqRuOtoMGrD1r6BEHefiUkNy84U9A2h1H jPMIaluTwHLiun1S9n00N7lKo0LaPMPPB7SaBVXO9QGaahrgZ3O5RuzMUQxBa9ieHG2G oU45p5c43fEsBOfWTXRAM2+jGYsEV6vp8zlXbnglVlWIzIhjp3j6rOYtlHc/bFCEWEZb 6wpwXCqOWZglGiqg3YFY6yyaR7+TMkf24EcV6rf2aB3w91wOEVwBpqlu0EhWsuKJX+b3 xxu+/x2YAwtxLipWRmClKM4zxaVaeBo/z4xlHzxvD+crcMaCt+tNfg2PaWsJjArbHqS1 /bMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=e6XRIlLb; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ky12-20020a170902f98c00b001b8c689060bsi3137097plb.344.2023.07.28.08.53.19; Fri, 28 Jul 2023 08:53:32 -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=@google.com header.s=20221208 header.b=e6XRIlLb; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236769AbjG1P1K (ORCPT + 99 others); Fri, 28 Jul 2023 11:27:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234457AbjG1P1I (ORCPT ); Fri, 28 Jul 2023 11:27:08 -0400 Received: from mail-qt1-x834.google.com (mail-qt1-x834.google.com [IPv6:2607:f8b0:4864:20::834]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47C5EE73 for ; Fri, 28 Jul 2023 08:27:07 -0700 (PDT) Received: by mail-qt1-x834.google.com with SMTP id d75a77b69052e-40631c5b9e9so288291cf.1 for ; Fri, 28 Jul 2023 08:27:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1690558026; x=1691162826; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=w2cHEglOBw7vOs0ctBUQxyK7WvVIZxui8AGCj214fFw=; b=e6XRIlLbdnBV3L+drIGrJ9hpPuszKL9KcdkNU3ekaiyj9oPIi424yCtahEr5IejeLS DVaJsKY6P2gQinDqRDKpkG2Cqzp2iZRE+SuDVrql/sUVH/V6fLH1tcS6jVzZSIYiUExw 4mjNGLaKuaNSZpM9kj6StV2PQjstWNDxKKSjF++SSDOHr9RgtdhJON6K/z0E0sdf+HIw GcV0Zs60/0lvk9ceXcscQ7QwYgzn3piuNUGWX3RqXqTt0Bx+NowyQrbj+pniVwxrEnPB eG6jturlsiIsowf+LA6PWNH3FuS9c7Kix3RXflkIjjNKYHtE+5Jk+A2pw/05jXC99LK1 QPCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690558026; x=1691162826; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=w2cHEglOBw7vOs0ctBUQxyK7WvVIZxui8AGCj214fFw=; b=FC+kOy7AOljX1lux6PJD77OQeECf2ZpVwqwsHbJJBn1aQSQBd7jOBE5FXSQg+ch2p1 jKKaPVthHRcA4JqYzp8d7xOq5305GIxD2bufq4oaSGgeRFMqxxyu1fhjpAZIKjYoPAUL QXlcUqaKEJOOue1NwOUVidLzM0hvA5XSHuQCrEBb8a0wmP4FQegHJL/zaNpoLeJQBSVe QZpxs3KgxSkELxI4uOQsxIabUlnWBlc9sF/H8ij7nFxhBQ0OwClvZTQPlNs+h5QVlR/V OP1V4p/cOKJhZ0UrkpxrQkMlY3kdMfdinnoohQO41OZnlDPAPQuUHVXuI85RGhg5ZiAY ZUrA== X-Gm-Message-State: ABy/qLat04iw06kBjAaCzNKfE38hMI5iLM5JT9xvtNL7CnxmubNnH8Q+ Yd80g5LYJr3IElGRFRkLgiu2rmtC38Klq8dxzJ1qhg== X-Received: by 2002:a05:622a:448:b0:3f8:5b2:aef0 with SMTP id o8-20020a05622a044800b003f805b2aef0mr297197qtx.24.1690558026249; Fri, 28 Jul 2023 08:27:06 -0700 (PDT) MIME-Version: 1.0 References: <20230728064917.767761-1-irogers@google.com> <20230728064917.767761-5-irogers@google.com> In-Reply-To: From: Ian Rogers Date: Fri, 28 Jul 2023 08:26:54 -0700 Message-ID: Subject: Re: [PATCH v1 4/6] perf build: Disable fewer flex warnings To: Arnaldo Carvalho de Melo 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 On Fri, Jul 28, 2023 at 7:02=E2=80=AFAM Arnaldo Carvalho de Melo wrote: > > Em Fri, Jul 28, 2023 at 10:59:38AM -0300, Arnaldo Carvalho de Melo escrev= eu: > > 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=3D1 -C tools/perf NO_BPF_SKEL=3D1 DEBUG=3D1 > > > > > > util/pmu-bison.c:855:9: error: variable 'perf_pmu_nerrs' set but no= t > > > used [-Werror,-Wunused-but-set-variable] > > > int yynerrs =3D 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; statem= ent 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' > =E2=AC=A2[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-fi= lter-bison.h: util/bpf-filt > > FLEX_GE_264 :=3D $(shell expr $(shell $(FLEX) --version | sed -e 's/fle= x \([0-9]\+\).\([0-9]\+\).\([0-9]\+\)/\1\2\3/g') \>\=3D 264) > ifeq ($(FLEX_GE_264),1) > - flex_flags :=3D -Wno-redundant-decls -Wno-switch-default -Wno-unused-f= unction > + flex_flags :=3D -Wno-redundant-decls -Wno-switch-default -Wno-unused-f= unction -Wno-misleading-indentation > else > flex_flags :=3D -w > endif > =E2=AC=A2[acme@toolbox perf-tools-next]$ > > > > 1 error generated. > > make[4]: *** [/var/home/acme/git/perf-tools-next/tools/build/Makefile.b= uild: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.b= uild: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 > > > > =E2=AC=A2[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 > > =E2=AC=A2[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 :=3D $(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 +=3D -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. Thanks, Ian > -- > > - Arnaldo