Received: by 2002:a05:622a:251a:b0:39a:b4a2:e86 with SMTP id cm26csp316601qtb; Wed, 19 Oct 2022 02:44:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7XVK0Ys573r4OtJseeDzG+qH0DNtf8SwXp7h8KsXcjN7P8ZXCI9Ttdk8RxA6KyRb7yGuVX X-Received: by 2002:a17:907:2c59:b0:78d:8e03:134 with SMTP id hf25-20020a1709072c5900b0078d8e030134mr5819400ejc.310.1666172641218; Wed, 19 Oct 2022 02:44:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666172641; cv=none; d=google.com; s=arc-20160816; b=KWwxLiKvvmFr2jfBVwJpJogG0sRCmQ+h+nn9pdea6ITuCpAEGq37qbRRc0cQhcr/96 B9ZXkewsmcOwfodnqh+ai8v3XTLcqMxVL0ox0t8wNJ03qEt9/Ayu4mn9cnkmHpd1i+o9 fna/b1jei4r/nhPo7ky3YRf7/QCMDqqB0yZsvpiNFoWFsm5fXBdyJeU75lKWufKv88ot KTKxR43uCmelIAGKtyMS9CH9iVOg1MnPCyn4wyWeFuMjgABcX8eKvL91Zq4oggXbfPue 7KuZNFs4OeVgUb4wAbIucT/7VntO/7PbBS0NoacPvc/fTYIww8tnfXgVrOPeVqhttQns wmLA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Wq0CIqaYruMU16t98Pzv7b4LP8eDxU11VThtbZ3c3aI=; b=NNEJJRxbUqOA09mWegsHwjI6JNV5yxNqHBL1Xp0eHevHKczrc9qfUg98JUtW70eFk0 D7KIIl5aILNOZltsJC5Zm1LxnZ54AkRNSa+pF8JaxoXj3JnccP/PFI+Q9ZGAwBfmAG2e nyi7/ZkLGYUSWhG7EVwAYsHsw7tNvAmStAsIULxQu7VjXCxj476ouuhy+LzJcS2iunqx qXszxzcunLxBxUpCOS47JNDNixVM4hNeDK5TV6ViT3CPK8EMnAnQj8GFKjPIFc8HoKS7 NBJlEJTfu7Hy12IzzCYhIMb4YI4fIrUG3ztJEe0xiPuDtLMBWTpVIjbQsOAXgCEcFKYK FuOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GNF178qw; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gb6-20020a170907960600b0078d25914115si16604781ejc.570.2022.10.19.02.43.26; Wed, 19 Oct 2022 02:44:01 -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=@linuxfoundation.org header.s=korg header.b=GNF178qw; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233779AbiJSJcY (ORCPT + 99 others); Wed, 19 Oct 2022 05:32:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233489AbiJSJ2c (ORCPT ); Wed, 19 Oct 2022 05:28:32 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7AC90E6F47; Wed, 19 Oct 2022 02:12:07 -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 2CDCF617E4; Wed, 19 Oct 2022 09:09:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 43D54C433D6; Wed, 19 Oct 2022 09:09:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170587; bh=NmkV02RavlMQ+igL7eQ1dCawCYrpnBKKw3h9lmSN8yo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GNF178qwxVM43I0cd7rJVOe3uzHCnPkL3LhqruwY7oETJ9oHBHtYxlTrhAEz6k4XX 9HNM8Tx7SixgJttcBkH96xK/+CuPZSxSWsBs1flod+CwNpiEUDyGRmked1kEe1qr60 CdL1cYydFotd+VvMU85u2W/nDhTfBRTN2jzjSpNc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, James Hilliard , Andrii Nakryiko , Jiri Olsa , Sasha Levin Subject: [PATCH 6.0 679/862] libbpf: Ensure functions with always_inline attribute are inline Date: Wed, 19 Oct 2022 10:32:46 +0200 Message-Id: <20221019083319.983036570@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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