UPSTREAM: ANDROID: tracing: add power/gpu_work_period
From Android 16 CDD: [C-0-13] MUST implement the shell command dumpsys gpu --gpuwork to display the aggregated GPU work data returned by the power/gpu_work_period kernel tracepoint, or display no data if the tracepoint is not supported. The AOSP implementation is frameworks/native/services/gpuservice/gpuwork/. Bug: 457797217 Test: cat /sys/kernel/tracing/events/power/gpu_work_period/format Change-Id: Ia3d695d4297d8e2d6b4ad89e5747e39aec737810 Signed-off-by: Chia-I Wu <olv@google.com> Signed-off-by: Sorayukii <sorayukii69@gmail.com>
This commit is contained in:
parent
b24d8263d0
commit
9703ac9c78
2 changed files with 33 additions and 0 deletions
|
|
@ -3,9 +3,11 @@
|
|||
* Copyright 2025 Google LLC
|
||||
*/
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/module.h>
|
||||
|
||||
#define CREATE_TRACE_POINTS
|
||||
#include <trace/events/gpu_power.h>
|
||||
|
||||
EXPORT_TRACEPOINT_SYMBOL(gpu_frequency);
|
||||
EXPORT_TRACEPOINT_SYMBOL(gpu_work_period);
|
||||
|
|
|
|||
|
|
@ -26,6 +26,37 @@ TRACE_EVENT(gpu_frequency,
|
|||
TP_printk("state=%u gpu_id=%u", __entry->state, __entry->gpu_id)
|
||||
);
|
||||
|
||||
TRACE_EVENT(gpu_work_period,
|
||||
|
||||
TP_PROTO(u32 gpu_id, u32 uid, u64 start_time_ns, u64 end_time_ns,
|
||||
u64 total_active_duration_ns),
|
||||
|
||||
TP_ARGS(gpu_id, uid, start_time_ns, end_time_ns, total_active_duration_ns),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(u32, gpu_id)
|
||||
__field(u32, uid)
|
||||
__field(u64, start_time_ns)
|
||||
__field(u64, end_time_ns)
|
||||
__field(u64, total_active_duration_ns)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->gpu_id = gpu_id;
|
||||
__entry->uid = uid;
|
||||
__entry->start_time_ns = start_time_ns;
|
||||
__entry->end_time_ns = end_time_ns;
|
||||
__entry->total_active_duration_ns = total_active_duration_ns;
|
||||
),
|
||||
|
||||
TP_printk("gpu_id=%u uid=%u start_time_ns=%llu end_time_ns=%llu total_active_duration_ns=%llu",
|
||||
__entry->gpu_id,
|
||||
__entry->uid,
|
||||
__entry->start_time_ns,
|
||||
__entry->end_time_ns,
|
||||
__entry->total_active_duration_ns)
|
||||
);
|
||||
|
||||
#endif /* _TRACE_GPU_POWER_H */
|
||||
|
||||
/* This part must be outside protection */
|
||||
|
|
|
|||
Loading…
Reference in a new issue