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=-3.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=no 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 64900C47404 for ; Sun, 6 Oct 2019 03:20:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2F21A222C0 for ; Sun, 6 Oct 2019 03:20:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=fb.com header.i=@fb.com header.b="YVT9nUnu" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725914AbfJFDUO (ORCPT ); Sat, 5 Oct 2019 23:20:14 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:10684 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725881AbfJFDUO (ORCPT ); Sat, 5 Oct 2019 23:20:14 -0400 Received: from pps.filterd (m0001303.ppops.net [127.0.0.1]) by m0001303.ppops.net (8.16.0.42/8.16.0.42) with SMTP id x9636txa027766 for ; Sat, 5 Oct 2019 20:20:13 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=facebook; bh=PAfgGg0BcNrZQ0GJkNbYJdXB9JQ+skBPvrXhc1LPUzo=; b=YVT9nUnuey6GTy0jV2vYOg+FoPBlSVUznhNfZbT7FFgHd9k9kndLUj1XWf60b75jQQn+ Ynj4ey/ua6CrUeqp25S7vN6zWrqXkPBNpTR52T0Iuet0hIT5GiX4aMQqhlVTTkr37go8 eEjEEj3rLCyGhtG4rJbea1RVyCgMhfgAbbo= Received: from mail.thefacebook.com (mailout.thefacebook.com [199.201.64.23]) by m0001303.ppops.net with ESMTP id 2vepunk460-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Sat, 05 Oct 2019 20:20:12 -0700 Received: from 2401:db00:30:600c:face:0:1f:0 (2620:10d:c081:10::13) by mail.thefacebook.com (2620:10d:c081:35::129) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.1.1713.5; Sat, 5 Oct 2019 20:20:11 -0700 Received: by dev101.prn2.facebook.com (Postfix, from userid 137359) id D1136861847; Sat, 5 Oct 2019 20:20:10 -0700 (PDT) Smtp-Origin-Hostprefix: dev From: Andrii Nakryiko Smtp-Origin-Hostname: dev101.prn2.facebook.com To: , , , CC: , , Andrii Nakryiko Smtp-Origin-Cluster: prn2c23 Subject: [PATCH v2 bpf-next 0/3] Auto-generate list of BPF helpers Date: Sat, 5 Oct 2019 20:20:05 -0700 Message-ID: <20191006032008.2571427-1-andriin@fb.com> X-Mailer: git-send-email 2.17.1 X-FB-Internal: Safe MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-10-06_01:2019-10-03,2019-10-06 signatures=0 X-Proofpoint-Spam-Details: rule=fb_default_notspam policy=fb_default score=0 spamscore=0 clxscore=1015 priorityscore=1501 mlxscore=0 malwarescore=0 phishscore=0 bulkscore=0 lowpriorityscore=0 impostorscore=0 suspectscore=9 mlxlogscore=708 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1908290000 definitions=main-1910060031 X-FB-Internal: deliver Sender: bpf-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org This patch set adds ability to auto-generate list of BPF helper definitions. It relies on existing scripts/bpf_helpers_doc.py and include/uapi/linux/bpf.h having a well-defined set of comments. bpf_helper_defs.h contains all BPF helper signatures which stay in sync with latest bpf.h UAPI. This auto-generated header is included from bpf_helpers.h, while all previously hand-written BPF helper definitions are simultaneously removed in patch #3. The end result is less manually maintained and redundant boilerplate code, while also more consistent and well-documented set of BPF helpers. Generated helper definitions are completely independent from a specific bpf.h on a target system, because it doesn't use BPF_FUNC_xxx enums. v1->v2: - add bpf_helper_defs.h to .gitignore and `make clean` (Alexei); Andrii Nakryiko (3): uapi/bpf: fix helper docs scripts/bpf: teach bpf_helpers_doc.py to dump BPF helper definitions libbpf: auto-generate list of BPF helper definitions include/uapi/linux/bpf.h | 32 ++-- scripts/bpf_helpers_doc.py | 155 ++++++++++++++++++- tools/include/uapi/linux/bpf.h | 32 ++-- tools/lib/bpf/.gitignore | 1 + tools/lib/bpf/Makefile | 10 +- tools/lib/bpf/bpf_helpers.h | 264 +-------------------------------- 6 files changed, 196 insertions(+), 298 deletions(-) -- 2.17.1