lkml.org 
[lkml]   [2022]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 1/9] cxl/mem: Implement Get Event Records command
On Tue, 16 Aug 2022 12:39:58 -0400
Steven Rostedt <rostedt@goodmis.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

\
 
 \ /
  Last update: 2022-08-16 18:43    [W:0.475 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site