Received: by 2002:a05:6500:1b41:b0:1fb:d597:ff75 with SMTP id cz1csp228479lqb; Tue, 4 Jun 2024 09:34:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVwWhqZ1VMF89fTbF52SS8PJ/6ZWpsEFMqOjLjSZYvVQYkAd2ooflfP2xCNp4Gj6AQJXG9MsYK9ndOxXwtpeRvQEqR1IoulYKOtj1zDqw== X-Google-Smtp-Source: AGHT+IGYNPp8PkzNoLIqhhkLZyJPJf1IVsVxXodgPOKpqVgcV5SgTPBxD5kSiaz+4XMJkB89XgGn X-Received: by 2002:a05:6808:1925:b0:3d1:ff8e:a5b6 with SMTP id 5614622812f47-3d1ff8ea68dmr2048440b6e.15.1717518869433; Tue, 04 Jun 2024 09:34:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717518869; cv=pass; d=google.com; s=arc-20160816; b=x+8mbdaDH/TDv31axYZgz+81DEdOLDqtVph7V0OOVgCCKSVHRKciaY24ZEbMb6ArQX wWPpYyqeaQINS5+QIwd2XHDbOF+L9o5LPQgYddVkHYlCD37mgjmVpRwSDfvH4ABC3pcJ R/XeaN6FCiDkdfJj7nf1TjgHHI9l94662r7rmsTLZzFgO7axIkTfXBMreNemcmIHJ+yx xFCEw847X+ld4hqpNowHX4C5kVwqpHCK8ycvVnQPl3I5xIy3ejyj2k5YF6x0rGpiTbtz LHYR6GQZNueY89ZtLpjJ6LaicTB1FcRPl84PSLZz8T1yp8N5/pIxHZ+HiSO7Bwlc+XDm fyLw== 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=ZMIrLczxPeFl1g0s/yUiQTdRkhc2+lyPZFpuRRRo3kU=; fh=0f3B9ssCLUq73U9v327+UXBWq08vpIx8EuoN4c+NsZA=; b=odIUlL2qaOY/0jkYiXk3J1kEGHt9x4gxYcTKoaF0PCMbwfjUUhJyiH7qFrmstfGpPp 5yBrtYYCVx6NWNa9MShUAxixNgRCVJhF00Edmjrp9Dd6Oz5wNDkHxZdJOJg/WYFvMiif R+RkQagoNSJRth8RU1hutSLz4kwAJNjs/g55zRBGgjEby9FMrQzT1yMKaBfUIPlbrdf6 Snu6T/YsyvOazy2RGa7U4dtfFVRxNsxQDYQ8RKrGTPTiD2UxcSEv4TG676PtCYXDqD62 5fAEeTkm1p+m3VREANQ2DVwSMcxuFVZ0//JDxmEo8y/suII8cq45KvMfVaoje+Qcdu7X z1Sw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-201083-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201083-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6ae4a739474si113435536d6.27.2024.06.04.09.34.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 09:34:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-201083-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-201083-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201083-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 272E01C2155F for ; Tue, 4 Jun 2024 16:34:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D1E851487C9; Tue, 4 Jun 2024 16:34:23 +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 5974F33F6; Tue, 4 Jun 2024 16:34: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=1717518863; cv=none; b=mlFx48IfEEW6qoZybIEwxA2/r5Yxhr+8oAmoNVN6R/p2fClvlemBysuRK6AYuiAYnnk9koMG3pKyqPB42UWI+Wq6+FrKyqoItzL0Yk3OZMuat6znFq8e6s0kF0Iw0Geowit/j1cB/mnevQ53fJe1XCZRaIwsx8gbkwIDFm8EiQ8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717518863; c=relaxed/simple; bh=7D7T22hQGM8W37qBr4mMHw1mBEwnwhMEDU/ROlDpLas=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=bxycQyELaUBvTvhXE2gPgRjSPXYSDYGQG6PHhx+c41fy8ZYtom+TaVRg7B1kkOzrlkQk6S9jDtA7Tgv1aKHzTjxaXgmEyX5nXNyNqA8p5yUvZwqNAxL3IM5deqVh/5R/M0jRVwIfP2anUj5HJlD7jSsyBLSIw0a3Bf5qsg/2iJw= 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 090D2C2BBFC; Tue, 4 Jun 2024 16:34:21 +0000 (UTC) Date: Tue, 4 Jun 2024 12:34:18 -0400 From: Steven Rostedt To: Mathieu Desnoyers Cc: "Masami Hiramatsu (Google)" , don , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/3] tracing/fprobe: Support raw tracepoint events on modules Message-ID: <20240604123418.22e16e97@gandalf.local.home> In-Reply-To: <419b80da-9cbf-4bb2-aabb-dc04f0fb0f37@efficios.com> References: <171723014778.258703.6731294779199848686.stgit@devnote2> <171723016594.258703.1629777910752596529.stgit@devnote2> <20240604084955.29b9440687522a1347e0e7cd@kernel.org> <419b80da-9cbf-4bb2-aabb-dc04f0fb0f37@efficios.com> 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, 4 Jun 2024 11:02:16 -0400 Mathieu Desnoyers wrote: > I see. > > It looks like there are a few things we could improve there: > > 1) With your approach, modules need to be already loaded before > attaching an fprobe event to them. This effectively prevents > attaching to any module init code. Is there any way we could allow > this by implementing a module coming notifier in fprobe as well ? > This would require that fprobes are kept around in a data structure > that matches the modules when they are loaded in the coming notifier. The above sounds like a nice enhancement, but not something necessary for this series. > > 2) Given that the fprobe module going notifier is protected by the > event_mutex, can we use locking rather than reference counting > in fprobe attach to guarantee the target module is not reclaimed > concurrently ? This would remove the transient side-effect of > holding a module reference count which temporarily prevents module > unload. Why do we care about unloading modules during the transition? Note, module unload has always been considered a second class citizen, and there's been talks in the past to even rip it out. -- Steve