From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9AA1FC433EF for ; Fri, 11 Mar 2022 01:51:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345454AbiCKBwF (ORCPT ); Thu, 10 Mar 2022 20:52:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241288AbiCKBwE (ORCPT ); Thu, 10 Mar 2022 20:52:04 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 858D91959F5 for ; Thu, 10 Mar 2022 17:51:02 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 34A14B82999 for ; Fri, 11 Mar 2022 01:51:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24469C340E8; Fri, 11 Mar 2022 01:50:59 +0000 (UTC) Date: Thu, 10 Mar 2022 20:50:57 -0500 From: Steven Rostedt To: Linus Torvalds Cc: LKML , Ingo Molnar , Andrew Morton , Daniel Bristot de Oliveira , Jiapeng Chong , Nicolas Saenz Julienne Subject: Re: [GIT PULL] tracing: minor fixes Message-ID: <20220310205057.6769ac0d@gandalf.local.home> In-Reply-To: References: <20220310174545.68e872fc@gandalf.local.home> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 10 Mar 2022 17:28:31 -0800 Linus Torvalds wrote: > On Thu, Mar 10, 2022 at 2:45 PM Steven Rostedt wrote: > > > > - Fix unregistering the same event twice a the user could disable > > the event osnoise will disable on unregistering. > > What? That sounds like a (bad) markov chain text generator made random > commit noises. > > I tried to edit that to something that actually makes some sense, but > who knows.. Ah sorry. That was something difficult to shorten, and I wrote that up at the end of the night. tracepoints will warn if you try to unregister a callback that is not registered. It doesn't break anything to do so, but because tracepoints are asynchronous, and when the user reads the ring buffer it triggers calls to special functions associated to a tracepoint, unregistering twice usually is because of a bug that can cause a hard to debug situation. So we warn if a callback is unregistered from a tracepoint that is not currently registered. What happened above is that the osnoise tracer registered callbacks to the tracepoints. And it unregisters them when the tracer is stopped (echo 0 into tracing_on) or removed (echo nop > current_tracer). If the user stops osnoise with the echo 0 to tracing_on that will cause the tracepoint callbacks to be unregistered. If the user then turns off osnoise, then it will unregister the callbacks again, even though they were no longer registered. Basically it was just an accounting error. -- Steve