Skip to content

Commit 5e31e34

Browse files
shijujose4davejiang
authored andcommitted
cxl/events: Update Common Event Record to CXL spec rev 3.1
CXL spec 3.1 section 8.2.9.2.1 Table 8-42, Common Event Record format has updated with Maintenance Operation Subclass information. Add updates for the above spec change in the CXL events record and CXL common trace event implementations. Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Davidlohr Bueso <dave@stgolabs.net> Reviewed-by: Ira Weiny <ira.weiny@intel.com> Signed-off-by: Shiju Jose <shiju.jose@huawei.com> Reviewed-by: Fan Ni <fan.ni@samsung.com> Link: https://patch.msgid.link/20250111091756.1682-2-shiju.jose@huawei.com Signed-off-by: Dave Jiang <dave.jiang@intel.com>
1 parent 2f84d07 commit 5e31e34

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

drivers/cxl/core/trace.h

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,13 @@ TRACE_EVENT(cxl_overflow,
166166
#define CXL_EVENT_RECORD_FLAG_MAINT_NEEDED BIT(3)
167167
#define CXL_EVENT_RECORD_FLAG_PERF_DEGRADED BIT(4)
168168
#define CXL_EVENT_RECORD_FLAG_HW_REPLACE BIT(5)
169+
#define CXL_EVENT_RECORD_FLAG_MAINT_OP_SUB_CLASS_VALID BIT(6)
169170
#define show_hdr_flags(flags) __print_flags(flags, " | ", \
170171
{ CXL_EVENT_RECORD_FLAG_PERMANENT, "PERMANENT_CONDITION" }, \
171172
{ CXL_EVENT_RECORD_FLAG_MAINT_NEEDED, "MAINTENANCE_NEEDED" }, \
172173
{ CXL_EVENT_RECORD_FLAG_PERF_DEGRADED, "PERFORMANCE_DEGRADED" }, \
173-
{ CXL_EVENT_RECORD_FLAG_HW_REPLACE, "HARDWARE_REPLACEMENT_NEEDED" } \
174+
{ CXL_EVENT_RECORD_FLAG_HW_REPLACE, "HARDWARE_REPLACEMENT_NEEDED" }, \
175+
{ CXL_EVENT_RECORD_FLAG_MAINT_OP_SUB_CLASS_VALID, "MAINT_OP_SUB_CLASS_VALID" } \
174176
)
175177

176178
/*
@@ -197,7 +199,8 @@ TRACE_EVENT(cxl_overflow,
197199
__field(u16, hdr_related_handle) \
198200
__field(u64, hdr_timestamp) \
199201
__field(u8, hdr_length) \
200-
__field(u8, hdr_maint_op_class)
202+
__field(u8, hdr_maint_op_class) \
203+
__field(u8, hdr_maint_op_sub_class)
201204

202205
#define CXL_EVT_TP_fast_assign(cxlmd, l, hdr) \
203206
__assign_str(memdev); \
@@ -209,17 +212,19 @@ TRACE_EVENT(cxl_overflow,
209212
__entry->hdr_handle = le16_to_cpu((hdr).handle); \
210213
__entry->hdr_related_handle = le16_to_cpu((hdr).related_handle); \
211214
__entry->hdr_timestamp = le64_to_cpu((hdr).timestamp); \
212-
__entry->hdr_maint_op_class = (hdr).maint_op_class
215+
__entry->hdr_maint_op_class = (hdr).maint_op_class; \
216+
__entry->hdr_maint_op_sub_class = (hdr).maint_op_sub_class
213217

214218
#define CXL_EVT_TP_printk(fmt, ...) \
215219
TP_printk("memdev=%s host=%s serial=%lld log=%s : time=%llu uuid=%pUb " \
216220
"len=%d flags='%s' handle=%x related_handle=%x " \
217-
"maint_op_class=%u : " fmt, \
221+
"maint_op_class=%u maint_op_sub_class=%u : " fmt, \
218222
__get_str(memdev), __get_str(host), __entry->serial, \
219223
cxl_event_log_type_str(__entry->log), \
220224
__entry->hdr_timestamp, &__entry->hdr_uuid, __entry->hdr_length,\
221225
show_hdr_flags(__entry->hdr_flags), __entry->hdr_handle, \
222226
__entry->hdr_related_handle, __entry->hdr_maint_op_class, \
227+
__entry->hdr_maint_op_sub_class, \
223228
##__VA_ARGS__)
224229

225230
TRACE_EVENT(cxl_generic_event,

include/cxl/event.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ struct cxl_event_record_hdr {
1818
__le16 related_handle;
1919
__le64 timestamp;
2020
u8 maint_op_class;
21-
u8 reserved[15];
21+
u8 maint_op_sub_class;
22+
u8 reserved[14];
2223
} __packed;
2324

2425
struct cxl_event_media_hdr {

0 commit comments

Comments
 (0)