Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp555376lqh; Tue, 7 May 2024 07:21:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV3KNOqkiJTgwZUyFlrChj6nxyZwvQRBaEsHf/iRp2u+8xEBZ4GQoaRJn93b5zJkbmI8BezBsi5vlN29VacBrx88JSjAR3RiYxPkAy/yw== X-Google-Smtp-Source: AGHT+IFsGxOa0TTxw5uq4g9XvufTzeBGPwKqX1bMXs8ZEHr9u+XyOPX7ebvSOFYWROULoFhqKX5q X-Received: by 2002:a17:902:c943:b0:1e5:5760:a6c1 with SMTP id i3-20020a170902c94300b001e55760a6c1mr4365030pla.21.1715091684591; Tue, 07 May 2024 07:21:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715091684; cv=pass; d=google.com; s=arc-20160816; b=Vspn6KbykIS/OyFifL/7DfFd4iQwmZ14xAwL8DCcpn6nBH7a1DKJB7W44F7ePXka85 uarI7hHTFgokf/6y++eF6jZByk6EcHAmLhXAdna2VzqtNt0msft7pZJl4ADlE/tk4FUP HA+Ih6R/9rvVyDZdwP9wrypWIPJtt5HtVwCXk3DErarkdbuYRothcUwsrEhPcHZNIoaH XcgP11odS/ejrsK8K956UyGXYd0GJRVF5JDWsaK/3M1TTeHVu7aBrSf0IRRndrjXXfTX 8S0Dn3z478WzyfKxUtGOOjTLxvLVtU8iKIDD5TxqKWmu5PMwworotcC5qigetG94F275 mOCw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:user-agent:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=zYsHOq3phh/N3+ms2CD2WVL13R1g7bxCLTcVCgMn/rM=; fh=SIgps5XdV0XNwjZfT2uAI7g3mrspDldK9Qs8qQAfoa4=; b=rePZ4HvvDEOtbQsYZRCFx/lRxiCx0xz3nO/IPeeuEPqDtEoG1m0x45x7KadulBAX6K hpNABWA1FhIJ81QYsIUGKVENXHZdjniY1w9IG4qpC0I9PTWFTdu8o2oD801aHxwhcyFz /UUg5NlPJZXW3Tc4Wqt/sh5YHYSMzyIfxQ3O1eq13noM6AnrYIm0/edesgjKJgVGoorf UsDUNnOUzfJlHGGllvdHPYp0SshBuO0o7qnb29RB88NmpOXpU1j0YgXdhKN0BONamAOg uHDPFb2sHLsbQo3XsTRvo3dliMfM2dvl18W3VB2Lni+i/8nxndLEFYtP2ydoGLltYdzb XLZw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bwbmmOjG; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-171542-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171542-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id me4-20020a170902fc4400b001e6764cd77bsi10887250plb.350.2024.05.07.07.21.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 07:21:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-171542-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bwbmmOjG; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-171542-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171542-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 1213E284AB5 for ; Tue, 7 May 2024 14:18:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E061116DEDA; Tue, 7 May 2024 14:14:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bwbmmOjG" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0363C16190B; Tue, 7 May 2024 14:13:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715091240; cv=none; b=OAyAIIDcJjKNwkmsXTDWVOr5ShYwqaz57+wcSXCd+l6uF7XV3x8pqh9Wd5Vpy1BteB1r28H/HLOEMmCMBUCGly8lPGats5iNhOBVwC+ytLEZGtm6on7PiMRNOg3Q8Ipyk9lw/sFYXBVy94h3tAai/qKoFaqBd88P2XhAbRRqg0E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715091240; c=relaxed/simple; bh=luUp+uu0oFKIjV/gk8O+fPSqFMHg0gN7kVes9334cs0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=oO7pSpNE5KEGVzt4J0RFr0F/PxV4SQBTu5xqTK0aAtIhiNDbDUkGdtHDi+YKfJpcfLW2dgyRoh5jWFdv/BLCYYbwVOnHh0I0RX8rJAoh1SN4Q5Qr1fZoLe1JC0EWOIJv8UMPHfqAZsF0hu0dc9lCoMA5kyoxxe2kNJ6b9r7QvxQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bwbmmOjG; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id AFD07C2BBFC; Tue, 7 May 2024 14:13:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715091239; bh=luUp+uu0oFKIjV/gk8O+fPSqFMHg0gN7kVes9334cs0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bwbmmOjGGVh8+XfBbJFrf/IHFwHDwfBhI6yjia9i+DvvMv5UuDGAWhqqZlPKGI1EX 0qvs6DQTsWpskQfg8A/G4/Rxg2VGByEk1qZsoq12++rsm4cfXs0RxMpw6mnrOYUyH/ zQ8i5ykwKUioirgL+3v5wq6pf9LTRMpV/EjqJ/T/PUKjwdBU5L42V6oR0oluyA0wEn u1CsL1aBxYFjyyLLJB0ct5AFPCrdoYYG1e3rfemSk1av4j5C95Zw4OSVVmDgZTig7w 4FWvDCzeXMz6B6ZbxIR3dlTe/M1rrWLPEPPluLrORy3jdH5LADBY1BzRC7RlqaXUuR vEH6jXLs0wJlA== From: "Masami Hiramatsu (Google)" To: Alexei Starovoitov , Steven Rostedt , Florent Revest Cc: linux-trace-kernel@vger.kernel.org, LKML , Martin KaFai Lau , bpf , Sven Schnelle , Alexei Starovoitov , Jiri Olsa , Arnaldo Carvalho de Melo , Daniel Borkmann , Alan Maguire , Mark Rutland , Peter Zijlstra , Thomas Gleixner , Guo Ren Subject: [PATCH v10 30/36] ftrace: Add CONFIG_HAVE_FTRACE_GRAPH_FUNC Date: Tue, 7 May 2024 23:13:53 +0900 Message-Id: <171509123327.162236.8914387678237087834.stgit@devnote2> X-Mailer: git-send-email 2.34.1 In-Reply-To: <171509088006.162236.7227326999861366050.stgit@devnote2> References: <171509088006.162236.7227326999861366050.stgit@devnote2> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit From: Masami Hiramatsu (Google) Add CONFIG_HAVE_FTRACE_GRAPH_FUNC kconfig in addition to ftrace_graph_func macro check. This is for the other feature (e.g. FPROBE) which requires to access ftrace_regs from fgraph_ops::entryfunc() can avoid compiling if the fgraph can not pass the valid ftrace_regs. Signed-off-by: Masami Hiramatsu (Google) --- Changes in v8: - Newly added. --- arch/arm64/Kconfig | 1 + arch/loongarch/Kconfig | 1 + arch/powerpc/Kconfig | 1 + arch/riscv/Kconfig | 1 + arch/x86/Kconfig | 1 + kernel/trace/Kconfig | 5 +++++ 6 files changed, 10 insertions(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 8d5047bc13bc..e0a5c69eeda2 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -206,6 +206,7 @@ config ARM64 select HAVE_SAMPLE_FTRACE_DIRECT_MULTI select HAVE_EFFICIENT_UNALIGNED_ACCESS select HAVE_FAST_GUP + select HAVE_FTRACE_GRAPH_FUNC select HAVE_FTRACE_MCOUNT_RECORD select HAVE_FUNCTION_TRACER select HAVE_FUNCTION_ERROR_INJECTION diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig index 21dc39ae6bc2..0276a6825e6d 100644 --- a/arch/loongarch/Kconfig +++ b/arch/loongarch/Kconfig @@ -121,6 +121,7 @@ config LOONGARCH select HAVE_EFFICIENT_UNALIGNED_ACCESS if !ARCH_STRICT_ALIGN select HAVE_EXIT_THREAD select HAVE_FAST_GUP + select HAVE_FTRACE_GRAPH_FUNC select HAVE_FTRACE_MCOUNT_RECORD select HAVE_FUNCTION_ARG_ACCESS_API select HAVE_FUNCTION_ERROR_INJECTION diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 1c4be3373686..b79d16c5846a 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -237,6 +237,7 @@ config PPC select HAVE_EBPF_JIT select HAVE_EFFICIENT_UNALIGNED_ACCESS select HAVE_FAST_GUP + select HAVE_FTRACE_GRAPH_FUNC select HAVE_FTRACE_MCOUNT_RECORD select HAVE_FUNCTION_ARG_ACCESS_API select HAVE_FUNCTION_DESCRIPTORS if PPC64_ELF_ABI_V1 diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index b58b8e81b510..6fd2a166904b 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -127,6 +127,7 @@ config RISCV select HAVE_DYNAMIC_FTRACE if !XIP_KERNEL && MMU && (CLANG_SUPPORTS_DYNAMIC_FTRACE || GCC_SUPPORTS_DYNAMIC_FTRACE) select HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS select HAVE_DYNAMIC_FTRACE_WITH_REGS if HAVE_DYNAMIC_FTRACE + select HAVE_FTRACE_GRAPH_FUNC select HAVE_FTRACE_MCOUNT_RECORD if !XIP_KERNEL select HAVE_FUNCTION_GRAPH_TRACER select HAVE_FUNCTION_GRAPH_FREGS diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 4da23dc0b07c..bd86e598e31d 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -225,6 +225,7 @@ config X86 select HAVE_EXIT_THREAD select HAVE_FAST_GUP select HAVE_FENTRY if X86_64 || DYNAMIC_FTRACE + select HAVE_FTRACE_GRAPH_FUNC if HAVE_FUNCTION_GRAPH_TRACER select HAVE_FTRACE_MCOUNT_RECORD select HAVE_FUNCTION_GRAPH_FREGS if HAVE_FUNCTION_GRAPH_TRACER select HAVE_FUNCTION_GRAPH_TRACER if X86_32 || (X86_64 && DYNAMIC_FTRACE) diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig index 0b6ce0a38967..0e4c33f1ab43 100644 --- a/kernel/trace/Kconfig +++ b/kernel/trace/Kconfig @@ -34,6 +34,11 @@ config HAVE_FUNCTION_GRAPH_TRACER config HAVE_FUNCTION_GRAPH_FREGS bool +config HAVE_FTRACE_GRAPH_FUNC + bool + help + True if ftrace_graph_func() is defined. + config HAVE_DYNAMIC_FTRACE bool help