[ndctl PATCH] cxl/test: Add test case for region info to cxl-events.sh

2024-03-27 Thread alison . schofield
From: Alison Schofield Events cxl_general_media and cxl_dram both report DPAs that may be mapped in a region. If the DPA is mapped, the trace event will include the HPA translation, region name and region uuid in the trace event. Add a test case that triggers these events with DPAs that map

[ndctl PATCH v12 0/8] Support poison list retrieval

2024-03-27 Thread alison . schofield
From: Alison Schofield Changes since v11: - Remove needless rc init (DaveJ) - Update man page examples (Wonjae, Dan) - Replace fprintf() w err() in libcxl.c (Fan) - Update stale --poison comment in unit test (Wonjae) - Move ndctl/cxl/event_trace.c/.h to ndctl/util/ (Dan) - Constify the pointer

[ndctl PATCH v12 2/8] util/trace: add an optional pid check to event parsing

2024-03-27 Thread alison . schofield
From: Alison Schofield When parsing events, callers may only be interested in events that originate from the current process. Introduce an optional argument to the event trace context: event_pid. When event_pid is present, simply skip the parsing of events without a matching pid. It is not a

Re: [ndctl PATCH v11 6/7] cxl/list: add --media-errors option to cxl list

2024-03-27 Thread Alison Schofield
On Thu, Mar 14, 2024 at 08:35:01PM -0700, Dan Williams wrote: > Alison Schofield wrote: > > On Fri, Mar 15, 2024 at 10:09:44AM +0900, Wonjae Lee wrote: > > > alison.schofi...@intel.com wrote: > > > > From: Alison Schofield > > > > > > > > The --media-errors option to 'cxl list' retrieves poison

[ndctl PATCH] cxl/test: use max_available_extent in cxl-destroy-region

2024-03-27 Thread alison . schofield
From: Alison Schofield Using .size in decoder selection can lead to a set_size failure with these error messages: cxl region: create_region: region8: set_size failed: Numerical result out of range [] cxl_core:alloc_hpa:555: cxl region8: HPA allocation error (-34) for size:0x2000

[ndctl PATCH v12 6/8] cxl/list: collect and parse media_error records

2024-03-27 Thread alison . schofield
From: Alison Schofield Media_error records are logged as events in the kernel tracing subsystem. To prepare the media_error records for cxl list, enable tracing, trigger the poison list read, and parse the generated cxl_poison events into a json representation. Use the event_trace private

[ndctl PATCH v12 5/8] libcxl: add interfaces for GET_POISON_LIST mailbox commands

2024-03-27 Thread alison . schofield
From: Alison Schofield CXL devices maintain a list of locations that are poisoned or result in poison if the addresses are accessed by the host. Per the spec (CXL 3.1 8.2.9.9.4.1), the device returns the Poison List as a set of Media Error Records that include the source of the error, the

[ndctl PATCH v12 8/8] cxl/test: add cxl-poison.sh unit test

2024-03-27 Thread alison . schofield
From: Alison Schofield Exercise cxl list, libcxl, and driver pieces of the get poison list pathway. Inject and clear poison using debugfs and use cxl-cli to read the poison list by memdev and by region. Signed-off-by: Alison Schofield Reviewed-by: Dave Jiang --- test/cxl-poison.sh | 137

[ndctl PATCH v12 7/8] cxl/list: add --media-errors option to cxl list

2024-03-27 Thread alison . schofield
From: Alison Schofield The --media-errors option to 'cxl list' retrieves poison lists from memory devices supporting the capability and displays the returned media_error records in the cxl list json. This option can apply to memdevs or regions. Include media-errors in the -vvv verbose option.

[ndctl PATCH v12 1/8] util/trace: move trace helpers from ndctl/cxl/ to ndctl/util/

2024-03-27 Thread alison . schofield
From: Alison Schofield A set of helpers used to parse kernel trace events were introduced in ndctl/cxl/ in support of the CXL monitor command. The work these helpers perform may be useful beyond CXL. Move them to the ndctl/util/ where other generic helpers reside. Replace cxl-ish naming with

[ndctl PATCH v12 3/8] util/trace: pass an event_ctx to its own parse_event method

2024-03-27 Thread alison . schofield
From: Alison Schofield Tidy-up the calling convention used in trace event parsing by passing the entire event_ctx to its parse_event method. This makes it explicit that a parse_event operates on an event_ctx object and it allows the parse_event function to access any members of the event_ctx

[ndctl PATCH v12 4/8] util/trace: add helpers to retrieve tep fields by type

2024-03-27 Thread alison . schofield
From: Alison Schofield Add helpers to extract the value of an event record field given the field name. This is useful when the user knows the name and format of the field and simply needs to get it. The helpers also return the 'type'_MAX of the type when the field is Since this is in