lkml.org 
[lkml]   [2020]   [Aug]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Add power/gpu_frequency tracepoint.
On Thu, 13 Aug 2020 14:03:57 -0700
Peiyong Lin <lpy@google.com> wrote:

> +/**
> + * gpu_frequency - Reports frequency changes in GPU clock domains
> + * @state: New frequency (in KHz)
> + * @gpu_id: GPU clock domain
> + */
> +TRACE_EVENT(gpu_frequency,
> +
> + TP_PROTO(unsigned int state, unsigned int gpu_id),
> +
> + TP_ARGS(state, gpu_id),
> +
> + TP_STRUCT__entry(
> + __field(unsigned int, state)
> + __field(unsigned int, gpu_id)

Both of the above entries are unsigned int.

> + ),
> +
> + TP_fast_assign(
> + __entry->state = state;
> + __entry->gpu_id = gpu_id;
> + ),
> +
> + TP_printk("state=%lu gpu_id=%lu",
> + (unsigned long)__entry->state,
> + (unsigned long)__entry->gpu_id)

Why typecast to (unsigned long) to use it in %lu? Why not just have:

TP_printk("state=%u gpu_id=%u",
__entry->state, __entry->gpu_id)

?

-- Steve


> +);
> #endif /* _TRACE_POWER_H */
>
> /* This part must be outside protection */

\
 
 \ /
  Last update: 2020-08-13 23:23    [W:0.105 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site