Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The generic format string injected into the printk index does not structurally match the actual strings emitted to dmesg, breaking userspace log matching.
--
--- Patch [11]: [PATCH v4 11/32] drm/xe/log: Index all SIGID printk messages ---
commit f6d6ae64e4098e49206f6df0c6d973a867e46f50
Author: Michal Wajdeczko <[email protected]>
drm/xe/log: Index all SIGID printk messages
This commit explicitly generates printk index entries using
dev_printk_index_emit() for xe_log_emit() messages. This ensures that
device level printk messages generated with varying prefixes are correctly
indexed for audit.
> diff --git a/drivers/gpu/drm/xe/xe_log.h b/drivers/gpu/drm/xe/xe_log.h
> index 0928b08666171..53fe2bb7ddd37 100644
> --- a/drivers/gpu/drm/xe/xe_log.h
> +++ b/drivers/gpu/drm/xe/xe_log.h
> @@ -16,9 +16,17 @@
> struct pci_dev;
>
> __printf(8, 9)
> -void xe_log_emit(struct pci_dev *pdev, int cper_sev, enum xe_sigid sigid,
> - u32 component, u32 location, const void *data, size_t len,
> - const char *fmt, ...);
> +void __xe_log_emit(struct pci_dev *pdev, int cper_sev, enum xe_sigid sigid,
> + u32 component, u32 location, const void *data, size_t len,
> + const char *fmt, ...);
> +
> +#define __xe_log_emit_printk_index(fmt) \
> + dev_printk_index_emit(NULL, "[drm]%s SIGID=%u %s(%s)%s%s%s: " fmt);
[Severity: Medium]
Does this hardcoded format string structurally diverge from the actual strings
emitted to dmesg?
Looking at log_emit_dmesg() in drivers/gpu/drm/xe/xe_log.c, when the data
parameter is NULL, the format string dynamically omits the parentheses:
else
log_dmesg_printf(pdev, cper_sev, "SIGID=%u %s%s%s%s%pV",
sigid, sev_prefix, hwe_prefix,
loc_prefix, comp_prefix, vaf);
Since the static string registered here contains literal parentheses and a
trailing colon, but these characters are dynamically omitted when data is
NULL or component is 0, will this mismatch cause regexes or exact-match
parsers generated from the index to fail to match the logs?
--
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=11
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.