Skip to content

Commit

Permalink
drm/xe/trace: Extract guc related traces
Browse files Browse the repository at this point in the history
xe_trace.h is starting to get over crowded. Move the traces
related to guc to its own file.

v2: Update year in License(Gustavo)

Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com>
Suggested-by: Jani Nikula <jani.nikula@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Radhakrishna Sripada <radhakrishna.sripada@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240607182943.3572524-3-radhakrishna.sripada@intel.com
  • Loading branch information
Radhakrishna Sripada authored and Matt Roper committed Jun 12, 2024
1 parent e46d3f8 commit 6a04e1f
Show file tree
Hide file tree
Showing 5 changed files with 114 additions and 81 deletions.
1 change: 1 addition & 0 deletions drivers/gpu/drm/xe/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ xe-y += xe_bb.o \
xe_tile_sysfs.o \
xe_trace.o \
xe_trace_bo.o \
xe_trace_guc.o \
xe_ttm_sys_mgr.o \
xe_ttm_stolen_mgr.o \
xe_ttm_vram_mgr.o \
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/xe/xe_guc_ct.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "xe_guc_submit.h"
#include "xe_map.h"
#include "xe_pm.h"
#include "xe_trace.h"
#include "xe_trace_guc.h"

/* Used when a CT send wants to block and / or receive data */
struct g2h_fence {
Expand Down
80 changes: 0 additions & 80 deletions drivers/gpu/drm/xe/xe_trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -332,86 +332,6 @@ DEFINE_EVENT(xe_hw_fence, xe_hw_fence_free,
TP_ARGS(fence)
);

/* GuC */
DECLARE_EVENT_CLASS(xe_guc_ct_flow_control,
TP_PROTO(u32 _head, u32 _tail, u32 size, u32 space, u32 len),
TP_ARGS(_head, _tail, size, space, len),

TP_STRUCT__entry(
__field(u32, _head)
__field(u32, _tail)
__field(u32, size)
__field(u32, space)
__field(u32, len)
),

TP_fast_assign(
__entry->_head = _head;
__entry->_tail = _tail;
__entry->size = size;
__entry->space = space;
__entry->len = len;
),

TP_printk("h2g flow control: head=%u, tail=%u, size=%u, space=%u, len=%u",
__entry->_head, __entry->_tail, __entry->size,
__entry->space, __entry->len)
);

DEFINE_EVENT(xe_guc_ct_flow_control, xe_guc_ct_h2g_flow_control,
TP_PROTO(u32 _head, u32 _tail, u32 size, u32 space, u32 len),
TP_ARGS(_head, _tail, size, space, len)
);

DEFINE_EVENT_PRINT(xe_guc_ct_flow_control, xe_guc_ct_g2h_flow_control,
TP_PROTO(u32 _head, u32 _tail, u32 size, u32 space, u32 len),
TP_ARGS(_head, _tail, size, space, len),

TP_printk("g2h flow control: head=%u, tail=%u, size=%u, space=%u, len=%u",
__entry->_head, __entry->_tail, __entry->size,
__entry->space, __entry->len)
);

DECLARE_EVENT_CLASS(xe_guc_ctb,
TP_PROTO(u8 gt_id, u32 action, u32 len, u32 _head, u32 tail),
TP_ARGS(gt_id, action, len, _head, tail),

TP_STRUCT__entry(
__field(u8, gt_id)
__field(u32, action)
__field(u32, len)
__field(u32, tail)
__field(u32, _head)
),

TP_fast_assign(
__entry->gt_id = gt_id;
__entry->action = action;
__entry->len = len;
__entry->tail = tail;
__entry->_head = _head;
),

TP_printk("gt%d: H2G CTB: action=0x%x, len=%d, tail=%d, head=%d\n",
__entry->gt_id, __entry->action, __entry->len,
__entry->tail, __entry->_head)
);

DEFINE_EVENT(xe_guc_ctb, xe_guc_ctb_h2g,
TP_PROTO(u8 gt_id, u32 action, u32 len, u32 _head, u32 tail),
TP_ARGS(gt_id, action, len, _head, tail)
);

DEFINE_EVENT_PRINT(xe_guc_ctb, xe_guc_ctb_g2h,
TP_PROTO(u8 gt_id, u32 action, u32 len, u32 _head, u32 tail),
TP_ARGS(gt_id, action, len, _head, tail),

TP_printk("gt%d: G2H CTB: action=0x%x, len=%d, tail=%d, head=%d\n",
__entry->gt_id, __entry->action, __entry->len,
__entry->tail, __entry->_head)

);

#endif

/* This part must be outside protection */
Expand Down
9 changes: 9 additions & 0 deletions drivers/gpu/drm/xe/xe_trace_guc.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright © 2024 Intel Corporation
*/

#ifndef __CHECKER__
#define CREATE_TRACE_POINTS
#include "xe_trace_guc.h"
#endif
103 changes: 103 additions & 0 deletions drivers/gpu/drm/xe/xe_trace_guc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright © 2024 Intel Corporation
*/

#undef TRACE_SYSTEM
#define TRACE_SYSTEM xe

#if !defined(_XE_TRACE_GUC_H_) || defined(TRACE_HEADER_MULTI_READ)
#define _XE_TRACE_GUC_H_

#include <linux/tracepoint.h>
#include <linux/types.h>

#include "xe_guc_exec_queue_types.h"

DECLARE_EVENT_CLASS(xe_guc_ct_flow_control,
TP_PROTO(u32 _head, u32 _tail, u32 size, u32 space, u32 len),
TP_ARGS(_head, _tail, size, space, len),

TP_STRUCT__entry(
__field(u32, _head)
__field(u32, _tail)
__field(u32, size)
__field(u32, space)
__field(u32, len)
),

TP_fast_assign(
__entry->_head = _head;
__entry->_tail = _tail;
__entry->size = size;
__entry->space = space;
__entry->len = len;
),

TP_printk("h2g flow control: head=%u, tail=%u, size=%u, space=%u, len=%u",
__entry->_head, __entry->_tail, __entry->size,
__entry->space, __entry->len)
);

DEFINE_EVENT(xe_guc_ct_flow_control, xe_guc_ct_h2g_flow_control,
TP_PROTO(u32 _head, u32 _tail, u32 size, u32 space, u32 len),
TP_ARGS(_head, _tail, size, space, len)
);

DEFINE_EVENT_PRINT(xe_guc_ct_flow_control, xe_guc_ct_g2h_flow_control,
TP_PROTO(u32 _head, u32 _tail, u32 size, u32 space, u32 len),
TP_ARGS(_head, _tail, size, space, len),

TP_printk("g2h flow control: head=%u, tail=%u, size=%u, space=%u, len=%u",
__entry->_head, __entry->_tail, __entry->size,
__entry->space, __entry->len)
);

DECLARE_EVENT_CLASS(xe_guc_ctb,
TP_PROTO(u8 gt_id, u32 action, u32 len, u32 _head, u32 tail),
TP_ARGS(gt_id, action, len, _head, tail),

TP_STRUCT__entry(
__field(u8, gt_id)
__field(u32, action)
__field(u32, len)
__field(u32, tail)
__field(u32, _head)
),

TP_fast_assign(
__entry->gt_id = gt_id;
__entry->action = action;
__entry->len = len;
__entry->tail = tail;
__entry->_head = _head;
),

TP_printk("gt%d: H2G CTB: action=0x%x, len=%d, tail=%d, head=%d\n",
__entry->gt_id, __entry->action, __entry->len,
__entry->tail, __entry->_head)
);

DEFINE_EVENT(xe_guc_ctb, xe_guc_ctb_h2g,
TP_PROTO(u8 gt_id, u32 action, u32 len, u32 _head, u32 tail),
TP_ARGS(gt_id, action, len, _head, tail)
);

DEFINE_EVENT_PRINT(xe_guc_ctb, xe_guc_ctb_g2h,
TP_PROTO(u8 gt_id, u32 action, u32 len, u32 _head, u32 tail),
TP_ARGS(gt_id, action, len, _head, tail),

TP_printk("gt%d: G2H CTB: action=0x%x, len=%d, tail=%d, head=%d\n",
__entry->gt_id, __entry->action, __entry->len,
__entry->tail, __entry->_head)

);

#endif

/* This part must be outside protection */
#undef TRACE_INCLUDE_PATH
#undef TRACE_INCLUDE_FILE
#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/xe
#define TRACE_INCLUDE_FILE xe_trace_guc
#include <trace/define_trace.h>

0 comments on commit 6a04e1f

Please sign in to comment.