summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'driver/gator_events_mali_400.c')
-rw-r--r--driver/gator_events_mali_400.c1009
1 files changed, 497 insertions, 512 deletions
diff --git a/driver/gator_events_mali_400.c b/driver/gator_events_mali_400.c
index a44cd8e..34a73c8 100644
--- a/driver/gator_events_mali_400.c
+++ b/driver/gator_events_mali_400.c
@@ -17,14 +17,6 @@
17#include "gator_events_mali_common.h" 17#include "gator_events_mali_common.h"
18#include "gator_events_mali_400.h" 18#include "gator_events_mali_400.h"
19 19
20#if !defined(GATOR_MALI_INTERFACE_STYLE)
21/*
22 * At the moment, we only have users with the old style interface, so
23 * make our life easier by making it the default...
24 */
25#define GATOR_MALI_INTERFACE_STYLE (2)
26#endif
27
28/* 20/*
29 * There are (currently) three different variants of the comms between gator and Mali: 21 * There are (currently) three different variants of the comms between gator and Mali:
30 * 1 (deprecated): No software counter support 22 * 1 (deprecated): No software counter support
@@ -60,81 +52,81 @@
60#define NUM_FP_UNITS (4) 52#define NUM_FP_UNITS (4)
61 53
62enum counters { 54enum counters {
63 /* Timeline activity */ 55 /* Timeline activity */
64 ACTIVITY_VP = 0, 56 ACTIVITY_VP = 0,
65 ACTIVITY_FP0, 57 ACTIVITY_FP0,
66 ACTIVITY_FP1, 58 ACTIVITY_FP1,
67 ACTIVITY_FP2, 59 ACTIVITY_FP2,
68 ACTIVITY_FP3, 60 ACTIVITY_FP3,
69 61
70 /* L2 cache counters */ 62 /* L2 cache counters */
71 COUNTER_L2_C0, 63 COUNTER_L2_C0,
72 COUNTER_L2_C1, 64 COUNTER_L2_C1,
73 65
74 /* Vertex processor counters */ 66 /* Vertex processor counters */
75 COUNTER_VP_C0, 67 COUNTER_VP_C0,
76 COUNTER_VP_C1, 68 COUNTER_VP_C1,
77 69
78 /* Fragment processor counters */ 70 /* Fragment processor counters */
79 COUNTER_FP0_C0, 71 COUNTER_FP0_C0,
80 COUNTER_FP0_C1, 72 COUNTER_FP0_C1,
81 COUNTER_FP1_C0, 73 COUNTER_FP1_C0,
82 COUNTER_FP1_C1, 74 COUNTER_FP1_C1,
83 COUNTER_FP2_C0, 75 COUNTER_FP2_C0,
84 COUNTER_FP2_C1, 76 COUNTER_FP2_C1,
85 COUNTER_FP3_C0, 77 COUNTER_FP3_C0,
86 COUNTER_FP3_C1, 78 COUNTER_FP3_C1,
87 79
88 /* EGL Software Counters */ 80 /* EGL Software Counters */
89 COUNTER_EGL_BLIT_TIME, 81 COUNTER_EGL_BLIT_TIME,
90 82
91 /* GLES Software Counters */ 83 /* GLES Software Counters */
92 COUNTER_GLES_DRAW_ELEMENTS_CALLS, 84 COUNTER_GLES_DRAW_ELEMENTS_CALLS,
93 COUNTER_GLES_DRAW_ELEMENTS_NUM_INDICES, 85 COUNTER_GLES_DRAW_ELEMENTS_NUM_INDICES,
94 COUNTER_GLES_DRAW_ELEMENTS_NUM_TRANSFORMED, 86 COUNTER_GLES_DRAW_ELEMENTS_NUM_TRANSFORMED,
95 COUNTER_GLES_DRAW_ARRAYS_CALLS, 87 COUNTER_GLES_DRAW_ARRAYS_CALLS,
96 COUNTER_GLES_DRAW_ARRAYS_NUM_TRANSFORMED, 88 COUNTER_GLES_DRAW_ARRAYS_NUM_TRANSFORMED,
97 COUNTER_GLES_DRAW_POINTS, 89 COUNTER_GLES_DRAW_POINTS,
98 COUNTER_GLES_DRAW_LINES, 90 COUNTER_GLES_DRAW_LINES,
99 COUNTER_GLES_DRAW_LINE_LOOP, 91 COUNTER_GLES_DRAW_LINE_LOOP,
100 COUNTER_GLES_DRAW_LINE_STRIP, 92 COUNTER_GLES_DRAW_LINE_STRIP,
101 COUNTER_GLES_DRAW_TRIANGLES, 93 COUNTER_GLES_DRAW_TRIANGLES,
102 COUNTER_GLES_DRAW_TRIANGLE_STRIP, 94 COUNTER_GLES_DRAW_TRIANGLE_STRIP,
103 COUNTER_GLES_DRAW_TRIANGLE_FAN, 95 COUNTER_GLES_DRAW_TRIANGLE_FAN,
104 COUNTER_GLES_NON_VBO_DATA_COPY_TIME, 96 COUNTER_GLES_NON_VBO_DATA_COPY_TIME,
105 COUNTER_GLES_UNIFORM_BYTES_COPIED_TO_MALI, 97 COUNTER_GLES_UNIFORM_BYTES_COPIED_TO_MALI,
106 COUNTER_GLES_UPLOAD_TEXTURE_TIME, 98 COUNTER_GLES_UPLOAD_TEXTURE_TIME,
107 COUNTER_GLES_UPLOAD_VBO_TIME, 99 COUNTER_GLES_UPLOAD_VBO_TIME,
108 COUNTER_GLES_NUM_FLUSHES, 100 COUNTER_GLES_NUM_FLUSHES,
109 COUNTER_GLES_NUM_VSHADERS_GENERATED, 101 COUNTER_GLES_NUM_VSHADERS_GENERATED,
110 COUNTER_GLES_NUM_FSHADERS_GENERATED, 102 COUNTER_GLES_NUM_FSHADERS_GENERATED,
111 COUNTER_GLES_VSHADER_GEN_TIME, 103 COUNTER_GLES_VSHADER_GEN_TIME,
112 COUNTER_GLES_FSHADER_GEN_TIME, 104 COUNTER_GLES_FSHADER_GEN_TIME,
113 COUNTER_GLES_INPUT_TRIANGLES, 105 COUNTER_GLES_INPUT_TRIANGLES,
114 COUNTER_GLES_VXCACHE_HIT, 106 COUNTER_GLES_VXCACHE_HIT,
115 COUNTER_GLES_VXCACHE_MISS, 107 COUNTER_GLES_VXCACHE_MISS,
116 COUNTER_GLES_VXCACHE_COLLISION, 108 COUNTER_GLES_VXCACHE_COLLISION,
117 COUNTER_GLES_CULLED_TRIANGLES, 109 COUNTER_GLES_CULLED_TRIANGLES,
118 COUNTER_GLES_CULLED_LINES, 110 COUNTER_GLES_CULLED_LINES,
119 COUNTER_GLES_BACKFACE_TRIANGLES, 111 COUNTER_GLES_BACKFACE_TRIANGLES,
120 COUNTER_GLES_GBCLIP_TRIANGLES, 112 COUNTER_GLES_GBCLIP_TRIANGLES,
121 COUNTER_GLES_GBCLIP_LINES, 113 COUNTER_GLES_GBCLIP_LINES,
122 COUNTER_GLES_TRIANGLES_DRAWN, 114 COUNTER_GLES_TRIANGLES_DRAWN,
123 COUNTER_GLES_DRAWCALL_TIME, 115 COUNTER_GLES_DRAWCALL_TIME,
124 COUNTER_GLES_TRIANGLES_COUNT, 116 COUNTER_GLES_TRIANGLES_COUNT,
125 COUNTER_GLES_INDEPENDENT_TRIANGLES_COUNT, 117 COUNTER_GLES_INDEPENDENT_TRIANGLES_COUNT,
126 COUNTER_GLES_STRIP_TRIANGLES_COUNT, 118 COUNTER_GLES_STRIP_TRIANGLES_COUNT,
127 COUNTER_GLES_FAN_TRIANGLES_COUNT, 119 COUNTER_GLES_FAN_TRIANGLES_COUNT,
128 COUNTER_GLES_LINES_COUNT, 120 COUNTER_GLES_LINES_COUNT,
129 COUNTER_GLES_INDEPENDENT_LINES_COUNT, 121 COUNTER_GLES_INDEPENDENT_LINES_COUNT,
130 COUNTER_GLES_STRIP_LINES_COUNT, 122 COUNTER_GLES_STRIP_LINES_COUNT,
131 COUNTER_GLES_LOOP_LINES_COUNT, 123 COUNTER_GLES_LOOP_LINES_COUNT,
132 124
133 COUNTER_FILMSTRIP, 125 COUNTER_FILMSTRIP,
134 COUNTER_FREQUENCY, 126 COUNTER_FREQUENCY,
135 COUNTER_VOLTAGE, 127 COUNTER_VOLTAGE,
136 128
137 NUMBER_OF_EVENTS 129 NUMBER_OF_EVENTS
138}; 130};
139 131
140#define FIRST_ACTIVITY_EVENT ACTIVITY_VP 132#define FIRST_ACTIVITY_EVENT ACTIVITY_VP
@@ -161,7 +153,7 @@ static unsigned long counter_key[NUMBER_OF_EVENTS];
161/* The data we have recorded */ 153/* The data we have recorded */
162static u32 counter_data[NUMBER_OF_EVENTS]; 154static u32 counter_data[NUMBER_OF_EVENTS];
163/* The address to sample (or 0 if samples are sent to us) */ 155/* The address to sample (or 0 if samples are sent to us) */
164static u32* counter_address[NUMBER_OF_EVENTS]; 156static u32 *counter_address[NUMBER_OF_EVENTS];
165 157
166/* An array used to return the data we recorded 158/* An array used to return the data we recorded
167 * as key,value pairs hence the *2 159 * as key,value pairs hence the *2
@@ -177,13 +169,12 @@ static int trace_registered;
177 */ 169 */
178static u32 get_difference(u32 start, u32 end) 170static u32 get_difference(u32 start, u32 end)
179{ 171{
180 if (start - end >= 0) 172 if (start - end >= 0) {
181 { 173 return start - end;
182 return start - end; 174 }
183 }
184 175
185 // Mali counters are unsigned 32 bit values that wrap. 176 // Mali counters are unsigned 32 bit values that wrap.
186 return (4294967295u - end) + start; 177 return (4294967295u - end) + start;
187} 178}
188 179
189/** 180/**
@@ -191,8 +182,8 @@ static u32 get_difference(u32 start, u32 end)
191 */ 182 */
192static inline int is_activity_counter(unsigned int event_id) 183static inline int is_activity_counter(unsigned int event_id)
193{ 184{
194 return (event_id >= FIRST_ACTIVITY_EVENT && 185 return (event_id >= FIRST_ACTIVITY_EVENT &&
195 event_id <= LAST_ACTIVITY_EVENT); 186 event_id <= LAST_ACTIVITY_EVENT);
196} 187}
197 188
198/** 189/**
@@ -200,7 +191,7 @@ static inline int is_activity_counter(unsigned int event_id)
200 */ 191 */
201static inline int is_hw_counter(unsigned int event_id) 192static inline int is_hw_counter(unsigned int event_id)
202{ 193{
203 return (event_id >= FIRST_HW_COUNTER && event_id <= LAST_HW_COUNTER); 194 return (event_id >= FIRST_HW_COUNTER && event_id <= LAST_HW_COUNTER);
204} 195}
205 196
206#if GATOR_MALI_INTERFACE_STYLE == 2 197#if GATOR_MALI_INTERFACE_STYLE == 2
@@ -209,7 +200,7 @@ static inline int is_hw_counter(unsigned int event_id)
209 */ 200 */
210static inline int is_sw_counter(unsigned int event_id) 201static inline int is_sw_counter(unsigned int event_id)
211{ 202{
212 return (event_id >= FIRST_SW_COUNTER && event_id <= LAST_SW_COUNTER); 203 return (event_id >= FIRST_SW_COUNTER && event_id <= LAST_SW_COUNTER);
213} 204}
214#endif 205#endif
215 206
@@ -217,209 +208,204 @@ static inline int is_sw_counter(unsigned int event_id)
217/* 208/*
218 * The Mali DDK uses s64 types to contain software counter values, but gator 209 * The Mali DDK uses s64 types to contain software counter values, but gator
219 * can only use a maximum of 32 bits. This function scales a software counter 210 * can only use a maximum of 32 bits. This function scales a software counter
220 * to an appopriate range. 211 * to an appropriate range.
221 */ 212 */
222static u32 scale_sw_counter_value(unsigned int event_id, signed long long value) 213static u32 scale_sw_counter_value(unsigned int event_id, signed long long value)
223{ 214{
224 u32 scaled_value; 215 u32 scaled_value;
225 216
226 switch (event_id) { 217 switch (event_id) {
227 case COUNTER_GLES_UPLOAD_TEXTURE_TIME: 218 case COUNTER_GLES_UPLOAD_TEXTURE_TIME:
228 case COUNTER_GLES_UPLOAD_VBO_TIME: 219 case COUNTER_GLES_UPLOAD_VBO_TIME:
229 scaled_value = (u32)div_s64(value, 1000000); 220 scaled_value = (u32)div_s64(value, 1000000);
230 break; 221 break;
231 default: 222 default:
232 scaled_value = (u32)value; 223 scaled_value = (u32)value;
233 break; 224 break;
234 } 225 }
235 226
236 return scaled_value; 227 return scaled_value;
237} 228}
238#endif 229#endif
239 230
240/* Probe for continuously sampled counter */ 231/* Probe for continuously sampled counter */
241#if 0 //WE_DONT_CURRENTLY_USE_THIS_SO_SUPPRESS_WARNING 232#if 0 //WE_DONT_CURRENTLY_USE_THIS_SO_SUPPRESS_WARNING
242GATOR_DEFINE_PROBE(mali_sample_address, TP_PROTO(unsigned int event_id, u32* addr)) 233GATOR_DEFINE_PROBE(mali_sample_address, TP_PROTO(unsigned int event_id, u32 *addr))
243{ 234{
244 /* Turning on too many pr_debug statements in frequently called functions 235 /* Turning on too many pr_debug statements in frequently called functions
245 * can cause stability and/or performance problems 236 * can cause stability and/or performance problems
246 */ 237 */
247 //pr_debug("gator: mali_sample_address %d %d\n", event_id, addr); 238 //pr_debug("gator: mali_sample_address %d %d\n", event_id, addr);
248 if (event_id >= ACTIVITY_VP && event_id <= COUNTER_FP3_C1) { 239 if (event_id >= ACTIVITY_VP && event_id <= COUNTER_FP3_C1) {
249 counter_address[event_id] = addr; 240 counter_address[event_id] = addr;
250 } 241 }
251} 242}
252#endif 243#endif
253 244
254/* Probe for hardware counter events */ 245/* Probe for hardware counter events */
255GATOR_DEFINE_PROBE(mali_hw_counter, TP_PROTO(unsigned int event_id, unsigned int value)) 246GATOR_DEFINE_PROBE(mali_hw_counter, TP_PROTO(unsigned int event_id, unsigned int value))
256{ 247{
257 /* Turning on too many pr_debug statements in frequently called functions 248 /* Turning on too many pr_debug statements in frequently called functions
258 * can cause stability and/or performance problems 249 * can cause stability and/or performance problems
259 */ 250 */
260 //pr_debug("gator: mali_hw_counter %d %d\n", event_id, value); 251 //pr_debug("gator: mali_hw_counter %d %d\n", event_id, value);
261 if (is_hw_counter(event_id)) { 252 if (is_hw_counter(event_id)) {
262 counter_data[event_id] = value; 253 counter_data[event_id] = value;
263 } 254 }
264} 255}
265 256
266#if GATOR_MALI_INTERFACE_STYLE == 2 257#if GATOR_MALI_INTERFACE_STYLE == 2
267GATOR_DEFINE_PROBE(mali_sw_counter, TP_PROTO(unsigned int event_id, signed long long value)) 258GATOR_DEFINE_PROBE(mali_sw_counter, TP_PROTO(unsigned int event_id, signed long long value))
268{ 259{
269 if (is_sw_counter(event_id)) { 260 if (is_sw_counter(event_id)) {
270 counter_data[event_id] = scale_sw_counter_value(event_id, value); 261 counter_data[event_id] = scale_sw_counter_value(event_id, value);
271 } 262 }
272} 263}
273#endif /* GATOR_MALI_INTERFACE_STYLE == 2 */ 264#endif /* GATOR_MALI_INTERFACE_STYLE == 2 */
274 265
275
276#if GATOR_MALI_INTERFACE_STYLE == 3 266#if GATOR_MALI_INTERFACE_STYLE == 3
277GATOR_DEFINE_PROBE(mali_sw_counters, TP_PROTO(pid_t pid, pid_t tid, void * surface_id, unsigned int * counters)) 267GATOR_DEFINE_PROBE(mali_sw_counters, TP_PROTO(pid_t pid, pid_t tid, void *surface_id, unsigned int *counters))
278{ 268{
279 u32 i; 269 u32 i;
280 270
281 /* Copy over the values for those counters which are enabled. */ 271 /* Copy over the values for those counters which are enabled. */
282 for(i=FIRST_SW_COUNTER; i <= LAST_SW_COUNTER; i++) 272 for (i = FIRST_SW_COUNTER; i <= LAST_SW_COUNTER; i++) {
283 { 273 if (counter_enabled[i]) {
284 if(counter_enabled[i]) 274 counter_data[i] = (u32)(counters[i - FIRST_SW_COUNTER]);
285 { 275 }
286 counter_data[i] = (u32)(counters[i - FIRST_SW_COUNTER]); 276 }
287 }
288 }
289} 277}
290#endif /* GATOR_MALI_INTERFACE_STYLE == 3 */ 278#endif /* GATOR_MALI_INTERFACE_STYLE == 3 */
291 279
292static int create_files(struct super_block *sb, struct dentry *root) { 280static int create_files(struct super_block *sb, struct dentry *root)
293 struct dentry *dir; 281{
294 int event; 282 struct dentry *dir;
295 int n_fp = NUM_FP_UNITS; 283 int event;
296 284 int n_fp = NUM_FP_UNITS;
297 const char* mali_name = gator_mali_get_mali_name(); 285
298 286 const char *mali_name = gator_mali_get_mali_name();
299 /* 287
300 * Create the filesystem entries for vertex processor, fragement processor 288 /*
301 * and L2 cache timeline and hardware counters. Software counters get 289 * Create the filesystem entries for vertex processor, fragment processor
302 * special handling after this block. 290 * and L2 cache timeline and hardware counters. Software counters get
303 */ 291 * special handling after this block.
304 for (event = FIRST_ACTIVITY_EVENT; event <= LAST_HW_COUNTER; event++) 292 */
305 { 293 for (event = FIRST_ACTIVITY_EVENT; event <= LAST_HW_COUNTER; event++) {
306 char buf[40]; 294 char buf[40];
307 295
308 /* 296 /*
309 * We can skip this event if it's for a non-existent fragment 297 * We can skip this event if it's for a non-existent fragment
310 * processor. 298 * processor.
311 */ 299 */
312 if (((event - ACTIVITY_FP0 >= n_fp) && (event < COUNTER_L2_C0)) || 300 if (((event - ACTIVITY_FP0 >= n_fp) && (event < COUNTER_L2_C0))
313 (((event - COUNTER_FP0_C0)/2 >= n_fp))) 301 || (((event - COUNTER_FP0_C0) / 2 >= n_fp))) {
314 { 302 continue;
315 continue; 303 }
316 } 304
317 305 /* Otherwise, set up the filesystem entry for this event. */
318 /* Otherwise, set up the filesystem entry for this event. */ 306 switch (event) {
319 switch (event) { 307 case ACTIVITY_VP:
320 case ACTIVITY_VP: 308 snprintf(buf, sizeof buf, "ARM_%s_VP_active", mali_name);
321 snprintf(buf, sizeof buf, "ARM_%s_VP_active", mali_name); 309 break;
322 break; 310 case ACTIVITY_FP0:
323 case ACTIVITY_FP0: 311 case ACTIVITY_FP1:
324 case ACTIVITY_FP1: 312 case ACTIVITY_FP2:
325 case ACTIVITY_FP2: 313 case ACTIVITY_FP3:
326 case ACTIVITY_FP3: 314 snprintf(buf, sizeof buf, "ARM_%s_FP%d_active",
327 snprintf(buf, sizeof buf, "ARM_%s_FP%d_active", 315 mali_name, event - ACTIVITY_FP0);
328 mali_name, event - ACTIVITY_FP0); 316 break;
329 break; 317 case COUNTER_L2_C0:
330 case COUNTER_L2_C0: 318 case COUNTER_L2_C1:
331 case COUNTER_L2_C1: 319 snprintf(buf, sizeof buf, "ARM_%s_L2_cnt%d",
332 snprintf(buf, sizeof buf, "ARM_%s_L2_cnt%d", 320 mali_name, event - COUNTER_L2_C0);
333 mali_name, event - COUNTER_L2_C0); 321 break;
334 break; 322 case COUNTER_VP_C0:
335 case COUNTER_VP_C0: 323 case COUNTER_VP_C1:
336 case COUNTER_VP_C1: 324 snprintf(buf, sizeof buf, "ARM_%s_VP_cnt%d",
337 snprintf(buf, sizeof buf, "ARM_%s_VP_cnt%d", 325 mali_name, event - COUNTER_VP_C0);
338 mali_name, event - COUNTER_VP_C0); 326 break;
339 break; 327 case COUNTER_FP0_C0:
340 case COUNTER_FP0_C0: 328 case COUNTER_FP0_C1:
341 case COUNTER_FP0_C1: 329 case COUNTER_FP1_C0:
342 case COUNTER_FP1_C0: 330 case COUNTER_FP1_C1:
343 case COUNTER_FP1_C1: 331 case COUNTER_FP2_C0:
344 case COUNTER_FP2_C0: 332 case COUNTER_FP2_C1:
345 case COUNTER_FP2_C1: 333 case COUNTER_FP3_C0:
346 case COUNTER_FP3_C0: 334 case COUNTER_FP3_C1:
347 case COUNTER_FP3_C1: 335 snprintf(buf, sizeof buf, "ARM_%s_FP%d_cnt%d",
348 snprintf(buf, sizeof buf, "ARM_%s_FP%d_cnt%d", mali_name, 336 mali_name, (event - COUNTER_FP0_C0) / 2,
349 (event - COUNTER_FP0_C0) / 2, (event - COUNTER_FP0_C0) % 2); 337 (event - COUNTER_FP0_C0) % 2);
350 break; 338 break;
351 default: 339 default:
352 printk("gator: trying to create file for non-existent counter (%d)\n", event); 340 printk("gator: trying to create file for non-existent counter (%d)\n", event);
353 continue; 341 continue;
354 } 342 }
355 343
356 dir = gatorfs_mkdir(sb, root, buf); 344 dir = gatorfs_mkdir(sb, root, buf);
357 345
358 if (!dir) { 346 if (!dir) {
359 return -1; 347 return -1;
360 } 348 }
361 349
362 gatorfs_create_ulong(sb, dir, "enabled", &counter_enabled[event]); 350 gatorfs_create_ulong(sb, dir, "enabled", &counter_enabled[event]);
363 351
364 /* Only create an event node for counters that can change what they count */ 352 /* Only create an event node for counters that can change what they count */
365 if (event >= COUNTER_L2_C0) { 353 if (event >= COUNTER_L2_C0) {
366 gatorfs_create_ulong(sb, dir, "event", &counter_event[event]); 354 gatorfs_create_ulong(sb, dir, "event", &counter_event[event]);
367 } 355 }
368 356
369 gatorfs_create_ro_ulong(sb, dir, "key", &counter_key[event]); 357 gatorfs_create_ro_ulong(sb, dir, "key", &counter_key[event]);
370 } 358 }
371 359
372 /* Now set up the software counter entries */ 360 /* Now set up the software counter entries */
373 for (event = FIRST_SW_COUNTER; event <= LAST_SW_COUNTER; event++) 361 for (event = FIRST_SW_COUNTER; event <= LAST_SW_COUNTER; event++) {
374 { 362 char buf[40];
375 char buf[40]; 363
376 364 snprintf(buf, sizeof(buf), "ARM_%s_SW_%d", mali_name, event);
377 snprintf(buf, sizeof(buf), "ARM_%s_SW_%d", mali_name, event); 365
378 366 dir = gatorfs_mkdir(sb, root, buf);
379 dir = gatorfs_mkdir(sb, root, buf); 367
380 368 if (!dir) {
381 if (!dir) { 369 return -1;
382 return -1; 370 }
383 } 371
384 372 gatorfs_create_ulong(sb, dir, "enabled", &counter_enabled[event]);
385 gatorfs_create_ulong(sb, dir, "enabled", &counter_enabled[event]); 373 gatorfs_create_ro_ulong(sb, dir, "key", &counter_key[event]);
386 gatorfs_create_ro_ulong(sb, dir, "key", &counter_key[event]); 374 }
387 } 375
388 376 /* Now set up the special counter entries */
389 /* Now set up the special counter entries */ 377 for (event = FIRST_SPECIAL_COUNTER; event <= LAST_SPECIAL_COUNTER; event++) {
390 for (event = FIRST_SPECIAL_COUNTER; event <= LAST_SPECIAL_COUNTER; event++) 378 char buf[40];
391 { 379
392 char buf[40]; 380 switch (event) {
393 381 case COUNTER_FILMSTRIP:
394 switch(event) { 382 snprintf(buf, sizeof(buf), "ARM_%s_Filmstrip_cnt0", mali_name);
395 case COUNTER_FILMSTRIP: 383 break;
396 snprintf(buf, sizeof(buf), "ARM_%s_Filmstrip_cnt0", mali_name); 384
397 break; 385 case COUNTER_FREQUENCY:
398 386 snprintf(buf, sizeof(buf), "ARM_%s_Frequency", mali_name);
399 case COUNTER_FREQUENCY: 387 break;
400 snprintf(buf, sizeof(buf), "ARM_%s_Frequency", mali_name); 388
401 break; 389 case COUNTER_VOLTAGE:
402 390 snprintf(buf, sizeof(buf), "ARM_%s_Voltage", mali_name);
403 case COUNTER_VOLTAGE: 391 break;
404 snprintf(buf, sizeof(buf), "ARM_%s_Voltage", mali_name); 392
405 break; 393 default:
406 394 break;
407 default: 395 }
408 break; 396
409 } 397 dir = gatorfs_mkdir(sb, root, buf);
410 398
411 dir = gatorfs_mkdir(sb, root, buf); 399 if (!dir) {
412 400 return -1;
413 if (!dir) { 401 }
414 return -1; 402
415 } 403 gatorfs_create_ulong(sb, dir, "event", &counter_event[event]);
416 404 gatorfs_create_ulong(sb, dir, "enabled", &counter_enabled[event]);
417 gatorfs_create_ulong(sb, dir, "event", &counter_event[event]); 405 gatorfs_create_ro_ulong(sb, dir, "key", &counter_key[event]);
418 gatorfs_create_ulong(sb, dir, "enabled", &counter_enabled[event]); 406 }
419 gatorfs_create_ro_ulong(sb, dir, "key", &counter_key[event]); 407
420 } 408 return 0;
421
422 return 0;
423} 409}
424 410
425/* 411/*
@@ -434,312 +420,311 @@ static mali_profiling_get_counters_type *mali_get_counters = NULL;
434 */ 420 */
435static int is_any_sw_counter_enabled(void) 421static int is_any_sw_counter_enabled(void)
436{ 422{
437 unsigned int i; 423 unsigned int i;
438 424
439 for (i = FIRST_SW_COUNTER; i <= LAST_SW_COUNTER; i++) 425 for (i = FIRST_SW_COUNTER; i <= LAST_SW_COUNTER; i++) {
440 { 426 if (counter_enabled[i]) {
441 if (counter_enabled[i]) 427 return 1; /* At least one counter is enabled */
442 { 428 }
443 return 1; /* At least one counter is enabled */ 429 }
444 }
445 }
446 430
447 return 0; /* No s/w counters enabled */ 431 return 0; /* No s/w counters enabled */
448} 432}
449 433
450static void mali_counter_initialize(void) 434static void mali_counter_initialize(void)
451{ 435{
452 /* If a Mali driver is present and exporting the appropriate symbol 436 /* If a Mali driver is present and exporting the appropriate symbol
453 * then we can request the HW counters (of which there are only 2) 437 * then we can request the HW counters (of which there are only 2)
454 * be configured to count the desired events 438 * be configured to count the desired events
455 */ 439 */
456 mali_profiling_set_event_type *mali_set_hw_event; 440 mali_profiling_set_event_type *mali_set_hw_event;
457 mali_osk_fb_control_set_type *mali_set_fb_event; 441 mali_osk_fb_control_set_type *mali_set_fb_event;
458 mali_profiling_control_type *mali_control; 442 mali_profiling_control_type *mali_control;
459 443
460 mali_set_hw_event = symbol_get(_mali_profiling_set_event); 444 mali_set_hw_event = symbol_get(_mali_profiling_set_event);
461 445
462 if (mali_set_hw_event) { 446 if (mali_set_hw_event) {
463 int i; 447 int i;
464 448
465 pr_debug("gator: mali online _mali_profiling_set_event symbol @ %p\n",mali_set_hw_event); 449 pr_debug("gator: mali online _mali_profiling_set_event symbol @ %p\n", mali_set_hw_event);
466 450
467 for (i = FIRST_HW_COUNTER; i <= LAST_HW_COUNTER; i++) { 451 for (i = FIRST_HW_COUNTER; i <= LAST_HW_COUNTER; i++) {
468 if (counter_enabled[i]) { 452 if (counter_enabled[i]) {
469 mali_set_hw_event(i, counter_event[i]); 453 mali_set_hw_event(i, counter_event[i]);
470 } else { 454 } else {
471 mali_set_hw_event(i, 0xFFFFFFFF); 455 mali_set_hw_event(i, 0xFFFFFFFF);
472 } 456 }
473 } 457 }
474 458
475 symbol_put(_mali_profiling_set_event); 459 symbol_put(_mali_profiling_set_event);
476 } else { 460 } else {
477 printk("gator: mali online _mali_profiling_set_event symbol not found\n"); 461 printk("gator: mali online _mali_profiling_set_event symbol not found\n");
478 } 462 }
479 463
480 mali_set_fb_event = symbol_get(_mali_osk_fb_control_set); 464 mali_set_fb_event = symbol_get(_mali_osk_fb_control_set);
481 465
482 if (mali_set_fb_event) { 466 if (mali_set_fb_event) {
483 pr_debug("gator: mali online _mali_osk_fb_control_set symbol @ %p\n", mali_set_fb_event); 467 pr_debug("gator: mali online _mali_osk_fb_control_set symbol @ %p\n", mali_set_fb_event);
484 468
485 mali_set_fb_event(0,(counter_enabled[COUNTER_FILMSTRIP]?1:0)); 469 mali_set_fb_event(0, (counter_enabled[COUNTER_FILMSTRIP] ? 1 : 0));
486 470
487 symbol_put(_mali_osk_fb_control_set); 471 symbol_put(_mali_osk_fb_control_set);
488 } else { 472 } else {
489 printk("gator: mali online _mali_osk_fb_control_set symbol not found\n"); 473 printk("gator: mali online _mali_osk_fb_control_set symbol not found\n");
490 } 474 }
491 475
492 /* Generic control interface for Mali DDK. */ 476 /* Generic control interface for Mali DDK. */
493 mali_control = symbol_get(_mali_profiling_control); 477 mali_control = symbol_get(_mali_profiling_control);
494 if (mali_control) { 478 if (mali_control) {
495 /* The event attribute in the XML file keeps the actual frame rate. */ 479 /* The event attribute in the XML file keeps the actual frame rate. */
496 unsigned int rate = counter_event[COUNTER_FILMSTRIP] & 0xff; 480 unsigned int rate = counter_event[COUNTER_FILMSTRIP] & 0xff;
497 unsigned int resize_factor = (counter_event[COUNTER_FILMSTRIP] >> 8) & 0xff; 481 unsigned int resize_factor = (counter_event[COUNTER_FILMSTRIP] >> 8) & 0xff;
498 482
499 pr_debug("gator: mali online _mali_profiling_control symbol @ %p\n", mali_control); 483 pr_debug("gator: mali online _mali_profiling_control symbol @ %p\n", mali_control);
500 484
501 mali_control(SW_EVENTS_ENABLE, (is_any_sw_counter_enabled()?1:0)); 485 mali_control(SW_EVENTS_ENABLE, (is_any_sw_counter_enabled() ? 1 : 0));
502 mali_control(FBDUMP_CONTROL_ENABLE, (counter_enabled[COUNTER_FILMSTRIP]?1:0)); 486 mali_control(FBDUMP_CONTROL_ENABLE, (counter_enabled[COUNTER_FILMSTRIP] ? 1 : 0));
503 mali_control(FBDUMP_CONTROL_RATE, rate); 487 mali_control(FBDUMP_CONTROL_RATE, rate);
504 mali_control(FBDUMP_CONTROL_RESIZE_FACTOR, resize_factor); 488 mali_control(FBDUMP_CONTROL_RESIZE_FACTOR, resize_factor);
505 489
506 pr_debug("gator: sent mali_control enabled=%d, rate=%d\n", (counter_enabled[COUNTER_FILMSTRIP]?1:0), rate); 490 pr_debug("gator: sent mali_control enabled=%d, rate=%d\n", (counter_enabled[COUNTER_FILMSTRIP] ? 1 : 0), rate);
507 491
508 symbol_put(_mali_profiling_control); 492 symbol_put(_mali_profiling_control);
509 } else { 493 } else {
510 printk("gator: mali online _mali_profiling_control symbol not found\n"); 494 printk("gator: mali online _mali_profiling_control symbol not found\n");
511 } 495 }
512 496
513 mali_get_counters = symbol_get(_mali_profiling_get_counters); 497 mali_get_counters = symbol_get(_mali_profiling_get_counters);
514 if (mali_get_counters){ 498 if (mali_get_counters) {
515 pr_debug("gator: mali online _mali_profiling_get_counters symbol @ %p\n", mali_get_counters); 499 pr_debug("gator: mali online _mali_profiling_get_counters symbol @ %p\n", mali_get_counters);
516 counter_prev[COUNTER_L2_C0] = 0; 500 counter_prev[COUNTER_L2_C0] = 0;
517 counter_prev[COUNTER_L2_C1] = 0; 501 counter_prev[COUNTER_L2_C1] = 0;
518 } 502 } else {
519 else{ 503 pr_debug("gator WARNING: mali _mali_profiling_get_counters symbol not defined");
520 pr_debug("gator WARNING: mali _mali_profiling_get_counters symbol not defined"); 504 }
521 }
522} 505}
523 506
524static void mali_counter_deinitialize(void) 507static void mali_counter_deinitialize(void)
525{ 508{
526 mali_profiling_set_event_type *mali_set_hw_event; 509 mali_profiling_set_event_type *mali_set_hw_event;
527 mali_osk_fb_control_set_type *mali_set_fb_event; 510 mali_osk_fb_control_set_type *mali_set_fb_event;
528 mali_profiling_control_type *mali_control; 511 mali_profiling_control_type *mali_control;
529 512
530 mali_set_hw_event = symbol_get(_mali_profiling_set_event); 513 mali_set_hw_event = symbol_get(_mali_profiling_set_event);
531 514
532 if (mali_set_hw_event) { 515 if (mali_set_hw_event) {
533 int i; 516 int i;
534
535 pr_debug("gator: mali offline _mali_profiling_set_event symbol @ %p\n",mali_set_hw_event);
536 for (i = FIRST_HW_COUNTER; i <= LAST_HW_COUNTER; i++) {
537 mali_set_hw_event(i, 0xFFFFFFFF);
538 }
539
540 symbol_put(_mali_profiling_set_event);
541 } else {
542 printk("gator: mali offline _mali_profiling_set_event symbol not found\n");
543 }
544 517
545 mali_set_fb_event = symbol_get(_mali_osk_fb_control_set); 518 pr_debug("gator: mali offline _mali_profiling_set_event symbol @ %p\n", mali_set_hw_event);
519 for (i = FIRST_HW_COUNTER; i <= LAST_HW_COUNTER; i++) {
520 mali_set_hw_event(i, 0xFFFFFFFF);
521 }
546 522
547 if (mali_set_fb_event) { 523 symbol_put(_mali_profiling_set_event);
548 pr_debug("gator: mali offline _mali_osk_fb_control_set symbol @ %p\n", mali_set_fb_event); 524 } else {
525 printk("gator: mali offline _mali_profiling_set_event symbol not found\n");
526 }
549 527
550 mali_set_fb_event(0,0); 528 mali_set_fb_event = symbol_get(_mali_osk_fb_control_set);
551 529
552 symbol_put(_mali_osk_fb_control_set); 530 if (mali_set_fb_event) {
553 } else { 531 pr_debug("gator: mali offline _mali_osk_fb_control_set symbol @ %p\n", mali_set_fb_event);
554 printk("gator: mali offline _mali_osk_fb_control_set symbol not found\n");
555 }
556 532
557 /* Generic control interface for Mali DDK. */ 533 mali_set_fb_event(0, 0);
558 mali_control = symbol_get(_mali_profiling_control);
559 534
560 if (mali_control) { 535 symbol_put(_mali_osk_fb_control_set);
561 pr_debug("gator: mali offline _mali_profiling_control symbol @ %p\n", mali_set_fb_event); 536 } else {
537 printk("gator: mali offline _mali_osk_fb_control_set symbol not found\n");
538 }
562 539
563 /* Reset the DDK state - disable counter collection */ 540 /* Generic control interface for Mali DDK. */
564 mali_control(SW_EVENTS_ENABLE, 0); 541 mali_control = symbol_get(_mali_profiling_control);
565 542
566 mali_control(FBDUMP_CONTROL_ENABLE, 0); 543 if (mali_control) {
544 pr_debug("gator: mali offline _mali_profiling_control symbol @ %p\n", mali_set_fb_event);
567 545
568 symbol_put(_mali_profiling_control); 546 /* Reset the DDK state - disable counter collection */
569 } else { 547 mali_control(SW_EVENTS_ENABLE, 0);
570 printk("gator: mali offline _mali_profiling_control symbol not found\n");
571 }
572 548
573 if (mali_get_counters){ 549 mali_control(FBDUMP_CONTROL_ENABLE, 0);
574 symbol_put(_mali_profiling_get_counters); 550
575 } 551 symbol_put(_mali_profiling_control);
552 } else {
553 printk("gator: mali offline _mali_profiling_control symbol not found\n");
554 }
555
556 if (mali_get_counters) {
557 symbol_put(_mali_profiling_get_counters);
558 }
576 559
577} 560}
578 561
579static int start(void) { 562static int start(void)
580 // register tracepoints 563{
581 if (GATOR_REGISTER_TRACE(mali_hw_counter)) { 564 // register tracepoints
582 printk("gator: mali_hw_counter tracepoint failed to activate\n"); 565 if (GATOR_REGISTER_TRACE(mali_hw_counter)) {
583 return -1; 566 printk("gator: mali_hw_counter tracepoint failed to activate\n");
584 } 567 return -1;
568 }
585 569
586#if GATOR_MALI_INTERFACE_STYLE == 1 570#if GATOR_MALI_INTERFACE_STYLE == 1
587 /* None. */ 571 /* None. */
588#elif GATOR_MALI_INTERFACE_STYLE == 2 572#elif GATOR_MALI_INTERFACE_STYLE == 2
589 /* For patched Mali driver. */ 573 /* For patched Mali driver. */
590 if (GATOR_REGISTER_TRACE(mali_sw_counter)) { 574 if (GATOR_REGISTER_TRACE(mali_sw_counter)) {
591 printk("gator: mali_sw_counter tracepoint failed to activate\n"); 575 printk("gator: mali_sw_counter tracepoint failed to activate\n");
592 return -1; 576 return -1;
593 } 577 }
594#elif GATOR_MALI_INTERFACE_STYLE == 3 578#elif GATOR_MALI_INTERFACE_STYLE == 3
595/* For Mali drivers with built-in support. */ 579/* For Mali drivers with built-in support. */
596 if (GATOR_REGISTER_TRACE(mali_sw_counters)) { 580 if (GATOR_REGISTER_TRACE(mali_sw_counters)) {
597 printk("gator: mali_sw_counters tracepoint failed to activate\n"); 581 printk("gator: mali_sw_counters tracepoint failed to activate\n");
598 return -1; 582 return -1;
599 } 583 }
600#else 584#else
601#error Unknown GATOR_MALI_INTERFACE_STYLE option. 585#error Unknown GATOR_MALI_INTERFACE_STYLE option.
602#endif 586#endif
603 587
604 trace_registered = 1; 588 trace_registered = 1;
605 589
606 mali_counter_initialize(); 590 mali_counter_initialize();
607 return 0; 591 return 0;
608} 592}
609 593
610static void stop(void) { 594static void stop(void)
611 unsigned int cnt; 595{
596 unsigned int cnt;
612 597
613 pr_debug("gator: mali stop\n"); 598 pr_debug("gator: mali stop\n");
614 599
615 if (trace_registered) { 600 if (trace_registered) {
616 GATOR_UNREGISTER_TRACE(mali_hw_counter); 601 GATOR_UNREGISTER_TRACE(mali_hw_counter);
617 602
618#if GATOR_MALI_INTERFACE_STYLE == 1 603#if GATOR_MALI_INTERFACE_STYLE == 1
619 /* None. */ 604 /* None. */
620#elif GATOR_MALI_INTERFACE_STYLE == 2 605#elif GATOR_MALI_INTERFACE_STYLE == 2
621 /* For patched Mali driver. */ 606 /* For patched Mali driver. */
622 GATOR_UNREGISTER_TRACE(mali_sw_counter); 607 GATOR_UNREGISTER_TRACE(mali_sw_counter);
623#elif GATOR_MALI_INTERFACE_STYLE == 3 608#elif GATOR_MALI_INTERFACE_STYLE == 3
624 /* For Mali drivers with built-in support. */ 609 /* For Mali drivers with built-in support. */
625 GATOR_UNREGISTER_TRACE(mali_sw_counters); 610 GATOR_UNREGISTER_TRACE(mali_sw_counters);
626#else 611#else
627#error Unknown GATOR_MALI_INTERFACE_STYLE option. 612#error Unknown GATOR_MALI_INTERFACE_STYLE option.
628#endif 613#endif
629 614
630 pr_debug("gator: mali timeline tracepoint deactivated\n"); 615 pr_debug("gator: mali timeline tracepoint deactivated\n");
631
632 trace_registered = 0;
633 }
634 616
635 for (cnt = FIRST_ACTIVITY_EVENT; cnt < NUMBER_OF_EVENTS; cnt++) { 617 trace_registered = 0;
636 counter_enabled[cnt] = 0; 618 }
637 counter_event[cnt] = 0;
638 counter_address[cnt] = NULL;
639 }
640 619
641 mali_counter_deinitialize(); 620 for (cnt = FIRST_ACTIVITY_EVENT; cnt < NUMBER_OF_EVENTS; cnt++) {
621 counter_enabled[cnt] = 0;
622 counter_event[cnt] = 0;
623 counter_address[cnt] = NULL;
624 }
625
626 mali_counter_deinitialize();
642} 627}
643 628
644static int read(int **buffer) { 629static int read(int **buffer)
645 int cnt, len = 0; 630{
646 631 int cnt, len = 0;
647 if (smp_processor_id()) return 0; 632
648 633 if (smp_processor_id())
649 // Read the L2 C0 and C1 here. 634 return 0;
650 if (counter_enabled[COUNTER_L2_C0] || counter_enabled[COUNTER_L2_C1] ) { 635
651 u32 src0 = 0; 636 // Read the L2 C0 and C1 here.
652 u32 val0 = 0; 637 if (counter_enabled[COUNTER_L2_C0] || counter_enabled[COUNTER_L2_C1]) {
653 u32 src1 = 0; 638 u32 src0 = 0;
654 u32 val1 = 0; 639 u32 val0 = 0;
655 640 u32 src1 = 0;
656 // Poke the driver to get the counter values 641 u32 val1 = 0;
657 if (mali_get_counters){ 642
658 mali_get_counters(&src0, &val0, &src1, &val1); 643 // Poke the driver to get the counter values
659 } 644 if (mali_get_counters) {
660 645 mali_get_counters(&src0, &val0, &src1, &val1);
661 if (counter_enabled[COUNTER_L2_C0]) 646 }
662 { 647
663 // Calculate and save src0's counter val0 648 if (counter_enabled[COUNTER_L2_C0]) {
664 counter_dump[len++] = counter_key[COUNTER_L2_C0]; 649 // Calculate and save src0's counter val0
665 counter_dump[len++] = get_difference(val0, counter_prev[COUNTER_L2_C0]); 650 counter_dump[len++] = counter_key[COUNTER_L2_C0];
666 } 651 counter_dump[len++] = get_difference(val0, counter_prev[COUNTER_L2_C0]);
667 652 }
668 if (counter_enabled[COUNTER_L2_C1]) 653
669 { 654 if (counter_enabled[COUNTER_L2_C1]) {
670 // Calculate and save src1's counter val1 655 // Calculate and save src1's counter val1
671 counter_dump[len++] = counter_key[COUNTER_L2_C1]; 656 counter_dump[len++] = counter_key[COUNTER_L2_C1];
672 counter_dump[len++] = get_difference(val1, counter_prev[COUNTER_L2_C1]); 657 counter_dump[len++] = get_difference(val1, counter_prev[COUNTER_L2_C1]);
673 } 658 }
674 659
675 // Save the previous values for the counters. 660 // Save the previous values for the counters.
676 counter_prev[COUNTER_L2_C0] = val0; 661 counter_prev[COUNTER_L2_C0] = val0;
677 counter_prev[COUNTER_L2_C1] = val1; 662 counter_prev[COUNTER_L2_C1] = val1;
678 } 663 }
679 664
680 // Process other (non-timeline) counters. 665 // Process other (non-timeline) counters.
681 for (cnt = COUNTER_VP_C0; cnt <= LAST_SW_COUNTER; cnt++) { 666 for (cnt = COUNTER_VP_C0; cnt <= LAST_SW_COUNTER; cnt++) {
682 if (counter_enabled[cnt]) { 667 if (counter_enabled[cnt]) {
683 counter_dump[len++] = counter_key[cnt]; 668 counter_dump[len++] = counter_key[cnt];
684 counter_dump[len++] = counter_data[cnt]; 669 counter_dump[len++] = counter_data[cnt];
685 670
686 counter_data[cnt] = 0; 671 counter_data[cnt] = 0;
687 } 672 }
688 } 673 }
689 674
690 /* 675 /*
691 * Add in the voltage and frequency counters if enabled. Note that, since these are 676 * Add in the voltage and frequency counters if enabled. Note that, since these are
692 * actually passed as events, the counter value should not be cleared. 677 * actually passed as events, the counter value should not be cleared.
693 */ 678 */
694 cnt = COUNTER_FREQUENCY; 679 cnt = COUNTER_FREQUENCY;
695 if (counter_enabled[cnt]) { 680 if (counter_enabled[cnt]) {
696 counter_dump[len++] = counter_key[cnt]; 681 counter_dump[len++] = counter_key[cnt];
697 counter_dump[len++] = counter_data[cnt]; 682 counter_dump[len++] = counter_data[cnt];
698 } 683 }
699 684
700 cnt = COUNTER_VOLTAGE; 685 cnt = COUNTER_VOLTAGE;
701 if (counter_enabled[cnt]) { 686 if (counter_enabled[cnt]) {
702 counter_dump[len++] = counter_key[cnt]; 687 counter_dump[len++] = counter_key[cnt];
703 counter_dump[len++] = counter_data[cnt]; 688 counter_dump[len++] = counter_data[cnt];
704 } 689 }
705 690
706 691 if (buffer) {
707 if (buffer) { 692 *buffer = (int *)counter_dump;
708 *buffer = (int*) counter_dump; 693 }
709 } 694
710 695 return len;
711 return len;
712} 696}
713 697
714static struct gator_interface gator_events_mali_interface = { 698static struct gator_interface gator_events_mali_interface = {
715 .create_files = create_files, 699 .create_files = create_files,
716 .start = start, 700 .start = start,
717 .stop = stop, 701 .stop = stop,
718 .read = read, 702 .read = read,
719}; 703};
720 704
721extern void gator_events_mali_log_dvfs_event(unsigned int frequency_mhz, unsigned int voltage_mv) { 705extern void gator_events_mali_log_dvfs_event(unsigned int frequency_mhz, unsigned int voltage_mv)
706{
722 counter_data[COUNTER_FREQUENCY] = frequency_mhz; 707 counter_data[COUNTER_FREQUENCY] = frequency_mhz;
723 counter_data[COUNTER_VOLTAGE] = voltage_mv; 708 counter_data[COUNTER_VOLTAGE] = voltage_mv;
724} 709}
725 710
726int gator_events_mali_init(void) 711int gator_events_mali_init(void)
727{ 712{
728 unsigned int cnt; 713 unsigned int cnt;
729 714
730 pr_debug("gator: mali init\n"); 715 pr_debug("gator: mali init\n");
731 716
732 for (cnt = FIRST_ACTIVITY_EVENT; cnt < NUMBER_OF_EVENTS; cnt++) { 717 for (cnt = FIRST_ACTIVITY_EVENT; cnt < NUMBER_OF_EVENTS; cnt++) {
733 counter_enabled[cnt] = 0; 718 counter_enabled[cnt] = 0;
734 counter_event[cnt] = 0; 719 counter_event[cnt] = 0;
735 counter_key[cnt] = gator_events_get_key(); 720 counter_key[cnt] = gator_events_get_key();
736 counter_address[cnt] = NULL; 721 counter_address[cnt] = NULL;
737 counter_data[cnt] = 0; 722 counter_data[cnt] = 0;
738 } 723 }
739 724
740 trace_registered = 0; 725 trace_registered = 0;
741 726
742 return gator_events_install(&gator_events_mali_interface); 727 return gator_events_install(&gator_events_mali_interface);
743} 728}
744 729
745gator_events_init(gator_events_mali_init); 730gator_events_init(gator_events_mali_init);