diff options
author | Jon Medhurst | 2014-04-24 09:23:44 -0500 |
---|---|---|
committer | Jon Medhurst | 2014-04-24 09:23:44 -0500 |
commit | ce2784285261bd64ce3c49a9e1c5f6624854cc99 (patch) | |
tree | 779d2d7cbed00255011510713e2ec49fec8740bd /driver/gator_trace_gpu.c | |
parent | 81e9a122ea802cf8fcaddfc91c3912e7076eed6e (diff) | |
parent | ba783f1443773505231ac2808c9a3716c3c2f3ae (diff) | |
download | arm-ds5-gator-ce2784285261bd64ce3c49a9e1c5f6624854cc99.tar.gz arm-ds5-gator-ce2784285261bd64ce3c49a9e1c5f6624854cc99.tar.xz arm-ds5-gator-ce2784285261bd64ce3c49a9e1c5f6624854cc99.zip |
Diffstat (limited to 'driver/gator_trace_gpu.c')
-rw-r--r-- | driver/gator_trace_gpu.c | 38 |
1 files changed, 7 insertions, 31 deletions
diff --git a/driver/gator_trace_gpu.c b/driver/gator_trace_gpu.c index 6332098..6afa548 100644 --- a/driver/gator_trace_gpu.c +++ b/driver/gator_trace_gpu.c | |||
@@ -23,8 +23,6 @@ | |||
23 | #endif | 23 | #endif |
24 | #endif | 24 | #endif |
25 | 25 | ||
26 | #include "gator_trace_gpu.h" | ||
27 | |||
28 | /* | 26 | /* |
29 | * Taken from MALI_PROFILING_EVENT_TYPE_* items in Mali DDK. | 27 | * Taken from MALI_PROFILING_EVENT_TYPE_* items in Mali DDK. |
30 | */ | 28 | */ |
@@ -37,7 +35,6 @@ | |||
37 | /* Note whether tracepoints have been registered */ | 35 | /* Note whether tracepoints have been registered */ |
38 | static int mali_timeline_trace_registered; | 36 | static int mali_timeline_trace_registered; |
39 | static int mali_job_slots_trace_registered; | 37 | static int mali_job_slots_trace_registered; |
40 | static int gpu_trace_registered; | ||
41 | 38 | ||
42 | enum { | 39 | enum { |
43 | GPU_UNIT_NONE = 0, | 40 | GPU_UNIT_NONE = 0, |
@@ -50,6 +47,8 @@ enum { | |||
50 | #define MALI_4xx (0x0b07) | 47 | #define MALI_4xx (0x0b07) |
51 | #define MALI_T6xx (0x0056) | 48 | #define MALI_T6xx (0x0056) |
52 | 49 | ||
50 | #if defined(MALI_SUPPORT) | ||
51 | |||
53 | struct mali_gpu_job { | 52 | struct mali_gpu_job { |
54 | int count; | 53 | int count; |
55 | int last_tgid; | 54 | int last_tgid; |
@@ -113,6 +112,7 @@ static void mali_gpu_stop(int unit, int core) | |||
113 | marshal_sched_gpu_start(unit, core, last_tgid, last_pid/*, last_job_id*/); | 112 | marshal_sched_gpu_start(unit, core, last_tgid, last_pid/*, last_job_id*/); |
114 | } | 113 | } |
115 | } | 114 | } |
115 | #endif | ||
116 | 116 | ||
117 | #if defined(MALI_SUPPORT) && (MALI_SUPPORT != MALI_T6xx) | 117 | #if defined(MALI_SUPPORT) && (MALI_SUPPORT != MALI_T6xx) |
118 | #include "gator_events_mali_4xx.h" | 118 | #include "gator_events_mali_4xx.h" |
@@ -232,16 +232,6 @@ GATOR_DEFINE_PROBE(mali_job_slots_event, TP_PROTO(unsigned int event_id, unsigne | |||
232 | } | 232 | } |
233 | #endif | 233 | #endif |
234 | 234 | ||
235 | GATOR_DEFINE_PROBE(gpu_activity_start, TP_PROTO(int gpu_unit, int gpu_core, struct task_struct *p)) | ||
236 | { | ||
237 | mali_gpu_enqueue(gpu_unit, gpu_core, (int)p->tgid, (int)p->pid, 0); | ||
238 | } | ||
239 | |||
240 | GATOR_DEFINE_PROBE(gpu_activity_stop, TP_PROTO(int gpu_unit, int gpu_core)) | ||
241 | { | ||
242 | mali_gpu_stop(gpu_unit, gpu_core); | ||
243 | } | ||
244 | |||
245 | static int gator_trace_gpu_start(void) | 235 | static int gator_trace_gpu_start(void) |
246 | { | 236 | { |
247 | /* | 237 | /* |
@@ -249,8 +239,10 @@ static int gator_trace_gpu_start(void) | |||
249 | * Absence of gpu trace points is not an error | 239 | * Absence of gpu trace points is not an error |
250 | */ | 240 | */ |
251 | 241 | ||
242 | #if defined(MALI_SUPPORT) | ||
252 | memset(&mali_gpu_jobs, 0, sizeof(mali_gpu_jobs)); | 243 | memset(&mali_gpu_jobs, 0, sizeof(mali_gpu_jobs)); |
253 | gpu_trace_registered = mali_timeline_trace_registered = mali_job_slots_trace_registered = 0; | 244 | #endif |
245 | mali_timeline_trace_registered = mali_job_slots_trace_registered = 0; | ||
254 | 246 | ||
255 | #if defined(MALI_SUPPORT) && (MALI_SUPPORT != MALI_T6xx) | 247 | #if defined(MALI_SUPPORT) && (MALI_SUPPORT != MALI_T6xx) |
256 | if (!GATOR_REGISTER_TRACE(mali_timeline_event)) { | 248 | if (!GATOR_REGISTER_TRACE(mali_timeline_event)) { |
@@ -264,17 +256,6 @@ static int gator_trace_gpu_start(void) | |||
264 | } | 256 | } |
265 | #endif | 257 | #endif |
266 | 258 | ||
267 | if (!mali_timeline_trace_registered) { | ||
268 | if (GATOR_REGISTER_TRACE(gpu_activity_start)) { | ||
269 | return 0; | ||
270 | } | ||
271 | if (GATOR_REGISTER_TRACE(gpu_activity_stop)) { | ||
272 | GATOR_UNREGISTER_TRACE(gpu_activity_start); | ||
273 | return 0; | ||
274 | } | ||
275 | gpu_trace_registered = 1; | ||
276 | } | ||
277 | |||
278 | return 0; | 259 | return 0; |
279 | } | 260 | } |
280 | 261 | ||
@@ -292,10 +273,5 @@ static void gator_trace_gpu_stop(void) | |||
292 | } | 273 | } |
293 | #endif | 274 | #endif |
294 | 275 | ||
295 | if (gpu_trace_registered) { | 276 | mali_timeline_trace_registered = mali_job_slots_trace_registered = 0; |
296 | GATOR_UNREGISTER_TRACE(gpu_activity_stop); | ||
297 | GATOR_UNREGISTER_TRACE(gpu_activity_start); | ||
298 | } | ||
299 | |||
300 | gpu_trace_registered = mali_timeline_trace_registered = mali_job_slots_trace_registered = 0; | ||
301 | } | 277 | } |