Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/xe/trace: Extract guc related traces

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

authored by

Radhakrishna Sripada and committed by
Matt Roper
6a04e1fc e46d3f81

+114 -81
+1
drivers/gpu/drm/xe/Makefile
··· 113 113 xe_tile_sysfs.o \ 114 114 xe_trace.o \ 115 115 xe_trace_bo.o \ 116 + xe_trace_guc.o \ 116 117 xe_ttm_sys_mgr.o \ 117 118 xe_ttm_stolen_mgr.o \ 118 119 xe_ttm_vram_mgr.o \
+1 -1
drivers/gpu/drm/xe/xe_guc_ct.c
··· 29 29 #include "xe_guc_submit.h" 30 30 #include "xe_map.h" 31 31 #include "xe_pm.h" 32 - #include "xe_trace.h" 32 + #include "xe_trace_guc.h" 33 33 34 34 /* Used when a CT send wants to block and / or receive data */ 35 35 struct g2h_fence {
-80
drivers/gpu/drm/xe/xe_trace.h
··· 332 332 TP_ARGS(fence) 333 333 ); 334 334 335 - /* GuC */ 336 - DECLARE_EVENT_CLASS(xe_guc_ct_flow_control, 337 - TP_PROTO(u32 _head, u32 _tail, u32 size, u32 space, u32 len), 338 - TP_ARGS(_head, _tail, size, space, len), 339 - 340 - TP_STRUCT__entry( 341 - __field(u32, _head) 342 - __field(u32, _tail) 343 - __field(u32, size) 344 - __field(u32, space) 345 - __field(u32, len) 346 - ), 347 - 348 - TP_fast_assign( 349 - __entry->_head = _head; 350 - __entry->_tail = _tail; 351 - __entry->size = size; 352 - __entry->space = space; 353 - __entry->len = len; 354 - ), 355 - 356 - TP_printk("h2g flow control: head=%u, tail=%u, size=%u, space=%u, len=%u", 357 - __entry->_head, __entry->_tail, __entry->size, 358 - __entry->space, __entry->len) 359 - ); 360 - 361 - DEFINE_EVENT(xe_guc_ct_flow_control, xe_guc_ct_h2g_flow_control, 362 - TP_PROTO(u32 _head, u32 _tail, u32 size, u32 space, u32 len), 363 - TP_ARGS(_head, _tail, size, space, len) 364 - ); 365 - 366 - DEFINE_EVENT_PRINT(xe_guc_ct_flow_control, xe_guc_ct_g2h_flow_control, 367 - TP_PROTO(u32 _head, u32 _tail, u32 size, u32 space, u32 len), 368 - TP_ARGS(_head, _tail, size, space, len), 369 - 370 - TP_printk("g2h flow control: head=%u, tail=%u, size=%u, space=%u, len=%u", 371 - __entry->_head, __entry->_tail, __entry->size, 372 - __entry->space, __entry->len) 373 - ); 374 - 375 - DECLARE_EVENT_CLASS(xe_guc_ctb, 376 - TP_PROTO(u8 gt_id, u32 action, u32 len, u32 _head, u32 tail), 377 - TP_ARGS(gt_id, action, len, _head, tail), 378 - 379 - TP_STRUCT__entry( 380 - __field(u8, gt_id) 381 - __field(u32, action) 382 - __field(u32, len) 383 - __field(u32, tail) 384 - __field(u32, _head) 385 - ), 386 - 387 - TP_fast_assign( 388 - __entry->gt_id = gt_id; 389 - __entry->action = action; 390 - __entry->len = len; 391 - __entry->tail = tail; 392 - __entry->_head = _head; 393 - ), 394 - 395 - TP_printk("gt%d: H2G CTB: action=0x%x, len=%d, tail=%d, head=%d\n", 396 - __entry->gt_id, __entry->action, __entry->len, 397 - __entry->tail, __entry->_head) 398 - ); 399 - 400 - DEFINE_EVENT(xe_guc_ctb, xe_guc_ctb_h2g, 401 - TP_PROTO(u8 gt_id, u32 action, u32 len, u32 _head, u32 tail), 402 - TP_ARGS(gt_id, action, len, _head, tail) 403 - ); 404 - 405 - DEFINE_EVENT_PRINT(xe_guc_ctb, xe_guc_ctb_g2h, 406 - TP_PROTO(u8 gt_id, u32 action, u32 len, u32 _head, u32 tail), 407 - TP_ARGS(gt_id, action, len, _head, tail), 408 - 409 - TP_printk("gt%d: G2H CTB: action=0x%x, len=%d, tail=%d, head=%d\n", 410 - __entry->gt_id, __entry->action, __entry->len, 411 - __entry->tail, __entry->_head) 412 - 413 - ); 414 - 415 335 #endif 416 336 417 337 /* This part must be outside protection */
+9
drivers/gpu/drm/xe/xe_trace_guc.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + /* 3 + * Copyright © 2024 Intel Corporation 4 + */ 5 + 6 + #ifndef __CHECKER__ 7 + #define CREATE_TRACE_POINTS 8 + #include "xe_trace_guc.h" 9 + #endif
+103
drivers/gpu/drm/xe/xe_trace_guc.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0-only */ 2 + /* 3 + * Copyright © 2024 Intel Corporation 4 + */ 5 + 6 + #undef TRACE_SYSTEM 7 + #define TRACE_SYSTEM xe 8 + 9 + #if !defined(_XE_TRACE_GUC_H_) || defined(TRACE_HEADER_MULTI_READ) 10 + #define _XE_TRACE_GUC_H_ 11 + 12 + #include <linux/tracepoint.h> 13 + #include <linux/types.h> 14 + 15 + #include "xe_guc_exec_queue_types.h" 16 + 17 + DECLARE_EVENT_CLASS(xe_guc_ct_flow_control, 18 + TP_PROTO(u32 _head, u32 _tail, u32 size, u32 space, u32 len), 19 + TP_ARGS(_head, _tail, size, space, len), 20 + 21 + TP_STRUCT__entry( 22 + __field(u32, _head) 23 + __field(u32, _tail) 24 + __field(u32, size) 25 + __field(u32, space) 26 + __field(u32, len) 27 + ), 28 + 29 + TP_fast_assign( 30 + __entry->_head = _head; 31 + __entry->_tail = _tail; 32 + __entry->size = size; 33 + __entry->space = space; 34 + __entry->len = len; 35 + ), 36 + 37 + TP_printk("h2g flow control: head=%u, tail=%u, size=%u, space=%u, len=%u", 38 + __entry->_head, __entry->_tail, __entry->size, 39 + __entry->space, __entry->len) 40 + ); 41 + 42 + DEFINE_EVENT(xe_guc_ct_flow_control, xe_guc_ct_h2g_flow_control, 43 + TP_PROTO(u32 _head, u32 _tail, u32 size, u32 space, u32 len), 44 + TP_ARGS(_head, _tail, size, space, len) 45 + ); 46 + 47 + DEFINE_EVENT_PRINT(xe_guc_ct_flow_control, xe_guc_ct_g2h_flow_control, 48 + TP_PROTO(u32 _head, u32 _tail, u32 size, u32 space, u32 len), 49 + TP_ARGS(_head, _tail, size, space, len), 50 + 51 + TP_printk("g2h flow control: head=%u, tail=%u, size=%u, space=%u, len=%u", 52 + __entry->_head, __entry->_tail, __entry->size, 53 + __entry->space, __entry->len) 54 + ); 55 + 56 + DECLARE_EVENT_CLASS(xe_guc_ctb, 57 + TP_PROTO(u8 gt_id, u32 action, u32 len, u32 _head, u32 tail), 58 + TP_ARGS(gt_id, action, len, _head, tail), 59 + 60 + TP_STRUCT__entry( 61 + __field(u8, gt_id) 62 + __field(u32, action) 63 + __field(u32, len) 64 + __field(u32, tail) 65 + __field(u32, _head) 66 + ), 67 + 68 + TP_fast_assign( 69 + __entry->gt_id = gt_id; 70 + __entry->action = action; 71 + __entry->len = len; 72 + __entry->tail = tail; 73 + __entry->_head = _head; 74 + ), 75 + 76 + TP_printk("gt%d: H2G CTB: action=0x%x, len=%d, tail=%d, head=%d\n", 77 + __entry->gt_id, __entry->action, __entry->len, 78 + __entry->tail, __entry->_head) 79 + ); 80 + 81 + DEFINE_EVENT(xe_guc_ctb, xe_guc_ctb_h2g, 82 + TP_PROTO(u8 gt_id, u32 action, u32 len, u32 _head, u32 tail), 83 + TP_ARGS(gt_id, action, len, _head, tail) 84 + ); 85 + 86 + DEFINE_EVENT_PRINT(xe_guc_ctb, xe_guc_ctb_g2h, 87 + TP_PROTO(u8 gt_id, u32 action, u32 len, u32 _head, u32 tail), 88 + TP_ARGS(gt_id, action, len, _head, tail), 89 + 90 + TP_printk("gt%d: G2H CTB: action=0x%x, len=%d, tail=%d, head=%d\n", 91 + __entry->gt_id, __entry->action, __entry->len, 92 + __entry->tail, __entry->_head) 93 + 94 + ); 95 + 96 + #endif 97 + 98 + /* This part must be outside protection */ 99 + #undef TRACE_INCLUDE_PATH 100 + #undef TRACE_INCLUDE_FILE 101 + #define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/xe 102 + #define TRACE_INCLUDE_FILE xe_trace_guc 103 + #include <trace/define_trace.h>