blob: 7c14ac1832ba0c7160281417eeb00f78b76bd18f [file] [log] [blame]
Norman Geed7402ff2011-10-28 08:51:11 -06001/* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 */
13
14#if !defined(_KGSL_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
15#define _KGSL_TRACE_H
16
17#undef TRACE_SYSTEM
18#define TRACE_SYSTEM kgsl
19#undef TRACE_INCLUDE_PATH
20#define TRACE_INCLUDE_PATH .
21#undef TRACE_INCLUDE_FILE
22#define TRACE_INCLUDE_FILE kgsl_trace
23
24#include <linux/tracepoint.h>
25
26struct kgsl_device;
27struct kgsl_ringbuffer_issueibcmds;
28struct kgsl_device_waittimestamp;
29
30/*
31 * Tracepoint for kgsl issue ib commands
32 */
33TRACE_EVENT(kgsl_issueibcmds,
34
35 TP_PROTO(struct kgsl_device *device,
36 struct kgsl_ringbuffer_issueibcmds *cmd, int result),
37
38 TP_ARGS(device, cmd, result),
39
40 TP_STRUCT__entry(
41 __string(device_name, device->name)
42 __field(unsigned int, drawctxt_id)
43 __field(unsigned int, ibdesc_addr)
44 __field(unsigned int, numibs)
45 __field(unsigned int, timestamp)
46 __field(unsigned int, flags)
47 __field(int, result)
48 ),
49
50 TP_fast_assign(
51 __assign_str(device_name, device->name);
52 __entry->drawctxt_id = cmd->drawctxt_id;
53 __entry->ibdesc_addr = cmd->ibdesc_addr;
54 __entry->numibs = cmd->numibs;
55 __entry->timestamp = cmd->timestamp;
56 __entry->flags = cmd->flags;
57 __entry->result = result;
58 ),
59
60 TP_printk(
61 "d_name=%s ctx=%u ib=%u numibs=%u timestamp=%u "
62 "flags=%u result=%d",
63 __get_str(device_name),
64 __entry->drawctxt_id,
65 __entry->ibdesc_addr,
66 __entry->numibs,
67 __entry->timestamp,
68 __entry->flags,
69 __entry->result
70 )
71);
72
73/*
74 * Tracepoint for kgsl readtimestamp
75 */
76TRACE_EVENT(kgsl_readtimestamp,
77
78 TP_PROTO(struct kgsl_device *device,
79 struct kgsl_cmdstream_readtimestamp *cmd),
80
81 TP_ARGS(device, cmd),
82
83 TP_STRUCT__entry(
84 __string(device_name, device->name)
85 __field(unsigned int, type)
86 __field(unsigned int, timestamp)
87 ),
88
89 TP_fast_assign(
90 __assign_str(device_name, device->name);
91 __entry->type = cmd->type;
92 __entry->timestamp = cmd->timestamp;
93 ),
94
95 TP_printk(
96 "d_name=%s type=%u timestamp=%u",
97 __get_str(device_name),
98 __entry->type,
99 __entry->timestamp
100 )
101);
102
103/*
104 * Tracepoint for kgsl waittimestamp entry
105 */
106TRACE_EVENT(kgsl_waittimestamp_entry,
107
108 TP_PROTO(struct kgsl_device *device,
109 struct kgsl_device_waittimestamp *cmd),
110
111 TP_ARGS(device, cmd),
112
113 TP_STRUCT__entry(
114 __string(device_name, device->name)
115 __field(unsigned int, timestamp)
116 __field(unsigned int, timeout)
117 ),
118
119 TP_fast_assign(
120 __assign_str(device_name, device->name);
121 __entry->timestamp = cmd->timestamp;
122 __entry->timeout = cmd->timeout;
123 ),
124
125 TP_printk(
126 "d_name=%s timestamp=%u timeout=%u",
127 __get_str(device_name),
128 __entry->timestamp,
129 __entry->timeout
130 )
131);
132
133/*
134 * Tracepoint for kgsl waittimestamp exit
135 */
136TRACE_EVENT(kgsl_waittimestamp_exit,
137
138 TP_PROTO(struct kgsl_device *device, int result),
139
140 TP_ARGS(device, result),
141
142 TP_STRUCT__entry(
143 __string(device_name, device->name)
144 __field(int, result)
145 ),
146
147 TP_fast_assign(
148 __assign_str(device_name, device->name);
149 __entry->result = result;
150 ),
151
152 TP_printk(
153 "d_name=%s result=%d",
154 __get_str(device_name),
155 __entry->result
156 )
157);
158#endif /* _KGSL_TRACE_H */
159
160/* This part must be outside protection */
161#include <trace/define_trace.h>