diff options
author | Thierry Reding <treding@nvidia.com> | 2014-06-12 07:14:50 -0400 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2014-11-13 10:11:32 -0500 |
commit | b40d02bf96e05851d1d16b4a75f66a9e16cfb2fb (patch) | |
tree | cf1bcf7e8762ca3de24884adc9fb46d2c65d052d | |
parent | db4fd5197b8c7223af9be8cd3f8d8b7239e5d06c (diff) |
gpu: host1x: Use struct host1x_bo pointers in traces
Rather than cast to a u32 use the struct host1x_bo pointers directly.
This avoid annoying warnings for 64-bit builds.
Signed-off-by: Thierry Reding <treding@nvidia.com>
-rw-r--r-- | drivers/gpu/host1x/hw/channel_hw.c | 12 | ||||
-rw-r--r-- | include/trace/events/host1x.h | 27 |
2 files changed, 23 insertions, 16 deletions
diff --git a/drivers/gpu/host1x/hw/channel_hw.c b/drivers/gpu/host1x/hw/channel_hw.c index 4608257ab656..946c332c3906 100644 --- a/drivers/gpu/host1x/hw/channel_hw.c +++ b/drivers/gpu/host1x/hw/channel_hw.c | |||
@@ -32,6 +32,7 @@ | |||
32 | static void trace_write_gather(struct host1x_cdma *cdma, struct host1x_bo *bo, | 32 | static void trace_write_gather(struct host1x_cdma *cdma, struct host1x_bo *bo, |
33 | u32 offset, u32 words) | 33 | u32 offset, u32 words) |
34 | { | 34 | { |
35 | struct device *dev = cdma_to_channel(cdma)->dev; | ||
35 | void *mem = NULL; | 36 | void *mem = NULL; |
36 | 37 | ||
37 | if (host1x_debug_trace_cmdbuf) | 38 | if (host1x_debug_trace_cmdbuf) |
@@ -44,11 +45,14 @@ static void trace_write_gather(struct host1x_cdma *cdma, struct host1x_bo *bo, | |||
44 | * of how much you can output to ftrace at once. | 45 | * of how much you can output to ftrace at once. |
45 | */ | 46 | */ |
46 | for (i = 0; i < words; i += TRACE_MAX_LENGTH) { | 47 | for (i = 0; i < words; i += TRACE_MAX_LENGTH) { |
47 | trace_host1x_cdma_push_gather( | 48 | u32 num_words = min(words - i, TRACE_MAX_LENGTH); |
48 | dev_name(cdma_to_channel(cdma)->dev), | 49 | offset += i * sizeof(u32); |
49 | (u32)bo, min(words - i, TRACE_MAX_LENGTH), | 50 | |
50 | offset + i * sizeof(u32), mem); | 51 | trace_host1x_cdma_push_gather(dev_name(dev), bo, |
52 | num_words, offset, | ||
53 | mem); | ||
51 | } | 54 | } |
55 | |||
52 | host1x_bo_munmap(bo, mem); | 56 | host1x_bo_munmap(bo, mem); |
53 | } | 57 | } |
54 | } | 58 | } |
diff --git a/include/trace/events/host1x.h b/include/trace/events/host1x.h index 94db6a2c3540..63116362543c 100644 --- a/include/trace/events/host1x.h +++ b/include/trace/events/host1x.h | |||
@@ -29,6 +29,8 @@ | |||
29 | #include <linux/ktime.h> | 29 | #include <linux/ktime.h> |
30 | #include <linux/tracepoint.h> | 30 | #include <linux/tracepoint.h> |
31 | 31 | ||
32 | struct host1x_bo; | ||
33 | |||
32 | DECLARE_EVENT_CLASS(host1x, | 34 | DECLARE_EVENT_CLASS(host1x, |
33 | TP_PROTO(const char *name), | 35 | TP_PROTO(const char *name), |
34 | TP_ARGS(name), | 36 | TP_ARGS(name), |
@@ -79,14 +81,14 @@ TRACE_EVENT(host1x_cdma_push, | |||
79 | ); | 81 | ); |
80 | 82 | ||
81 | TRACE_EVENT(host1x_cdma_push_gather, | 83 | TRACE_EVENT(host1x_cdma_push_gather, |
82 | TP_PROTO(const char *name, u32 mem_id, | 84 | TP_PROTO(const char *name, struct host1x_bo *bo, |
83 | u32 words, u32 offset, void *cmdbuf), | 85 | u32 words, u32 offset, void *cmdbuf), |
84 | 86 | ||
85 | TP_ARGS(name, mem_id, words, offset, cmdbuf), | 87 | TP_ARGS(name, bo, words, offset, cmdbuf), |
86 | 88 | ||
87 | TP_STRUCT__entry( | 89 | TP_STRUCT__entry( |
88 | __field(const char *, name) | 90 | __field(const char *, name) |
89 | __field(u32, mem_id) | 91 | __field(struct host1x_bo *, bo) |
90 | __field(u32, words) | 92 | __field(u32, words) |
91 | __field(u32, offset) | 93 | __field(u32, offset) |
92 | __field(bool, cmdbuf) | 94 | __field(bool, cmdbuf) |
@@ -100,13 +102,13 @@ TRACE_EVENT(host1x_cdma_push_gather, | |||
100 | } | 102 | } |
101 | __entry->cmdbuf = cmdbuf; | 103 | __entry->cmdbuf = cmdbuf; |
102 | __entry->name = name; | 104 | __entry->name = name; |
103 | __entry->mem_id = mem_id; | 105 | __entry->bo = bo; |
104 | __entry->words = words; | 106 | __entry->words = words; |
105 | __entry->offset = offset; | 107 | __entry->offset = offset; |
106 | ), | 108 | ), |
107 | 109 | ||
108 | TP_printk("name=%s, mem_id=%08x, words=%u, offset=%d, contents=[%s]", | 110 | TP_printk("name=%s, bo=%p, words=%u, offset=%d, contents=[%s]", |
109 | __entry->name, __entry->mem_id, | 111 | __entry->name, __entry->bo, |
110 | __entry->words, __entry->offset, | 112 | __entry->words, __entry->offset, |
111 | __print_hex(__get_dynamic_array(cmdbuf), | 113 | __print_hex(__get_dynamic_array(cmdbuf), |
112 | __entry->cmdbuf ? __entry->words * 4 : 0)) | 114 | __entry->cmdbuf ? __entry->words * 4 : 0)) |
@@ -221,12 +223,13 @@ TRACE_EVENT(host1x_syncpt_load_min, | |||
221 | ); | 223 | ); |
222 | 224 | ||
223 | TRACE_EVENT(host1x_syncpt_wait_check, | 225 | TRACE_EVENT(host1x_syncpt_wait_check, |
224 | TP_PROTO(void *mem_id, u32 offset, u32 syncpt_id, u32 thresh, u32 min), | 226 | TP_PROTO(struct host1x_bo *bo, u32 offset, u32 syncpt_id, u32 thresh, |
227 | u32 min), | ||
225 | 228 | ||
226 | TP_ARGS(mem_id, offset, syncpt_id, thresh, min), | 229 | TP_ARGS(bo, offset, syncpt_id, thresh, min), |
227 | 230 | ||
228 | TP_STRUCT__entry( | 231 | TP_STRUCT__entry( |
229 | __field(void *, mem_id) | 232 | __field(struct host1x_bo *, bo) |
230 | __field(u32, offset) | 233 | __field(u32, offset) |
231 | __field(u32, syncpt_id) | 234 | __field(u32, syncpt_id) |
232 | __field(u32, thresh) | 235 | __field(u32, thresh) |
@@ -234,15 +237,15 @@ TRACE_EVENT(host1x_syncpt_wait_check, | |||
234 | ), | 237 | ), |
235 | 238 | ||
236 | TP_fast_assign( | 239 | TP_fast_assign( |
237 | __entry->mem_id = mem_id; | 240 | __entry->bo = bo; |
238 | __entry->offset = offset; | 241 | __entry->offset = offset; |
239 | __entry->syncpt_id = syncpt_id; | 242 | __entry->syncpt_id = syncpt_id; |
240 | __entry->thresh = thresh; | 243 | __entry->thresh = thresh; |
241 | __entry->min = min; | 244 | __entry->min = min; |
242 | ), | 245 | ), |
243 | 246 | ||
244 | TP_printk("mem_id=%p, offset=%05x, id=%d, thresh=%d, current=%d", | 247 | TP_printk("bo=%p, offset=%05x, id=%d, thresh=%d, current=%d", |
245 | __entry->mem_id, __entry->offset, | 248 | __entry->bo, __entry->offset, |
246 | __entry->syncpt_id, __entry->thresh, | 249 | __entry->syncpt_id, __entry->thresh, |
247 | __entry->min) | 250 | __entry->min) |
248 | ); | 251 | ); |