Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1/* SPDX-License-Identifier: GPL-2.0 or MIT */
2/* Copyright 2025 Collabora ltd. */
3
4#undef TRACE_SYSTEM
5#define TRACE_SYSTEM panthor
6
7#if !defined(__PANTHOR_TRACE_H__) || defined(TRACE_HEADER_MULTI_READ)
8#define __PANTHOR_TRACE_H__
9
10#include <linux/tracepoint.h>
11#include <linux/types.h>
12
13#include "panthor_hw.h"
14
15/**
16 * gpu_power_status - called whenever parts of GPU hardware are turned on or off
17 * @dev: pointer to the &struct device, for printing the device name
18 * @shader_bitmap: bitmap where a high bit indicates the shader core at a given
19 * bit index is on, and a low bit indicates a shader core is
20 * either powered off or absent
21 * @tiler_bitmap: bitmap where a high bit indicates the tiler unit at a given
22 * bit index is on, and a low bit indicates a tiler unit is
23 * either powered off or absent
24 * @l2_bitmap: bitmap where a high bit indicates the L2 cache at a given bit
25 * index is on, and a low bit indicates the L2 cache is either
26 * powered off or absent
27 */
28TRACE_EVENT_FN(gpu_power_status,
29 TP_PROTO(const struct device *dev, u64 shader_bitmap, u64 tiler_bitmap,
30 u64 l2_bitmap),
31 TP_ARGS(dev, shader_bitmap, tiler_bitmap, l2_bitmap),
32 TP_STRUCT__entry(
33 __string(dev_name, dev_name(dev))
34 __field(u64, shader_bitmap)
35 __field(u64, tiler_bitmap)
36 __field(u64, l2_bitmap)
37 ),
38 TP_fast_assign(
39 __assign_str(dev_name);
40 __entry->shader_bitmap = shader_bitmap;
41 __entry->tiler_bitmap = tiler_bitmap;
42 __entry->l2_bitmap = l2_bitmap;
43 ),
44 TP_printk("%s: shader_bitmap=0x%llx tiler_bitmap=0x%llx l2_bitmap=0x%llx",
45 __get_str(dev_name), __entry->shader_bitmap, __entry->tiler_bitmap,
46 __entry->l2_bitmap
47 ),
48 panthor_hw_power_status_register, panthor_hw_power_status_unregister
49);
50
51/**
52 * gpu_job_irq - called after a job interrupt from firmware completes
53 * @dev: pointer to the &struct device, for printing the device name
54 * @events: bitmask of BIT(CSG id) | BIT(31) for a global event
55 * @duration_ns: Nanoseconds between job IRQ handler entry and exit
56 *
57 * The panthor_job_irq_handler() function instrumented by this tracepoint exits
58 * once it has queued the firmware interrupts for processing, not when the
59 * firmware interrupts are fully processed. This tracepoint allows for debugging
60 * issues with delays in the workqueue's processing of events.
61 */
62TRACE_EVENT(gpu_job_irq,
63 TP_PROTO(const struct device *dev, u32 events, u32 duration_ns),
64 TP_ARGS(dev, events, duration_ns),
65 TP_STRUCT__entry(
66 __string(dev_name, dev_name(dev))
67 __field(u32, events)
68 __field(u32, duration_ns)
69 ),
70 TP_fast_assign(
71 __assign_str(dev_name);
72 __entry->events = events;
73 __entry->duration_ns = duration_ns;
74 ),
75 TP_printk("%s: events=0x%x duration_ns=%d", __get_str(dev_name),
76 __entry->events, __entry->duration_ns)
77);
78
79#endif /* __PANTHOR_TRACE_H__ */
80
81#undef TRACE_INCLUDE_PATH
82#define TRACE_INCLUDE_PATH .
83#undef TRACE_INCLUDE_FILE
84#define TRACE_INCLUDE_FILE panthor_trace
85
86#include <trace/define_trace.h>