Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1684026rwr; Fri, 5 May 2023 19:25:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ50bE/Btv9z7bnUwCLGy6rq/h4zlXJlRt7fHZ+Uc40j/ssom+EEXYxZVoGiDPJEJEx5DJJ/ X-Received: by 2002:a05:6a21:32a2:b0:f5:40dd:4c55 with SMTP id yt34-20020a056a2132a200b000f540dd4c55mr3929803pzb.60.1683339955127; Fri, 05 May 2023 19:25:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683339955; cv=none; d=google.com; s=arc-20160816; b=RqEOMSGktCXXeQjwHgelapbfbRJz2GIvJNOCpWCB6xSAbPDm8phePFJkF+AG2w2tyK 0UPS1c7ewdY4rrMwqJ1bDEhD+XY/qRtOaW3+sr6l+y/VEIgG0F3EGq51uW4QGpA9JhI1 AX3zgsRib6yKciZRGzAJv8Nh5+0O3JbsgDhXivSROC4eheYMlt8Sx88/tSwNbypb5A1f iSv06kEZ+GQCW6sEPO9Q6OZ5IkaE7APmWiEBXMEf2oqiHChDhgHQIKvmY8eSqrx8B4y5 qf+gE84DZ6xEtBcEaXgNuDr1W0kkJctz5eMgMkUWBKT0IQ1DCOOoUGOo2gqlS373qmHL ZGag== 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=pJf4bwuwk+xW5YFYNv2ihAkRZ7CiJDxHsIhFi1q/46E=; b=h3ZvljluPzOTYH08KNGG7PA9a1mBbLi4ctv8Nqj/6sV+7kmLr9XEaaqH5GpSKiCBII cVXL6fqkO4dGvy0sSytqV8YVKOvDDFxvMPblEg3o4zuUFANl2JxNOoLCpBksZ3j1cr5z b5CQoV7O+ctfH7GBYL8tdnRlLwZCLxtCos7VujCVluHH0DXXLAQNwXnUZYPCVwMoN+zN VR3ppnLJu7cym+r1aOUDCzOBGC22Q9GRFiB7oFMwcVf6zMoOBLRK9NTFt2fM8UJb+rdk U1r9qK8oZ44c92/50rPJU/HdI8sbc7WbI45sOjZa6G0d6R3YuC7JVC6TONVNQwPfWbIL d3JA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=Ti63042a; 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 m189-20020a633fc6000000b0052c30f8deafsi3256373pga.767.2023.05.05.19.25.40; Fri, 05 May 2023 19:25:55 -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=Ti63042a; 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 S230339AbjEFCPQ (ORCPT + 99 others); Fri, 5 May 2023 22:15:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231349AbjEFCPI (ORCPT ); Fri, 5 May 2023 22:15:08 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5102C5FF2 for ; Fri, 5 May 2023 19:15:06 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id 3f1490d57ef6-b8f324b3ef8so3048254276.0 for ; Fri, 05 May 2023 19:15:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1683339305; x=1685931305; h=to:from:subject:mime-version:message-id:date:from:to:cc:subject :date:message-id:reply-to; bh=pJf4bwuwk+xW5YFYNv2ihAkRZ7CiJDxHsIhFi1q/46E=; b=Ti63042aDcnZkRbwB60td25AhQmPK47NkWC4qIEwqnfJdGnj0R04pdJ2Hmgfnm0P9x pnr53iBTBqHhMz2a1cjdh1lJqGEd5NO4jdoPES1QWLOzDszwUDRuyE4gKQQMKrzAdbQT GWNLK3lHqXnKx1gm7p/uEzOZnR6dbIOScU4gUUyzFaULBVNQLD01x1ht1EjMgDk3zer0 CrIFaKj0/OeOYRjv2KXodKeX6aLlthx7d9iJuEd8xAbtDgONnObWblpk0L8UPOopVPgi tU5oRk2o8taGUXAsOx5REh74Eus7puNDh4VdSRLZvmaZKJKRfnaUz0JG52z6+kCQYJVk g+Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683339305; x=1685931305; h=to:from:subject:mime-version:message-id:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=pJf4bwuwk+xW5YFYNv2ihAkRZ7CiJDxHsIhFi1q/46E=; b=kVRXdIIs6ddtr4s1Q8uW3wQikAYrGqqjFKFJixLdjLhb6qqcr5bBhjRKsP+m94Fqqw VGqdmR8vjk+HVBRXl/+9coGu3CWlTelSe3Yn6aQy+04gscOlT5mkK6HESF2TBgLNQI6r /zmXQJuANxdkNPNLUbekxRZbmSWkby2gSQ0H8c8O0Mc4wewzTI+jmN06g8HJC9qPGSqE B3eKufAhucFnH5VUTLf+HfpYfaGsy4IfTKKf+R1j6LZPVjoaQkCMimo1b3gquvQZT/eM efkoPnuV1JAm8Hk1IwHyG0JvRuSwjtaAcxQpRX173CBWjnkhR7GoomyvSkoonxGZMKKX mDOQ== X-Gm-Message-State: AC+VfDx2dZmea55+2+0Wt+VXIVqNpswhdCJvGsTLVLtpbcd6ZXC2daJV V34hX05layHNckam1f+PBJeLm1ni86qt X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:4715:8e64:29b7:6c4]) (user=irogers job=sendgmr) by 2002:a81:e206:0:b0:55a:3532:2fd5 with SMTP id p6-20020a81e206000000b0055a35322fd5mr2078640ywl.8.1683339305504; Fri, 05 May 2023 19:15:05 -0700 (PDT) Date: Fri, 5 May 2023 19:14:50 -0700 Message-Id: <20230506021450.3499232-1-irogers@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.40.1.521.gf1e218fcd8-goog Subject: [PATCH v1] perf build: Add system include paths to BPF builds From: Ian Rogers To: Song Liu , Yang Jihong , Andrii Nakryiko , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , Paul Walmsley , Palmer Dabbelt , Albert Ou , Nathan Chancellor , Nick Desaulniers , Tom Rix , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, bpf@vger.kernel.org, llvm@lists.linux.dev 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=unavailable 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 There are insufficient headers in tools/include to satisfy building BPF programs and their header dependencies. Add the system include paths from the non-BPF clang compile so that these headers can be found. This code was taken from: tools/testing/selftests/bpf/Makefile Signed-off-by: Ian Rogers --- tools/perf/Makefile.perf | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 61c33d100b2b..37befdfa8ac8 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -1057,7 +1057,25 @@ $(SKEL_TMP_OUT) $(LIBAPI_OUTPUT) $(LIBBPF_OUTPUT) $(LIBPERF_OUTPUT) $(LIBSUBCMD_ ifndef NO_BPF_SKEL BPFTOOL := $(SKEL_TMP_OUT)/bootstrap/bpftool -BPF_INCLUDE := -I$(SKEL_TMP_OUT)/.. -I$(LIBBPF_INCLUDE) + +# Get Clang's default includes on this system, as opposed to those seen by +# '-target bpf'. This fixes "missing" files on some architectures/distros, +# such as asm/byteorder.h, asm/socket.h, asm/sockios.h, sys/cdefs.h etc. +# +# Use '-idirafter': Don't interfere with include mechanics except where the +# build would have failed anyways. +define get_sys_includes +$(shell $(1) $(2) -v -E - &1 \ + | sed -n '/<...> search starts here:/,/End of search list./{ s| \(/.*\)|-idirafter \1|p }') \ +$(shell $(1) $(2) -dM -E -