Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp11888949rwd; Thu, 22 Jun 2023 21:18:18 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7OA3E18oKWX0Y4gEiH6SnW3UcZCkq4nBlgVE0QWimL7sazPEtiJOGdc3HoTgRZjH5/SAmg X-Received: by 2002:a05:6358:45d:b0:130:e11b:80f3 with SMTP id 29-20020a056358045d00b00130e11b80f3mr10419159rwe.12.1687493898139; Thu, 22 Jun 2023 21:18:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687493898; cv=none; d=google.com; s=arc-20160816; b=GSvwxUW2Z2aSy8JEjrQHndjNV3EkbMhJhMWyYWEfjduJfoKUUemItyzubT4EkZlrn7 rSv1efvfsfnV9yJ/Sf/jgDLZjYip/A+RAaIvG148qScpLrvFCjbEcG3KN7GRP/1FZlft pcKu1x/5M039nwHCECQjhITlH8fQuZeym3NaYmcEYhZd8vztlKn0He7nyTyEtQRZ1Ixr +yD2kP3ecqa9MSkSOoHa0JFamx6oRVXkB6o57OkKgrSN35pyOVFcL9R+P0XQXS9Adc5X RxDZB45kX6jAQudgxHPta0OKbIGY1tS2Qhn3Z/HsNdrA8Z9TU0JVYBQ/3o65ZyDuKJLN rglA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:from:subject:mime-version:message-id:date :dkim-signature; bh=IWD9j1HDpuBwOtgRD8+VR/HyczlG3iSDWYis44Ihg3g=; b=RyS5OjSnyrR6LmNzHXxET/gYToPFL7hJ/3doc9gYS1ZQYRUQPMkokukhF0JZKX9Dde tEr+igRCIojN1AI5TdpCLwqiATJSmE94c32pXilNqRwIyJ/K6YUKAi0oZzaPzXcVWN6r Ez/wTR4M0KU+Ys1YUqXETP6yeP++owZSy5uhddltGuSjAIj3OOSiFsvbZlfoLZ/cMGLf Q8eA18BzjLGKg645WPylhcEj9m3utILXEPjvbkmFhKKgPSLmCGbxoDPwKeDKOFq0oPsI sY4KHGgumsd0qACk/E4TJqXXW9JJU4P2zakYC5KjeA95qBP7RkcDy18396cw0624R4wd dhcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=Z6TPQvcA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m6-20020a625806000000b00625c6092a12si2513291pfb.215.2023.06.22.21.18.05; Thu, 22 Jun 2023 21:18:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=Z6TPQvcA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231329AbjFWEOX (ORCPT + 99 others); Fri, 23 Jun 2023 00:14:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231315AbjFWEOP (ORCPT ); Fri, 23 Jun 2023 00:14:15 -0400 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83B472117 for ; Thu, 22 Jun 2023 21:14:14 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-565ba5667d5so2239797b3.0 for ; Thu, 22 Jun 2023 21:14:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1687493653; x=1690085653; h=to:from:subject:mime-version:message-id:date:from:to:cc:subject :date:message-id:reply-to; bh=IWD9j1HDpuBwOtgRD8+VR/HyczlG3iSDWYis44Ihg3g=; b=Z6TPQvcA237450CbME4sySp4GZO5k8VXvDqisLx4wxKL4CKK/VN69L/LEq+H/jaxaa 9jSPwdoN4ybnlf8zZXY2xA2TmCMbDjvpEblejvKPPC0N0bZ8bPoTy+JIdGEkptUU73zh E3XHe1UxVrOjHWaHcF5+wDYec6y8ndt8Nyq6paH6a+aoXZ0WVt3QQmKzMXCDOyaul7ag eByKdsLT4j27OEzLPHGbfYd3dwkCjRhmsTB3THolp9iILFJwADGV1IkAkP4dPjDZiyLZ Lg73CBhNQYuWVz6YdXlqTjET0jJZcFUOvcAispoSjBR0zBurogbz/GQYj3z9DIjRh6T6 aN4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687493653; x=1690085653; h=to:from:subject:mime-version:message-id:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=IWD9j1HDpuBwOtgRD8+VR/HyczlG3iSDWYis44Ihg3g=; b=ZhdFk8bnN3WaaITmvZBo+dg8+BjvHcii6F3a5bSt93kxFKRTSVw2/o8AY9II5QY+xE KbyWzDsybFkcn3kfui+s5eTLRZr3MOEIDd/ekZlOzXPQbYgwQYHUf9DsLDCAlbRhg6/p Fip39fozpOUBnyIy6XoaUxqJgpP966WJAaRpoiQPrmoJCEZwTOKHHqT1QB4wMaQ3TLKl yp9nQVBFyZ9E74lwnbcrNnNO1LAgz9Vg64kdHKTwBJpAhrXCvlgez1b67JPrK/56DYsX Vrqfx9vYeNVQuhwbHU43R1yFiweCJhpmJNXzVk0VaU3Dy+HDWhMvJi8VVnQEI4CJukKj 3bBg== X-Gm-Message-State: AC+VfDxVRFJW4xul9WbOZMBH97RneeTIy/6SLtUoBDLtlZV9Yi/U33eD LLg3UYMJGXKD1Z1EJIgSR7s68KO6mk8W X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:6559:8968:cdfe:35b6]) (user=irogers job=sendgmr) by 2002:a81:ae07:0:b0:570:200:18e1 with SMTP id m7-20020a81ae07000000b00570020018e1mr7911028ywh.3.1687493653716; Thu, 22 Jun 2023 21:14:13 -0700 (PDT) Date: Thu, 22 Jun 2023 21:14:01 -0700 Message-Id: <20230623041405.4039475-1-irogers@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.41.0.162.gfafddb0af9-goog Subject: [PATCH v4 0/4] Bring back vmlinux.h generation From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , James Clark , Tiezhu Yang , Yang Jihong , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 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,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 760ebc45746b ("perf lock contention: Add empty 'struct rq' to satisfy libbpf 'runqueue' type verification") inadvertently created a declaration of 'struct rq' that conflicted with a generated vmlinux.h's: ``` util/bpf_skel/lock_contention.bpf.c:419:8: error: redefinition of 'rq' struct rq {}; ^ /tmp/perf/util/bpf_skel/.tmp/../vmlinux.h:45630:8: note: previous definition is here struct rq { ^ 1 error generated. ``` Fix the issue by moving the declaration to vmlinux.h. So this can't happen again, bring back build support for generating vmlinux.h then add build tests. v4. Rebase and add Namhyung and Jiri's acked-by. v3. Address Namhyung's comments on filtering ELF files with readelf. v2. Rebase on perf-tools-next. Add Andrii's acked-by. Add patch to filter out kernels that lack a .BTF section and cause the build to break. Ian Rogers (4): perf build: Add ability to build with a generated vmlinux.h perf bpf: Move the declaration of struct rq perf test: Add build tests for BUILD_BPF_SKEL perf build: Filter out BTF sources without a .BTF section tools/perf/Makefile.config | 4 ++ tools/perf/Makefile.perf | 39 ++++++++++++++++++- tools/perf/tests/make | 4 ++ tools/perf/util/bpf_skel/.gitignore | 1 + .../perf/util/bpf_skel/lock_contention.bpf.c | 2 - .../util/bpf_skel/{ => vmlinux}/vmlinux.h | 10 +++++ 6 files changed, 57 insertions(+), 3 deletions(-) rename tools/perf/util/bpf_skel/{ => vmlinux}/vmlinux.h (90%) -- 2.41.0.162.gfafddb0af9-goog