From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <3dILDYAgKCpM3CEBz50x3BB381.zB985yxy53x58FBHEz1JxE1.BE3@flex--gprocida.bounces.google.com> 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 D1ED438515E7 for ; Fri, 11 Jun 2021 15:34:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D1ED438515E7 Received: by mail-qt1-x849.google.com with SMTP id d7-20020ac811870000b02901e65f85117bso2122515qtj.18 for ; Fri, 11 Jun 2021 08:34:12 -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:message-id:mime-version:subject:from:to:cc; bh=xTHCzyPeAoQcXgc15Qs2SisDBpUVF//6MIzVzm2hss4=; b=fDhx/D3k7ZAB4eizz7ZHD/gA+Mp5LA0tMLcLEuHI1K1x1oo/8t7X9SYXyAUisqpExM ZVt/kEz2ubPoilfksZ0Mnsz1nSl0Kz/gDGd4XZWYbO3g//IcpIBRUAqXrvURLlG85PXI M0072+tzId1No7fxpWWnVVzVE5AhOTcKkmxslmHcVZkTm4iSh12QCqZn27NiyUhgtBVr m5W71t4QGnqiO1o8XLIAh5iAWMhwtQK200bwzIukF4ANUsDa15SyeGZd9ojVDHFTH/oJ 465NyCw4FCti54TOOLiGPSucHgjMdpCTACMHck4U1cC513PY5n0rLGV5zlvMPtQ0x7fy FNgw== X-Gm-Message-State: AOAM5316aODvZ3G2ETnTczHIOtrztQ8Z0JUwZnvKOh26Ocr/TN8dukr5 RcMR1X6proS4ML/YhJzfVXFIU4pmqYg3JPP3Lts4Sxq8f8lZZPe/shuEvRNws3k5stuekMX43vs /xLZwxB0wNdn8/zyPbsYTN5B3tM1cFwULrxqWUWp1ZA3HpFsy4h40bOVSX2Bp6nDCBNSmzZo= X-Google-Smtp-Source: ABdhPJwrLtGEE3KSoazMvvQgfg2ye1Ozy1hAWEtZyOLq0Ov92+bwpmzIvrTHp9pjgWIbxxp8UgdIYWx0PaJ83Q== X-Received: from tef.lon.corp.google.com ([2a00:79e0:d:210:c264:c1f9:cf3c:2c0b]) (user=gprocida job=sendgmr) by 2002:a05:6214:1551:: with SMTP id t17mr5476022qvw.50.1623425652359; Fri, 11 Jun 2021 08:34:12 -0700 (PDT) Date: Fri, 11 Jun 2021 16:33:13 +0100 Message-Id: <20210611153319.778996-1-gprocida@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.32.0.272.g935e593368-goog Subject: [PATCH 0/6] BTF ABI From: Giuliano Procida To: libabigail@sourceware.org Cc: dodji@seketeli.org, kernel-team@android.com, gprocida@google.com, maennich@google.com, teguiani@android.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-15.8 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, SUBJ_ALL_CAPS, TXREP, USER_IN_DEF_DKIM_WL autolearn=no 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 List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 15:34:18 -0000 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. 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): Tweak clang-format Allow C++17 code to be compiled 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 | 888 ++++++++++++++++++++++++ include/abg-scc.h | 122 ++++ src/Makefile.am | 9 +- src/abg-btf.cc | 1649 +++++++++++++++++++++++++++++++++++++++++++++ tests/Makefile.am | 7 + tests/test-scc.cc | 220 ++++++ tools/Makefile.am | 14 + tools/btfdiff.cc | 71 ++ tools/btfinfo.cc | 22 + 12 files changed, 3034 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 -- 2.32.0.272.g935e593368-goog