From patchwork Sun Feb 25 15:20:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Masami Hiramatsu (Google)" X-Patchwork-Id: 206071 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp1622667dyb; Sun, 25 Feb 2024 07:23:24 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX8krvyRnFRKhqzOESkmhv34FEyNzsF7gf8+g7f6kD3lQxxMB9VWvROxlQ/eWbtDDus38HJ4LrS1W0NcExW1ySGeCothg== X-Google-Smtp-Source: AGHT+IEDyo8Q7A3CjlzpExafQC04erELt3qEph69+Y/C+jvgh7TCdGbyVKywvHoZvTGZswl8kwPR X-Received: by 2002:a05:6402:340d:b0:565:50f8:bad5 with SMTP id k13-20020a056402340d00b0056550f8bad5mr3569256edc.30.1708874603793; Sun, 25 Feb 2024 07:23:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708874603; cv=pass; d=google.com; s=arc-20160816; b=D+Ug3W5JPEI9BZsxW123SnIln/eui9bKkKIlfs9KRODAHo07kcI4xn2WQcwe2Iv2Pq 40F5VZZkwZETJhatml08cdZmF/eN2GsGuvylOOQUsfbyrDoRqHGe2oK/cQ/paQrPMDuo gUa4L3FZ8ftkJn70/D9HH5T7o5kcnpv+XoopQDrJ75u1GpYT7Gzuei56DyJBmFDEW7e0 wz/eb2ClOTr+dXt21mgmhygWlxWmUWEDzf2S7eIcpnXPUvNxVsrJZx3xwaJXzZqqjVu5 oDEYbyGVGpci4r8ccERy1V8x50BsgLBXmm6QRIIzOVtijF+9Zm+MUz5Lw8ODVx3MXZng GlMw== 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=PecUgcoIMrwtGBE/ao83X2NVrvLnPZv1CquVcFerEMU=; fh=SIgps5XdV0XNwjZfT2uAI7g3mrspDldK9Qs8qQAfoa4=; b=S5p158wh2lMWy9wj2jbYlOw4q5NcOfTu59NBJ8HJkBbqHUmRLTfdvqb18hXsuPInYU crneS0KkYMDkxLl9AIwuJZCsHvoAQnPO5B4GUqYSRbXF6tDySQ0jtPnkQaQjp2Mye/fm 0JlSnp/ulVc26+2oyZLrtXVyH7A5K3soV7C1DeOAMsFYPRpQ8Y2ogA63QgpYWWQpa8j8 CdmDTAZQWWIkiipsgZU8LE4+hPzyAwBpxj9UmGZ4CTIqI/R9Vdn+akkDSXaSvOETMkek gnLnY+5Fh71NT13wFG51mFuHaGJclye3LHWrW0EpFyQ1B/g+eYtkAxvHoWekZBkI14CT tTUA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DaDmzfG3; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-80158-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80158-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a19-20020a05640213d300b00565aec519f8si1175451edx.191.2024.02.25.07.23.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 07:23:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-80158-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DaDmzfG3; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-80158-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80158-ouuuleilei=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 am.mirrors.kernel.org (Postfix) with ESMTPS id 69B4E1F218EC for ; Sun, 25 Feb 2024 15:23:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EE9FE1CA95; Sun, 25 Feb 2024 15:20:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="DaDmzfG3" 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 4970217BAE; Sun, 25 Feb 2024 15:20:38 +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=1708874438; cv=none; b=iaEm6pNid6xlXxMic39i1zhZ4wONRuV+Ad8BSjDv8bZz/AboHbehIzn1e2MB7wCiyXgzCdms44zJqUKP/4qU/2YRfeHlGD2/1qh+zpjymMmyWrj8NIF3q6yjAU2inECF2Jr8qZHu5gCgd1J755MSrkEtoDVawXEgQqDKHxkNUrg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708874438; c=relaxed/simple; bh=hsfsFcKKsVTJkdP0dB2wrWv8HoaQNUBNDAvj51YNQfY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=CkXqPF5BT6XHV/BHDvx+2xIw+y3UKb/qCin3hHl46RFcRDj/aK12RZHnRV6S+33MISkujfb1f+H0h1TjLo8uPiz0hBiAh4bINij898pVibqg4ILEQqXNBTcNKKhDo0aZHEz8fUyH5kjRs9iQRr1oA4uPdiqrQCdKU689Hyb4OS8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DaDmzfG3; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C3D4C433F1; Sun, 25 Feb 2024 15:20:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708874438; bh=hsfsFcKKsVTJkdP0dB2wrWv8HoaQNUBNDAvj51YNQfY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DaDmzfG3v6HhupM8rZr6Cz1asnz4gfGtJFwVQ7vTGcG2CQVLnbP5L/J/uHK+YAxLv GnnKfG6G1X+q6lQiF5nUNITFpeyAVPhtVRWZUohrdCQ34T2n8fUcAYPSYu3dgTJi3u m5TCOST/wQcXh1JBfjPqNjpKJOqvkshr05beWjUoZVbGb3UrT8nQL2dtsPQpMWxwt2 6rtsJiVQzGkpnrdt5ttPYu6KgoqJ6HI0SPEmMMyw7VmoRfgE0fzFlXlEedsI57E8EE OxidUbWKWakYlH19uxhM7VvqTIldSxLKKYFvSqN6V2FGGLv+6R3htZNYCa+XyRIBEp k+IxZ3I8ifwsQ== 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 v8 30/35] ftrace: Add CONFIG_HAVE_FTRACE_GRAPH_FUNC Date: Mon, 26 Feb 2024 00:20:33 +0900 Message-Id: <170887443285.564249.1101825677626621865.stgit@devnote2> X-Mailer: git-send-email 2.34.1 In-Reply-To: <170887410337.564249.6360118840946697039.stgit@devnote2> References: <170887410337.564249.6360118840946697039.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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791884896298272198 X-GMAIL-MSGID: 1791884896298272198 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 eea361de3224..bd9af77924c4 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -205,6 +205,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 b1c5e12d4e64..5a523de6f7e8 100644 --- a/arch/loongarch/Kconfig +++ b/arch/loongarch/Kconfig @@ -119,6 +119,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 b9fc064d38d2..920e5e1deab4 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 3ae5ab6a65b0..66aba0d8822a 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -119,6 +119,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 6d1566822a7b..4df2dc455659 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -223,6 +223,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 e2fc600f0ef2..9056315d56ed 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