Skip to content

Commit b40d02b

Browse files
committedNov 13, 2014
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 <[email protected]>
1 parent db4fd51 commit b40d02b

File tree

2 files changed

+23
-16
lines changed

2 files changed

+23
-16
lines changed
 

‎drivers/gpu/host1x/hw/channel_hw.c

+8-4
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
static void trace_write_gather(struct host1x_cdma *cdma, struct host1x_bo *bo,
3333
u32 offset, u32 words)
3434
{
35+
struct device *dev = cdma_to_channel(cdma)->dev;
3536
void *mem = NULL;
3637

3738
if (host1x_debug_trace_cmdbuf)
@@ -44,11 +45,14 @@ static void trace_write_gather(struct host1x_cdma *cdma, struct host1x_bo *bo,
4445
* of how much you can output to ftrace at once.
4546
*/
4647
for (i = 0; i < words; i += TRACE_MAX_LENGTH) {
47-
trace_host1x_cdma_push_gather(
48-
dev_name(cdma_to_channel(cdma)->dev),
49-
(u32)bo, min(words - i, TRACE_MAX_LENGTH),
50-
offset + i * sizeof(u32), mem);
48+
u32 num_words = min(words - i, TRACE_MAX_LENGTH);
49+
offset += i * sizeof(u32);
50+
51+
trace_host1x_cdma_push_gather(dev_name(dev), bo,
52+
num_words, offset,
53+
mem);
5154
}
55+
5256
host1x_bo_munmap(bo, mem);
5357
}
5458
}

‎include/trace/events/host1x.h

+15-12
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
#include <linux/ktime.h>
3030
#include <linux/tracepoint.h>
3131

32+
struct host1x_bo;
33+
3234
DECLARE_EVENT_CLASS(host1x,
3335
TP_PROTO(const char *name),
3436
TP_ARGS(name),
@@ -79,14 +81,14 @@ TRACE_EVENT(host1x_cdma_push,
7981
);
8082

8183
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,
8385
u32 words, u32 offset, void *cmdbuf),
8486

85-
TP_ARGS(name, mem_id, words, offset, cmdbuf),
87+
TP_ARGS(name, bo, words, offset, cmdbuf),
8688

8789
TP_STRUCT__entry(
8890
__field(const char *, name)
89-
__field(u32, mem_id)
91+
__field(struct host1x_bo *, bo)
9092
__field(u32, words)
9193
__field(u32, offset)
9294
__field(bool, cmdbuf)
@@ -100,13 +102,13 @@ TRACE_EVENT(host1x_cdma_push_gather,
100102
}
101103
__entry->cmdbuf = cmdbuf;
102104
__entry->name = name;
103-
__entry->mem_id = mem_id;
105+
__entry->bo = bo;
104106
__entry->words = words;
105107
__entry->offset = offset;
106108
),
107109

108-
TP_printk("name=%s, mem_id=%08x, words=%u, offset=%d, contents=[%s]",
109-
__entry->name, __entry->mem_id,
110+
TP_printk("name=%s, bo=%p, words=%u, offset=%d, contents=[%s]",
111+
__entry->name, __entry->bo,
110112
__entry->words, __entry->offset,
111113
__print_hex(__get_dynamic_array(cmdbuf),
112114
__entry->cmdbuf ? __entry->words * 4 : 0))
@@ -221,28 +223,29 @@ TRACE_EVENT(host1x_syncpt_load_min,
221223
);
222224

223225
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),
225228

226-
TP_ARGS(mem_id, offset, syncpt_id, thresh, min),
229+
TP_ARGS(bo, offset, syncpt_id, thresh, min),
227230

228231
TP_STRUCT__entry(
229-
__field(void *, mem_id)
232+
__field(struct host1x_bo *, bo)
230233
__field(u32, offset)
231234
__field(u32, syncpt_id)
232235
__field(u32, thresh)
233236
__field(u32, min)
234237
),
235238

236239
TP_fast_assign(
237-
__entry->mem_id = mem_id;
240+
__entry->bo = bo;
238241
__entry->offset = offset;
239242
__entry->syncpt_id = syncpt_id;
240243
__entry->thresh = thresh;
241244
__entry->min = min;
242245
),
243246

244-
TP_printk("mem_id=%p, offset=%05x, id=%d, thresh=%d, current=%d",
245-
__entry->mem_id, __entry->offset,
247+
TP_printk("bo=%p, offset=%05x, id=%d, thresh=%d, current=%d",
248+
__entry->bo, __entry->offset,
246249
__entry->syncpt_id, __entry->thresh,
247250
__entry->min)
248251
);

0 commit comments

Comments
 (0)
Please sign in to comment.