All of
 help / color / mirror / Atom feed
From: Quentin Monnet <>
To: Alexei Starovoitov <>,
	Daniel Borkmann <>,
	Andrii Nakryiko <>
	Quentin Monnet <>,
	Milan Landaverde <>
Subject: [PATCH bpf-next] selftests/bpf: Fix parsing of prog types in UAPI hdr for bpftool sync
Date: Mon,  4 Apr 2022 15:09:44 +0100	[thread overview]
Message-ID: <> (raw)

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

Let's update the script to support parsing enum values when they have
comments on the same line.

Cc: Andrii Nakryiko <>
Cc: Milan Landaverde <>
Signed-off-by: Quentin Monnet <>
 tools/testing/selftests/bpf/ | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/bpf/ b/tools/testing/selftests/bpf/
index 6bf21e47882a..c0e7acd698ed 100755
--- a/tools/testing/selftests/bpf/
+++ b/tools/testing/selftests/bpf/
@@ -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)

             reply	other threads:[~2022-04-04 14:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-04 14:09 Quentin Monnet [this message]
2022-04-04 21:50 ` [PATCH bpf-next] selftests/bpf: Fix parsing of prog types in UAPI hdr for bpftool sync patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.