2 * Copyright (C) 2012-2014, 2016 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")
123 * Define a tracepoint used to gather core activity for systrace
124 * @param pid The process id for which the core activity originates from
125 * @param active If the core is active (1) or not (0)
126 * @param core_type The type of core active, either GP (1) or PP (0)
127 * @param core_id The core id that is active for the core_type
128 * @param frame_builder_id The frame builder id associated with this core activity
129 * @param flush_id The flush id associated with this core activity
131 TRACE_EVENT(mali_core_active,
133 TP_PROTO(pid_t pid, unsigned int active, unsigned int core_type, unsigned int core_id, unsigned int frame_builder_id, unsigned int flush_id),
135 TP_ARGS(pid, active, core_type, core_id, frame_builder_id, flush_id),
139 __field(unsigned int, active)
140 __field(unsigned int, core_type)
141 __field(unsigned int, core_id)
142 __field(unsigned int, frame_builder_id)
143 __field(unsigned int, flush_id)
148 __entry->active = active;
149 __entry->core_type = core_type;
150 __entry->core_id = core_id;
151 __entry->frame_builder_id = frame_builder_id;
152 __entry->flush_id = flush_id;
155 TP_printk("%s|%d|%s%i:%x|%d", __entry->active ? "S" : "F", __entry->pid, __entry->core_type ? "GP" : "PP", __entry->core_id, __entry->flush_id, __entry->frame_builder_id)
158 #endif /* MALI_LINUX_TRACE_H */
160 /* This part must exist outside the header guard. */
161 #include <trace/define_trace.h>