drm/xe/guc: Add new debugfs entry for lfd format output

Add new debugfs entry "guc_log_lfd", prepared for output guc log
in LFD(Log Format Descriptors) format.

Signed-off-by: Zhanjun Dong <zhanjun.dong@intel.com>
Reviewed-by: Julia Filipchuk <julia.filipchuk@intel.com>
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Link: https://patch.msgid.link/20251127170759.2620994-7-zhanjun.dong@intel.com
This commit is contained in:
Zhanjun Dong 2025-11-27 12:07:59 -05:00 committed by Ashutosh Dixit
parent 09fb6bccef
commit c7ea291be0
3 changed files with 23 additions and 3 deletions

View File

@ -81,6 +81,12 @@ static int guc_log(struct xe_guc *guc, struct drm_printer *p)
return 0;
}
static int guc_log_lfd(struct xe_guc *guc, struct drm_printer *p)
{
xe_guc_log_print_lfd(&guc->log, p);
return 0;
}
static int guc_log_dmesg(struct xe_guc *guc, struct drm_printer *p)
{
xe_guc_log_print_dmesg(&guc->log);
@ -117,6 +123,7 @@ static const struct drm_info_list slpc_debugfs_list[] = {
/* everything else should be added here */
static const struct drm_info_list pf_only_debugfs_list[] = {
{ "guc_log", .show = guc_debugfs_show, .data = guc_log },
{ "guc_log_lfd", .show = guc_debugfs_show, .data = guc_log_lfd },
{ "guc_log_dmesg", .show = guc_debugfs_show, .data = guc_log_dmesg },
};

View File

@ -542,9 +542,7 @@ xe_guc_log_add_crash_dump(struct drm_printer *p, struct xe_guc_log_snapshot *sna
return size;
}
void
xe_guc_log_snapshot_print_lfd(struct xe_guc_log_snapshot *snapshot, struct drm_printer *p);
void
static void
xe_guc_log_snapshot_print_lfd(struct xe_guc_log_snapshot *snapshot, struct drm_printer *p)
{
struct guc_lfd_file_header header;
@ -609,6 +607,20 @@ void xe_guc_log_print(struct xe_guc_log *log, struct drm_printer *p)
xe_guc_log_snapshot_free(snapshot);
}
/**
* xe_guc_log_print_lfd - dump a copy of the GuC log in LFD format
* @log: GuC log structure
* @p: the printer object to output to
*/
void xe_guc_log_print_lfd(struct xe_guc_log *log, struct drm_printer *p)
{
struct xe_guc_log_snapshot *snapshot;
snapshot = xe_guc_log_snapshot_capture(log, false);
xe_guc_log_snapshot_print_lfd(snapshot, p);
xe_guc_log_snapshot_free(snapshot);
}
int xe_guc_log_init(struct xe_guc_log *log)
{
struct xe_device *xe = log_to_xe(log);

View File

@ -52,6 +52,7 @@ struct xe_device;
int xe_guc_log_init(struct xe_guc_log *log);
void xe_guc_log_print(struct xe_guc_log *log, struct drm_printer *p);
void xe_guc_log_print_lfd(struct xe_guc_log *log, struct drm_printer *p);
void xe_guc_log_print_dmesg(struct xe_guc_log *log);
struct xe_guc_log_snapshot *xe_guc_log_snapshot_capture(struct xe_guc_log *log, bool atomic);
void xe_guc_log_snapshot_print(struct xe_guc_log_snapshot *snapshot, struct drm_printer *p);