[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220816124128.618948e9@gandalf.local.home>
Date: Tue, 16 Aug 2022 12:41:28 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: ira.weiny@...el.com
Cc: Dan Williams <dan.j.williams@...el.com>,
Alison Schofield <alison.schofield@...el.com>,
Vishal Verma <vishal.l.verma@...el.com>,
Ben Widawsky <bwidawsk@...nel.org>,
Jonathan Cameron <Jonathan.Cameron@...wei.com>,
Davidlohr Bueso <dave@...olabs.net>,
linux-kernel@...r.kernel.org, linux-cxl@...r.kernel.org
Subject: Re: [RFC PATCH 1/9] cxl/mem: Implement Get Event Records command
On Tue, 16 Aug 2022 12:39:58 -0400
Steven Rostedt <rostedt@...dmis.org> 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 "<tracepoint>_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
Powered by blists - more mailing lists