From patchwork Sun Nov 5 16:09:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Masami Hiramatsu (Google)" X-Patchwork-Id: 161673 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp2197418vqu; Sun, 5 Nov 2023 08:10:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IHtEBrEYwVPMnPUh55HxfPqpwQ7s0nO9VlO3Argrm8kgEb5n6jaItrXuOHiWn9OGw1rDeJm X-Received: by 2002:a05:6870:bb1b:b0:1f0:6565:9a37 with SMTP id nw27-20020a056870bb1b00b001f065659a37mr11771266oab.50.1699200615983; Sun, 05 Nov 2023 08:10:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699200615; cv=none; d=google.com; s=arc-20160816; b=hIZv98oYoN/MpKAWknA8CE/touwbqoM/gQodp30nb81+tOJ2U62c1e8E/znpuboNu9 aGEGtXjn+Kfzr3WeLcGchjpxsZqCAfbY90ri9uLF5jTrT88xW3/AIJHdqAHvQa7uaKB3 Uqke8MQ6bYPsJQESuliBeVXhEmL8fzHQdg7jIMTxQByIUbgELQ8RTKHhmnWEvrlX9g+W ny8QyYsZV0IVK8KcTiJMtME8DkV8L38Faf5yGkcbfC6Xez+dcOOlsGrmMlbXM89YSaZ6 +Ok8HXZWUc2JERyrBon2ymTm2UWMkFZy08XfTVJaM4ErFbKSfkAFH+2R5tbjBDAEk4CS umMA== 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=g2cVJrZDgiMnw2CnUCJh/woCo0rG1+gb5OVy/zc7glQ=; fh=SIgps5XdV0XNwjZfT2uAI7g3mrspDldK9Qs8qQAfoa4=; b=jS0H/0vCu7W87ly/TVpnq7N7SqKkAVm01dkcZSvIZqN4vcY8FnJiT339ucZhmRnPX+ lda6vafLcJY43/xDmOf15bKXSGFSq8MZSpjfn9x68WjqhSEeQ+DweuUfKt/zyQE5OeV2 1p/AJRi5XlwScbI3OdzH9j0EFSjz4A6H4GXmxCPkEHRGMeDdikQheIxhhZpAwrKvfrao bfIxuyhc8JWR8zJHfdmr8cIa3j6gpzbyroz6+Ur3RXSFicbdNNSJwd/0oc3EDMg3s9mz cGilXqj0OpZU4VqKgrQ6qNMCfr5JEZ9x2st1c8eniGPI0wVdVudsNADGVhJhKRPFQ4QU Q54A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="c/CoB3R0"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id eg11-20020a056a00800b00b006bca1246564si6231515pfb.271.2023.11.05.08.10.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 08:10:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="c/CoB3R0"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 3F8EE804705A; Sun, 5 Nov 2023 08:10:15 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229593AbjKEQKK (ORCPT + 34 others); Sun, 5 Nov 2023 11:10:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229791AbjKEQKH (ORCPT ); Sun, 5 Nov 2023 11:10:07 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1E17184 for ; Sun, 5 Nov 2023 08:10:04 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D602C433C8; Sun, 5 Nov 2023 16:10:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1699200604; bh=6QXlcdrE6Vd0uevCRAQA5jRWA9Z4WkVDk80uAUwbJ/E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c/CoB3R0PwHpStxpBdcBy486i6VbtYtAR1YYmvlMJgWlkvwAslfAM1MBCOHQznEuS EKB3GpxYg2osZ0mbNEFlBtDFS7IVzI8nLjnyHdFfeaBzk/uPzEYKy3lm1Bh7rSay0R qkBO9K4WnNjpxWMohFj5Bz6IizDWDIk+eYYnnzFX5DId19isCVydBj6Z1yGqVq2lxc vsiYZsNeJERJi8N1ScBOr5UoHyCG75QN3HFIMfGa2X5DeJe5Y5ak8aag8MhZQpGBcn kpy8+KCP3F7miOXW/IulJ9Y5Nh6snHUESFyYCkL2wO64KgRqRsaKfBZSyp+XcguuOu wfUKgBO98l/PA== 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: [RFC PATCH 17/32] function_graph: Fix to update curr_ret_stack with ARRAY entry size Date: Mon, 6 Nov 2023 01:09:57 +0900 Message-Id: <169920059747.482486.11622923727523240888.stgit@devnote2> X-Mailer: git-send-email 2.34.1 In-Reply-To: <169920038849.482486.15796387219966662967.stgit@devnote2> References: <169920038849.482486.15796387219966662967.stgit@devnote2> User-Agent: StGit/0.19 MIME-Version: 1.0 X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 05 Nov 2023 08:10:15 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781740985513097663 X-GMAIL-MSGID: 1781740985513097663 From: Masami Hiramatsu (Google) __ftrace_return_to_handler() missed to update the curr_ret_stack when it gets a FGRAPH_TYPE_ARRAY. Since that type entry will follows some data words, it must update curr_ret_stack by entry size value (__get_index(val)) instead of 1. Signed-off-by: Masami Hiramatsu (Google) --- kernel/trace/fgraph.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/trace/fgraph.c b/kernel/trace/fgraph.c index 0f8e9f22e9e0..597250bd30dc 100644 --- a/kernel/trace/fgraph.c +++ b/kernel/trace/fgraph.c @@ -740,7 +740,8 @@ static unsigned long __ftrace_return_to_handler(struct fgraph_ret_regs *ret_regs case FGRAPH_TYPE_ARRAY: idx = __get_array(val); fgraph_array[idx]->retfunc(&trace, fgraph_array[idx]); - fallthrough; + curr_ret_stack -= __get_index(val); + break; case FGRAPH_TYPE_RESERVED: curr_ret_stack--; break;