summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSaleh Dindar <sdindar@nvidia.com>2018-05-15 12:35:02 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-06-05 17:54:03 -0400
commit6bf0a4b49ef81a0affbb642bfaf67e33b37c2f12 (patch)
treee2b246346f3723d774a942a4a4f85cd06bfc9c32 /include
parent000406ecbe1d7bf0f3d2ff3df54b4c5ac7a9133e (diff)
nvhost:pva: Add VPU performance tracking
VPU performance tracking is added by using post-actions and delivering results to the trace JIRA PVA-1087 Change-Id: Ia0030348665c8c0857cf107f4f76d9cc6052f1f2 Signed-off-by: Saleh Dindar <sdindar@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1719719 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'include')
-rw-r--r--include/trace/events/nvhost_pva.h53
-rw-r--r--include/uapi/linux/nvhost_events.h15
2 files changed, 67 insertions, 1 deletions
diff --git a/include/trace/events/nvhost_pva.h b/include/trace/events/nvhost_pva.h
index 4571739f3..c921c5e08 100644
--- a/include/trace/events/nvhost_pva.h
+++ b/include/trace/events/nvhost_pva.h
@@ -140,6 +140,59 @@ TRACE_EVENT(nvhost_pva_task_stats,
140 __entry->complete_time, __entry->vpu_assigned) 140 __entry->complete_time, __entry->vpu_assigned)
141); 141);
142 142
143TRACE_EVENT(nvhost_pva_task_vpu_perf,
144
145 TP_PROTO(
146 const char *name,
147 u32 index,
148 u32 count,
149 u32 sum,
150 u64 sum_squared,
151 u32 min,
152 u32 max
153 ),
154
155 TP_ARGS(
156 name,
157 index,
158 count,
159 sum,
160 sum_squared,
161 min,
162 max
163 ),
164
165 TP_STRUCT__entry(
166 __field(const char *, name)
167 __field(u32, index)
168 __field(u32, count)
169 __field(u32, sum)
170 __field(u64, sum_squared)
171 __field(u32, min)
172 __field(u32, max)
173 ),
174
175 TP_fast_assign(
176 __entry->name = name;
177 __entry->index = index;
178 __entry->count = count;
179 __entry->sum = sum;
180 __entry->sum_squared = sum_squared;
181 __entry->min = min;
182 __entry->max = max;
183 ),
184
185 TP_printk("%s\tindex: %u\tcount: %u\taverage: %u\t"
186 "variance: %llu\tminimum: %u\t"
187 "maximum: %u",
188 __entry->name, __entry->index, __entry->count,
189 __entry->sum / __entry->count,
190 ((u64)__entry->count * __entry->sum_squared -
191 (u64)__entry->sum * (u64)__entry->sum)
192 / __entry->count / __entry->count,
193 __entry->min, __entry->max)
194);
195
143#endif /* _TRACE_NVHOST_PVA_H */ 196#endif /* _TRACE_NVHOST_PVA_H */
144 197
145/* This part must be outside protection */ 198/* This part must be outside protection */
diff --git a/include/uapi/linux/nvhost_events.h b/include/uapi/linux/nvhost_events.h
index 0f1da7064..1282ee38a 100644
--- a/include/uapi/linux/nvhost_events.h
+++ b/include/uapi/linux/nvhost_events.h
@@ -67,6 +67,16 @@ struct nvhost_task_end {
67 u32 syncpt_thresh; 67 u32 syncpt_thresh;
68} __packed; 68} __packed;
69 69
70struct nvhost_vpu_perf_counter {
71 u32 operation;
72 u32 tag;
73 u32 count;
74 u32 average;
75 u64 variance;
76 u32 minimum;
77 u32 maximum;
78} __packed;
79
70enum { 80enum {
71 /* struct nvhost_task_submit */ 81 /* struct nvhost_task_submit */
72 NVHOST_TASK_SUBMIT = 0, 82 NVHOST_TASK_SUBMIT = 0,
@@ -77,7 +87,10 @@ enum {
77 /* struct nvhost_task_end */ 87 /* struct nvhost_task_end */
78 NVHOST_TASK_END = 2, 88 NVHOST_TASK_END = 2,
79 89
80 NVHOST_NUM_EVENT_TYPES = 3 90 /* struct nvhost_vpu_perf_counter */
91 NVHOST_VPU_PERF_COUNTER = 3,
92
93 NVHOST_NUM_EVENT_TYPES = 4
81}; 94};
82 95
83enum { 96enum {