@@ -344,6 +344,72 @@ OPTIONS
--region::
Specify CXL region device name(s), or device id(s), to filter the listing.
+-a::
+--media-errors::
+ Include media-error information. The poison list is retrieved
+ from the device(s) and media error records are added to the
+ listing. When the request is by region, memdev names and
+ host physical addresses are added to the record.
+
+----
+# cxl list -m mem11 --media-errors
+[
+ {
+ "memdev":"mem11",
+ "pmem_size":268435456,
+ "ram_size":0,
+ "serial":0,
+ "host":"0000:37:00.0",
+ "media_errors":{
+ "nr media-errors":1,
+ "media-error records":[
+ {
+ "dpa":0,
+ "length":64,
+ "source":"Internal",
+ "flags":"",
+ "overflow_time":0
+ }
+ ]
+ }
+ }
+]
+# cxl list -r region5 --media-errors
+[
+ {
+ "region":"region5",
+ "resource":1035623989248,
+ "size":2147483648,
+ "interleave_ways":2,
+ "interleave_granularity":4096,
+ "decode_state":"commit",
+ "media_errors":{
+ "nr media-errors":2,
+ "media-error records":[
+ {
+ "memdev":"mem2",
+ "hpa":0,
+ "dpa":0,
+ "length":64,
+ "source":"Internal",
+ "flags":"",
+ "overflow_time":0
+ },
+ {
+ "memdev":"mem5",
+ "hpa":0,
+ "dpa":1792,
+ "length":512,
+ "source":"Vendor",
+ "flags":"",
+ "overflow_time":0
+ }
+ ]
+ }
+ }
+]
+----
+
-v::
--verbose::
Increase verbosity of the output. This can be specified
@@ -686,6 +686,8 @@ static unsigned long params_to_flags(struct cxl_filter_params *param)
flags |= UTIL_JSON_TARGETS;
if (param->partition)
flags |= UTIL_JSON_PARTITION;
+ if (param->media_errors)
+ flags |= UTIL_JSON_MEDIA_ERRORS;
return flags;
}
@@ -26,6 +26,7 @@ struct cxl_filter_params {
bool human;
bool health;
bool partition;
+ bool media_errors;
int verbose;
struct log_ctx ctx;
};
@@ -52,6 +52,8 @@ static const struct option options[] = {
"include memory device health information"),
OPT_BOOLEAN('I', "partition", ¶m.partition,
"include memory device partition information"),
+ OPT_BOOLEAN('a', "media-errors", ¶m.media_errors,
+ "include media error information "),
OPT_INCR('v', "verbose", ¶m.verbose,
"increase output detail"),
#ifdef ENABLE_DEBUG