Re: [PATCH v2 08/22] drm/xe/log: Add SIGID log helpers for components

Michal Wajdeczko <[email protected]>
Newsgroups org.freedesktop.lists.intel-xe
Message-ID <[email protected]>

On 7/29/2026 10:06 AM, Jani Nikula wrote:
> On Tue, 28 Jul 2026, Michal Wajdeczko <[email protected]> wrote:
>> Our component list already defines relation between the component
>> name, identified by the TAG, and its numerical identifier and the
>> assigned SIGID. We can also already prepare location identifier
>> based on the pointer type used to emit the log entry. Add helper
>> that will prepare SIGID, COMPONENT and LOCATION parameters for
>> xe_log_emit() using provided componentn TAG and the pointer.
>>
>> Signed-off-by: Michal Wajdeczko <[email protected]>
>> Cc: Rodrigo Vivi <[email protected]>
>> ---
>> Cc: Aravind Iddamsetty <[email protected]>
>> Cc: Mallesh Koujalagi <[email protected]>
>> ---
>> v2: rebased/simplified (Michal)
>> ---
>>  drivers/gpu/drm/xe/xe_log.h | 18 ++++++++++++++++++
>>  1 file changed, 18 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/xe/xe_log.h b/drivers/gpu/drm/xe/xe_log.h
>> index 43deaf93ce3e..b0f50aa35a96 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), (loc), \
>>  		    (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)
> 
> I understand you want to use a short TAG at call sites, but the string
> concatenation means cscope/global can't find any of them, and you have
> to resort to git grep.

but there should be no need to look for full enum names, as those are
only needed for internal use by the macros. And "grep -w TAG" shall
point you to the component definitions in xe_log_abi.h (PATCH 3/22)

> 
> BR,
> Jani.
> 
>> +
>>  #endif
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.