Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp483039imi; Thu, 21 Jul 2022 05:13:28 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vn9PG0hi+vkTOSt2I7p9r4jAIjXZOZazfzV8u9AYwxJLBNT16SpYaxq3lA1tVJpLCVHfmD X-Received: by 2002:a05:6e02:1ca7:b0:2dd:e20:cfe7 with SMTP id x7-20020a056e021ca700b002dd0e20cfe7mr2677166ill.311.1658405608557; Thu, 21 Jul 2022 05:13:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658405608; cv=none; d=google.com; s=arc-20160816; b=mtkowKgEg4RBLIxuooPFxL8ug131LY28XC60IwTETSYExL5vwZOkAExNA1ZrOzIQjL XoJ8ztsVUjYahbNh5+KTr3zF1CDxMuIXVW1kghp8cPPVPE7nkS7uAOqXe3MjEzpwJj2e ip/Frt9x/zox0CYcgb3bjwNuUf3VgkBSdp1QvbTn52KcQstDf1HXIQWIaLyklh6gxVTy fihYRIQFfsJgI8kGeFYerdV66EXxn03spvN86Oj3M4+rM5UtQUVsxcDPW2qUoRT8xE6L 25y0Pgv8cmBBSPBuRA04Q/UaB0denzZxbU46kNPgFxiBrHN/TVsd/u+/mAYrouWvL8sL NiuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=k8ZML4W8juPVQGMrmhXfSIOgLsHZ4XGxMeo+BC7oDBs=; b=kqMBfswsbZ9aWWIeolVume3A4ve/7ZXFtNRzm8cd/G9UySCi2+h2Uk6aVq7GgHzH3W oOxh9Wc1O4UpaHv6p8rlnLRC7INpfiXPcN+7bGi8G7GrpoDPF0NCYeejPOTFEw2cPTHw rIuy0Xdiv7MD6P5+bWCxX7DEdNf1jaBl5ZYBJ+U8UCt1xToXCH5h3iAQqTXaKLi86665 HxZIK8xYSLzZh5bTUYNY7VnALorx1L4kwccmaNGdHbAgVYUcxLrhWXM1ZbjnRwAOorjd dwPpCNp9/UNRSkYohAhql1ZvqUP+GZKuLWPe/E7507bGss9K/yzsp+E98nqUd/L3CMwa 9hJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fipYXFe5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d31-20020a023f1f000000b0032ec51298fesi1349659jaa.13.2022.07.21.05.13.13; Thu, 21 Jul 2022 05:13:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fipYXFe5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233490AbiGUMIx (ORCPT + 99 others); Thu, 21 Jul 2022 08:08:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232830AbiGUMIw (ORCPT ); Thu, 21 Jul 2022 08:08:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDC6B85F95; Thu, 21 Jul 2022 05:08:51 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 76A0A61CFF; Thu, 21 Jul 2022 12:08:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 22D1FC3411E; Thu, 21 Jul 2022 12:08:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658405330; bh=LXie3sbnk8wgU9gzwq8ntIR3HYeqzQkMMgEXBK+44jE=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=fipYXFe5tkugtJrcKyXxa51hr12B18OxkCCuzLPicXgcFU20MBvpER5VMZsrll6nS bE8UKSXOLSkCbjARk7NzKSVcLyWkyrSseoI3t3bkI7JqVziq+qyjIP/juaJRuub3Tf VMhNkMUHeBXvBNGGC/rJuA6xQak+5eHNrJD1qP9++LypHnACsuCIefculn2UafC/KO l1RJjkiz/gBrNBlZgiDcHnVTuEMiXElL4mZ/G3kDz93QU66JsHxnnRm3+SiKyn8nhQ 5RdyVlwiIpJgzpsuEMRKuQSyfQ9UfunsyPlob3N8oDajqgSMPV/oqtNrMsEb+PaKHJ PkFglKMtlfOUg== Message-ID: <3c0a4cb5-f88f-ec5f-e614-d1e8ceb036c2@kernel.org> Date: Thu, 21 Jul 2022 14:08:38 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH V6 04/16] rv/include: Add deterministic automata monitor definition via C macros Content-Language: en-US To: Steven Rostedt Cc: Wim Van Sebroeck , Guenter Roeck , Jonathan Corbet , Ingo Molnar , Thomas Gleixner , Peter Zijlstra , Will Deacon , Catalin Marinas , Marco Elver , Dmitry Vyukov , "Paul E. McKenney" , Shuah Khan , Gabriele Paoloni , Juri Lelli , Clark Williams , Tao Zhou , Randy Dunlap , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-devel@vger.kernel.org References: <9ffc05b67fff087413143a420373731e0e34eef4.1658244826.git.bristot@kernel.org> <20220720160606.3e672b55@gandalf.local.home> From: Daniel Bristot de Oliveira In-Reply-To: <20220720160606.3e672b55@gandalf.local.home> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS 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 On 7/20/22 22:06, Steven Rostedt wrote: >> +/* \ >> + * da_monitor_enabled_##name - checks if the monitor is enabled \ >> + */ \ >> +static inline bool da_monitor_enabled_##name(void) \ >> +{ \ > Should we add a: > > smp_rmb(); > > here? And then a smp_wmb() where these switches get updated? > Makes sense. Should I also add the READ_ONCE/WRITE_ONCE? like smp_rmb() READ_ONCE(var) WRITE_ONCE(var, value) smp_wmb() for all these on/off knobs, or just the barriers? > I guess how critical is it that these turn off immediately after the switch > is flipped? It is not critical to continue the execution of those that have already crossed by the variable. Still, waiting for the tracepoints to finish their execution before returning to the user-space task that disabled the variable might be a good thing. IIRC, we can do that via RCU... like, synchronize_rcu()? >> + /* global switch */ \ >> + if (unlikely(!rv_monitoring_on())) \ >> + return 0; \ >> + \ >> + /* monitor enabled */ \ >> + if (unlikely(!rv_##name.enabled)) \ >> + return 0; \ >> + \ >> + return 1; \ >> +} \ >> + \