From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4321BC433F7 for ; Wed, 22 Jul 2020 21:13:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1B2E622B3F for ; Wed, 22 Jul 2020 21:13:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595452396; bh=TElq2iDLIWPnpZTsVRK7uTiZ+vQTXYN26Q6K19aA+1M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=DE5d1XvhMDTBLwpVHFjfkYcjGezCuReXx65LoI3BdlbSE2nuGy5lErF6mZx2fwVbR ll42fcDPE+tYWzHc69oRWkmuQW+UyS5t8Wsxpc8O+/nIAUTYCUFeez40Dj5EEQuxvS QoJQ/Cw6pxW0H4UflVfAw3Kx5m3PgaId3MevXl2A= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732999AbgGVVNP convert rfc822-to-8bit (ORCPT ); Wed, 22 Jul 2020 17:13:15 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:53153 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732896AbgGVVNO (ORCPT ); Wed, 22 Jul 2020 17:13:14 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-366-ru16wf5MMjKWsEVK3By8Mw-1; Wed, 22 Jul 2020 17:13:07 -0400 X-MC-Unique: ru16wf5MMjKWsEVK3By8Mw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C1D60800465; Wed, 22 Jul 2020 21:13:05 +0000 (UTC) Received: from krava.redhat.com (unknown [10.40.194.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5DB5E19C4F; Wed, 22 Jul 2020 21:13:02 +0000 (UTC) From: Jiri Olsa To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko Cc: netdev@vger.kernel.org, bpf@vger.kernel.org, Song Liu , Yonghong Song , Martin KaFai Lau , David Miller , John Fastabend , Wenbo Zhang , KP Singh , Brendan Gregg , Florent Revest , Al Viro Subject: [PATCH v8 bpf-next 10/13] bpf: Update .BTF_ids section in btf.rst with sets info Date: Wed, 22 Jul 2020 23:12:20 +0200 Message-Id: <20200722211223.1055107-11-jolsa@kernel.org> In-Reply-To: <20200722211223.1055107-1-jolsa@kernel.org> References: <20200722211223.1055107-1-jolsa@kernel.org> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: kernel.org Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: 8BIT Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Updating btf.rst doc with info about BTF_SET_START/END macros. Signed-off-by: Jiri Olsa --- Documentation/bpf/btf.rst | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/Documentation/bpf/btf.rst b/Documentation/bpf/btf.rst index b5361b8621c9..44dc789de2b4 100644 --- a/Documentation/bpf/btf.rst +++ b/Documentation/bpf/btf.rst @@ -724,6 +724,31 @@ want to define unused entry in BTF_ID_LIST, like:: BTF_ID_UNUSED BTF_ID(struct, task_struct) +The ``BTF_SET_START/END`` macros pair defines sorted list of BTF ID values +and their count, with following syntax:: + + BTF_SET_START(set) + BTF_ID(type1, name1) + BTF_ID(type2, name2) + BTF_SET_END(set) + +resulting in following layout in .BTF_ids section:: + + __BTF_ID__set__set: + .zero 4 + __BTF_ID__type1__name1__3: + .zero 4 + __BTF_ID__type2__name2__4: + .zero 4 + +The ``struct btf_id_set set;`` variable is defined to access the list. + +The ``typeX`` name can be one of following:: + + struct, union, typedef, func + +and is used as a filter when resolving the BTF ID value. + All the BTF ID lists and sets are compiled in the .BTF_ids section and resolved during the linking phase of kernel build by ``resolve_btfids`` tool. -- 2.25.4