1*16216333SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */ 275471687STerje Bergstrom /* 375471687STerje Bergstrom * include/trace/events/host1x.h 475471687STerje Bergstrom * 575471687STerje Bergstrom * host1x event logging to ftrace. 675471687STerje Bergstrom * 775471687STerje Bergstrom * Copyright (c) 2010-2013, NVIDIA Corporation. 875471687STerje Bergstrom */ 975471687STerje Bergstrom 1075471687STerje Bergstrom #undef TRACE_SYSTEM 1175471687STerje Bergstrom #define TRACE_SYSTEM host1x 1275471687STerje Bergstrom 1375471687STerje Bergstrom #if !defined(_TRACE_HOST1X_H) || defined(TRACE_HEADER_MULTI_READ) 1475471687STerje Bergstrom #define _TRACE_HOST1X_H 1575471687STerje Bergstrom 1675471687STerje Bergstrom #include <linux/ktime.h> 1775471687STerje Bergstrom #include <linux/tracepoint.h> 1875471687STerje Bergstrom 19b40d02bfSThierry Reding struct host1x_bo; 20b40d02bfSThierry Reding 2175471687STerje Bergstrom DECLARE_EVENT_CLASS(host1x, 2275471687STerje Bergstrom TP_PROTO(const char *name), 2375471687STerje Bergstrom TP_ARGS(name), 2475471687STerje Bergstrom TP_STRUCT__entry(__field(const char *, name)), 2575471687STerje Bergstrom TP_fast_assign(__entry->name = name;), 2675471687STerje Bergstrom TP_printk("name=%s", __entry->name) 2775471687STerje Bergstrom ); 2875471687STerje Bergstrom 296579324aSTerje Bergstrom DEFINE_EVENT(host1x, host1x_channel_open, 306579324aSTerje Bergstrom TP_PROTO(const char *name), 316579324aSTerje Bergstrom TP_ARGS(name) 326579324aSTerje Bergstrom ); 336579324aSTerje Bergstrom 346579324aSTerje Bergstrom DEFINE_EVENT(host1x, host1x_channel_release, 356579324aSTerje Bergstrom TP_PROTO(const char *name), 366579324aSTerje Bergstrom TP_ARGS(name) 376579324aSTerje Bergstrom ); 386579324aSTerje Bergstrom 396579324aSTerje Bergstrom DEFINE_EVENT(host1x, host1x_cdma_begin, 406579324aSTerje Bergstrom TP_PROTO(const char *name), 416579324aSTerje Bergstrom TP_ARGS(name) 426579324aSTerje Bergstrom ); 436579324aSTerje Bergstrom 446579324aSTerje Bergstrom DEFINE_EVENT(host1x, host1x_cdma_end, 456579324aSTerje Bergstrom TP_PROTO(const char *name), 466579324aSTerje Bergstrom TP_ARGS(name) 476579324aSTerje Bergstrom ); 486579324aSTerje Bergstrom 496579324aSTerje Bergstrom TRACE_EVENT(host1x_cdma_push, 506579324aSTerje Bergstrom TP_PROTO(const char *name, u32 op1, u32 op2), 516579324aSTerje Bergstrom 526579324aSTerje Bergstrom TP_ARGS(name, op1, op2), 536579324aSTerje Bergstrom 546579324aSTerje Bergstrom TP_STRUCT__entry( 556579324aSTerje Bergstrom __field(const char *, name) 566579324aSTerje Bergstrom __field(u32, op1) 576579324aSTerje Bergstrom __field(u32, op2) 586579324aSTerje Bergstrom ), 596579324aSTerje Bergstrom 606579324aSTerje Bergstrom TP_fast_assign( 616579324aSTerje Bergstrom __entry->name = name; 626579324aSTerje Bergstrom __entry->op1 = op1; 636579324aSTerje Bergstrom __entry->op2 = op2; 646579324aSTerje Bergstrom ), 656579324aSTerje Bergstrom 666579324aSTerje Bergstrom TP_printk("name=%s, op1=%08x, op2=%08x", 676579324aSTerje Bergstrom __entry->name, __entry->op1, __entry->op2) 686579324aSTerje Bergstrom ); 696579324aSTerje Bergstrom 705a5fccbdSThierry Reding TRACE_EVENT(host1x_cdma_push_wide, 715a5fccbdSThierry Reding TP_PROTO(const char *name, u32 op1, u32 op2, u32 op3, u32 op4), 725a5fccbdSThierry Reding 735a5fccbdSThierry Reding TP_ARGS(name, op1, op2, op3, op4), 745a5fccbdSThierry Reding 755a5fccbdSThierry Reding TP_STRUCT__entry( 765a5fccbdSThierry Reding __field(const char *, name) 775a5fccbdSThierry Reding __field(u32, op1) 785a5fccbdSThierry Reding __field(u32, op2) 795a5fccbdSThierry Reding __field(u32, op3) 805a5fccbdSThierry Reding __field(u32, op4) 815a5fccbdSThierry Reding ), 825a5fccbdSThierry Reding 835a5fccbdSThierry Reding TP_fast_assign( 845a5fccbdSThierry Reding __entry->name = name; 855a5fccbdSThierry Reding __entry->op1 = op1; 865a5fccbdSThierry Reding __entry->op2 = op2; 875a5fccbdSThierry Reding __entry->op3 = op3; 885a5fccbdSThierry Reding __entry->op4 = op4; 895a5fccbdSThierry Reding ), 905a5fccbdSThierry Reding 915a5fccbdSThierry Reding TP_printk("name=%s, op1=%08x, op2=%08x, op3=%08x op4=%08x", 925a5fccbdSThierry Reding __entry->name, __entry->op1, __entry->op2, __entry->op3, 935a5fccbdSThierry Reding __entry->op4) 945a5fccbdSThierry Reding ); 955a5fccbdSThierry Reding 966579324aSTerje Bergstrom TRACE_EVENT(host1x_cdma_push_gather, 97b40d02bfSThierry Reding TP_PROTO(const char *name, struct host1x_bo *bo, 986579324aSTerje Bergstrom u32 words, u32 offset, void *cmdbuf), 996579324aSTerje Bergstrom 100b40d02bfSThierry Reding TP_ARGS(name, bo, words, offset, cmdbuf), 1016579324aSTerje Bergstrom 1026579324aSTerje Bergstrom TP_STRUCT__entry( 1036579324aSTerje Bergstrom __field(const char *, name) 104b40d02bfSThierry Reding __field(struct host1x_bo *, bo) 1056579324aSTerje Bergstrom __field(u32, words) 1066579324aSTerje Bergstrom __field(u32, offset) 1076579324aSTerje Bergstrom __field(bool, cmdbuf) 1086579324aSTerje Bergstrom __dynamic_array(u32, cmdbuf, words) 1096579324aSTerje Bergstrom ), 1106579324aSTerje Bergstrom 1116579324aSTerje Bergstrom TP_fast_assign( 1126579324aSTerje Bergstrom if (cmdbuf) { 1136579324aSTerje Bergstrom memcpy(__get_dynamic_array(cmdbuf), cmdbuf+offset, 1146579324aSTerje Bergstrom words * sizeof(u32)); 1156579324aSTerje Bergstrom } 1166579324aSTerje Bergstrom __entry->cmdbuf = cmdbuf; 1176579324aSTerje Bergstrom __entry->name = name; 118b40d02bfSThierry Reding __entry->bo = bo; 1196579324aSTerje Bergstrom __entry->words = words; 1206579324aSTerje Bergstrom __entry->offset = offset; 1216579324aSTerje Bergstrom ), 1226579324aSTerje Bergstrom 123b40d02bfSThierry Reding TP_printk("name=%s, bo=%p, words=%u, offset=%d, contents=[%s]", 124b40d02bfSThierry Reding __entry->name, __entry->bo, 1256579324aSTerje Bergstrom __entry->words, __entry->offset, 1266579324aSTerje Bergstrom __print_hex(__get_dynamic_array(cmdbuf), 1276579324aSTerje Bergstrom __entry->cmdbuf ? __entry->words * 4 : 0)) 1286579324aSTerje Bergstrom ); 1296579324aSTerje Bergstrom 1306579324aSTerje Bergstrom TRACE_EVENT(host1x_channel_submit, 13124c94e16SThierry Reding TP_PROTO(const char *name, u32 cmdbufs, u32 relocs, u32 syncpt_id, 13224c94e16SThierry Reding u32 syncpt_incrs), 1336579324aSTerje Bergstrom 13424c94e16SThierry Reding TP_ARGS(name, cmdbufs, relocs, syncpt_id, syncpt_incrs), 1356579324aSTerje Bergstrom 1366579324aSTerje Bergstrom TP_STRUCT__entry( 1376579324aSTerje Bergstrom __field(const char *, name) 1386579324aSTerje Bergstrom __field(u32, cmdbufs) 1396579324aSTerje Bergstrom __field(u32, relocs) 1406579324aSTerje Bergstrom __field(u32, syncpt_id) 1416579324aSTerje Bergstrom __field(u32, syncpt_incrs) 1426579324aSTerje Bergstrom ), 1436579324aSTerje Bergstrom 1446579324aSTerje Bergstrom TP_fast_assign( 1456579324aSTerje Bergstrom __entry->name = name; 1466579324aSTerje Bergstrom __entry->cmdbufs = cmdbufs; 1476579324aSTerje Bergstrom __entry->relocs = relocs; 1486579324aSTerje Bergstrom __entry->syncpt_id = syncpt_id; 1496579324aSTerje Bergstrom __entry->syncpt_incrs = syncpt_incrs; 1506579324aSTerje Bergstrom ), 1516579324aSTerje Bergstrom 15224c94e16SThierry Reding TP_printk("name=%s, cmdbufs=%u, relocs=%u, syncpt_id=%u, " 15324c94e16SThierry Reding "syncpt_incrs=%u", 15424c94e16SThierry Reding __entry->name, __entry->cmdbufs, __entry->relocs, 1556579324aSTerje Bergstrom __entry->syncpt_id, __entry->syncpt_incrs) 1566579324aSTerje Bergstrom ); 1576579324aSTerje Bergstrom 1586579324aSTerje Bergstrom TRACE_EVENT(host1x_channel_submitted, 1596579324aSTerje Bergstrom TP_PROTO(const char *name, u32 syncpt_base, u32 syncpt_max), 1606579324aSTerje Bergstrom 1616579324aSTerje Bergstrom TP_ARGS(name, syncpt_base, syncpt_max), 1626579324aSTerje Bergstrom 1636579324aSTerje Bergstrom TP_STRUCT__entry( 1646579324aSTerje Bergstrom __field(const char *, name) 1656579324aSTerje Bergstrom __field(u32, syncpt_base) 1666579324aSTerje Bergstrom __field(u32, syncpt_max) 1676579324aSTerje Bergstrom ), 1686579324aSTerje Bergstrom 1696579324aSTerje Bergstrom TP_fast_assign( 1706579324aSTerje Bergstrom __entry->name = name; 1716579324aSTerje Bergstrom __entry->syncpt_base = syncpt_base; 1726579324aSTerje Bergstrom __entry->syncpt_max = syncpt_max; 1736579324aSTerje Bergstrom ), 1746579324aSTerje Bergstrom 1756579324aSTerje Bergstrom TP_printk("name=%s, syncpt_base=%d, syncpt_max=%d", 1766579324aSTerje Bergstrom __entry->name, __entry->syncpt_base, __entry->syncpt_max) 1776579324aSTerje Bergstrom ); 1786579324aSTerje Bergstrom 1796579324aSTerje Bergstrom TRACE_EVENT(host1x_channel_submit_complete, 1806579324aSTerje Bergstrom TP_PROTO(const char *name, int count, u32 thresh), 1816579324aSTerje Bergstrom 1826579324aSTerje Bergstrom TP_ARGS(name, count, thresh), 1836579324aSTerje Bergstrom 1846579324aSTerje Bergstrom TP_STRUCT__entry( 1856579324aSTerje Bergstrom __field(const char *, name) 1866579324aSTerje Bergstrom __field(int, count) 1876579324aSTerje Bergstrom __field(u32, thresh) 1886579324aSTerje Bergstrom ), 1896579324aSTerje Bergstrom 1906579324aSTerje Bergstrom TP_fast_assign( 1916579324aSTerje Bergstrom __entry->name = name; 1926579324aSTerje Bergstrom __entry->count = count; 1936579324aSTerje Bergstrom __entry->thresh = thresh; 1946579324aSTerje Bergstrom ), 1956579324aSTerje Bergstrom 1966579324aSTerje Bergstrom TP_printk("name=%s, count=%d, thresh=%d", 1976579324aSTerje Bergstrom __entry->name, __entry->count, __entry->thresh) 1986579324aSTerje Bergstrom ); 1996579324aSTerje Bergstrom 2006579324aSTerje Bergstrom TRACE_EVENT(host1x_wait_cdma, 2016579324aSTerje Bergstrom TP_PROTO(const char *name, u32 eventid), 2026579324aSTerje Bergstrom 2036579324aSTerje Bergstrom TP_ARGS(name, eventid), 2046579324aSTerje Bergstrom 2056579324aSTerje Bergstrom TP_STRUCT__entry( 2066579324aSTerje Bergstrom __field(const char *, name) 2076579324aSTerje Bergstrom __field(u32, eventid) 2086579324aSTerje Bergstrom ), 2096579324aSTerje Bergstrom 2106579324aSTerje Bergstrom TP_fast_assign( 2116579324aSTerje Bergstrom __entry->name = name; 2126579324aSTerje Bergstrom __entry->eventid = eventid; 2136579324aSTerje Bergstrom ), 2146579324aSTerje Bergstrom 2156579324aSTerje Bergstrom TP_printk("name=%s, event=%d", __entry->name, __entry->eventid) 2166579324aSTerje Bergstrom ); 2176579324aSTerje Bergstrom 21875471687STerje Bergstrom TRACE_EVENT(host1x_syncpt_load_min, 21975471687STerje Bergstrom TP_PROTO(u32 id, u32 val), 22075471687STerje Bergstrom 22175471687STerje Bergstrom TP_ARGS(id, val), 22275471687STerje Bergstrom 22375471687STerje Bergstrom TP_STRUCT__entry( 22475471687STerje Bergstrom __field(u32, id) 22575471687STerje Bergstrom __field(u32, val) 22675471687STerje Bergstrom ), 22775471687STerje Bergstrom 22875471687STerje Bergstrom TP_fast_assign( 22975471687STerje Bergstrom __entry->id = id; 23075471687STerje Bergstrom __entry->val = val; 23175471687STerje Bergstrom ), 23275471687STerje Bergstrom 23375471687STerje Bergstrom TP_printk("id=%d, val=%d", __entry->id, __entry->val) 23475471687STerje Bergstrom ); 23575471687STerje Bergstrom 2366579324aSTerje Bergstrom TRACE_EVENT(host1x_syncpt_wait_check, 237b40d02bfSThierry Reding TP_PROTO(struct host1x_bo *bo, u32 offset, u32 syncpt_id, u32 thresh, 238b40d02bfSThierry Reding u32 min), 2396579324aSTerje Bergstrom 240b40d02bfSThierry Reding TP_ARGS(bo, offset, syncpt_id, thresh, min), 2416579324aSTerje Bergstrom 2426579324aSTerje Bergstrom TP_STRUCT__entry( 243b40d02bfSThierry Reding __field(struct host1x_bo *, bo) 2446579324aSTerje Bergstrom __field(u32, offset) 2456579324aSTerje Bergstrom __field(u32, syncpt_id) 2466579324aSTerje Bergstrom __field(u32, thresh) 2476579324aSTerje Bergstrom __field(u32, min) 2486579324aSTerje Bergstrom ), 2496579324aSTerje Bergstrom 2506579324aSTerje Bergstrom TP_fast_assign( 251b40d02bfSThierry Reding __entry->bo = bo; 2526579324aSTerje Bergstrom __entry->offset = offset; 2536579324aSTerje Bergstrom __entry->syncpt_id = syncpt_id; 2546579324aSTerje Bergstrom __entry->thresh = thresh; 2556579324aSTerje Bergstrom __entry->min = min; 2566579324aSTerje Bergstrom ), 2576579324aSTerje Bergstrom 258b40d02bfSThierry Reding TP_printk("bo=%p, offset=%05x, id=%d, thresh=%d, current=%d", 259b40d02bfSThierry Reding __entry->bo, __entry->offset, 2606579324aSTerje Bergstrom __entry->syncpt_id, __entry->thresh, 2616579324aSTerje Bergstrom __entry->min) 2626579324aSTerje Bergstrom ); 2636579324aSTerje Bergstrom 26475471687STerje Bergstrom #endif /* _TRACE_HOST1X_H */ 26575471687STerje Bergstrom 26675471687STerje Bergstrom /* This part must be outside protection */ 26775471687STerje Bergstrom #include <trace/define_trace.h> 268