@@ -346,6 +346,98 @@ TRACE_EVENT(cxl_general_media,
346
346
)
347
347
);
348
348
349
+ /*
350
+ * DRAM Event Record - DER
351
+ *
352
+ * CXL rev 3.0 section 8.2.9.2.1.2; Table 8-44
353
+ */
354
+ /*
355
+ * DRAM Event Record defines many fields the same as the General Media Event
356
+ * Record. Reuse those definitions as appropriate.
357
+ */
358
+ #define CXL_DER_VALID_CHANNEL BIT(0)
359
+ #define CXL_DER_VALID_RANK BIT(1)
360
+ #define CXL_DER_VALID_NIBBLE BIT(2)
361
+ #define CXL_DER_VALID_BANK_GROUP BIT(3)
362
+ #define CXL_DER_VALID_BANK BIT(4)
363
+ #define CXL_DER_VALID_ROW BIT(5)
364
+ #define CXL_DER_VALID_COLUMN BIT(6)
365
+ #define CXL_DER_VALID_CORRECTION_MASK BIT(7)
366
+ #define show_dram_valid_flags (flags ) __print_flags(flags, "|", \
367
+ { CXL_DER_VALID_CHANNEL, "CHANNEL" }, \
368
+ { CXL_DER_VALID_RANK, "RANK" }, \
369
+ { CXL_DER_VALID_NIBBLE, "NIBBLE" }, \
370
+ { CXL_DER_VALID_BANK_GROUP, "BANK GROUP" }, \
371
+ { CXL_DER_VALID_BANK, "BANK" }, \
372
+ { CXL_DER_VALID_ROW, "ROW" }, \
373
+ { CXL_DER_VALID_COLUMN, "COLUMN" }, \
374
+ { CXL_DER_VALID_CORRECTION_MASK, "CORRECTION MASK" } \
375
+ )
376
+
377
+ TRACE_EVENT (cxl_dram ,
378
+
379
+ TP_PROTO (const struct device * dev , enum cxl_event_log_type log ,
380
+ struct cxl_event_dram * rec ),
381
+
382
+ TP_ARGS (dev , log , rec ),
383
+
384
+ TP_STRUCT__entry (
385
+ CXL_EVT_TP_entry
386
+ /* DRAM */
387
+ __field (u64 , dpa )
388
+ __field (u8 , descriptor )
389
+ __field (u8 , type )
390
+ __field (u8 , transaction_type )
391
+ __field (u8 , channel )
392
+ __field (u16 , validity_flags )
393
+ __field (u16 , column ) /* Out of order to pack trace record */
394
+ __field (u32 , nibble_mask )
395
+ __field (u32 , row )
396
+ __array (u8 , cor_mask , CXL_EVENT_DER_CORRECTION_MASK_SIZE )
397
+ __field (u8 , rank ) /* Out of order to pack trace record */
398
+ __field (u8 , bank_group ) /* Out of order to pack trace record */
399
+ __field (u8 , bank ) /* Out of order to pack trace record */
400
+ __field (u8 , dpa_flags ) /* Out of order to pack trace record */
401
+ ),
402
+
403
+ TP_fast_assign (
404
+ CXL_EVT_TP_fast_assign (dev , log , rec -> hdr );
405
+
406
+ /* DRAM */
407
+ __entry -> dpa = le64_to_cpu (rec -> phys_addr );
408
+ __entry -> dpa_flags = __entry -> dpa & CXL_DPA_FLAGS_MASK ;
409
+ __entry -> dpa &= CXL_DPA_MASK ;
410
+ __entry -> descriptor = rec -> descriptor ;
411
+ __entry -> type = rec -> type ;
412
+ __entry -> transaction_type = rec -> transaction_type ;
413
+ __entry -> validity_flags = get_unaligned_le16 (rec -> validity_flags );
414
+ __entry -> channel = rec -> channel ;
415
+ __entry -> rank = rec -> rank ;
416
+ __entry -> nibble_mask = get_unaligned_le24 (rec -> nibble_mask );
417
+ __entry -> bank_group = rec -> bank_group ;
418
+ __entry -> bank = rec -> bank ;
419
+ __entry -> row = get_unaligned_le24 (rec -> row );
420
+ __entry -> column = get_unaligned_le16 (rec -> column );
421
+ memcpy (__entry -> cor_mask , & rec -> correction_mask ,
422
+ CXL_EVENT_DER_CORRECTION_MASK_SIZE );
423
+ ),
424
+
425
+ CXL_EVT_TP_printk ("dpa=%llx dpa_flags='%s' descriptor='%s' type='%s' " \
426
+ "transaction_type='%s' channel=%u rank=%u nibble_mask=%x " \
427
+ "bank_group=%u bank=%u row=%u column=%u cor_mask=%s " \
428
+ "validity_flags='%s'" ,
429
+ __entry -> dpa , show_dpa_flags (__entry -> dpa_flags ),
430
+ show_event_desc_flags (__entry -> descriptor ),
431
+ show_mem_event_type (__entry -> type ),
432
+ show_trans_type (__entry -> transaction_type ),
433
+ __entry -> channel , __entry -> rank , __entry -> nibble_mask ,
434
+ __entry -> bank_group , __entry -> bank ,
435
+ __entry -> row , __entry -> column ,
436
+ __print_hex (__entry -> cor_mask , CXL_EVENT_DER_CORRECTION_MASK_SIZE ),
437
+ show_dram_valid_flags (__entry -> validity_flags )
438
+ )
439
+ );
440
+
349
441
#endif /* _CXL_EVENTS_H */
350
442
351
443
#define TRACE_INCLUDE_FILE trace
0 commit comments