drivers/gpu/drm/xe/xe_gt_stats.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/xe/xe_gt_stats.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/xe/xe_gt_stats.h- Extension
.h- Size
- 1417 bytes
- Lines
- 65
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/ktime.hxe_gt_stats_types.h
Detected Declarations
struct xe_gtstruct drm_printerfunction xe_gt_stats_initfunction xe_gt_stats_incrfunction xe_gt_stats_ktime_get
Annotated Snippet
#ifndef _XE_GT_STATS_H_
#define _XE_GT_STATS_H_
#include <linux/ktime.h>
#include "xe_gt_stats_types.h"
struct xe_gt;
struct drm_printer;
#ifdef CONFIG_DEBUG_FS
int xe_gt_stats_init(struct xe_gt *gt);
int xe_gt_stats_print_info(struct xe_gt *gt, struct drm_printer *p);
void xe_gt_stats_clear(struct xe_gt *gt);
void xe_gt_stats_incr(struct xe_gt *gt, const enum xe_gt_stats_id id, int incr);
#else
static inline int xe_gt_stats_init(struct xe_gt *gt)
{
return 0;
}
static inline void
xe_gt_stats_incr(struct xe_gt *gt, const enum xe_gt_stats_id id,
int incr)
{
}
#endif
/**
* xe_gt_stats_ktime_us_delta() - Get delta in microseconds between now and a
* start time
* @start: Start time
*
* Helper for GT stats to get delta in microseconds between now and a start
* time, compiles out if GT stats are disabled.
*
* Return: Delta in microseconds between now and a start time
*/
static inline s64 xe_gt_stats_ktime_us_delta(ktime_t start)
{
return IS_ENABLED(CONFIG_DEBUG_FS) ?
ktime_us_delta(ktime_get(), start) : 0;
}
/**
* xe_gt_stats_ktime_get() - Get current ktime
*
* Helper for GT stats to get current ktime, compiles out if GT stats are
* disabled.
*
* Return: Get current ktime
*/
static inline ktime_t xe_gt_stats_ktime_get(void)
{
return IS_ENABLED(CONFIG_DEBUG_FS) ? ktime_get() : 0;
}
#endif
Annotation
- Immediate include surface: `linux/ktime.h`, `xe_gt_stats_types.h`.
- Detected declarations: `struct xe_gt`, `struct drm_printer`, `function xe_gt_stats_init`, `function xe_gt_stats_incr`, `function xe_gt_stats_ktime_get`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
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.