• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *
3  * (C) COPYRIGHT 2015-2017 ARM Limited. All rights reserved.
4  *
5  * This program is free software and is provided to you under the terms of the
6  * GNU General Public License version 2 as published by the Free Software
7  * Foundation, and any use by you of this program is subject to the terms
8  * of such GNU licence.
9  *
10  * A copy of the licence is included with the program, and can also be obtained
11  * from Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
12  * Boston, MA  02110-1301, USA.
13  *
14  */
15 
16 
17 
18 #if !defined(_KBASE_TLSTREAM_H)
19 #define _KBASE_TLSTREAM_H
20 
21 #include <mali_kbase.h>
22 
23 /*****************************************************************************/
24 
25 /**
26  * kbase_tlstream_init - initialize timeline infrastructure in kernel
27  * Return: zero on success, negative number on error
28  */
29 int kbase_tlstream_init(void);
30 
31 /**
32  * kbase_tlstream_term - terminate timeline infrastructure in kernel
33  *
34  * Timeline need have to been previously enabled with kbase_tlstream_init().
35  */
36 void kbase_tlstream_term(void);
37 
38 /**
39  * kbase_tlstream_acquire - acquire timeline stream file descriptor
40  * @kctx:  kernel common context
41  * @flags: timeline stream flags
42  *
43  * This descriptor is meant to be used by userspace timeline to gain access to
44  * kernel timeline stream. This stream is later broadcasted by user space to the
45  * timeline client.
46  * Only one entity can own the descriptor at any given time. Descriptor shall be
47  * closed if unused. If descriptor cannot be obtained (i.e. when it is already
48  * being used) return will be a negative value.
49  *
50  * Return: file descriptor on success, negative number on error
51  */
52 int kbase_tlstream_acquire(struct kbase_context *kctx, u32 flags);
53 
54 /**
55  * kbase_tlstream_flush_streams - flush timeline streams.
56  *
57  * Function will flush pending data in all timeline streams.
58  */
59 void kbase_tlstream_flush_streams(void);
60 
61 /**
62  * kbase_tlstream_reset_body_streams - reset timeline body streams.
63  *
64  * Function will discard pending data in all timeline body streams.
65  */
66 void kbase_tlstream_reset_body_streams(void);
67 
68 #if MALI_UNIT_TEST
69 /**
70  * kbase_tlstream_test - start timeline stream data generator
71  * @tpw_count: number of trace point writers in each context
72  * @msg_delay: time delay in milliseconds between trace points written by one
73  *             writer
74  * @msg_count: number of trace points written by one writer
75  * @aux_msg:   if non-zero aux messages will be included
76  *
77  * This test starts a requested number of asynchronous writers in both IRQ and
78  * thread context. Each writer will generate required number of test
79  * tracepoints (tracepoints with embedded information about writer that
80  * should be verified by user space reader). Tracepoints will be emitted in
81  * all timeline body streams. If aux_msg is non-zero writer will also
82  * generate not testable tracepoints (tracepoints without information about
83  * writer). These tracepoints are used to check correctness of remaining
84  * timeline message generating functions. Writer will wait requested time
85  * between generating another set of messages. This call blocks until all
86  * writers finish.
87  */
88 void kbase_tlstream_test(
89 		unsigned int tpw_count,
90 		unsigned int msg_delay,
91 		unsigned int msg_count,
92 		int          aux_msg);
93 
94 /**
95  * kbase_tlstream_stats - read timeline stream statistics
96  * @bytes_collected: will hold number of bytes read by the user
97  * @bytes_generated: will hold number of bytes generated by trace points
98  */
99 void kbase_tlstream_stats(u32 *bytes_collected, u32 *bytes_generated);
100 #endif /* MALI_UNIT_TEST */
101 
102 /*****************************************************************************/
103 
104 #define TL_ATOM_STATE_IDLE 0
105 #define TL_ATOM_STATE_READY 1
106 #define TL_ATOM_STATE_DONE 2
107 #define TL_ATOM_STATE_POSTED 3
108 
109 void __kbase_tlstream_tl_summary_new_ctx(void *context, u32 nr, u32 tgid);
110 void __kbase_tlstream_tl_summary_new_gpu(void *gpu, u32 id, u32 core_count);
111 void __kbase_tlstream_tl_summary_new_lpu(void *lpu, u32 nr, u32 fn);
112 void __kbase_tlstream_tl_summary_lifelink_lpu_gpu(void *lpu, void *gpu);
113 void __kbase_tlstream_tl_summary_new_as(void *as, u32 nr);
114 void __kbase_tlstream_tl_summary_lifelink_as_gpu(void *as, void *gpu);
115 void __kbase_tlstream_tl_new_ctx(void *context, u32 nr, u32 tgid);
116 void __kbase_tlstream_tl_new_atom(void *atom, u32 nr);
117 void __kbase_tlstream_tl_del_ctx(void *context);
118 void __kbase_tlstream_tl_del_atom(void *atom);
119 void __kbase_tlstream_tl_ret_ctx_lpu(void *context, void *lpu);
120 void __kbase_tlstream_tl_ret_atom_ctx(void *atom, void *context);
121 void __kbase_tlstream_tl_ret_atom_lpu(
122 		void *atom, void *lpu, const char *attrib_match_list);
123 void __kbase_tlstream_tl_nret_ctx_lpu(void *context, void *lpu);
124 void __kbase_tlstream_tl_nret_atom_ctx(void *atom, void *context);
125 void __kbase_tlstream_tl_nret_atom_lpu(void *atom, void *lpu);
126 void __kbase_tlstream_tl_ret_as_ctx(void *as, void *ctx);
127 void __kbase_tlstream_tl_nret_as_ctx(void *as, void *ctx);
128 void __kbase_tlstream_tl_ret_atom_as(void *atom, void *as);
129 void __kbase_tlstream_tl_nret_atom_as(void *atom, void *as);
130 void __kbase_tlstream_tl_dep_atom_atom(void *atom1, void *atom2);
131 void __kbase_tlstream_tl_ndep_atom_atom(void *atom1, void *atom2);
132 void __kbase_tlstream_tl_rdep_atom_atom(void *atom1, void *atom2);
133 void __kbase_tlstream_tl_attrib_atom_config(
134 		void *atom, u64 jd, u64 affinity, u32 config);
135 void __kbase_tlstream_tl_attrib_atom_priority(void *atom, u32 prio);
136 void __kbase_tlstream_tl_attrib_atom_state(void *atom, u32 state);
137 void __kbase_tlstream_tl_attrib_atom_priority_change(void *atom);
138 void __kbase_tlstream_tl_attrib_atom_jit(
139 		void *atom, u64 edit_addr, u64 new_addr);
140 void __kbase_tlstream_tl_attrib_as_config(
141 		void *as, u64 transtab, u64 memattr, u64 transcfg);
142 void __kbase_tlstream_tl_event_atom_softstop_ex(void *atom);
143 void __kbase_tlstream_tl_event_lpu_softstop(void *lpu);
144 void __kbase_tlstream_tl_event_atom_softstop_issue(void *atom);
145 void __kbase_tlstream_jd_gpu_soft_reset(void *gpu);
146 void __kbase_tlstream_aux_pm_state(u32 core_type, u64 state);
147 void __kbase_tlstream_aux_pagefault(u32 ctx_nr, u64 page_count_change);
148 void __kbase_tlstream_aux_pagesalloc(u32 ctx_nr, u64 page_count);
149 void __kbase_tlstream_aux_devfreq_target(u64 target_freq);
150 void __kbase_tlstream_aux_protected_enter_start(void *gpu);
151 void __kbase_tlstream_aux_protected_enter_end(void *gpu);
152 void __kbase_tlstream_aux_protected_leave_start(void *gpu);
153 void __kbase_tlstream_aux_protected_leave_end(void *gpu);
154 
155 #define TLSTREAM_ENABLED (1 << 31)
156 
157 extern atomic_t kbase_tlstream_enabled;
158 
159 #define __TRACE_IF_ENABLED(trace_name, ...)                         \
160 	do {                                                        \
161 		int enabled = atomic_read(&kbase_tlstream_enabled); \
162 		if (enabled & TLSTREAM_ENABLED)                     \
163 			__kbase_tlstream_##trace_name(__VA_ARGS__); \
164 	} while (0)
165 
166 #define __TRACE_IF_ENABLED_LATENCY(trace_name, ...)                     \
167 	do {                                                            \
168 		int enabled = atomic_read(&kbase_tlstream_enabled);     \
169 		if (enabled & BASE_TLSTREAM_ENABLE_LATENCY_TRACEPOINTS) \
170 			__kbase_tlstream_##trace_name(__VA_ARGS__);     \
171 	} while (0)
172 
173 #define __TRACE_IF_ENABLED_JD(trace_name, ...)                      \
174 	do {                                                        \
175 		int enabled = atomic_read(&kbase_tlstream_enabled); \
176 		if (enabled & BASE_TLSTREAM_JOB_DUMPING_ENABLED)    \
177 			__kbase_tlstream_##trace_name(__VA_ARGS__); \
178 	} while (0)
179 
180 /*****************************************************************************/
181 
182 /**
183  * KBASE_TLSTREAM_TL_SUMMARY_NEW_CTX - create context object in timeline
184  *                                     summary
185  * @context: name of the context object
186  * @nr:      context number
187  * @tgid:    thread Group Id
188  *
189  * Function emits a timeline message informing about context creation. Context
190  * is created with context number (its attribute), that can be used to link
191  * kbase context with userspace context.
192  * This message is directed to timeline summary stream.
193  */
194 #define KBASE_TLSTREAM_TL_SUMMARY_NEW_CTX(context, nr, tgid) \
195 	__TRACE_IF_ENABLED(tl_summary_new_ctx, context, nr, tgid)
196 
197 /**
198  * KBASE_TLSTREAM_TL_SUMMARY_NEW_GPU - create GPU object in timeline summary
199  * @gpu:        name of the GPU object
200  * @id:         id value of this GPU
201  * @core_count: number of cores this GPU hosts
202  *
203  * Function emits a timeline message informing about GPU creation. GPU is
204  * created with two attributes: id and core count.
205  * This message is directed to timeline summary stream.
206  */
207 #define KBASE_TLSTREAM_TL_SUMMARY_NEW_GPU(gpu, id, core_count) \
208 	__TRACE_IF_ENABLED(tl_summary_new_gpu, gpu, id, core_count)
209 
210 /**
211  * KBASE_TLSTREAM_TL_SUMMARY_NEW_LPU - create LPU object in timeline summary
212  * @lpu: name of the Logical Processing Unit object
213  * @nr:  sequential number assigned to this LPU
214  * @fn:  property describing this LPU's functional abilities
215  *
216  * Function emits a timeline message informing about LPU creation. LPU is
217  * created with two attributes: number linking this LPU with GPU's job slot
218  * and function bearing information about this LPU abilities.
219  * This message is directed to timeline summary stream.
220  */
221 #define KBASE_TLSTREAM_TL_SUMMARY_NEW_LPU(lpu, nr, fn) \
222 	__TRACE_IF_ENABLED(tl_summary_new_lpu, lpu, nr, fn)
223 
224 /**
225  * KBASE_TLSTREAM_TL_SUMMARY_LIFELINK_LPU_GPU - lifelink LPU object to GPU
226  * @lpu: name of the Logical Processing Unit object
227  * @gpu: name of the GPU object
228  *
229  * Function emits a timeline message informing that LPU object shall be deleted
230  * along with GPU object.
231  * This message is directed to timeline summary stream.
232  */
233 #define KBASE_TLSTREAM_TL_SUMMARY_LIFELINK_LPU_GPU(lpu, gpu) \
234 	__TRACE_IF_ENABLED(tl_summary_lifelink_lpu_gpu, lpu, gpu)
235 
236 /**
237  * KBASE_TLSTREAM_TL_SUMMARY_NEW_AS - create address space object in timeline summary
238  * @as: name of the address space object
239  * @nr: sequential number assigned to this address space
240  *
241  * Function emits a timeline message informing about address space creation.
242  * Address space is created with one attribute: number identifying this
243  * address space.
244  * This message is directed to timeline summary stream.
245  */
246 #define KBASE_TLSTREAM_TL_SUMMARY_NEW_AS(as, nr) \
247 	__TRACE_IF_ENABLED(tl_summary_new_as, as, nr)
248 
249 /**
250  * KBASE_TLSTREAM_TL_SUMMARY_LIFELINK_AS_GPU - lifelink address space object to GPU
251  * @as:  name of the address space object
252  * @gpu: name of the GPU object
253  *
254  * Function emits a timeline message informing that address space object
255  * shall be deleted along with GPU object.
256  * This message is directed to timeline summary stream.
257  */
258 #define KBASE_TLSTREAM_TL_SUMMARY_LIFELINK_AS_GPU(as, gpu) \
259 	__TRACE_IF_ENABLED(tl_summary_lifelink_as_gpu, as, gpu)
260 
261 /**
262  * KBASE_TLSTREAM_TL_NEW_CTX - create context object in timeline
263  * @context: name of the context object
264  * @nr:      context number
265  * @tgid:    thread Group Id
266  *
267  * Function emits a timeline message informing about context creation. Context
268  * is created with context number (its attribute), that can be used to link
269  * kbase context with userspace context.
270  */
271 #define KBASE_TLSTREAM_TL_NEW_CTX(context, nr, tgid) \
272 	__TRACE_IF_ENABLED(tl_new_ctx, context, nr, tgid)
273 
274 /**
275  * KBASE_TLSTREAM_TL_NEW_ATOM - create atom object in timeline
276  * @atom: name of the atom object
277  * @nr:   sequential number assigned to this atom
278  *
279  * Function emits a timeline message informing about atom creation. Atom is
280  * created with atom number (its attribute) that links it with actual work
281  * bucket id understood by hardware.
282  */
283 #define KBASE_TLSTREAM_TL_NEW_ATOM(atom, nr) \
284 	__TRACE_IF_ENABLED(tl_new_atom, atom, nr)
285 
286 /**
287  * KBASE_TLSTREAM_TL_DEL_CTX - destroy context object in timeline
288  * @context: name of the context object
289  *
290  * Function emits a timeline message informing that context object ceased to
291  * exist.
292  */
293 #define KBASE_TLSTREAM_TL_DEL_CTX(context) \
294 	__TRACE_IF_ENABLED(tl_del_ctx, context)
295 
296 /**
297  * KBASE_TLSTREAM_TL_DEL_ATOM - destroy atom object in timeline
298  * @atom: name of the atom object
299  *
300  * Function emits a timeline message informing that atom object ceased to
301  * exist.
302  */
303 #define KBASE_TLSTREAM_TL_DEL_ATOM(atom) \
304 	__TRACE_IF_ENABLED(tl_del_atom, atom)
305 
306 /**
307  * KBASE_TLSTREAM_TL_RET_CTX_LPU - retain context by LPU
308  * @context: name of the context object
309  * @lpu:     name of the Logical Processing Unit object
310  *
311  * Function emits a timeline message informing that context is being held
312  * by LPU and must not be deleted unless it is released.
313  */
314 #define KBASE_TLSTREAM_TL_RET_CTX_LPU(context, lpu) \
315 	__TRACE_IF_ENABLED(tl_ret_ctx_lpu, context, lpu)
316 
317 /**
318  * KBASE_TLSTREAM_TL_RET_ATOM_CTX - retain atom by context
319  * @atom:    name of the atom object
320  * @context: name of the context object
321  *
322  * Function emits a timeline message informing that atom object is being held
323  * by context and must not be deleted unless it is released.
324  */
325 #define KBASE_TLSTREAM_TL_RET_ATOM_CTX(atom, context) \
326 	__TRACE_IF_ENABLED(tl_ret_atom_ctx, atom, context)
327 
328 /**
329  * KBASE_TLSTREAM_TL_RET_ATOM_LPU - retain atom by LPU
330  * @atom:              name of the atom object
331  * @lpu:               name of the Logical Processing Unit object
332  * @attrib_match_list: list containing match operator attributes
333  *
334  * Function emits a timeline message informing that atom object is being held
335  * by LPU and must not be deleted unless it is released.
336  */
337 #define KBASE_TLSTREAM_TL_RET_ATOM_LPU(atom, lpu, attrib_match_list) \
338 	__TRACE_IF_ENABLED(tl_ret_atom_lpu, atom, lpu, attrib_match_list)
339 
340 /**
341  * KBASE_TLSTREAM_TL_NRET_CTX_LPU - release context by LPU
342  * @context: name of the context object
343  * @lpu:     name of the Logical Processing Unit object
344  *
345  * Function emits a timeline message informing that context is being released
346  * by LPU object.
347  */
348 #define KBASE_TLSTREAM_TL_NRET_CTX_LPU(context, lpu) \
349 	__TRACE_IF_ENABLED(tl_nret_ctx_lpu, context, lpu)
350 
351 /**
352  * KBASE_TLSTREAM_TL_NRET_ATOM_CTX - release atom by context
353  * @atom:    name of the atom object
354  * @context: name of the context object
355  *
356  * Function emits a timeline message informing that atom object is being
357  * released by context.
358  */
359 #define KBASE_TLSTREAM_TL_NRET_ATOM_CTX(atom, context) \
360 	__TRACE_IF_ENABLED(tl_nret_atom_ctx, atom, context)
361 
362 /**
363  * KBASE_TLSTREAM_TL_NRET_ATOM_LPU - release atom by LPU
364  * @atom: name of the atom object
365  * @lpu:  name of the Logical Processing Unit object
366  *
367  * Function emits a timeline message informing that atom object is being
368  * released by LPU.
369  */
370 #define KBASE_TLSTREAM_TL_NRET_ATOM_LPU(atom, lpu) \
371 	__TRACE_IF_ENABLED(tl_nret_atom_lpu, atom, lpu)
372 
373 /**
374  * KBASE_TLSTREAM_TL_RET_AS_CTX - lifelink address space object to context
375  * @as:  name of the address space object
376  * @ctx: name of the context object
377  *
378  * Function emits a timeline message informing that address space object
379  * is being held by the context object.
380  */
381 #define KBASE_TLSTREAM_TL_RET_AS_CTX(as, ctx) \
382 	__TRACE_IF_ENABLED(tl_ret_as_ctx, as, ctx)
383 
384 /**
385  * KBASE_TLSTREAM_TL_NRET_AS_CTX - release address space by context
386  * @as:  name of the address space object
387  * @ctx: name of the context object
388  *
389  * Function emits a timeline message informing that address space object
390  * is being released by atom.
391  */
392 #define KBASE_TLSTREAM_TL_NRET_AS_CTX(as, ctx) \
393 	__TRACE_IF_ENABLED(tl_nret_as_ctx, as, ctx)
394 
395 /**
396  * KBASE_TLSTREAM_TL_RET_ATOM_AS - retain atom by address space
397  * @atom: name of the atom object
398  * @as:   name of the address space object
399  *
400  * Function emits a timeline message informing that atom object is being held
401  * by address space and must not be deleted unless it is released.
402  */
403 #define KBASE_TLSTREAM_TL_RET_ATOM_AS(atom, as) \
404 	__TRACE_IF_ENABLED(tl_ret_atom_as, atom, as)
405 
406 /**
407  * KBASE_TLSTREAM_TL_NRET_ATOM_AS - release atom by address space
408  * @atom: name of the atom object
409  * @as:   name of the address space object
410  *
411  * Function emits a timeline message informing that atom object is being
412  * released by address space.
413  */
414 #define KBASE_TLSTREAM_TL_NRET_ATOM_AS(atom, as) \
415 	__TRACE_IF_ENABLED(tl_nret_atom_as, atom, as)
416 
417 /**
418  * KBASE_TLSTREAM_TL_DEP_ATOM_ATOM - parent atom depends on child atom
419  * @atom1: name of the child atom object
420  * @atom2: name of the parent atom object that depends on child atom
421  *
422  * Function emits a timeline message informing that parent atom waits for
423  * child atom object to be completed before start its execution.
424  */
425 #define KBASE_TLSTREAM_TL_DEP_ATOM_ATOM(atom1, atom2) \
426 	__TRACE_IF_ENABLED(tl_dep_atom_atom, atom1, atom2)
427 
428 /**
429  * KBASE_TLSTREAM_TL_NDEP_ATOM_ATOM - dependency between atoms resolved
430  * @atom1: name of the child atom object
431  * @atom2: name of the parent atom object that depended on child atom
432  *
433  * Function emits a timeline message informing that parent atom execution
434  * dependency on child atom has been resolved.
435  */
436 #define KBASE_TLSTREAM_TL_NDEP_ATOM_ATOM(atom1, atom2) \
437 	__TRACE_IF_ENABLED(tl_ndep_atom_atom, atom1, atom2)
438 
439 /**
440  * KBASE_TLSTREAM_TL_RDEP_ATOM_ATOM - information about already resolved dependency between atoms
441  * @atom1: name of the child atom object
442  * @atom2: name of the parent atom object that depended on child atom
443  *
444  * Function emits a timeline message informing that parent atom execution
445  * dependency on child atom has been resolved.
446  */
447 #define KBASE_TLSTREAM_TL_RDEP_ATOM_ATOM(atom1, atom2) \
448 	__TRACE_IF_ENABLED(tl_rdep_atom_atom, atom1, atom2)
449 
450 /**
451  * KBASE_TLSTREAM_TL_ATTRIB_ATOM_CONFIG - atom job slot attributes
452  * @atom:     name of the atom object
453  * @jd:       job descriptor address
454  * @affinity: job affinity
455  * @config:   job config
456  *
457  * Function emits a timeline message containing atom attributes.
458  */
459 #define KBASE_TLSTREAM_TL_ATTRIB_ATOM_CONFIG(atom, jd, affinity, config) \
460 	__TRACE_IF_ENABLED(tl_attrib_atom_config, atom, jd, affinity, config)
461 
462 /**
463  * KBASE_TLSTREAM_TL_ATTRIB_ATOM_PRIORITY - atom priority
464  * @atom: name of the atom object
465  * @prio: atom priority
466  *
467  * Function emits a timeline message containing atom priority.
468  */
469 #define KBASE_TLSTREAM_TL_ATTRIB_ATOM_PRIORITY(atom, prio) \
470 	__TRACE_IF_ENABLED_LATENCY(tl_attrib_atom_priority, atom, prio)
471 
472 /**
473  * KBASE_TLSTREAM_TL_ATTRIB_ATOM_STATE - atom state
474  * @atom:  name of the atom object
475  * @state: atom state
476  *
477  * Function emits a timeline message containing atom state.
478  */
479 #define KBASE_TLSTREAM_TL_ATTRIB_ATOM_STATE(atom, state) \
480 	__TRACE_IF_ENABLED_LATENCY(tl_attrib_atom_state, atom, state)
481 
482 /**
483  * KBASE_TLSTREAM_TL_ATTRIB_ATOM_PRIORITY_CHANGE - atom caused priority change
484  * @atom:  name of the atom object
485  *
486  * Function emits a timeline message signalling priority change
487  */
488 #define KBASE_TLSTREAM_TL_ATTRIB_ATOM_PRIORITY_CHANGE(atom) \
489 	__TRACE_IF_ENABLED_LATENCY(tl_attrib_atom_priority_change, atom)
490 
491 /**
492  * KBASE_TLSTREAM_TL_ATTRIB_ATOM_JIT - jit happened on atom
493  * @atom:       atom identifier
494  * @edit_addr:  address edited by jit
495  * @new_addr:   address placed into the edited location
496  */
497 #define KBASE_TLSTREAM_TL_ATTRIB_ATOM_JIT(atom, edit_addr, new_addr) \
498 	__TRACE_IF_ENABLED_JD(tl_attrib_atom_jit, atom, edit_addr, new_addr)
499 
500 /**
501  * KBASE_TLSTREAM_TL_ATTRIB_AS_CONFIG - address space attributes
502  * @as:       assigned address space
503  * @transtab: configuration of the TRANSTAB register
504  * @memattr:  configuration of the MEMATTR register
505  * @transcfg: configuration of the TRANSCFG register (or zero if not present)
506  *
507  * Function emits a timeline message containing address space attributes.
508  */
509 #define KBASE_TLSTREAM_TL_ATTRIB_AS_CONFIG(as, transtab, memattr, transcfg) \
510 	__TRACE_IF_ENABLED(tl_attrib_as_config, as, transtab, memattr, transcfg)
511 
512 /**
513  * KBASE_TLSTREAM_TL_EVENT_ATOM_SOFTSTOP_ex
514  * @atom:       atom identifier
515  */
516 #define KBASE_TLSTREAM_TL_EVENT_ATOM_SOFTSTOP_EX(atom) \
517 	__TRACE_IF_ENABLED(tl_event_atom_softstop_ex, atom)
518 
519 /**
520  * KBASE_TLSTREAM_TL_EVENT_LPU_softstop
521  * @lpu:        name of the LPU object
522  */
523 #define KBASE_TLSTREAM_TL_EVENT_LPU_SOFTSTOP(lpu) \
524 	__TRACE_IF_ENABLED(tl_event_lpu_softstop, lpu)
525 
526 /**
527  * KBASE_TLSTREAM_TL_EVENT_ATOM_SOFTSTOP_issue
528  * @atom:       atom identifier
529  */
530 #define KBASE_TLSTREAM_TL_EVENT_ATOM_SOFTSTOP_ISSUE(atom) \
531 	__TRACE_IF_ENABLED(tl_event_atom_softstop_issue, atom)
532 
533 /**
534  * KBASE_TLSTREAM_JD_GPU_SOFT_RESET - The GPU is being soft reset
535  * @gpu:        name of the GPU object
536  *
537  * This imperative tracepoint is specific to job dumping.
538  * Function emits a timeline message indicating GPU soft reset.
539  */
540 #define KBASE_TLSTREAM_JD_GPU_SOFT_RESET(gpu) \
541 	__TRACE_IF_ENABLED(jd_gpu_soft_reset, gpu)
542 
543 
544 /**
545  * KBASE_TLSTREAM_AUX_PM_STATE - timeline message: power management state
546  * @core_type: core type (shader, tiler, l2 cache, l3 cache)
547  * @state:     64bits bitmask reporting power state of the cores (1-ON, 0-OFF)
548  */
549 #define KBASE_TLSTREAM_AUX_PM_STATE(core_type, state) \
550 	__TRACE_IF_ENABLED(aux_pm_state, core_type, state)
551 
552 /**
553  * KBASE_TLSTREAM_AUX_PAGEFAULT - timeline message: MMU page fault event
554  *                                resulting in new pages being mapped
555  * @ctx_nr:            kernel context number
556  * @page_count_change: number of pages to be added
557  */
558 #define KBASE_TLSTREAM_AUX_PAGEFAULT(ctx_nr, page_count_change) \
559 	__TRACE_IF_ENABLED(aux_pagefault, ctx_nr, page_count_change)
560 
561 /**
562  * KBASE_TLSTREAM_AUX_PAGESALLOC - timeline message: total number of allocated
563  *                                 pages is changed
564  * @ctx_nr:     kernel context number
565  * @page_count: number of pages used by the context
566  */
567 #define KBASE_TLSTREAM_AUX_PAGESALLOC(ctx_nr, page_count) \
568 	__TRACE_IF_ENABLED(aux_pagesalloc, ctx_nr, page_count)
569 
570 /**
571  * KBASE_TLSTREAM_AUX_DEVFREQ_TARGET - timeline message: new target DVFS
572  *                                     frequency
573  * @target_freq: new target frequency
574  */
575 #define KBASE_TLSTREAM_AUX_DEVFREQ_TARGET(target_freq) \
576 	__TRACE_IF_ENABLED(aux_devfreq_target, target_freq)
577 
578 /**
579  * KBASE_TLSTREAM_AUX_PROTECTED_ENTER_START - The GPU has started transitioning
580  *                                            to protected mode
581  * @gpu: name of the GPU object
582  *
583  * Function emits a timeline message indicating the GPU is starting to
584  * transition to protected mode.
585  */
586 #define KBASE_TLSTREAM_AUX_PROTECTED_ENTER_START(gpu) \
587 	__TRACE_IF_ENABLED_LATENCY(aux_protected_enter_start, gpu)
588 
589 /**
590  * KBASE_TLSTREAM_AUX_PROTECTED_ENTER_END - The GPU has finished transitioning
591  *                                          to protected mode
592  * @gpu: name of the GPU object
593  *
594  * Function emits a timeline message indicating the GPU has finished
595  * transitioning to protected mode.
596  */
597 #define KBASE_TLSTREAM_AUX_PROTECTED_ENTER_END(gpu) \
598 	__TRACE_IF_ENABLED_LATENCY(aux_protected_enter_end, gpu)
599 
600 /**
601  * KBASE_TLSTREAM_AUX_PROTECTED_LEAVE_START - The GPU has started transitioning
602  *                                            to non-protected mode
603  * @gpu: name of the GPU object
604  *
605  * Function emits a timeline message indicating the GPU is starting to
606  * transition to non-protected mode.
607  */
608 #define KBASE_TLSTREAM_AUX_PROTECTED_LEAVE_START(gpu) \
609 	__TRACE_IF_ENABLED_LATENCY(aux_protected_leave_start, gpu)
610 
611 /**
612  * KBASE_TLSTREAM_AUX_PROTECTED_LEAVE_END - The GPU has finished transitioning
613  *                                          to non-protected mode
614  * @gpu: name of the GPU object
615  *
616  * Function emits a timeline message indicating the GPU has finished
617  * transitioning to non-protected mode.
618  */
619 #define KBASE_TLSTREAM_AUX_PROTECTED_LEAVE_END(gpu) \
620 	__TRACE_IF_ENABLED_LATENCY(aux_protected_leave_end, gpu)
621 
622 #endif /* _KBASE_TLSTREAM_H */
623 
624