]>
Commit | Line | Data |
---|---|---|
bf93b448 AD |
1 | /* |
2 | * Copyright 2017 Advanced Micro Devices, Inc. | |
3 | * | |
4 | * Permission is hereby granted, free of charge, to any person obtaining a | |
5 | * copy of this software and associated documentation files (the "Software"), | |
6 | * to deal in the Software without restriction, including without limitation | |
7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
8 | * and/or sell copies of the Software, and to permit persons to whom the | |
9 | * Software is furnished to do so, subject to the following conditions: | |
10 | * | |
11 | * The above copyright notice and this permission notice shall be included in | |
12 | * all copies or substantial portions of the Software. | |
13 | * | |
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | |
17 | * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR | |
18 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |
19 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |
20 | * OTHER DEALINGS IN THE SOFTWARE. | |
21 | * | |
22 | */ | |
23 | ||
353da3c5 CZ |
24 | #if !defined(_GPU_SCHED_TRACE_H) || defined(TRACE_HEADER_MULTI_READ) |
25 | #define _GPU_SCHED_TRACE_H_ | |
26 | ||
27 | #include <linux/stringify.h> | |
28 | #include <linux/types.h> | |
29 | #include <linux/tracepoint.h> | |
30 | ||
31 | #include <drm/drmP.h> | |
32 | ||
33 | #undef TRACE_SYSTEM | |
34 | #define TRACE_SYSTEM gpu_sched | |
35 | #define TRACE_INCLUDE_FILE gpu_sched_trace | |
36 | ||
37 | TRACE_EVENT(amd_sched_job, | |
38 | TP_PROTO(struct amd_sched_job *sched_job), | |
39 | TP_ARGS(sched_job), | |
40 | TP_STRUCT__entry( | |
41 | __field(struct amd_sched_entity *, entity) | |
f54d1867 | 42 | __field(struct dma_fence *, fence) |
4f839a24 | 43 | __field(const char *, name) |
eabd76ce | 44 | __field(uint64_t, id) |
353da3c5 CZ |
45 | __field(u32, job_count) |
46 | __field(int, hw_job_count) | |
47 | ), | |
48 | ||
49 | TP_fast_assign( | |
50 | __entry->entity = sched_job->s_entity; | |
eabd76ce | 51 | __entry->id = sched_job->id; |
6fc13675 | 52 | __entry->fence = &sched_job->s_fence->finished; |
4f839a24 | 53 | __entry->name = sched_job->sched->name; |
353da3c5 CZ |
54 | __entry->job_count = kfifo_len( |
55 | &sched_job->s_entity->job_queue) / sizeof(sched_job); | |
56 | __entry->hw_job_count = atomic_read( | |
57 | &sched_job->sched->hw_rq_count); | |
58 | ), | |
eabd76ce NH |
59 | TP_printk("entity=%p, id=%llu, fence=%p, ring=%s, job count:%u, hw job count:%d", |
60 | __entry->entity, __entry->id, | |
61 | __entry->fence, __entry->name, | |
7034decf | 62 | __entry->job_count, __entry->hw_job_count) |
353da3c5 | 63 | ); |
7034decf CZ |
64 | |
65 | TRACE_EVENT(amd_sched_process_job, | |
66 | TP_PROTO(struct amd_sched_fence *fence), | |
67 | TP_ARGS(fence), | |
68 | TP_STRUCT__entry( | |
f54d1867 | 69 | __field(struct dma_fence *, fence) |
7034decf CZ |
70 | ), |
71 | ||
72 | TP_fast_assign( | |
6fc13675 | 73 | __entry->fence = &fence->finished; |
7034decf CZ |
74 | ), |
75 | TP_printk("fence=%p signaled", __entry->fence) | |
76 | ); | |
77 | ||
353da3c5 CZ |
78 | #endif |
79 | ||
80 | /* This part must be outside protection */ | |
81 | #undef TRACE_INCLUDE_PATH | |
82 | #define TRACE_INCLUDE_PATH . | |
83 | #include <trace/define_trace.h> |