2 * Copyright (C) 2011-2012 ARM Limited. All rights reserved.
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.
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.
11 #if !defined (MALI_LINUX_TRACE_H) || defined (TRACE_HEADER_MULTI_READ)
12 #define MALI_LINUX_TRACE_H
14 #include <linux/types.h>
16 #include <linux/stringify.h>
17 #include <linux/tracepoint.h>
20 #define TRACE_SYSTEM mali
21 #define TRACE_SYSTEM_STRING __stringfy(TRACE_SYSTEM)
23 #define TRACE_INCLUDE_PATH .
24 #define TRACE_INCLUDE_FILE mali_linux_trace
27 * Define the tracepoint used to communicate the status of a GPU. Called
28 * when a GPU turns on or turns off.
30 * @param event_id The type of the event. This parameter is a bitfield
31 * encoding the type of the event.
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.
39 TRACE_EVENT(mali_timeline_event,
41 TP_PROTO(unsigned int event_id, unsigned int d0, unsigned int d1,
42 unsigned int d2, unsigned int d3, unsigned int d4),
44 TP_ARGS(event_id, d0, d1, d2, d3, d4),
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)
56 __entry->event_id = event_id;
64 TP_printk("event=%d", __entry->event_id)
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.
73 * @param counter_id The counter ID.
74 * @param value The value of the counter.
76 TRACE_EVENT(mali_hw_counter,
78 TP_PROTO(unsigned int counter_id, unsigned int value),
80 TP_ARGS(counter_id, value),
83 __field(unsigned int, counter_id)
84 __field(unsigned int, value)
88 __entry->counter_id = counter_id;
91 TP_printk("event %d = %d", __entry->counter_id, __entry->value)
95 * Define a tracepoint used to send a bundle of software counters.
97 * @param counters The bundle of counters.
99 TRACE_EVENT(mali_sw_counters,
101 TP_PROTO(pid_t pid, pid_t tid, void * surface_id, unsigned int * counters),
103 TP_ARGS(pid, tid, surface_id, counters),
108 __field(void *, surface_id)
109 __field(unsigned int *, counters)
115 __entry->surface_id = surface_id;
116 __entry->counters = counters;
119 TP_printk("counters were %s", __entry->counters == NULL? "NULL" : "not NULL")
122 #endif /* MALI_LINUX_TRACE_H */
124 /* This part must exist outside the header guard. */
125 #include <trace/define_trace.h>