drivers/gpu/drm/xe/xe_gt_stats.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/xe/xe_gt_stats.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/xe/xe_gt_stats.c- Extension
.c- Size
- 6914 bytes
- Lines
- 204
- 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
drm/drm_managed.hdrm/drm_print.hxe_device.hxe_gt_stats.h
Detected Declarations
function xe_gt_stats_finifunction xe_gt_stats_initfunction xe_gt_stats_incrfunction xe_gt_stats_print_infofunction for_each_possible_cpufunction xe_gt_stats_clearfunction for_each_possible_cpu
Annotated Snippet
for_each_possible_cpu(cpu) {
struct xe_gt_stats *s = per_cpu_ptr(gt->stats, cpu);
total += s->counters[id];
}
drm_printf(p, "%s: %lld\n", stat_description[id], total);
}
return 0;
}
/**
* xe_gt_stats_clear() - Clear the GT stats
* @gt: GT structure
*
* Clear (zero) all available GT stats. Note that if the stats are being
* updated while this function is running, the results may be unpredictable.
* Intended to be called on an idle GPU.
*/
void xe_gt_stats_clear(struct xe_gt *gt)
{
int cpu;
for_each_possible_cpu(cpu) {
struct xe_gt_stats *s = per_cpu_ptr(gt->stats, cpu);
memset(s, 0, sizeof(*s));
}
}
Annotation
- Immediate include surface: `drm/drm_managed.h`, `drm/drm_print.h`, `xe_device.h`, `xe_gt_stats.h`.
- Detected declarations: `function xe_gt_stats_fini`, `function xe_gt_stats_init`, `function xe_gt_stats_incr`, `function xe_gt_stats_print_info`, `function for_each_possible_cpu`, `function xe_gt_stats_clear`, `function for_each_possible_cpu`.
- 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.