Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp895305lqb; Fri, 24 May 2024 18:31:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWLtD0BQKN6AC0EIfDtMB85n1YQKFHWnEoOyQm/j5ypoi3nGtodIanT/QUICHkwNFCMsCcBchCcEyv4YX5a9zwganO4HsVwTOPYuL99dA== X-Google-Smtp-Source: AGHT+IEIQ7hHEuq0Y3G4VaXuv+BPj2cVD6u7+z+vLbsf9Q/ENoUCnK3ThdJsFlnmUnlxWKj/Xu6o X-Received: by 2002:a05:6214:2f02:b0:6a9:ed54:be81 with SMTP id 6a1803df08f44-6abbbc98fc0mr36059176d6.34.1716600693857; Fri, 24 May 2024 18:31:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716600693; cv=pass; d=google.com; s=arc-20160816; b=vSf250gKxWyoRS9cAH/rs7OlerDpM+PCbMpysd5Js8ALKKNEIsBm9TFokuFl/1oHab W4iJ+gG3/YXc2+P94hjbZDabfFwH9XHtzDRMPzCvk42p+fOgNKykqkPjp+ZXq9JG2NbB yGRI26KQqttTIZEqrl/uK98deaiBT1zNPtTuPhBbczAWDeS8UBW/ghmyV3XWfgdC/bWY tp6UvyKVFDAxW+3kZMvSBdOPtdlp9/K/RDtUWIw4slz3g6Az7aGvKD5sBNJitDP/8Urx Z7bXaBl0HXhvL8sYui7sNWZIkZhtgrQEAAaVMoUq5xrv9wrpo7tIVpkM3UjCgPnHR1CZ 9NTw== 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:references:in-reply-to:message-id :subject:cc:to:from:date; bh=KdAEXdW39nHJUpGqbpspAg9c+Gb+BxCzMW/HqzUqxZ4=; fh=VaF/w+FGpk/prTFLJfCoV+GJDmV0Sd6dt8EMZrBTbz0=; b=mkcvbZ8uQQ/xJ4WRaY8/joWkr9M5FsYv1Efrj68DF61vOtrzg/JBTrwmcSsoN+0Iii rHbk9aTQuwr4Bv+YTnVZMXUuPwXpjIhhwa3NvpEovxNZ8Tx6C2WGGvzgojA6r3EtE7i0 kSZbiWZu865sYc6uVY4GwQfia5g4J55C/uI6Y7AiW04Urldh30rqUfPwQ3nRyWbGrfdm uzk878JiXepevWPWH/FVE24O30I8+fm9aVDWfwWlr5X1LpUoyByZEF4HZBMIYqUGNd1c 7M3Z47k3nNzi2l5aLxA7q+ClJ9dESofz8+rG0drgnZI4FARj1RKwr8/eH84+/yCewdpP Obwg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-189231-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-189231-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6ac06f4fd84si31044646d6.84.2024.05.24.18.31.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 May 2024 18:31:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-189231-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-189231-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-189231-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 961641C2131E for ; Sat, 25 May 2024 01:31:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7FA241C2D; Sat, 25 May 2024 01:31:24 +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 F18B210F2; Sat, 25 May 2024 01:31:23 +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=1716600684; cv=none; b=u/CVhub6xpZ8HuHP7GFRndxFyl0Zhqx7gnKOQkWAQKFbMI/8wZG4mpWlFh4YTXirba4iVId6HGeXBcZJDg1vjC2yVYt/o6GV1+b1S/jAzbprEqxFF1New5ZKqeTsV4fcMIToY59ey7tLk7vb2KYe7zv+yeLWM6VXxwfmsJJvA6Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716600684; c=relaxed/simple; bh=z7oKLt6Rw3xg2+xTJUcSeAWH56aHvfdrjINRXOlJgLg=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=uegw1GxFCb8+HcKsO+PSkH1KvI/tMHjd7euGY0oDTpXoMGXNXMBhgkCosEg83lzLfCAfjuFXxhIIEMs3GFg13IpI8BxEOeHAJMNMS2hYfMXgzMxgS9aey5UxFD3crPSm/OwHgM6TixYVDabRKRoR/boF6aC4spLDCCL6cjTq8nU= 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 55AC3C2BBFC; Sat, 25 May 2024 01:31:21 +0000 (UTC) Date: Fri, 24 May 2024 21:32:08 -0400 From: Steven Rostedt To: "Masami Hiramatsu (Google)" Cc: Alexei Starovoitov , Florent Revest , 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: Re: [PATCH v10 07/36] function_graph: Allow multiple users to attach to function graph Message-ID: <20240524213208.36f274c8@gandalf.local.home> In-Reply-To: <171509096221.162236.8806372072523195752.stgit@devnote2> References: <171509088006.162236.7227326999861366050.stgit@devnote2> <171509096221.162236.8806372072523195752.stgit@devnote2> X-Mailer: Claws Mail 3.20.0git84 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 7 May 2024 23:09:22 +0900 "Masami Hiramatsu (Google)" wrote: > @@ -109,6 +244,21 @@ ftrace_push_return_trace(unsigned long ret, unsigned long func, > if (!current->ret_stack) > return -EBUSY; > > + /* > + * At first, check whether the previous fgraph callback is pushed by > + * the fgraph on the same function entry. > + * But if @func is the self tail-call function, we also need to ensure > + * the ret_stack is not for the previous call by checking whether the > + * bit of @fgraph_idx is set or not. > + */ > + ret_stack = get_ret_stack(current, current->curr_ret_stack, &offset); > + if (ret_stack && ret_stack->func == func && > + get_fgraph_type(current, offset + FGRAPH_FRAME_OFFSET) == FGRAPH_TYPE_BITMAP && > + !is_fgraph_index_set(current, offset + FGRAPH_FRAME_OFFSET, fgraph_idx)) > + return offset + FGRAPH_FRAME_OFFSET; > + > + val = (FGRAPH_TYPE_RESERVED << FGRAPH_TYPE_SHIFT) | FGRAPH_FRAME_OFFSET; > + > BUILD_BUG_ON(SHADOW_STACK_SIZE % sizeof(long)); I'm trying to figure out what the above is trying to do. This gets called once in function_graph_enter() (or function_graph_enter_ops()). What exactly are you trying to catch here? Is it from this email: https://lore.kernel.org/all/20231110105154.df937bf9f200a0c16806c522@kernel.org/ As that's the last version before you added the above code. But you also noticed it may not be needed, but triggered a crash without it in v3: https://lore.kernel.org/all/20231205234511.3839128259dfec153ea7da81@kernel.org/ I removed this code in my version and it runs just fine. Perhaps there was another bug that this was hiding that you fixed in later versions? -- Steve