Commit 21c41445 authored by Rodrigo Siqueira's avatar Rodrigo Siqueira Committed by Alex Deucher

drm/amd/display: Rework registers tracepoint

amdgpu_dc_rreg and amdgpu_dc_wreg are very similar, for this reason,
this commits abstract these two events by using DECLARE_EVENT_CLASS and
create an instance of it for each one of these events.
Signed-off-by: default avatarRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Acked-by: default avatarAurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 9d83722d
...@@ -31,40 +31,33 @@ ...@@ -31,40 +31,33 @@
#include <linux/tracepoint.h> #include <linux/tracepoint.h>
TRACE_EVENT(amdgpu_dc_rreg, DECLARE_EVENT_CLASS(amdgpu_dc_reg_template,
TP_PROTO(unsigned long *read_count, uint32_t reg, uint32_t value), TP_PROTO(unsigned long *count, uint32_t reg, uint32_t value),
TP_ARGS(read_count, reg, value), TP_ARGS(count, reg, value),
TP_STRUCT__entry(
__field(uint32_t, reg)
__field(uint32_t, value)
),
TP_fast_assign(
__entry->reg = reg;
__entry->value = value;
*read_count = *read_count + 1;
),
TP_printk("reg=0x%08lx, value=0x%08lx",
(unsigned long)__entry->reg,
(unsigned long)__entry->value)
);
TRACE_EVENT(amdgpu_dc_wreg, TP_STRUCT__entry(
TP_PROTO(unsigned long *write_count, uint32_t reg, uint32_t value), __field(uint32_t, reg)
TP_ARGS(write_count, reg, value), __field(uint32_t, value)
TP_STRUCT__entry( ),
__field(uint32_t, reg)
__field(uint32_t, value) TP_fast_assign(
), __entry->reg = reg;
TP_fast_assign( __entry->value = value;
__entry->reg = reg; *count = *count + 1;
__entry->value = value; ),
*write_count = *write_count + 1;
), TP_printk("reg=0x%08lx, value=0x%08lx",
TP_printk("reg=0x%08lx, value=0x%08lx", (unsigned long)__entry->reg,
(unsigned long)__entry->reg, (unsigned long)__entry->value)
(unsigned long)__entry->value)
); );
DEFINE_EVENT(amdgpu_dc_reg_template, amdgpu_dc_rreg,
TP_PROTO(unsigned long *count, uint32_t reg, uint32_t value),
TP_ARGS(count, reg, value));
DEFINE_EVENT(amdgpu_dc_reg_template, amdgpu_dc_wreg,
TP_PROTO(unsigned long *count, uint32_t reg, uint32_t value),
TP_ARGS(count, reg, value));
TRACE_EVENT(amdgpu_dc_performance, TRACE_EVENT(amdgpu_dc_performance,
TP_PROTO(unsigned long read_count, unsigned long write_count, TP_PROTO(unsigned long read_count, unsigned long write_count,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment