Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp36983lqp; Tue, 11 Jun 2024 13:46:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWbBpEjTGDTF3TB9woLMy9cq2L80dLyAA34NEQ/0r8/9HvTzRouPYeFb2gW1LfJBVOXdjdufkm+XsH6GERssVxhjkPWiS8EcoUa1aUH6A== X-Google-Smtp-Source: AGHT+IHrKKU8B/gwGypz4sFGNSOiYAvY1b5GRl2EamD1Rz1iBFzL1jHJtRO00nre1TNWrcAGQ7/7 X-Received: by 2002:a05:6a00:23c7:b0:705:b3b1:8fa8 with SMTP id d2e1a72fcca58-705bcdee04emr58976b3a.2.1718138786946; Tue, 11 Jun 2024 13:46:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718138786; cv=pass; d=google.com; s=arc-20160816; b=DchHHXJ0LGZqV/JEdEaDIggkDeSbcSiphmBjBg127Vi2lN3l/XdVJSdstL2dx50iJD qkR/8+h2Q6AWMxgCAqlfNvyXYjVcTC2HsiQEQTNlThOupKJdUM5M9oeCixR9VtFRsrgM lcMxv62XRxGVTPTK4JQSO1Q9IHfKEe5Li+Uo1qbcof5dZFuORNnTXDPd9/NTkkg1jF4d SMEeKZm0ARw7tI0fK3afBSSPsSLs0k4KzUZ8F3+noVi8Bb3uCWtQ7mjz3ijmt673YNeS Aq2n1N9HKXt/t69744vrysuW03U3NnwchtfU7zIZGdYhr3tU/hXytl6MQvGZ3sWrLZ5K YhMw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:subject:cc:to:from:date:user-agent:message-id; bh=AcKNTzRxbZSb2SIZDvyr5VVRcLNLjCvf8EFWBivfFJE=; fh=nKfoN7UdqOu/DvYTGAbUDlQOipRyyGAc9CYQlDoFez0=; b=W9wlfOyz6bsG7zrF1gMk3tV+PC+Rly6p1ZyrDR7SaM0Zw3Zy5OsJlgoG0Vl4ixDQHU fsznRwMI6rLS484pG/7UMlAJJMuybnr9XjkSXykvYQK45RkEGFdWzSD/iHReSyk8KEvO qO9XcPO6U2u3bHcGr9252Di/TQxiJkPCwwROIaUnGiTLDmh5NKIb604ZyVbKji2ABxWZ 7iskgRgP8XyS79oMHt6UqKilespmkaQK5R0OArCMm90RuL5J/h1d453NaSzdUIqFi/cU ekahaof2aukHYfAvOUUr6QEBbum3xAPjCJwLZiUc8eTQrJQSzilPrheLX42dkEl/n7dj qkhg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-210590-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210590-linux.lists.archive=gmail.com@vger.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 d2e1a72fcca58-70476f9768dsi4719022b3a.223.2024.06.11.13.46.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:46:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210590-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; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-210590-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210590-linux.lists.archive=gmail.com@vger.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 9440A287AC0 for ; Tue, 11 Jun 2024 20:46:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 115A51534E7; Tue, 11 Jun 2024 20:46:13 +0000 (UTC) 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 86A2D1CD16 for ; Tue, 11 Jun 2024 20:46:12 +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=1718138772; cv=none; b=JurthEzRb86ajNDgrAkV9ja23P04KfJ4fWOaVwNz17N2XJ+65+aTA2Den9sse7e5+0BSeMRGlge/pbCo7qbMIfPMzuwBjDnJ2Qxy1KD1x79Ef5avih/kLt8HSvyaNNc8LPonveIdxPa62QJ+ah89XCJBUNOSte06p255X7g4LnA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718138772; c=relaxed/simple; bh=ImQ9KOd+2hjVgtXx/dfloG4fYodqkEbfTCz8zH9mw/k=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=B21iehOElCmiyuZ6OJNxOQ7fiieie01Bj8rZ4QVktKZc01O26sOojMxkCuUAZ2AEx57+wTZDifIFeE6JEhSjVQMaKuO+8Zrfx4aqAVM2CsJB3VDXOJlRR6qQaaD6YNQA8Jd5MsSdxGBR7FhVGITIqDXzt/Jp/JWz5lBJGc+wQns= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 130A1C4AF1C; Tue, 11 Jun 2024 20:46:12 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1sH8Nw-00000001V2e-2eUr; Tue, 11 Jun 2024 16:46:28 -0400 Message-ID: <20240611204628.489153002@goodmis.org> User-Agent: quilt/0.68 Date: Tue, 11 Jun 2024 16:45:55 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , kernel test robot Subject: [for-next][PATCH 1/4] function_graph: Make fgraph_update_pid_func() a stub for !DYNAMIC_FTRACE References: <20240611204554.092271761@goodmis.org> 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 From: "Steven Rostedt (Google)" When CONFIG_DYNAMIC_FTRACE is not set, the function fgraph_update_pid_func() doesn't do anything. Currently, most of its logic is within a "#ifdef CONFIG_DYNAMIC_FTRACE" block, but its variables were declared outside that, and when DYNAMIC_FTRACE is not set, it produces unused variable warnings. Instead, just place it (and the helper function fgraph_pid_func()) within the #ifdef block and have the header file use a empty stub function for when DYNAMIC_FTRACE is not defined. Link: https://lore.kernel.org/linux-trace-kernel/20240607094833.6a787d73@rorschach.local.home Cc: Masami Hiramatsu Cc: Mark Rutland Cc: Mathieu Desnoyers Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202406071806.BRjaC5FF-lkp@intel.com/ Signed-off-by: Steven Rostedt (Google) --- kernel/trace/fgraph.c | 4 ++-- kernel/trace/ftrace_internal.h | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/kernel/trace/fgraph.c b/kernel/trace/fgraph.c index a13551a023aa..63d0c2f84ce1 100644 --- a/kernel/trace/fgraph.c +++ b/kernel/trace/fgraph.c @@ -1138,6 +1138,7 @@ void ftrace_graph_exit_task(struct task_struct *t) kfree(ret_stack); } +#ifdef CONFIG_DYNAMIC_FTRACE static int fgraph_pid_func(struct ftrace_graph_ent *trace, struct fgraph_ops *gops) { @@ -1164,7 +1165,6 @@ void fgraph_update_pid_func(void) if (!(graph_ops.flags & FTRACE_OPS_FL_INITIALIZED)) return; -#ifdef CONFIG_DYNAMIC_FTRACE list_for_each_entry(op, &graph_ops.subop_list, list) { if (op->flags & FTRACE_OPS_FL_PID) { gops = container_of(op, struct fgraph_ops, ops); @@ -1174,8 +1174,8 @@ void fgraph_update_pid_func(void) static_call_update(fgraph_func, gops->entryfunc); } } -#endif } +#endif /* Allocate a return stack for each task */ static int start_graph_tracing(void) diff --git a/kernel/trace/ftrace_internal.h b/kernel/trace/ftrace_internal.h index 4bb1e881154a..3235470e61b3 100644 --- a/kernel/trace/ftrace_internal.h +++ b/kernel/trace/ftrace_internal.h @@ -52,7 +52,11 @@ static inline int ftrace_shutdown_subops(struct ftrace_ops *ops, struct ftrace_o #ifdef CONFIG_FUNCTION_GRAPH_TRACER extern int ftrace_graph_active; +# ifdef CONFIG_DYNAMIC_FTRACE extern void fgraph_update_pid_func(void); +# else +static inline void fgraph_update_pid_func(void) {} +# endif #else /* !CONFIG_FUNCTION_GRAPH_TRACER */ # define ftrace_graph_active 0 static inline void fgraph_update_pid_func(void) {} -- 2.43.0