Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3894214rwb; Tue, 16 Aug 2022 10:28:19 -0700 (PDT) X-Google-Smtp-Source: AA6agR4jN6LXclO/f93FSTFzl2FYK+8SDkXWz7nfux/MeuRw+t/WSsTqn8Tr7IhETGuddO6/jZwA X-Received: by 2002:a17:907:87b0:b0:731:3dfd:bc8d with SMTP id qv48-20020a17090787b000b007313dfdbc8dmr13709509ejc.607.1660670899375; Tue, 16 Aug 2022 10:28:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660670899; cv=none; d=google.com; s=arc-20160816; b=HH76Q917/VsDm+LEGA6d68CZrK7kOXJ9k8w6Xv7hPN425S3Wea55DBBrBM3nlV/0iU sVmd1oX/SLUgqU3aPOrnTy8nV0lievXKAFqNOMRFlb4KWpQ1hS7ag4joVxaeLYGvRd6A fWgmKi4Yt7ainXbIWxV2kLhyxvd60+EfBNQTJIPnweD9/IKJFHqH07IrdZU+VO04xLpt aQQ28KAR0ETWbzuAbgHaIadUJoe2rv+HlOo1OeJkOs5GPUlSKdHnA8G3MQTAUQ0oDxkR NDVTdj+V71b7tx/0Jd7UuWNo+55kz7JANKKSfLzJzNjlATQTqnp7d/kgMv3W3V3ZULzx NpEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=LPOUlgD5ZBn5T9++j/Us5DnGMrIdcCooHnCLHDybKS8=; b=DnB+pE+7YxwjH5BXvE/rYk3swBjSn9FCAC3CEsUro1TVaAdGpbzQVbxCTo5rIcQNrQ nWuvqndQGohbRh7sfgrd3k+MVBy4soo/B1ykCWxtuDcGnGD8J89f2tTfP8zMsvdmiLOW idNlWsFV51vSNdBV8wBB6Ziw/ESmsl14U8JX4mIV57mtbRbLTYJnA9IRMVz2hOi4Gk07 JhYasFYVtiePCoY4RA1353+WxKbJ4IJJNgFMNFge5bOdRN9R/nFrpPUT6mWx2aGDMS/J ysfzNdhLqITTYjTDcqpifqkhC+Sv72WHJCg1/msCsZIJqk62haw7JHcNmoyGmrbkccAq /DPA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f12-20020aa7d84c000000b0043cb2fabd05si9274873eds.326.2022.08.16.10.27.53; Tue, 16 Aug 2022 10:28:19 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236166AbiHPQlY (ORCPT + 99 others); Tue, 16 Aug 2022 12:41:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230494AbiHPQlX (ORCPT ); Tue, 16 Aug 2022 12:41:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B4EF80B51; Tue, 16 Aug 2022 09:41:23 -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 077646123A; Tue, 16 Aug 2022 16:41:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3A08EC433D6; Tue, 16 Aug 2022 16:41:21 +0000 (UTC) Date: Tue, 16 Aug 2022 12:41:28 -0400 From: Steven Rostedt To: ira.weiny@intel.com Cc: Dan Williams , Alison Schofield , Vishal Verma , Ben Widawsky , Jonathan Cameron , Davidlohr Bueso , linux-kernel@vger.kernel.org, linux-cxl@vger.kernel.org Subject: Re: [RFC PATCH 1/9] cxl/mem: Implement Get Event Records command Message-ID: <20220816124128.618948e9@gandalf.local.home> In-Reply-To: <20220816123958.2b49674a@gandalf.local.home> References: <20220813053243.757363-1-ira.weiny@intel.com> <20220813053243.757363-2-ira.weiny@intel.com> <20220816123958.2b49674a@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 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 Tue, 16 Aug 2022 12:39:58 -0400 Steven Rostedt wrote: > > + record_count = le16_to_cpu(payload.record_count); > > + if (record_count > 0) > > + trace_cxl_event(dev_name(cxlds->dev), type, > > + &payload.record); > > + > > + if (payload.flags & CXL_GET_EVENT_FLAG_OVERFLOW) > > + trace_cxl_event_overflow(dev_name(cxlds->dev), type, > > + &payload); > > If you want to avoid the compare operations when the tracepoints are not > enabled, you can add: > > if (trace_cxl_event_enabled()) { > if (record_count > 0) > trace_cxl_event(dev_name(cxlds->dev), type, > &payload.record); > } > > if (trace_cxl_event_overflow_enabled()) { > if (payload.flags & CXL_GET_EVENT_FLAG_OVERFLOW) > trace_cxl_event_overflow(dev_name(cxlds->dev), type, > &payload); > } > > Those "_enabled()" functions are static branches. Which means > when not enabled it's a nop that skips this code, and when either is > enabled, it turns into a jump to the contents of the if block. Ignore this suggestion. I see in the second patch you add more logic to the if condition. Only use this suggestion if the logic is only for when the tracepoint is enabled. -- Steve