Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3978271rwb; Sun, 9 Oct 2022 15:10:13 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7RzEg+OPDfPdVUB13BkcIfQkNhP7OTfp9aQ4MYl1ChDfmZ0w91GynzxcehzW4jXt8qV4OU X-Received: by 2002:a17:907:2c5b:b0:78d:3f8a:19d0 with SMTP id hf27-20020a1709072c5b00b0078d3f8a19d0mr12126193ejc.369.1665353412836; Sun, 09 Oct 2022 15:10:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665353412; cv=none; d=google.com; s=arc-20160816; b=XiH5XO+5U1MWC5pZHaZ+Z3DHMErWJGrcV1q+tbRTUjFKMQ5ll9Fl3CbzjUSklrawXi 7Kcc43wjXRZIVTBFAIsScNPVkMFNvrN2nq8Hv+IvNLIvwcPVGb6JSo+xcCMnxviE39qp DX9ociS/wXuXvTbH1LAl37TMp1Y103mgjVTOtqg3YVykwtTkYiTBQ6RpW0zNe9b/tUkf +yYIjW5YTeR67S+aigBdwib8shwmpSEVWUBjavta2oJRmqFwZ4eE4/52fzEy5HQ/MjbO OPUL5MCAL+3URfXSZjk1dNkc8hiYAJ44IbCHOhJbrH9VsSq7CEadQ7TFTkfK1T6kNJGo csgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Wq0CIqaYruMU16t98Pzv7b4LP8eDxU11VThtbZ3c3aI=; b=fgIp9w98dtrUQCr4YAB/METdcdxK5NT6wp9ecWpPvtbKa/anUtPl3okuTHmdm2/ran czSBvy43qC2iGVwkmhXLJ+FocefQuUM0N2TSGon0bGEvDeqUDAx2r5E3RI2VBFrrdNip NTFPBIul7RrcJMZscW7wm2M0LK2RLJPJD62NM3N/Mn2jVF5O2BgpD9XzP1IifDqCEstl fOm5P6/QL3K8aboR/cLb8nxgVkfQiKtlyLMHwMJnCc+UMT6tzuSAiwBdd1fHsCW4PdL+ PN0VOqsrWihw4oy1Vv9iij27W3+e/HYbAmtC2r8oNhCzdf9l8kzLBmLljkFuhd1fmO9C G1Sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZbKCiH7q; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sd33-20020a1709076e2100b0078da414a7cesi4150029ejc.149.2022.10.09.15.09.46; Sun, 09 Oct 2022 15:10:12 -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=@kernel.org header.s=k20201202 header.b=ZbKCiH7q; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229986AbiJIWIB (ORCPT + 99 others); Sun, 9 Oct 2022 18:08:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229974AbiJIWH7 (ORCPT ); Sun, 9 Oct 2022 18:07:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB78B275D5; Sun, 9 Oct 2022 15:07:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 54E5860C93; Sun, 9 Oct 2022 22:07:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC13EC433D6; Sun, 9 Oct 2022 22:07:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665353277; bh=NmkV02RavlMQ+igL7eQ1dCawCYrpnBKKw3h9lmSN8yo=; h=From:To:Cc:Subject:Date:From; b=ZbKCiH7q/Arpq6dajG/Smd79zWOTmn+8p/ENk+XCv6ETgGQqSgaMiD9ZcgJVUNftI +EfRXGXlwozzo74aZHFr5rI+PIEC/GoChKIR4vMY++APJAPgWi0uGYJDcEidOtsnps hiWkzmdYO0lK2zpfRgTtuNo+e19tKPpvHEhl0uK0XypYg1HlRfMhpbnmV5fq2fndpv PsA6JJKBHerujTtxdZ2ojYaG5AFNawA6bVviAznaST2/3rzNncKXpwOdUaO0nN6+uB i0S7B8zowtQoRsMCNCzAixhhquOfbOtc04+wJPUq8wANcMuJlu0uJsBUYdbjoF/7WR 8Gwj7SbHSWChw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: James Hilliard , Andrii Nakryiko , Jiri Olsa , Sasha Levin , ast@kernel.org, daniel@iogearbox.net, bpf@vger.kernel.org Subject: [PATCH AUTOSEL 6.0 01/77] libbpf: Ensure functions with always_inline attribute are inline Date: Sun, 9 Oct 2022 18:06:38 -0400 Message-Id: <20221009220754.1214186-1-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FILL_THIS_FORM, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS 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 From: James Hilliard [ Upstream commit d25f40ff68aa61c838947bb9adee6c6b36e77453 ] GCC expects the always_inline attribute to only be set on inline functions, as such we should make all functions with this attribute use the __always_inline macro which makes the function inline and sets the attribute. Fixes errors like: /home/buildroot/bpf-next/tools/testing/selftests/bpf/tools/include/bpf/bpf_tracing.h:439:1: error: ‘always_inline’ function might not be inlinable [-Werror=attributes] 439 | ____##name(unsigned long long *ctx, ##args) | ^~~~ Signed-off-by: James Hilliard Signed-off-by: Andrii Nakryiko Acked-by: Jiri Olsa Link: https://lore.kernel.org/bpf/20220803151403.793024-1-james.hilliard1@gmail.com Signed-off-by: Sasha Levin --- tools/lib/bpf/bpf_tracing.h | 14 +++++++------- tools/lib/bpf/usdt.bpf.h | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/lib/bpf/bpf_tracing.h b/tools/lib/bpf/bpf_tracing.h index 43ca3aff2292..5fdb93da423b 100644 --- a/tools/lib/bpf/bpf_tracing.h +++ b/tools/lib/bpf/bpf_tracing.h @@ -426,7 +426,7 @@ struct pt_regs; */ #define BPF_PROG(name, args...) \ name(unsigned long long *ctx); \ -static __attribute__((always_inline)) typeof(name(0)) \ +static __always_inline typeof(name(0)) \ ____##name(unsigned long long *ctx, ##args); \ typeof(name(0)) name(unsigned long long *ctx) \ { \ @@ -435,7 +435,7 @@ typeof(name(0)) name(unsigned long long *ctx) \ return ____##name(___bpf_ctx_cast(args)); \ _Pragma("GCC diagnostic pop") \ } \ -static __attribute__((always_inline)) typeof(name(0)) \ +static __always_inline typeof(name(0)) \ ____##name(unsigned long long *ctx, ##args) struct pt_regs; @@ -460,7 +460,7 @@ struct pt_regs; */ #define BPF_KPROBE(name, args...) \ name(struct pt_regs *ctx); \ -static __attribute__((always_inline)) typeof(name(0)) \ +static __always_inline typeof(name(0)) \ ____##name(struct pt_regs *ctx, ##args); \ typeof(name(0)) name(struct pt_regs *ctx) \ { \ @@ -469,7 +469,7 @@ typeof(name(0)) name(struct pt_regs *ctx) \ return ____##name(___bpf_kprobe_args(args)); \ _Pragma("GCC diagnostic pop") \ } \ -static __attribute__((always_inline)) typeof(name(0)) \ +static __always_inline typeof(name(0)) \ ____##name(struct pt_regs *ctx, ##args) #define ___bpf_kretprobe_args0() ctx @@ -484,7 +484,7 @@ ____##name(struct pt_regs *ctx, ##args) */ #define BPF_KRETPROBE(name, args...) \ name(struct pt_regs *ctx); \ -static __attribute__((always_inline)) typeof(name(0)) \ +static __always_inline typeof(name(0)) \ ____##name(struct pt_regs *ctx, ##args); \ typeof(name(0)) name(struct pt_regs *ctx) \ { \ @@ -540,7 +540,7 @@ static __always_inline typeof(name(0)) ____##name(struct pt_regs *ctx, ##args) #define BPF_KSYSCALL(name, args...) \ name(struct pt_regs *ctx); \ extern _Bool LINUX_HAS_SYSCALL_WRAPPER __kconfig; \ -static __attribute__((always_inline)) typeof(name(0)) \ +static __always_inline typeof(name(0)) \ ____##name(struct pt_regs *ctx, ##args); \ typeof(name(0)) name(struct pt_regs *ctx) \ { \ @@ -555,7 +555,7 @@ typeof(name(0)) name(struct pt_regs *ctx) \ return ____##name(___bpf_syscall_args(args)); \ _Pragma("GCC diagnostic pop") \ } \ -static __attribute__((always_inline)) typeof(name(0)) \ +static __always_inline typeof(name(0)) \ ____##name(struct pt_regs *ctx, ##args) #define BPF_KPROBE_SYSCALL BPF_KSYSCALL diff --git a/tools/lib/bpf/usdt.bpf.h b/tools/lib/bpf/usdt.bpf.h index 4f2adc0bd6ca..fdfd235e52c4 100644 --- a/tools/lib/bpf/usdt.bpf.h +++ b/tools/lib/bpf/usdt.bpf.h @@ -232,7 +232,7 @@ long bpf_usdt_cookie(struct pt_regs *ctx) */ #define BPF_USDT(name, args...) \ name(struct pt_regs *ctx); \ -static __attribute__((always_inline)) typeof(name(0)) \ +static __always_inline typeof(name(0)) \ ____##name(struct pt_regs *ctx, ##args); \ typeof(name(0)) name(struct pt_regs *ctx) \ { \ @@ -241,7 +241,7 @@ typeof(name(0)) name(struct pt_regs *ctx) \ return ____##name(___bpf_usdt_args(args)); \ _Pragma("GCC diagnostic pop") \ } \ -static __attribute__((always_inline)) typeof(name(0)) \ +static __always_inline typeof(name(0)) \ ____##name(struct pt_regs *ctx, ##args) #endif /* __USDT_BPF_H__ */ -- 2.35.1