tizen 2.4 release
[kernel/linux-3.0.git] / drivers / gpu / arm / mali400 / mali / linux / mali_linux_trace.h
1 /*
2  * Copyright (C) 2011-2012 ARM Limited. All rights reserved.
3  *
4  * This program is free software and is provided to you under the terms of the GNU General Public License version 2
5  * as published by the Free Software Foundation, and any use by you of this program is subject to the terms of such GNU licence.
6  *
7  * A copy of the licence is included with the program, and can also be obtained from Free Software
8  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
9  */
10
11 #if !defined (MALI_LINUX_TRACE_H) || defined (TRACE_HEADER_MULTI_READ)
12 #define MALI_LINUX_TRACE_H
13
14 #include <linux/types.h>
15
16 #include <linux/stringify.h>
17 #include <linux/tracepoint.h>
18
19 #undef  TRACE_SYSTEM
20 #define TRACE_SYSTEM mali
21 #define TRACE_SYSTEM_STRING __stringfy(TRACE_SYSTEM)
22
23 #define TRACE_INCLUDE_PATH .
24 #define TRACE_INCLUDE_FILE mali_linux_trace
25
26 /**
27  * Define the tracepoint used to communicate the status of a GPU. Called 
28  * when a GPU turns on or turns off.
29  *
30  * @param event_id The type of the event. This parameter is a bitfield 
31  *  encoding the type of the event.
32  *
33  * @param d0 First data parameter.
34  * @param d1 Second data parameter.
35  * @param d2 Third data parameter.
36  * @param d3 Fourth data parameter.
37  * @param d4 Fifth data parameter.
38  */
39 TRACE_EVENT(mali_timeline_event,
40
41     TP_PROTO(unsigned int event_id, unsigned int d0, unsigned int d1, 
42         unsigned int d2, unsigned int d3, unsigned int d4),
43
44     TP_ARGS(event_id, d0, d1, d2, d3, d4),
45
46     TP_STRUCT__entry(
47         __field(unsigned int, event_id)
48         __field(unsigned int, d0)
49         __field(unsigned int, d1)
50         __field(unsigned int, d2)
51         __field(unsigned int, d3)
52         __field(unsigned int, d4)
53     ),
54
55     TP_fast_assign(
56         __entry->event_id = event_id;
57         __entry->d0 = d0;
58         __entry->d1 = d1;
59         __entry->d2 = d2;
60         __entry->d3 = d3;
61         __entry->d4 = d4;
62     ),
63
64     TP_printk("event=%d", __entry->event_id)
65 );
66
67 /**
68  * Define a tracepoint used to regsiter the value of a hardware counter.
69  * Hardware counters belonging to the vertex or fragment processor are
70  * reported via this tracepoint each frame, whilst L2 cache hardware
71  * counters are reported continuously.
72  *
73  * @param counter_id The counter ID.
74  * @param value The value of the counter.
75  */
76 TRACE_EVENT(mali_hw_counter,
77
78     TP_PROTO(unsigned int counter_id, unsigned int value),
79
80     TP_ARGS(counter_id, value),
81
82     TP_STRUCT__entry(
83         __field(unsigned int, counter_id)
84         __field(unsigned int, value)
85     ),
86
87     TP_fast_assign(
88         __entry->counter_id = counter_id;
89     ),
90
91     TP_printk("event %d = %d", __entry->counter_id, __entry->value)
92 );
93
94 /**
95  * Define a tracepoint used to send a bundle of software counters.
96  *
97  * @param counters The bundle of counters.
98  */
99 TRACE_EVENT(mali_sw_counters,
100
101     TP_PROTO(pid_t pid, pid_t tid, void * surface_id, unsigned int * counters),
102
103     TP_ARGS(pid, tid, surface_id, counters),
104
105     TP_STRUCT__entry(
106             __field(pid_t, pid)
107             __field(pid_t, tid)
108             __field(void *, surface_id)
109             __field(unsigned int *, counters)
110     ),
111
112     TP_fast_assign(
113             __entry->pid = pid;
114                         __entry->tid = tid;
115                         __entry->surface_id = surface_id;
116                         __entry->counters = counters;
117     ),
118
119     TP_printk("counters were %s", __entry->counters == NULL? "NULL" : "not NULL")
120 );
121
122 #endif /* MALI_LINUX_TRACE_H */
123
124 /* This part must exist outside the header guard. */
125 #include <trace/define_trace.h>
126