drivers/gpu/drm/scheduler/gpu_scheduler_trace.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/scheduler/gpu_scheduler_trace.h- Extension
.h- Size
- 5659 bytes
- Lines
- 160
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/stringify.hlinux/types.hlinux/tracepoint.htrace/define_trace.h
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
#if !defined(_GPU_SCHED_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ)
#define _GPU_SCHED_TRACE_H_
#include <linux/stringify.h>
#include <linux/types.h>
#include <linux/tracepoint.h>
#undef TRACE_SYSTEM
#define TRACE_SYSTEM gpu_scheduler
#define TRACE_INCLUDE_FILE gpu_scheduler_trace
/**
* DOC: uAPI trace events
*
* ``drm_sched_job_queue``, ``drm_sched_job_run``, ``drm_sched_job_add_dep``,
* ``drm_sched_job_done`` and ``drm_sched_job_unschedulable`` are considered
* stable uAPI.
*
* Common trace events attributes:
*
* * ``dev`` - the dev_name() of the device running the job.
*
* * ``ring`` - the hardware ring running the job. Together with ``dev`` it
* uniquely identifies where the job is going to be executed.
*
* * ``fence`` - the &struct dma_fence.context and the &struct dma_fence.seqno of
* &struct drm_sched_fence.finished
*
* All the events depends on drm_sched_job_arm() having been called already for
* the job because they use &struct drm_sched_job.sched or
* &struct drm_sched_job.s_fence.
*/
DECLARE_EVENT_CLASS(drm_sched_job,
TP_PROTO(struct drm_sched_job *sched_job, struct drm_sched_entity *entity),
TP_ARGS(sched_job, entity),
TP_STRUCT__entry(
__string(name, sched_job->sched->name)
__field(u32, job_count)
__field(int, hw_job_count)
__string(dev, dev_name(sched_job->sched->dev))
__field(u64, fence_context)
__field(u64, fence_seqno)
__field(u64, client_id)
),
TP_fast_assign(
__assign_str(name);
__entry->job_count = spsc_queue_count(&entity->job_queue);
__entry->hw_job_count = atomic_read(
&sched_job->sched->credit_count);
__assign_str(dev);
__entry->fence_context = sched_job->s_fence->finished.context;
__entry->fence_seqno = sched_job->s_fence->finished.seqno;
__entry->client_id = sched_job->s_fence->drm_client_id;
),
TP_printk("dev=%s, fence=%llu:%llu, ring=%s, job count:%u, hw job count:%d, client_id:%llu",
__get_str(dev),
__entry->fence_context, __entry->fence_seqno, __get_str(name),
__entry->job_count, __entry->hw_job_count, __entry->client_id)
);
DEFINE_EVENT(drm_sched_job, drm_sched_job_queue,
TP_PROTO(struct drm_sched_job *sched_job, struct drm_sched_entity *entity),
TP_ARGS(sched_job, entity)
);
DEFINE_EVENT(drm_sched_job, drm_sched_job_run,
TP_PROTO(struct drm_sched_job *sched_job, struct drm_sched_entity *entity),
TP_ARGS(sched_job, entity)
);
TRACE_EVENT(drm_sched_job_done,
TP_PROTO(struct drm_sched_fence *fence),
TP_ARGS(fence),
TP_STRUCT__entry(
__field(u64, fence_context)
__field(u64, fence_seqno)
),
TP_fast_assign(
__entry->fence_context = fence->finished.context;
__entry->fence_seqno = fence->finished.seqno;
),
TP_printk("fence=%llu:%llu signaled",
__entry->fence_context, __entry->fence_seqno)
);
TRACE_EVENT(drm_sched_job_add_dep,
TP_PROTO(struct drm_sched_job *sched_job, struct dma_fence *fence),
Annotation
- Immediate include surface: `linux/stringify.h`, `linux/types.h`, `linux/tracepoint.h`, `trace/define_trace.h`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.