Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2142700iof; Tue, 7 Jun 2022 21:10:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXj1KZ5CICSQVfrAum5osSoW9rB3D3xJwUDbh3OA2HnXUUf/UcxfCk0YBxwZNBhI+lJM5z X-Received: by 2002:a17:90a:7b89:b0:1e8:9f24:26b2 with SMTP id z9-20020a17090a7b8900b001e89f2426b2mr8044743pjc.106.1654661430608; Tue, 07 Jun 2022 21:10:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654661430; cv=none; d=google.com; s=arc-20160816; b=PfU5pr5FXrklpQC1KkC+tGeFJ4LaqtPbgbyctMoOhH1luQvgeZPA/n64XFBS9p9LRa +C9i3ciIuLhCZEDP89iGB0k+3dox0zff2wkCuyqUA4k7O7QFEjk6HEPDBgvN70gNhl2+ SxR5j17GyQdk03VaXxdmoIoYbOL5dW2my23+RfGP9FJ50yJXaoV7w6dbX5680UI6ccSn glEw4HN69BJYbs6rRGI3HE6pyhr1g54Z+gxp/Rue7WjsNEC021OytAVWxdMn6u3fkhQs 6sPDd9scYwGwhaI3q754PbKjrW6ePVy5O1T+z6EcmXjbNFfpGSTbBHbIFpqF1CVZ0+dk aRdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/m7folDWpC1MAp3OuIaFyzeH3lxZNl8wMkhp3kVBXSY=; b=Qs6RF0AHclkIEuJNzraxwe6Ua9wxit29vYiyEtDJz76Im06C111h7mM4kr0gjwzFsJ dMGRiqwbIGfKr6ZgCYTLe+HmxgVCHPQTDAvjvBkt+neIrVs9Oj4P8yGpQuFq3V/B6Lmq rg/YUGdogh8v5MZwmMTrcJhC18sFbiR2HkaWRISud6gmrX93E+MwtwhLXZs0N/UsdIcZ LFZ33UX47EyUYscQYaOdLz9kGzW8GH1pQFu1FkZ1l/v83I+5EkVjfWgln8+pg+XLY7R9 eskBZtXfaKXtlXJx0YkuUb9T8eXmRxdkpjmKDTk3LqEdPmt8LFZJ34sE3nGOfZueTqfJ UmeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=C2RINI0h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id p16-20020a170902b09000b001614cd9cc52si25868775plr.197.2022.06.07.21.10.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 21:10:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=C2RINI0h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3E5012293B4; Tue, 7 Jun 2022 20:41:53 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383148AbiFGWBT (ORCPT + 99 others); Tue, 7 Jun 2022 18:01:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377539AbiFGVCp (ORCPT ); Tue, 7 Jun 2022 17:02:45 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 150AD13392E; Tue, 7 Jun 2022 11:48:24 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 580F9B82018; Tue, 7 Jun 2022 18:48:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1619C385A2; Tue, 7 Jun 2022 18:48:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654627702; bh=eoTntXkJva1hHSA1bjTzO8FjSkV4RFJ+pjuoRT5FL7Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C2RINI0h0VbUpDCnV9JiNzDin/N0XwDPMNpPHUlM0wwUQoFbJneafBBPbjGYVbLBD G8tzaqNlcMhhLeoo9jq0YtJ5t0QeO6BNCuOboDerCrT8Xu/xgvtaEFkfE71Wu5ozuI g4/SNGlImyt/uWVAIgsfgxcShoiuFFlbSM3SxH88= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Quentin Monnet , Andrii Nakryiko , Sasha Levin Subject: [PATCH 5.18 060/879] selftests/bpf: Fix parsing of prog types in UAPI hdr for bpftool sync Date: Tue, 7 Jun 2022 18:52:58 +0200 Message-Id: <20220607165004.432627806@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 From: Quentin Monnet [ Upstream commit 4eeebce6ac4ad80ee8243bb847c98e0e55848d47 ] The script for checking that various lists of types in bpftool remain in sync with the UAPI BPF header uses a regex to parse enum bpf_prog_type. If this enum contains a set of values different from the list of program types in bpftool, it complains. This script should have reported the addition, some time ago, of the new BPF_PROG_TYPE_SYSCALL, which was not reported to bpftool's program types list. It failed to do so, because it failed to parse that new type from the enum. This is because the new value, in the BPF header, has an explicative comment on the same line, and the regex does not support that. Let's update the script to support parsing enum values when they have comments on the same line. Signed-off-by: Quentin Monnet Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220404140944.64744-1-quentin@isovalent.com Signed-off-by: Sasha Levin --- tools/testing/selftests/bpf/test_bpftool_synctypes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/test_bpftool_synctypes.py b/tools/testing/selftests/bpf/test_bpftool_synctypes.py index 6bf21e47882a..c0e7acd698ed 100755 --- a/tools/testing/selftests/bpf/test_bpftool_synctypes.py +++ b/tools/testing/selftests/bpf/test_bpftool_synctypes.py @@ -180,7 +180,7 @@ class FileExtractor(object): @enum_name: name of the enum to parse """ start_marker = re.compile(f'enum {enum_name} {{\n') - pattern = re.compile('^\s*(BPF_\w+),?$') + pattern = re.compile('^\s*(BPF_\w+),?(\s+/\*.*\*/)?$') end_marker = re.compile('^};') parser = BlockParser(self.reader) parser.search_block(start_marker) -- 2.35.1