Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [Medium] The `cxl_dynamic_capacity` tracepoint omits `validity_flags` and 
other critical diagnostic fields, leaving userspace unable to validate parsed 
values.
--

commit 7da6c652fcb2ca33cefdf89b66affc0318921f70
Author: Ira Weiny <[email protected]>

cxl/mem: Trace Dynamic capacity Event Record

This commit adds tracepoints for CXL Dynamic Capacity Event Records defined
in the CXL specification. It enables user space debugging of DC capacity
changes by exposing the events through the trace log.

> diff --git a/drivers/cxl/core/trace.h b/drivers/cxl/core/trace.h
> index a972e4ef19368..e5b88887d11b5 100644
> --- a/drivers/cxl/core/trace.h
> +++ b/drivers/cxl/core/trace.h

[ ... ]

> +TRACE_EVENT(cxl_dynamic_capacity,
> +
> +     TP_PROTO(const struct cxl_memdev *cxlmd, enum cxl_event_log_type log,
> +              struct cxl_event_dcd *rec),
> +
> +     TP_ARGS(cxlmd, log, rec),
> +
> +     TP_STRUCT__entry(
> +             CXL_EVT_TP_entry
> +
> +             /* Dynamic capacity Event */
> +             __field(u8, event_type)
> +             __field(u16, hostid)
> +             __field(u8, updated_region_index)
> +             __field(u64, dpa_start)
> +             __field(u64, length)
> +             __array(u8, uuid, UUID_SIZE)
> +             __field(u16, sh_extent_seq)
> +     ),

[Severity: Medium]
Are we missing some diagnostic fields from struct cxl_event_dcd in
this tracepoint definition? 

It appears that validity_flags, flags (which contains the More bit),
num_avail_extents, and num_avail_tags are omitted here. Without
validity_flags, user space might be unable to determine if hostid and
updated_region_index contain valid data or hardware garbage. Additionally,
dropping the flags field could prevent user space from properly piecing
together multi-record capacity changes using the More bit.

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=28

Reply via email to