diff --git a/drivers/gpu/drm/xe/xe_log.h b/drivers/gpu/drm/xe/xe_log.h index 916218560297..c30db02950b0 100644 --- a/drivers/gpu/drm/xe/xe_log.h +++ b/drivers/gpu/drm/xe/xe_log.h @@ -85,4 +85,22 @@ void xe_log_emit(struct pci_dev *pdev, int cper_sev, enum xe_sigid sigid, xe_log_from((any), CPER_SEV_INFORMATIONAL, (sig), (comp), \ (data), (len), fmt, ##args) +/** + * xe_log_comp() - Emit a structured SIGID log entry on the component behalf. + * @any: the &xe_device or &xe_tile or &xe_gt pointer this report relates to + * @cper_sev: CPER severity (CPER_SEV_FATAL, CPER_SEV_RECOVERABLE, ...) + * @TAG: the component tag to use + * @data: pointer to the additional details, or ERR_PTR, or NULL if not applicable + * @len: length of the @data in bytes, or 0 if not applicable + * @fmt: printf-style free text format string (not a stable interface) + * @args: arguments for the @fmt format string + * + * The SIGID will be determined from the component's @TAG. + * The component identifier will be determined from the component's @TAG. + * The location used to emit SIGID entry will be based on the @any pointer type. + */ +#define xe_log_comp(any, cper_sev, TAG, data, len, fmt, args...) \ + xe_log_from((any), (cper_sev), (int)XE_LOG_COMPONENT_##TAG##_SIGID, \ + XE_LOG_COMPONENT_##TAG, (data), (len), fmt, ##args) + #endif