Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1238225lqj; Mon, 3 Jun 2024 14:58:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWXPPIW4FSq4vihtOzYuYl8ZCAEiLbIT6Wyh3uwLV7HpYTNG5F8SCnlPX1PqowZoKdNJB2N6yI6rjoPbI96yQZq7XpyiKKBl2nSggagCA== X-Google-Smtp-Source: AGHT+IHgtcAtstiJfzW0/X4WzNdiVP2PuRsQFggEQLY3wvRkNQmJayKNnzjO/EB2VOBYzwHvzpHr X-Received: by 2002:a05:6a00:10c5:b0:702:71e6:2064 with SMTP id d2e1a72fcca58-70271e623fdmr3752390b3a.30.1717451881035; Mon, 03 Jun 2024 14:58:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717451881; cv=pass; d=google.com; s=arc-20160816; b=Zeu66D3OxEvQ8LSpnrmIIP7uR2tGcr1Mhax0NBEQEyCMTNKcPyix0vEttWFL9uUMCg p7kF0R+XnCDE6x9MKnUS2ERwhKaYCqK8q7Rbo9qNrt7ETyL4U50ti2GtLvVqvYDKg8l/ HcN+zkHey3mEDpiM1hyZCX2SxGRrdcLMoT40dvHwTLvJxU8w7fyou2iJtvg95sLHAASW ndegJDKLHsJ6bQI+juwZvNqt2QRRRowQDK4arM+YSSl2xUX1vUtIw1/5HhBt4nqu72KI tvGytxAXR3CvEkvWXi1bIbveYLcTGFPTMEZvZm8f9OmOJWyleO0hVSSKcCHWEJzSw8h6 DWIw== 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=EvgWpdAYOOWf7Nqanns4vpQQHe9j0EUvCHh8KycLt3U=; fh=0f3B9ssCLUq73U9v327+UXBWq08vpIx8EuoN4c+NsZA=; b=OjdbZEzjHXIl6WQcJ//z051yBHF6HeNKl8cDyewRpd/jjW54dT9yXqAxxS4PZaXKVB PDFIIvc/7XVrTK8I8c93UA2q1X2iOW4pUipIGSTYCwQ6fZL4l2JnhA8XfGo8dtNudZw9 Td20XcAQtA1fy+e5vMHeeGH/EyKRHywigYM+Ht6i5uuUDJQA5Mj79lUmvbS+0XZrwaXB fhxdMawimlt4IjaNna/Ju4hdRFnksww8sBWKBkUTy77KbCGvhIU+nNn5T64iRe2aS3vE sq16HHDu/QsnvHFyfcJR4TD0xOy561QusZmCANgJzrdz3BTWGEfg2aYFaBNEx06yJ9XS uFdg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-199745-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199745-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-7027de77cb0si799316b3a.85.2024.06.03.14.58.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 14:58:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-199745-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-199745-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199745-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 CD4EA28D479 for ; Mon, 3 Jun 2024 21:48:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8C30813C827; Mon, 3 Jun 2024 21:48:52 +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 1443580603; Mon, 3 Jun 2024 21:48:51 +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=1717451332; cv=none; b=PfSAI6uV8FLPb37YbNluISawAUex289OHkgxKsQV40OZCWqwS4kYg0qsqvln7SnEwHNQ2GUnYHXV0g/clXhkJi6vvs6eWbdutbLvEizKYdrJ07B4OaBypuR45R7m3RxtfuTwR08IksAelYLP4ET7PoG42Od7/3oPoREM0Ev0Wso= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717451332; c=relaxed/simple; bh=O6uxIQ2+m4DWt8r05WCJpLj0L+gvfDUljJouVxNAmhA=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=KHaNYoMipW2jK8Zke3GOsXqONX6QeVcqTXaRyZ2q4vKTJVg1WJAC+sKMCxx4I+3QRXXdFtFR9y2ZptC2cCcBaIwSnZnIams1cy/AGFDXcuiuzIWfhrBtZWoR0uoUie9kzOCI8k5GKp+lwskgoYiXe5jf/jC6vgqA661acvFDBY4= 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 E2DD5C2BD10; Mon, 3 Jun 2024 21:48:50 +0000 (UTC) Date: Mon, 3 Jun 2024 17:50:01 -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: <20240603175001.603be0f4@gandalf.local.home> In-Reply-To: References: <171723014778.258703.6731294779199848686.stgit@devnote2> <171723016594.258703.1629777910752596529.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 Mon, 3 Jun 2024 15:50:55 -0400 Mathieu Desnoyers wrote: > Hi Masami, > > Why prevent module unload when a fprobe tracepoint is attached to a > module ? This changes the kernel's behavior significantly just for the > sake of instrumentation. > > As an alternative, LTTng-modules attach/detach to/from modules with the > coming/going notifiers, so the instrumentation gets removed when a > module is unloaded rather than preventing its unload by holding a module > reference count. I would recommend a similar approach for fprobe. I think one major difference between fprobes and LTTng module attachment, is that fprobes is an internal mechanism used by other utilities (like BPF). You could have a program loaded that expects an fprobe to succeed, and may have undefined behavior if the fprobe suddenly disappears. That is, we don't know what is depending on that fprobe to simply disable it on module unload. -- Steve