xref: /openbmc/linux/include/trace/events/host1x.h (revision 5a5fccbd8c315c08db01e585e1cbe88e30b70691)
175471687STerje Bergstrom /*
275471687STerje Bergstrom  * include/trace/events/host1x.h
375471687STerje Bergstrom  *
475471687STerje Bergstrom  * host1x event logging to ftrace.
575471687STerje Bergstrom  *
675471687STerje Bergstrom  * Copyright (c) 2010-2013, NVIDIA Corporation.
775471687STerje Bergstrom  *
875471687STerje Bergstrom  * This program is free software; you can redistribute it and/or modify
975471687STerje Bergstrom  * it under the terms of the GNU General Public License as published by
1075471687STerje Bergstrom  * the Free Software Foundation; either version 2 of the License, or
1175471687STerje Bergstrom  * (at your option) any later version.
1275471687STerje Bergstrom  *
1375471687STerje Bergstrom  * This program is distributed in the hope that it will be useful, but WITHOUT
1475471687STerje Bergstrom  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1575471687STerje Bergstrom  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
1675471687STerje Bergstrom  * more details.
1775471687STerje Bergstrom  *
1875471687STerje Bergstrom  * You should have received a copy of the GNU General Public License along
1975471687STerje Bergstrom  * with this program; if not, write to the Free Software Foundation, Inc.,
2075471687STerje Bergstrom  * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
2175471687STerje Bergstrom  */
2275471687STerje Bergstrom 
2375471687STerje Bergstrom #undef TRACE_SYSTEM
2475471687STerje Bergstrom #define TRACE_SYSTEM host1x
2575471687STerje Bergstrom 
2675471687STerje Bergstrom #if !defined(_TRACE_HOST1X_H) || defined(TRACE_HEADER_MULTI_READ)
2775471687STerje Bergstrom #define _TRACE_HOST1X_H
2875471687STerje Bergstrom 
2975471687STerje Bergstrom #include <linux/ktime.h>
3075471687STerje Bergstrom #include <linux/tracepoint.h>
3175471687STerje Bergstrom 
32b40d02bfSThierry Reding struct host1x_bo;
33b40d02bfSThierry Reding 
3475471687STerje Bergstrom DECLARE_EVENT_CLASS(host1x,
3575471687STerje Bergstrom 	TP_PROTO(const char *name),
3675471687STerje Bergstrom 	TP_ARGS(name),
3775471687STerje Bergstrom 	TP_STRUCT__entry(__field(const char *, name)),
3875471687STerje Bergstrom 	TP_fast_assign(__entry->name = name;),
3975471687STerje Bergstrom 	TP_printk("name=%s", __entry->name)
4075471687STerje Bergstrom );
4175471687STerje Bergstrom 
426579324aSTerje Bergstrom DEFINE_EVENT(host1x, host1x_channel_open,
436579324aSTerje Bergstrom 	TP_PROTO(const char *name),
446579324aSTerje Bergstrom 	TP_ARGS(name)
456579324aSTerje Bergstrom );
466579324aSTerje Bergstrom 
476579324aSTerje Bergstrom DEFINE_EVENT(host1x, host1x_channel_release,
486579324aSTerje Bergstrom 	TP_PROTO(const char *name),
496579324aSTerje Bergstrom 	TP_ARGS(name)
506579324aSTerje Bergstrom );
516579324aSTerje Bergstrom 
526579324aSTerje Bergstrom DEFINE_EVENT(host1x, host1x_cdma_begin,
536579324aSTerje Bergstrom 	TP_PROTO(const char *name),
546579324aSTerje Bergstrom 	TP_ARGS(name)
556579324aSTerje Bergstrom );
566579324aSTerje Bergstrom 
576579324aSTerje Bergstrom DEFINE_EVENT(host1x, host1x_cdma_end,
586579324aSTerje Bergstrom 	TP_PROTO(const char *name),
596579324aSTerje Bergstrom 	TP_ARGS(name)
606579324aSTerje Bergstrom );
616579324aSTerje Bergstrom 
626579324aSTerje Bergstrom TRACE_EVENT(host1x_cdma_push,
636579324aSTerje Bergstrom 	TP_PROTO(const char *name, u32 op1, u32 op2),
646579324aSTerje Bergstrom 
656579324aSTerje Bergstrom 	TP_ARGS(name, op1, op2),
666579324aSTerje Bergstrom 
676579324aSTerje Bergstrom 	TP_STRUCT__entry(
686579324aSTerje Bergstrom 		__field(const char *, name)
696579324aSTerje Bergstrom 		__field(u32, op1)
706579324aSTerje Bergstrom 		__field(u32, op2)
716579324aSTerje Bergstrom 	),
726579324aSTerje Bergstrom 
736579324aSTerje Bergstrom 	TP_fast_assign(
746579324aSTerje Bergstrom 		__entry->name = name;
756579324aSTerje Bergstrom 		__entry->op1 = op1;
766579324aSTerje Bergstrom 		__entry->op2 = op2;
776579324aSTerje Bergstrom 	),
786579324aSTerje Bergstrom 
796579324aSTerje Bergstrom 	TP_printk("name=%s, op1=%08x, op2=%08x",
806579324aSTerje Bergstrom 		__entry->name, __entry->op1, __entry->op2)
816579324aSTerje Bergstrom );
826579324aSTerje Bergstrom 
83*5a5fccbdSThierry Reding TRACE_EVENT(host1x_cdma_push_wide,
84*5a5fccbdSThierry Reding 	TP_PROTO(const char *name, u32 op1, u32 op2, u32 op3, u32 op4),
85*5a5fccbdSThierry Reding 
86*5a5fccbdSThierry Reding 	TP_ARGS(name, op1, op2, op3, op4),
87*5a5fccbdSThierry Reding 
88*5a5fccbdSThierry Reding 	TP_STRUCT__entry(
89*5a5fccbdSThierry Reding 		__field(const char *, name)
90*5a5fccbdSThierry Reding 		__field(u32, op1)
91*5a5fccbdSThierry Reding 		__field(u32, op2)
92*5a5fccbdSThierry Reding 		__field(u32, op3)
93*5a5fccbdSThierry Reding 		__field(u32, op4)
94*5a5fccbdSThierry Reding 	),
95*5a5fccbdSThierry Reding 
96*5a5fccbdSThierry Reding 	TP_fast_assign(
97*5a5fccbdSThierry Reding 		__entry->name = name;
98*5a5fccbdSThierry Reding 		__entry->op1 = op1;
99*5a5fccbdSThierry Reding 		__entry->op2 = op2;
100*5a5fccbdSThierry Reding 		__entry->op3 = op3;
101*5a5fccbdSThierry Reding 		__entry->op4 = op4;
102*5a5fccbdSThierry Reding 	),
103*5a5fccbdSThierry Reding 
104*5a5fccbdSThierry Reding 	TP_printk("name=%s, op1=%08x, op2=%08x, op3=%08x op4=%08x",
105*5a5fccbdSThierry Reding 		__entry->name, __entry->op1, __entry->op2, __entry->op3,
106*5a5fccbdSThierry Reding 		__entry->op4)
107*5a5fccbdSThierry Reding );
108*5a5fccbdSThierry Reding 
1096579324aSTerje Bergstrom TRACE_EVENT(host1x_cdma_push_gather,
110b40d02bfSThierry Reding 	TP_PROTO(const char *name, struct host1x_bo *bo,
1116579324aSTerje Bergstrom 			u32 words, u32 offset, void *cmdbuf),
1126579324aSTerje Bergstrom 
113b40d02bfSThierry Reding 	TP_ARGS(name, bo, words, offset, cmdbuf),
1146579324aSTerje Bergstrom 
1156579324aSTerje Bergstrom 	TP_STRUCT__entry(
1166579324aSTerje Bergstrom 		__field(const char *, name)
117b40d02bfSThierry Reding 		__field(struct host1x_bo *, bo)
1186579324aSTerje Bergstrom 		__field(u32, words)
1196579324aSTerje Bergstrom 		__field(u32, offset)
1206579324aSTerje Bergstrom 		__field(bool, cmdbuf)
1216579324aSTerje Bergstrom 		__dynamic_array(u32, cmdbuf, words)
1226579324aSTerje Bergstrom 	),
1236579324aSTerje Bergstrom 
1246579324aSTerje Bergstrom 	TP_fast_assign(
1256579324aSTerje Bergstrom 		if (cmdbuf) {
1266579324aSTerje Bergstrom 			memcpy(__get_dynamic_array(cmdbuf), cmdbuf+offset,
1276579324aSTerje Bergstrom 					words * sizeof(u32));
1286579324aSTerje Bergstrom 		}
1296579324aSTerje Bergstrom 		__entry->cmdbuf = cmdbuf;
1306579324aSTerje Bergstrom 		__entry->name = name;
131b40d02bfSThierry Reding 		__entry->bo = bo;
1326579324aSTerje Bergstrom 		__entry->words = words;
1336579324aSTerje Bergstrom 		__entry->offset = offset;
1346579324aSTerje Bergstrom 	),
1356579324aSTerje Bergstrom 
136b40d02bfSThierry Reding 	TP_printk("name=%s, bo=%p, words=%u, offset=%d, contents=[%s]",
137b40d02bfSThierry Reding 	  __entry->name, __entry->bo,
1386579324aSTerje Bergstrom 	  __entry->words, __entry->offset,
1396579324aSTerje Bergstrom 	  __print_hex(__get_dynamic_array(cmdbuf),
1406579324aSTerje Bergstrom 		  __entry->cmdbuf ? __entry->words * 4 : 0))
1416579324aSTerje Bergstrom );
1426579324aSTerje Bergstrom 
1436579324aSTerje Bergstrom TRACE_EVENT(host1x_channel_submit,
14424c94e16SThierry Reding 	TP_PROTO(const char *name, u32 cmdbufs, u32 relocs, u32 syncpt_id,
14524c94e16SThierry Reding 		 u32 syncpt_incrs),
1466579324aSTerje Bergstrom 
14724c94e16SThierry Reding 	TP_ARGS(name, cmdbufs, relocs, syncpt_id, syncpt_incrs),
1486579324aSTerje Bergstrom 
1496579324aSTerje Bergstrom 	TP_STRUCT__entry(
1506579324aSTerje Bergstrom 		__field(const char *, name)
1516579324aSTerje Bergstrom 		__field(u32, cmdbufs)
1526579324aSTerje Bergstrom 		__field(u32, relocs)
1536579324aSTerje Bergstrom 		__field(u32, syncpt_id)
1546579324aSTerje Bergstrom 		__field(u32, syncpt_incrs)
1556579324aSTerje Bergstrom 	),
1566579324aSTerje Bergstrom 
1576579324aSTerje Bergstrom 	TP_fast_assign(
1586579324aSTerje Bergstrom 		__entry->name = name;
1596579324aSTerje Bergstrom 		__entry->cmdbufs = cmdbufs;
1606579324aSTerje Bergstrom 		__entry->relocs = relocs;
1616579324aSTerje Bergstrom 		__entry->syncpt_id = syncpt_id;
1626579324aSTerje Bergstrom 		__entry->syncpt_incrs = syncpt_incrs;
1636579324aSTerje Bergstrom 	),
1646579324aSTerje Bergstrom 
16524c94e16SThierry Reding 	TP_printk("name=%s, cmdbufs=%u, relocs=%u, syncpt_id=%u, "
16624c94e16SThierry Reding 		  "syncpt_incrs=%u",
16724c94e16SThierry Reding 		  __entry->name, __entry->cmdbufs, __entry->relocs,
1686579324aSTerje Bergstrom 		  __entry->syncpt_id, __entry->syncpt_incrs)
1696579324aSTerje Bergstrom );
1706579324aSTerje Bergstrom 
1716579324aSTerje Bergstrom TRACE_EVENT(host1x_channel_submitted,
1726579324aSTerje Bergstrom 	TP_PROTO(const char *name, u32 syncpt_base, u32 syncpt_max),
1736579324aSTerje Bergstrom 
1746579324aSTerje Bergstrom 	TP_ARGS(name, syncpt_base, syncpt_max),
1756579324aSTerje Bergstrom 
1766579324aSTerje Bergstrom 	TP_STRUCT__entry(
1776579324aSTerje Bergstrom 		__field(const char *, name)
1786579324aSTerje Bergstrom 		__field(u32, syncpt_base)
1796579324aSTerje Bergstrom 		__field(u32, syncpt_max)
1806579324aSTerje Bergstrom 	),
1816579324aSTerje Bergstrom 
1826579324aSTerje Bergstrom 	TP_fast_assign(
1836579324aSTerje Bergstrom 		__entry->name = name;
1846579324aSTerje Bergstrom 		__entry->syncpt_base = syncpt_base;
1856579324aSTerje Bergstrom 		__entry->syncpt_max = syncpt_max;
1866579324aSTerje Bergstrom 	),
1876579324aSTerje Bergstrom 
1886579324aSTerje Bergstrom 	TP_printk("name=%s, syncpt_base=%d, syncpt_max=%d",
1896579324aSTerje Bergstrom 		__entry->name, __entry->syncpt_base, __entry->syncpt_max)
1906579324aSTerje Bergstrom );
1916579324aSTerje Bergstrom 
1926579324aSTerje Bergstrom TRACE_EVENT(host1x_channel_submit_complete,
1936579324aSTerje Bergstrom 	TP_PROTO(const char *name, int count, u32 thresh),
1946579324aSTerje Bergstrom 
1956579324aSTerje Bergstrom 	TP_ARGS(name, count, thresh),
1966579324aSTerje Bergstrom 
1976579324aSTerje Bergstrom 	TP_STRUCT__entry(
1986579324aSTerje Bergstrom 		__field(const char *, name)
1996579324aSTerje Bergstrom 		__field(int, count)
2006579324aSTerje Bergstrom 		__field(u32, thresh)
2016579324aSTerje Bergstrom 	),
2026579324aSTerje Bergstrom 
2036579324aSTerje Bergstrom 	TP_fast_assign(
2046579324aSTerje Bergstrom 		__entry->name = name;
2056579324aSTerje Bergstrom 		__entry->count = count;
2066579324aSTerje Bergstrom 		__entry->thresh = thresh;
2076579324aSTerje Bergstrom 	),
2086579324aSTerje Bergstrom 
2096579324aSTerje Bergstrom 	TP_printk("name=%s, count=%d, thresh=%d",
2106579324aSTerje Bergstrom 		__entry->name, __entry->count, __entry->thresh)
2116579324aSTerje Bergstrom );
2126579324aSTerje Bergstrom 
2136579324aSTerje Bergstrom TRACE_EVENT(host1x_wait_cdma,
2146579324aSTerje Bergstrom 	TP_PROTO(const char *name, u32 eventid),
2156579324aSTerje Bergstrom 
2166579324aSTerje Bergstrom 	TP_ARGS(name, eventid),
2176579324aSTerje Bergstrom 
2186579324aSTerje Bergstrom 	TP_STRUCT__entry(
2196579324aSTerje Bergstrom 		__field(const char *, name)
2206579324aSTerje Bergstrom 		__field(u32, eventid)
2216579324aSTerje Bergstrom 	),
2226579324aSTerje Bergstrom 
2236579324aSTerje Bergstrom 	TP_fast_assign(
2246579324aSTerje Bergstrom 		__entry->name = name;
2256579324aSTerje Bergstrom 		__entry->eventid = eventid;
2266579324aSTerje Bergstrom 	),
2276579324aSTerje Bergstrom 
2286579324aSTerje Bergstrom 	TP_printk("name=%s, event=%d", __entry->name, __entry->eventid)
2296579324aSTerje Bergstrom );
2306579324aSTerje Bergstrom 
23175471687STerje Bergstrom TRACE_EVENT(host1x_syncpt_load_min,
23275471687STerje Bergstrom 	TP_PROTO(u32 id, u32 val),
23375471687STerje Bergstrom 
23475471687STerje Bergstrom 	TP_ARGS(id, val),
23575471687STerje Bergstrom 
23675471687STerje Bergstrom 	TP_STRUCT__entry(
23775471687STerje Bergstrom 		__field(u32, id)
23875471687STerje Bergstrom 		__field(u32, val)
23975471687STerje Bergstrom 	),
24075471687STerje Bergstrom 
24175471687STerje Bergstrom 	TP_fast_assign(
24275471687STerje Bergstrom 		__entry->id = id;
24375471687STerje Bergstrom 		__entry->val = val;
24475471687STerje Bergstrom 	),
24575471687STerje Bergstrom 
24675471687STerje Bergstrom 	TP_printk("id=%d, val=%d", __entry->id, __entry->val)
24775471687STerje Bergstrom );
24875471687STerje Bergstrom 
2496579324aSTerje Bergstrom TRACE_EVENT(host1x_syncpt_wait_check,
250b40d02bfSThierry Reding 	TP_PROTO(struct host1x_bo *bo, u32 offset, u32 syncpt_id, u32 thresh,
251b40d02bfSThierry Reding 		 u32 min),
2526579324aSTerje Bergstrom 
253b40d02bfSThierry Reding 	TP_ARGS(bo, offset, syncpt_id, thresh, min),
2546579324aSTerje Bergstrom 
2556579324aSTerje Bergstrom 	TP_STRUCT__entry(
256b40d02bfSThierry Reding 		__field(struct host1x_bo *, bo)
2576579324aSTerje Bergstrom 		__field(u32, offset)
2586579324aSTerje Bergstrom 		__field(u32, syncpt_id)
2596579324aSTerje Bergstrom 		__field(u32, thresh)
2606579324aSTerje Bergstrom 		__field(u32, min)
2616579324aSTerje Bergstrom 	),
2626579324aSTerje Bergstrom 
2636579324aSTerje Bergstrom 	TP_fast_assign(
264b40d02bfSThierry Reding 		__entry->bo = bo;
2656579324aSTerje Bergstrom 		__entry->offset = offset;
2666579324aSTerje Bergstrom 		__entry->syncpt_id = syncpt_id;
2676579324aSTerje Bergstrom 		__entry->thresh = thresh;
2686579324aSTerje Bergstrom 		__entry->min = min;
2696579324aSTerje Bergstrom 	),
2706579324aSTerje Bergstrom 
271b40d02bfSThierry Reding 	TP_printk("bo=%p, offset=%05x, id=%d, thresh=%d, current=%d",
272b40d02bfSThierry Reding 		__entry->bo, __entry->offset,
2736579324aSTerje Bergstrom 		__entry->syncpt_id, __entry->thresh,
2746579324aSTerje Bergstrom 		__entry->min)
2756579324aSTerje Bergstrom );
2766579324aSTerje Bergstrom 
27775471687STerje Bergstrom #endif /*  _TRACE_HOST1X_H */
27875471687STerje Bergstrom 
27975471687STerje Bergstrom /* This part must be outside protection */
28075471687STerje Bergstrom #include <trace/define_trace.h>
281