[v2,0/6] BTF ABI
Message ID | 20210622103318.478914-1-gprocida@google.com |
---|---|
Headers |
Return-Path: <libabigail-bounces+patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E03BF3889809 for <patchwork@sourceware.org>; Tue, 22 Jun 2021 10:33:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E03BF3889809 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1624358011; bh=7ZJhTpfzFQlch1/idmJ9KlZrj0R+ZBPxi4i3x4wWQkQ=; h=Date:In-Reply-To:References:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Help:List-Subscribe:From:Reply-To:Cc:From; b=nji8MQcZHliOmyAL8DVOmSuttgYNL6Rn9hbusnH/Ws2OdyRhOUPpS/y2fXkw1guPf Ed6mX70XlURD3KB3prTxTdESKC7z+G7uiPSGb3mmHHeWitgGEGnO8GDkOiBjxxjl2t F91ecPVPjekBvk4iUE31ojDu+GcmbPPP6iSgBrQ8= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from mail-qt1-x849.google.com (mail-qt1-x849.google.com [IPv6:2607:f8b0:4864:20::849]) by sourceware.org (Postfix) with ESMTPS id CB051385BF99 for <libabigail@sourceware.org>; Tue, 22 Jun 2021 10:33:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CB051385BF99 Received: by mail-qt1-x849.google.com with SMTP id t6-20020ac80dc60000b029024e988e8277so18357867qti.23 for <libabigail@sourceware.org>; Tue, 22 Jun 2021 03:33:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=7ZJhTpfzFQlch1/idmJ9KlZrj0R+ZBPxi4i3x4wWQkQ=; b=MIV+IROo2eTzG9wOoKftUn3tSu6LqW1MJ9vkLrBr4R5J1QcgC8sraEEq8dQeN9qgCW MLwPGRvmfUy6MIPOcSwSr72nED9ZlOX5j80G4l+YNMxLfjWvCgu7WbQ0AV5lrR5G8R9C 9q0+TiyuBRv1orDXVmnvSD6Tv2sIIOcZQLwI5P0qYQjTsAkOIPYqkjTnj3Rz0s2DJwxG 3DLTI/0pVaDa79Vt2OxJ8Xjh7tX29/pJTmmXmDVFi8aouIhgLJnHbHYGtpGPPFqO8F0a YUOQmFGCbWug72OBiB3iMuCZPlUoHDSm+LX7se/OZJUjnm+jm9nk9V3SyrQwaO4+Pfbd HrVA== X-Gm-Message-State: AOAM533wb3nW/guavtsTZqRkDyQr2PeRQVtpE53yfnm5TfuZZRkxlBN2 I/pY9Fa0Hnz+NdEEVIBq2anY7dNAW1BX9pifrpumsU8zLMpyv0XYcdrdBtig+85HSCa0NlRhocI D7FeuzuKO8p4VSMU5ZTIGAnqX7IYzPd2G03O3dcEjrdOvPUbP8zDmaIqTL23gfsmtzC2ItA8= X-Google-Smtp-Source: ABdhPJwPiool3b5Nu5ntEw+oq8SnXmGAY83Klc6rk9l7amolJsMD/1hZcYwW8YqvHkMFQa+Pe4Qvq1FmleXc+g== X-Received: from tef.lon.corp.google.com ([2a00:79e0:d:210:b7d7:a6fe:d167:7a5d]) (user=gprocida job=sendgmr) by 2002:a0c:ca8d:: with SMTP id a13mr8496808qvk.57.1624358004211; Tue, 22 Jun 2021 03:33:24 -0700 (PDT) Date: Tue, 22 Jun 2021 11:33:12 +0100 In-Reply-To: <20210611153319.778996-1-gprocida@google.com> Message-Id: <20210622103318.478914-1-gprocida@google.com> Mime-Version: 1.0 References: <20210611153319.778996-1-gprocida@google.com> X-Mailer: git-send-email 2.32.0.288.g62a8d224e6-goog Subject: [PATCH v2 0/6] BTF ABI To: libabigail@sourceware.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-16.0 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project <libabigail.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libabigail>, <mailto:libabigail-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libabigail/> List-Help: <mailto:libabigail-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libabigail>, <mailto:libabigail-request@sourceware.org?subject=subscribe> From: Giuliano Procida via Libabigail <libabigail@sourceware.org> Reply-To: Giuliano Procida <gprocida@google.com> Cc: maennich@google.com, kernel-team@android.com Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libabigail" <libabigail-bounces+patchwork=sourceware.org@sourceware.org> |
Message
Giuliano Procida
June 22, 2021, 10:33 a.m. UTC
Hi. This code was developed by Maria Teguiani who interned with Android last summer and later by me. BTF is the BPF type format. See: https://www.kernel.org/doc/html/latest/bpf/btf.html The Linux kernel can be compiled with BTF type information. Together with the kernel and ELF symtabs, it can be used to as an alternative basis for kernel ABI monitoring. BTF has several limitations compared with libabigail ABI XML. Foremost, it supports C types only. There are also some other significant issues that may be resolved with time. The simplicity of BTF makes it an ideal vehicle for experimentation. An ELF object file containing DWARF debug information can be augmented with BTF debug information using pahole -J. pahole is part of dwarves. These patches contribute: - a BTF parser / BTF graph builder - code to dump BTF information as it is parsed - a BTF graph difference algorithm to generate graphs of differences - a C type name generator - code to serialise a difference graph as a text report The graph difference algorithm uses a strongly-connected component finder based on the path-based SCC algorithm. My main contribution here was the design which allows the BTF graph difference algorithm to be written in a straightforward recursive style. New in v2: - Fixed bug around ELF symbol lifetimes and the use of string_view. - Performances tweaks making more pieces of the diff algorithm O(N). Missing from these patches are: - Some documentation I wrote in markdown format. - A suite of small tests, of which the C language ones have been used to validate the BTF utilities. I hope this work will be useful to anyone wishing to experiment with BTF as an ABI representation or who has an interest in graph diff algorithms. Feedback is very welcome. Regards, Giuliano. Giuliano Procida (6): Allow C++17 code to be compiled Tweak clang-format BTF: add SCC finder and test BTF: add core functionality BTF: add btfinfo and btfdiff tools BTF: clang-format all the new source files .clang-format | 9 +- COMPILING | 5 + configure.ac | 21 +- include/abg-btf.h | 946 ++++++++++++++++++++++++++ include/abg-scc.h | 121 ++++ src/Makefile.am | 9 +- src/abg-btf.cc | 1650 +++++++++++++++++++++++++++++++++++++++++++++ tests/Makefile.am | 7 + tests/test-scc.cc | 220 ++++++ tools/Makefile.am | 14 + tools/btfdiff.cc | 71 ++ tools/btfinfo.cc | 22 + 12 files changed, 3092 insertions(+), 3 deletions(-) create mode 100644 include/abg-btf.h create mode 100644 include/abg-scc.h create mode 100644 src/abg-btf.cc create mode 100644 tests/test-scc.cc create mode 100644 tools/btfdiff.cc create mode 100644 tools/btfinfo.cc