lkml.org 
[lkml]   [2022]   [Sep]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 4/9] cxl/mem: Trace General Media Event Record
On Mon, 12 Sep 2022 15:38:21 -0700
Ira Weiny <ira.weiny@intel.com> wrote:

> On Wed, Aug 24, 2022 at 05:11:13PM +0100, Jonathan Cameron wrote:
> > On Fri, 12 Aug 2022 22:32:38 -0700
> > ira.weiny@intel.com wrote:
> >
> > > From: Ira Weiny <ira.weiny@intel.com>
> > >
> > > CXL v3.0 section 8.2.9.2.1.1 defines the General Media Event Record.
> > >
> > > Determine if the event read is a general media record and if so trace
> > > the record.
> > >
> > > Signed-off-by: Ira Weiny <ira.weiny@intel.com>
> > A few trivial things inline...
> >
>
> [snip]
>
> > > +/*
> > > + * General Media Event Record - GMER
> > > + * CXL v2.0 Section 8.2.9.1.1.1; Table 154
> > > + */
> > > +#define CXL_GMER_PHYS_ADDR_VOLATILE BIT(0)
> > > +#define CXL_GMER_PHYS_ADDR_MASK 0x3f
> >
> > Inverse of mask is confusing. Just specify the full mask.
>
> Fixed
>
> [snip]
>
> > > + TP_printk("%s: %s time=%llu id=%pUl handle=%x related_handle=%x hdr_flags='%s': " \
> > > + "phys_addr=%llx volatile=%s desc='%s' type='%s' trans_type='%s' channel=%u " \
> > > + "rank=%u device=%x comp_id=%s valid_flags='%s'",
> > > + __get_str(dev_name), show_log_type(__entry->log),
> > > + __entry->timestamp, __entry->id, __entry->handle,
> > > + __entry->related_handle, show_hdr_flags(__entry->flags),
> > > + __entry->phys_addr & ~CXL_GMER_PHYS_ADDR_MASK,
> > > + (__entry->phys_addr & CXL_GMER_PHYS_ADDR_VOLATILE) ? "TRUE" : "FALSE",
> > > + show_event_desc_flags(__entry->descriptor),
> > > + show_mem_event_type(__entry->type),
> > > + show_trans_type(__entry->transaction_type),
> > > + __entry->channel, __entry->rank, __entry->device,
> > > + __print_hex(__entry->comp_id, CXL_EVT_GEN_MED_COMP_ID_SIZE),
> > > + show_valid_flags(__entry->validity_flags)
> >
> > Can we make the printing of fields with valid flags conditional?
> > Been a while since I wrote a Trace point, but I think I recall doing that..
>
> I'm not seeing a way right off. But I can't say it is impossible...

Needs some helper code... Here's one I made earlier (and had almost entirely
banished from my memory!)

https://lore.kernel.org/all/20191114133919.32290-2-Jonathan.Cameron@huawei.com/

>
> I'll keep an eye out as I clean the series up,
> Ira
>
> >
> > > + )
> > > +);
> > > +
> > > #endif /* _CXL_TRACE_EVENTS_H */
> > >
> > > /* This part must be outside protection */
> >

\
 
 \ /
  Last update: 2022-09-20 17:54    [W:0.081 / U:0.908 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site