gator: Version 5.18
[firefly-linux-kernel-4.4.55.git] / drivers / gator / gator_trace_gpu.h
1 /**
2  * Copyright (C) ARM Limited 2010-2014. All rights reserved.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  */
8
9 #undef TRACE_GPU
10 #define TRACE_GPU gpu
11
12 #if !defined(_TRACE_GPU_H)
13 #define _TRACE_GPU_H
14
15 #include <linux/tracepoint.h>
16
17 /*
18  * UNIT - the GPU processor type
19  *  1 = Vertex Processor
20  *  2 = Fragment Processor
21  *
22  * CORE - the GPU processor core number
23  *  this is not the CPU core number
24  */
25
26 /*
27  * Tracepoint for calling GPU unit start activity on core
28  */
29 TRACE_EVENT(gpu_activity_start,
30
31             TP_PROTO(int gpu_unit, int gpu_core, struct task_struct *p),
32
33             TP_ARGS(gpu_unit, gpu_core, p),
34
35             TP_STRUCT__entry(
36                              __field(int, gpu_unit)
37                              __field(int, gpu_core)
38                              __array(char, comm, TASK_COMM_LEN)
39                              __field(pid_t, pid)
40             ),
41
42             TP_fast_assign(
43                            __entry->gpu_unit = gpu_unit;
44                            __entry->gpu_core = gpu_core;
45                            memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
46                            __entry->pid = p->pid;
47             ),
48
49             TP_printk("unit=%d core=%d comm=%s pid=%d",
50                       __entry->gpu_unit, __entry->gpu_core, __entry->comm,
51                       __entry->pid)
52     );
53
54 /*
55  * Tracepoint for calling GPU unit stop activity on core
56  */
57 TRACE_EVENT(gpu_activity_stop,
58
59             TP_PROTO(int gpu_unit, int gpu_core),
60
61             TP_ARGS(gpu_unit, gpu_core),
62
63             TP_STRUCT__entry(
64                              __field(int, gpu_unit)
65                              __field(int, gpu_core)
66             ),
67
68             TP_fast_assign(
69                            __entry->gpu_unit = gpu_unit;
70                            __entry->gpu_core = gpu_core;
71             ),
72
73             TP_printk("unit=%d core=%d", __entry->gpu_unit, __entry->gpu_core)
74     );
75
76 #endif /* _TRACE_GPU_H */
77
78 /* This part must be outside protection */
79 #include <trace/define_trace.h>